From 4b11ee0e9770608bf12d0ecffd549a0ca5d19d19 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot Date: Wed, 11 Dec 2024 08:51:37 +0000 Subject: [PATCH] Generate Client Library code - Automated --- .../pyproject.toml | 2 +- .../grantami/serverapi_openapi/__init__.py | 2 + .../serverapi_openapi/models/__init__.py | 2 + .../models/gsa_record_capabilities.py | 185 ++++++++++++++++++ .../models/gsa_record_version.py | 35 ++++ 5 files changed, 225 insertions(+), 1 deletion(-) create mode 100644 ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_record_capabilities.py diff --git a/ansys-grantami-serverapi-openapi/pyproject.toml b/ansys-grantami-serverapi-openapi/pyproject.toml index fbe4b4e8..5fb44769 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 = "4.0.0.dev354" +version = "4.0.0.dev356" 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 75b61a54..e031730d 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 @@ -739,6 +739,7 @@ from .models.gsa_record_ancestor_history_identity_criterion import ( GsaRecordAncestorHistoryIdentityCriterion, ) +from .models.gsa_record_capabilities import GsaRecordCapabilities from .models.gsa_record_color import GsaRecordColor from .models.gsa_record_color_property import GsaRecordColorProperty from .models.gsa_record_export_failure import GsaRecordExportFailure @@ -1640,6 +1641,7 @@ "GsaRangeHistogramAggregationDatumCriterion", "GsaRecordAncestorCriterion", "GsaRecordAncestorHistoryIdentityCriterion", + "GsaRecordCapabilities", "GsaRecordColor", "GsaRecordColorProperty", "GsaRecordExportFailure", 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 e37d9a99..a3c013d2 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 @@ -663,6 +663,7 @@ from .gsa_record_ancestor_history_identity_criterion import ( GsaRecordAncestorHistoryIdentityCriterion, ) +from .gsa_record_capabilities import GsaRecordCapabilities from .gsa_record_color import GsaRecordColor from .gsa_record_color_property import GsaRecordColorProperty from .gsa_record_export_failure import GsaRecordExportFailure @@ -1517,6 +1518,7 @@ "GsaRangeHistogramAggregationDatumCriterion", "GsaRecordAncestorCriterion", "GsaRecordAncestorHistoryIdentityCriterion", + "GsaRecordCapabilities", "GsaRecordColor", "GsaRecordColorProperty", "GsaRecordExportFailure", diff --git a/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_record_capabilities.py b/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_record_capabilities.py new file mode 100644 index 00000000..c1b847e3 --- /dev/null +++ b/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_record_capabilities.py @@ -0,0 +1,185 @@ +# Copyright (C) 2023 - 2024 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 GsaRecordCapabilities(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] = { + "can_modify": "bool", + "can_write": "bool", + } + + attribute_map: dict[str, str] = { + "can_modify": "canModify", + "can_write": "canWrite", + } + + subtype_mapping: dict[str, str] = {} + + discriminator: Optional[str] = None + + def __init__( + self, + *, + can_modify: "bool", + can_write: "bool", + ) -> None: + """GsaRecordCapabilities - a model defined in Swagger + + Parameters + ---------- + can_modify: bool + can_write: bool + """ + self._can_write: bool + self._can_modify: bool + + self.can_write = can_write + self.can_modify = can_modify + + @property + def can_write(self) -> "bool": + """Gets the can_write of this GsaRecordCapabilities. + True if the current user has write permission for this record version, and is in write mode. Write permission is required to edit record properties, and to perform version control actions. + + Returns + ------- + bool + The can_write of this GsaRecordCapabilities. + """ + return self._can_write + + @can_write.setter + def can_write(self, can_write: "bool") -> None: + """Sets the can_write of this GsaRecordCapabilities. + True if the current user has write permission for this record version, and is in write mode. Write permission is required to edit record properties, and to perform version control actions. + + Parameters + ---------- + can_write: bool + The can_write of this GsaRecordCapabilities. + """ + # Field is not nullable + if can_write is None: + raise ValueError("Invalid value for 'can_write', must not be 'None'") + # Field is required + if can_write is Unset: # type: ignore[comparison-overlap, unused-ignore] + raise ValueError("Invalid value for 'can_write', must not be 'Unset'") + self._can_write = can_write + + @property + def can_modify(self) -> "bool": + """Gets the can_modify of this GsaRecordCapabilities. + True if the current user can modify this record version, e.g. edit record properties. The user needs write permission, and if the table is version controlled, the record must be unreleased. + + Returns + ------- + bool + The can_modify of this GsaRecordCapabilities. + """ + return self._can_modify + + @can_modify.setter + def can_modify(self, can_modify: "bool") -> None: + """Sets the can_modify of this GsaRecordCapabilities. + True if the current user can modify this record version, e.g. edit record properties. The user needs write permission, and if the table is version controlled, the record must be unreleased. + + Parameters + ---------- + can_modify: bool + The can_modify of this GsaRecordCapabilities. + """ + # Field is not nullable + if can_modify is None: + raise ValueError("Invalid value for 'can_modify', must not be 'None'") + # Field is required + if can_modify is Unset: # type: ignore[comparison-overlap, unused-ignore] + raise ValueError("Invalid value for 'can_modify', must not be 'Unset'") + self._can_modify = can_modify + + @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, GsaRecordCapabilities): + 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_record_version.py b/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_record_version.py index 13a5a27a..7168235e 100644 --- a/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_record_version.py +++ b/ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/models/gsa_record_version.py @@ -61,6 +61,7 @@ class GsaRecordVersion(ModelBase): Name of the property used as discriminator for subtypes. """ swagger_types: dict[str, str] = { + "capabilities": "GsaRecordCapabilities", "created_by_user": "str", "created_date": "datetime", "database_key": "str", @@ -79,6 +80,7 @@ class GsaRecordVersion(ModelBase): } attribute_map: dict[str, str] = { + "capabilities": "capabilities", "created_by_user": "createdByUser", "created_date": "createdDate", "database_key": "databaseKey", @@ -101,6 +103,7 @@ class GsaRecordVersion(ModelBase): "table": "GsaSlimTable", "recordType": "GsaRecordType", "recordColor": "GsaRecordColor", + "capabilities": "GsaRecordCapabilities", "versionState": "GsaVersionState", } @@ -109,6 +112,7 @@ class GsaRecordVersion(ModelBase): def __init__( self, *, + capabilities: "GsaRecordCapabilities", created_by_user: "str", created_date: "datetime", database_key: "str", @@ -129,6 +133,7 @@ def __init__( Parameters ---------- + capabilities: GsaRecordCapabilities created_by_user: str created_date: datetime database_key: str @@ -156,6 +161,7 @@ def __init__( self._released_date: Union[datetime, None, Unset_Type] = Unset self._short_name: str self._record_color: GsaRecordColor + self._capabilities: GsaRecordCapabilities self._version_number: int self._version_state: GsaVersionState self._name: str @@ -173,6 +179,7 @@ def __init__( self.released_date = released_date self.short_name = short_name self.record_color = record_color + self.capabilities = capabilities self.version_number = version_number self.version_state = version_state self.name = name @@ -480,6 +487,34 @@ def record_color(self, record_color: "GsaRecordColor") -> None: raise ValueError("Invalid value for 'record_color', must not be 'Unset'") self._record_color = record_color + @property + def capabilities(self) -> "GsaRecordCapabilities": + """Gets the capabilities of this GsaRecordVersion. + + Returns + ------- + GsaRecordCapabilities + The capabilities of this GsaRecordVersion. + """ + return self._capabilities + + @capabilities.setter + def capabilities(self, capabilities: "GsaRecordCapabilities") -> None: + """Sets the capabilities of this GsaRecordVersion. + + Parameters + ---------- + capabilities: GsaRecordCapabilities + The capabilities of this GsaRecordVersion. + """ + # Field is not nullable + if capabilities is None: + raise ValueError("Invalid value for 'capabilities', must not be 'None'") + # Field is required + if capabilities is Unset: # type: ignore[comparison-overlap, unused-ignore] + raise ValueError("Invalid value for 'capabilities', must not be 'Unset'") + self._capabilities = capabilities + @property def version_number(self) -> "int": """Gets the version_number of this GsaRecordVersion.