-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate Client Library code - Automated
- Loading branch information
1 parent
f729f5f
commit 2f39c1d
Showing
10 changed files
with
979 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. <[email protected]>"] | ||
maintainers = ["ANSYS, Inc. <[email protected]>"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/api/bulk_api.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
149 changes: 149 additions & 0 deletions
149
...s-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_bulk_info.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Oops, something went wrong.