From 2f39c1dc500b09df4bac198a46aa3afe714b2805 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot Date: Fri, 7 Feb 2025 09:14:37 +0000 Subject: [PATCH] Generate Client Library code - Automated --- .../pyproject.toml | 2 +- .../grantami/serverapi_openapi/__init__.py | 12 + .../serverapi_openapi/api/__init__.py | 2 + .../serverapi_openapi/api/bulk_api.py | 120 ++++++++ .../serverapi_openapi/models/__init__.py | 10 + .../serverapi_openapi/models/gsa_bulk_info.py | 149 ++++++++++ .../models/gsa_bulk_request.py | 149 ++++++++++ .../models/gsa_bulk_request_http_method.py | 49 +++ .../models/gsa_bulk_request_item.py | 278 ++++++++++++++++++ .../models/gsa_bulk_response_item.py | 209 +++++++++++++ 10 files changed, 979 insertions(+), 1 deletion(-) create mode 100644 ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/api/bulk_api.py create mode 100644 ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_bulk_info.py create mode 100644 ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_bulk_request.py create mode 100644 ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_bulk_request_http_method.py create mode 100644 ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_bulk_request_item.py create mode 100644 ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_bulk_response_item.py diff --git a/ansys-grantami-serverapi-openapi/pyproject.toml b/ansys-grantami-serverapi-openapi/pyproject.toml index 08445623..78fd009c 100644 --- a/ansys-grantami-serverapi-openapi/pyproject.toml +++ b/ansys-grantami-serverapi-openapi/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "ansys-grantami-serverapi-openapi" description = "Autogenerated client library for the Granta MI Server API." -version = "5.0.0.dev421" +version = "5.0.0.dev423" license = "MIT" authors = ["ANSYS, Inc. "] maintainers = ["ANSYS, Inc. "] diff --git a/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/__init__.py b/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/__init__.py index a7b59c3b..ae4d8a50 100644 --- a/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/__init__.py +++ b/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/__init__.py @@ -34,6 +34,7 @@ # import apis into sdk package from .api.aggregation_api import AggregationApi +from .api.bulk_api import BulkApi from .api.data_api import DataApi from .api.data_export_api import DataExportApi from .api.database_api import DatabaseApi @@ -152,6 +153,11 @@ from .models.gsa_boolean_criterion import GsaBooleanCriterion from .models.gsa_boost_by_guid import GsaBoostByGuid from .models.gsa_boost_by_identity import GsaBoostByIdentity +from .models.gsa_bulk_info import GsaBulkInfo +from .models.gsa_bulk_request import GsaBulkRequest +from .models.gsa_bulk_request_http_method import GsaBulkRequestHttpMethod +from .models.gsa_bulk_request_item import GsaBulkRequestItem +from .models.gsa_bulk_response_item import GsaBulkResponseItem from .models.gsa_calendar_interval import GsaCalendarInterval from .models.gsa_configuration import GsaConfiguration from .models.gsa_configurations_info import GsaConfigurationsInfo @@ -1057,6 +1063,7 @@ __all__ = [ "AggregationApi", + "BulkApi", "DataApi", "DataExportApi", "DatabaseApi", @@ -1163,6 +1170,11 @@ "GsaBooleanCriterion", "GsaBoostByGuid", "GsaBoostByIdentity", + "GsaBulkInfo", + "GsaBulkRequest", + "GsaBulkRequestHttpMethod", + "GsaBulkRequestItem", + "GsaBulkResponseItem", "GsaCalendarInterval", "GsaConfiguration", "GsaConfigurationsInfo", diff --git a/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/api/__init__.py b/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/api/__init__.py index 586a4d8a..3263dc5d 100644 --- a/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/api/__init__.py +++ b/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/api/__init__.py @@ -27,6 +27,7 @@ # import apis into api package from .aggregation_api import AggregationApi +from .bulk_api import BulkApi from .data_api import DataApi from .data_export_api import DataExportApi from .database_api import DatabaseApi @@ -73,6 +74,7 @@ __all__ = [ "ApiBase", "AggregationApi", + "BulkApi", "DataApi", "DataExportApi", "DatabaseApi", diff --git a/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/api/bulk_api.py b/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/api/bulk_api.py new file mode 100644 index 00000000..d6b6b243 --- /dev/null +++ b/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/api/bulk_api.py @@ -0,0 +1,120 @@ +# Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +""" +MI Server API + +No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: v1 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import re # noqa: F401 +from typing import TYPE_CHECKING, Any, BinaryIO, Optional, Union # noqa: F401 + +from . import ApiBase + +if TYPE_CHECKING: + import pathlib + + from ..models import * + + +class BulkApi(ApiBase): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def bulk(self, *, body: "Optional[GsaBulkRequest]" = None) -> "Union[GsaBulkInfo, None]": + """Handles multiple requests. The requests should be independent - they could be executed in any order. The response will contain a response item for each request item, in the same order as the request items. Requests that return file or image responses cannot be sent via the bulk endpoint. + + This method makes a synchronous HTTP request. + + Parameters + ---------- + body: GsaBulkRequest + + Returns + ------- + Union[GsaBulkInfo, None] + """ + data = self._bulk_with_http_info(body, _return_http_data_only=True) + return data # type: ignore[no-any-return] + + def _bulk_with_http_info(self, body: "Optional[GsaBulkRequest]" = None, **kwargs: Any) -> Any: + all_params = ["body", "_return_http_data_only", "_preload_content", "_request_timeout"] + + params = locals() + for key, val in params["kwargs"].items(): + if key not in all_params: + raise TypeError(f"Got an unexpected keyword argument '{key}' to method bulk") + params[key] = val + del params["kwargs"] + + collection_formats: dict[str, Any] = {} + + path_params: dict[str, Any] = {} + + query_params: list[Any] = [] + + header_params: dict[str, Any] = {} + + form_params: list[Any] = [] + local_var_files: dict[str, Any] = {} + + body_params = None + if "body" in params and body is not None: + body_params = params["body"] + # HTTP header 'Accept' + header_params["Accept"] = self.api_client.select_header_accept( + ["text/plain", "application/json", "text/json"] + ) + + # HTTP header 'Content-Type' + header_params["Content-Type"] = self.api_client.select_header_content_type( + ["application/json-patch+json", "application/json", "text/json", "application/*+json"] + ) + + response_type_map: dict[int, Optional[str]] = { + 200: "GsaBulkInfo", + 400: None, + } + + return self.api_client.call_api( + "/v1alpha/bulk", + "POST", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + _return_http_data_only=params.get("_return_http_data_only"), + _preload_content=params.get("_preload_content", True), + _request_timeout=params.get("_request_timeout"), + collection_formats=collection_formats, + response_type_map=response_type_map, + ) diff --git a/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/__init__.py b/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/__init__.py index 07ec47a2..e13ae4ab 100644 --- a/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/__init__.py +++ b/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/__init__.py @@ -105,6 +105,11 @@ from .gsa_boolean_criterion import GsaBooleanCriterion from .gsa_boost_by_guid import GsaBoostByGuid from .gsa_boost_by_identity import GsaBoostByIdentity +from .gsa_bulk_info import GsaBulkInfo +from .gsa_bulk_request import GsaBulkRequest +from .gsa_bulk_request_http_method import GsaBulkRequestHttpMethod +from .gsa_bulk_request_item import GsaBulkRequestItem +from .gsa_bulk_response_item import GsaBulkResponseItem from .gsa_calendar_interval import GsaCalendarInterval from .gsa_configuration import GsaConfiguration from .gsa_configurations_info import GsaConfigurationsInfo @@ -1038,6 +1043,11 @@ "GsaBooleanCriterion", "GsaBoostByGuid", "GsaBoostByIdentity", + "GsaBulkInfo", + "GsaBulkRequest", + "GsaBulkRequestHttpMethod", + "GsaBulkRequestItem", + "GsaBulkResponseItem", "GsaCalendarInterval", "GsaConfiguration", "GsaConfigurationsInfo", diff --git a/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_bulk_info.py b/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_bulk_info.py new file mode 100644 index 00000000..56a5c447 --- /dev/null +++ b/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_bulk_info.py @@ -0,0 +1,149 @@ +# Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +""" +MI Server API + +No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: v1 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import re # noqa: F401 +from typing import TYPE_CHECKING, Any, BinaryIO, Optional, Union # noqa: F401 + +from . import ModelBase, Unset, Unset_Type + +if TYPE_CHECKING: + from datetime import datetime + import pathlib + + from . import * + + +class GsaBulkInfo(ModelBase): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes + ---------- + swagger_types: dict[str, str] + The key is attribute name and the value is attribute type. + attribute_map: dict[str, str] + The key is attribute name and the value is json key in definition. + subtype_mapping: dict[str, str] + The key is the unmangled property name and the value is the corresponding type. + discriminator: Optional[str] + Name of the property used as discriminator for subtypes. + """ + swagger_types: dict[str, str] = { + "data": "list[GsaBulkResponseItem]", + } + + attribute_map: dict[str, str] = { + "data": "data", + } + + subtype_mapping: dict[str, str] = { + "data": "GsaBulkResponseItem", + } + + discriminator: Optional[str] = None + + def __init__( + self, + *, + data: "list[GsaBulkResponseItem]", + ) -> None: + """GsaBulkInfo - a model defined in Swagger + + Parameters + ---------- + data: list[GsaBulkResponseItem] + """ + self._data: list[GsaBulkResponseItem] + + self.data = data + + @property + def data(self) -> "list[GsaBulkResponseItem]": + """Gets the data of this GsaBulkInfo. + + Returns + ------- + list[GsaBulkResponseItem] + The data of this GsaBulkInfo. + """ + return self._data + + @data.setter + def data(self, data: "list[GsaBulkResponseItem]") -> None: + """Sets the data of this GsaBulkInfo. + + Parameters + ---------- + data: list[GsaBulkResponseItem] + The data of this GsaBulkInfo. + """ + # Field is not nullable + if data is None: + raise ValueError("Invalid value for 'data', must not be 'None'") + # Field is required + if data is Unset: # type: ignore[comparison-overlap, unused-ignore] + raise ValueError("Invalid value for 'data', must not be 'Unset'") + self._data = data + + @classmethod + def get_real_child_model(cls, data: dict[str, str]) -> str: + """Raises a NotImplementedError for a type without a discriminator defined. + + Parameters + ---------- + data: ModelBase + Object representing a subclass of this class + + Raises + ------ + NotImplementedError + This class has no discriminator, and hence no subclasses + """ + raise NotImplementedError() + + def __repr__(self) -> str: + """For 'print' and 'pprint'""" + return self.to_str() + + def __eq__(self, other: Any) -> bool: + """Returns true if both objects are equal""" + if not isinstance(other, GsaBulkInfo): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other: Any) -> bool: + """Returns true if both objects are not equal""" + return not self == other diff --git a/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_bulk_request.py b/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_bulk_request.py new file mode 100644 index 00000000..24d720d3 --- /dev/null +++ b/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_bulk_request.py @@ -0,0 +1,149 @@ +# Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +""" +MI Server API + +No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: v1 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import re # noqa: F401 +from typing import TYPE_CHECKING, Any, BinaryIO, Optional, Union # noqa: F401 + +from . import ModelBase, Unset, Unset_Type + +if TYPE_CHECKING: + from datetime import datetime + import pathlib + + from . import * + + +class GsaBulkRequest(ModelBase): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes + ---------- + swagger_types: dict[str, str] + The key is attribute name and the value is attribute type. + attribute_map: dict[str, str] + The key is attribute name and the value is json key in definition. + subtype_mapping: dict[str, str] + The key is the unmangled property name and the value is the corresponding type. + discriminator: Optional[str] + Name of the property used as discriminator for subtypes. + """ + swagger_types: dict[str, str] = { + "requests": "list[GsaBulkRequestItem]", + } + + attribute_map: dict[str, str] = { + "requests": "requests", + } + + subtype_mapping: dict[str, str] = { + "requests": "GsaBulkRequestItem", + } + + discriminator: Optional[str] = None + + def __init__( + self, + *, + requests: "list[GsaBulkRequestItem]", + ) -> None: + """GsaBulkRequest - a model defined in Swagger + + Parameters + ---------- + requests: list[GsaBulkRequestItem] + """ + self._requests: list[GsaBulkRequestItem] + + self.requests = requests + + @property + def requests(self) -> "list[GsaBulkRequestItem]": + """Gets the requests of this GsaBulkRequest. + + Returns + ------- + list[GsaBulkRequestItem] + The requests of this GsaBulkRequest. + """ + return self._requests + + @requests.setter + def requests(self, requests: "list[GsaBulkRequestItem]") -> None: + """Sets the requests of this GsaBulkRequest. + + Parameters + ---------- + requests: list[GsaBulkRequestItem] + The requests of this GsaBulkRequest. + """ + # Field is not nullable + if requests is None: + raise ValueError("Invalid value for 'requests', must not be 'None'") + # Field is required + if requests is Unset: # type: ignore[comparison-overlap, unused-ignore] + raise ValueError("Invalid value for 'requests', must not be 'Unset'") + self._requests = requests + + @classmethod + def get_real_child_model(cls, data: dict[str, str]) -> str: + """Raises a NotImplementedError for a type without a discriminator defined. + + Parameters + ---------- + data: ModelBase + Object representing a subclass of this class + + Raises + ------ + NotImplementedError + This class has no discriminator, and hence no subclasses + """ + raise NotImplementedError() + + def __repr__(self) -> str: + """For 'print' and 'pprint'""" + return self.to_str() + + def __eq__(self, other: Any) -> bool: + """Returns true if both objects are equal""" + if not isinstance(other, GsaBulkRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other: Any) -> bool: + """Returns true if both objects are not equal""" + return not self == other diff --git a/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_bulk_request_http_method.py b/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_bulk_request_http_method.py new file mode 100644 index 00000000..8728ae31 --- /dev/null +++ b/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_bulk_request_http_method.py @@ -0,0 +1,49 @@ +# Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +""" +MI Server API + +No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: v1 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from enum import Enum + + +class GsaBulkRequestHttpMethod(Enum): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Allowed Enum values + """ + GET = "GET" + POST = "POST" + DELETE = "DELETE" + PATCH = "PATCH" + PUT = "PUT" diff --git a/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_bulk_request_item.py b/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_bulk_request_item.py new file mode 100644 index 00000000..b566fcf0 --- /dev/null +++ b/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_bulk_request_item.py @@ -0,0 +1,278 @@ +# Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +""" +MI Server API + +No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: v1 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import re # noqa: F401 +from typing import TYPE_CHECKING, Any, BinaryIO, Optional, Union # noqa: F401 + +from . import ModelBase, Unset, Unset_Type + +if TYPE_CHECKING: + from datetime import datetime + import pathlib + + from . import * + + +class GsaBulkRequestItem(ModelBase): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes + ---------- + swagger_types: dict[str, str] + The key is attribute name and the value is attribute type. + attribute_map: dict[str, str] + The key is attribute name and the value is json key in definition. + subtype_mapping: dict[str, str] + The key is the unmangled property name and the value is the corresponding type. + discriminator: Optional[str] + Name of the property used as discriminator for subtypes. + """ + swagger_types: dict[str, str] = { + "method": "GsaBulkRequestHttpMethod", + "path": "str", + "body": "object", + "headers": "dict(str, str)", + "query": "dict(str, str)", + } + + attribute_map: dict[str, str] = { + "method": "method", + "path": "path", + "body": "body", + "headers": "headers", + "query": "query", + } + + subtype_mapping: dict[str, str] = { + "method": "GsaBulkRequestHttpMethod", + } + + discriminator: Optional[str] = None + + def __init__( + self, + *, + method: "GsaBulkRequestHttpMethod", + path: "str", + body: "Union[object, None, Unset_Type]" = Unset, + headers: "Union[dict[str, str], None, Unset_Type]" = Unset, + query: "Union[dict[str, str], None, Unset_Type]" = Unset, + ) -> None: + """GsaBulkRequestItem - a model defined in Swagger + + Parameters + ---------- + method: GsaBulkRequestHttpMethod + path: str + body: object, optional + headers: dict[str, str], optional + query: dict[str, str], optional + """ + self._path: str + self._method: GsaBulkRequestHttpMethod + self._body: Union[object, None, Unset_Type] = Unset + self._headers: Union[dict[str, str], None, Unset_Type] = Unset + self._query: Union[dict[str, str], None, Unset_Type] = Unset + + self.path = path + self.method = method + if body is not Unset: + self.body = body + if headers is not Unset: + self.headers = headers + if query is not Unset: + self.query = query + + @property + def path(self) -> "str": + """Gets the path of this GsaBulkRequestItem. + The relative path for this request. + + Returns + ------- + str + The path of this GsaBulkRequestItem. + """ + return self._path + + @path.setter + def path(self, path: "str") -> None: + """Sets the path of this GsaBulkRequestItem. + The relative path for this request. + + Parameters + ---------- + path: str + The path of this GsaBulkRequestItem. + """ + # Field is not nullable + if path is None: + raise ValueError("Invalid value for 'path', must not be 'None'") + # Field is required + if path is Unset: # type: ignore[comparison-overlap, unused-ignore] + raise ValueError("Invalid value for 'path', must not be 'Unset'") + self._path = path + + @property + def method(self) -> "GsaBulkRequestHttpMethod": + """Gets the method of this GsaBulkRequestItem. + + Returns + ------- + GsaBulkRequestHttpMethod + The method of this GsaBulkRequestItem. + """ + return self._method + + @method.setter + def method(self, method: "GsaBulkRequestHttpMethod") -> None: + """Sets the method of this GsaBulkRequestItem. + + Parameters + ---------- + method: GsaBulkRequestHttpMethod + The method of this GsaBulkRequestItem. + """ + # Field is not nullable + if method is None: + raise ValueError("Invalid value for 'method', must not be 'None'") + # Field is required + if method is Unset: # type: ignore[comparison-overlap, unused-ignore] + raise ValueError("Invalid value for 'method', must not be 'Unset'") + self._method = method + + @property + def body(self) -> "Union[object, None, Unset_Type]": + """Gets the body of this GsaBulkRequestItem. + The request body. The type of this object depends on the request being sent. It should be the same as if this request were being sent separately. + + Returns + ------- + Union[object, None, Unset_Type] + The body of this GsaBulkRequestItem. + """ + return self._body + + @body.setter + def body(self, body: "Union[object, None, Unset_Type]") -> None: + """Sets the body of this GsaBulkRequestItem. + The request body. The type of this object depends on the request being sent. It should be the same as if this request were being sent separately. + + Parameters + ---------- + body: Union[object, None, Unset_Type] + The body of this GsaBulkRequestItem. + """ + self._body = body + + @property + def headers(self) -> "Union[dict[str, str], None, Unset_Type]": + """Gets the headers of this GsaBulkRequestItem. + Any additional headers to set on this request. Headers from the bulk request will also be included. Headers set in this field override any headers also set on the bulk request. + + Returns + ------- + Union[dict[str, str], None, Unset_Type] + The headers of this GsaBulkRequestItem. + """ + return self._headers + + @headers.setter + def headers(self, headers: "Union[dict[str, str], None, Unset_Type]") -> None: + """Sets the headers of this GsaBulkRequestItem. + Any additional headers to set on this request. Headers from the bulk request will also be included. Headers set in this field override any headers also set on the bulk request. + + Parameters + ---------- + headers: Union[dict[str, str], None, Unset_Type] + The headers of this GsaBulkRequestItem. + """ + self._headers = headers + + @property + def query(self) -> "Union[dict[str, str], None, Unset_Type]": + """Gets the query of this GsaBulkRequestItem. + Query string parameters. + + Returns + ------- + Union[dict[str, str], None, Unset_Type] + The query of this GsaBulkRequestItem. + """ + return self._query + + @query.setter + def query(self, query: "Union[dict[str, str], None, Unset_Type]") -> None: + """Sets the query of this GsaBulkRequestItem. + Query string parameters. + + Parameters + ---------- + query: Union[dict[str, str], None, Unset_Type] + The query of this GsaBulkRequestItem. + """ + self._query = query + + @classmethod + def get_real_child_model(cls, data: dict[str, str]) -> str: + """Raises a NotImplementedError for a type without a discriminator defined. + + Parameters + ---------- + data: ModelBase + Object representing a subclass of this class + + Raises + ------ + NotImplementedError + This class has no discriminator, and hence no subclasses + """ + raise NotImplementedError() + + def __repr__(self) -> str: + """For 'print' and 'pprint'""" + return self.to_str() + + def __eq__(self, other: Any) -> bool: + """Returns true if both objects are equal""" + if not isinstance(other, GsaBulkRequestItem): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other: Any) -> bool: + """Returns true if both objects are not equal""" + return not self == other diff --git a/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_bulk_response_item.py b/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_bulk_response_item.py new file mode 100644 index 00000000..f8a68450 --- /dev/null +++ b/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_bulk_response_item.py @@ -0,0 +1,209 @@ +# Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +""" +MI Server API + +No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + +OpenAPI spec version: v1 + +Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import re # noqa: F401 +from typing import TYPE_CHECKING, Any, BinaryIO, Optional, Union # noqa: F401 + +from . import ModelBase, Unset, Unset_Type + +if TYPE_CHECKING: + from datetime import datetime + import pathlib + + from . import * + + +class GsaBulkResponseItem(ModelBase): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes + ---------- + swagger_types: dict[str, str] + The key is attribute name and the value is attribute type. + attribute_map: dict[str, str] + The key is attribute name and the value is json key in definition. + subtype_mapping: dict[str, str] + The key is the unmangled property name and the value is the corresponding type. + discriminator: Optional[str] + Name of the property used as discriminator for subtypes. + """ + swagger_types: dict[str, str] = { + "status": "SystemNetHttpStatusCode", + "body": "object", + "headers": "dict(str, str)", + } + + attribute_map: dict[str, str] = { + "status": "status", + "body": "body", + "headers": "headers", + } + + subtype_mapping: dict[str, str] = { + "status": "SystemNetHttpStatusCode", + } + + discriminator: Optional[str] = None + + def __init__( + self, + *, + status: "SystemNetHttpStatusCode", + body: "Union[object, None, Unset_Type]" = Unset, + headers: "Union[dict[str, str], None, Unset_Type]" = Unset, + ) -> None: + """GsaBulkResponseItem - a model defined in Swagger + + Parameters + ---------- + status: SystemNetHttpStatusCode + body: object, optional + headers: dict[str, str], optional + """ + self._status: SystemNetHttpStatusCode + self._body: Union[object, None, Unset_Type] = Unset + self._headers: Union[dict[str, str], None, Unset_Type] = Unset + + self.status = status + if body is not Unset: + self.body = body + if headers is not Unset: + self.headers = headers + + @property + def status(self) -> "SystemNetHttpStatusCode": + """Gets the status of this GsaBulkResponseItem. + + Returns + ------- + SystemNetHttpStatusCode + The status of this GsaBulkResponseItem. + """ + return self._status + + @status.setter + def status(self, status: "SystemNetHttpStatusCode") -> None: + """Sets the status of this GsaBulkResponseItem. + + Parameters + ---------- + status: SystemNetHttpStatusCode + The status of this GsaBulkResponseItem. + """ + # Field is not nullable + if status is None: + raise ValueError("Invalid value for 'status', must not be 'None'") + # Field is required + if status is Unset: # type: ignore[comparison-overlap, unused-ignore] + raise ValueError("Invalid value for 'status', must not be 'Unset'") + self._status = status + + @property + def body(self) -> "Union[object, None, Unset_Type]": + """Gets the body of this GsaBulkResponseItem. + The response body. The type of this object depends on the request being sent. It should be the same as if the request were sent separately. + + Returns + ------- + Union[object, None, Unset_Type] + The body of this GsaBulkResponseItem. + """ + return self._body + + @body.setter + def body(self, body: "Union[object, None, Unset_Type]") -> None: + """Sets the body of this GsaBulkResponseItem. + The response body. The type of this object depends on the request being sent. It should be the same as if the request were sent separately. + + Parameters + ---------- + body: Union[object, None, Unset_Type] + The body of this GsaBulkResponseItem. + """ + self._body = body + + @property + def headers(self) -> "Union[dict[str, str], None, Unset_Type]": + """Gets the headers of this GsaBulkResponseItem. + + Returns + ------- + Union[dict[str, str], None, Unset_Type] + The headers of this GsaBulkResponseItem. + """ + return self._headers + + @headers.setter + def headers(self, headers: "Union[dict[str, str], None, Unset_Type]") -> None: + """Sets the headers of this GsaBulkResponseItem. + + Parameters + ---------- + headers: Union[dict[str, str], None, Unset_Type] + The headers of this GsaBulkResponseItem. + """ + self._headers = headers + + @classmethod + def get_real_child_model(cls, data: dict[str, str]) -> str: + """Raises a NotImplementedError for a type without a discriminator defined. + + Parameters + ---------- + data: ModelBase + Object representing a subclass of this class + + Raises + ------ + NotImplementedError + This class has no discriminator, and hence no subclasses + """ + raise NotImplementedError() + + def __repr__(self) -> str: + """For 'print' and 'pprint'""" + return self.to_str() + + def __eq__(self, other: Any) -> bool: + """Returns true if both objects are equal""" + if not isinstance(other, GsaBulkResponseItem): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other: Any) -> bool: + """Returns true if both objects are not equal""" + return not self == other