Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix library generation with poetry 2.0 #291

Merged
merged 2 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/generate_library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: "Ensure poetry.lock file is up to date"
run: |
pip install poetry
poetry lock --no-update
poetry lock
working-directory: ansys-grantami-serverapi-openapi

- name: "Install and run pre-commit"
Expand Down
42 changes: 40 additions & 2 deletions ansys-grantami-serverapi-openapi/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ansys-grantami-serverapi-openapi/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.dev368"
version = "4.0.0.dev376"
license = "MIT"
authors = ["ANSYS, Inc. <[email protected]>"]
maintainers = ["ANSYS, Inc. <[email protected]>"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,19 @@ class GsaDataExportHyperlink(ModelBase):
"address": "str",
"description": "str",
"formatted_address": "str",
"target": "GsaHyperlinkTarget",
}

attribute_map: dict[str, str] = {
"address": "address",
"description": "description",
"formatted_address": "formattedAddress",
"target": "target",
}

subtype_mapping: dict[str, str] = {}
subtype_mapping: dict[str, str] = {
"target": "GsaHyperlinkTarget",
}

discriminator: Optional[str] = None

Expand All @@ -82,6 +86,7 @@ def __init__(
address: "Union[str, None, Unset_Type]" = Unset,
description: "Union[str, None, Unset_Type]" = Unset,
formatted_address: "Union[str, None, Unset_Type]" = Unset,
target: "Union[GsaHyperlinkTarget, Unset_Type]" = Unset,
) -> None:
"""GsaDataExportHyperlink - a model defined in Swagger
Expand All @@ -90,17 +95,21 @@ def __init__(
address: str, optional
description: str, optional
formatted_address: str, optional
target: GsaHyperlinkTarget, optional
"""
self._address: Union[str, None, Unset_Type] = Unset
self._formatted_address: Union[str, None, Unset_Type] = Unset
self._description: Union[str, None, Unset_Type] = Unset
self._target: Union[GsaHyperlinkTarget, Unset_Type] = Unset

if address is not Unset:
self.address = address
if formatted_address is not Unset:
self.formatted_address = formatted_address
if description is not Unset:
self.description = description
if target is not Unset:
self.target = target

@property
def address(self) -> "Union[str, None, Unset_Type]":
Expand Down Expand Up @@ -168,6 +177,31 @@ def description(self, description: "Union[str, None, Unset_Type]") -> None:
"""
self._description = description

@property
def target(self) -> "Union[GsaHyperlinkTarget, Unset_Type]":
"""Gets the target of this GsaDataExportHyperlink.
Returns
-------
Union[GsaHyperlinkTarget, Unset_Type]
The target of this GsaDataExportHyperlink.
"""
return self._target

@target.setter
def target(self, target: "Union[GsaHyperlinkTarget, Unset_Type]") -> None:
"""Sets the target of this GsaDataExportHyperlink.
Parameters
----------
target: Union[GsaHyperlinkTarget, Unset_Type]
The target of this GsaDataExportHyperlink.
"""
# Field is not nullable
if target is None:
raise ValueError("Invalid value for 'target', must not be 'None'")
self._target = target

@classmethod
def get_real_child_model(cls, data: dict[str, str]) -> str:
"""Raises a NotImplementedError for a type without a discriminator defined.
Expand Down
Loading