Skip to content

Commit

Permalink
Fix library generation with poetry 2.0 (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
da1910 authored Jan 13, 2025
1 parent e1f3c4a commit 053dbbc
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 5 deletions.
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

0 comments on commit 053dbbc

Please sign in to comment.