Skip to content

Commit

Permalink
Merge branch 'main' into feat/variable-owner-examples
Browse files Browse the repository at this point in the history
  • Loading branch information
tilen1976 committed Jan 8, 2025
2 parents ffd2186 + 5eed8f0 commit e513d8e
Show file tree
Hide file tree
Showing 14 changed files with 699 additions and 810 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pip==24.3.1
nox==2024.10.9
nox-poetry==1.0.3
poetry==1.8.4
poetry==1.8.5
virtualenv==20.28.0
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ jobs:
- name: Publish package on PyPI
if: steps.check-version.outputs.tag
uses: pypa/[email protected].2
uses: pypa/[email protected].3

- name: Publish package on TestPyPI
if: (!steps.check-version.outputs.tag)
uses: pypa/[email protected].2
uses: pypa/[email protected].3
with:
repository-url: https://test.pypi.org/legacy/

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,4 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# No need to run SonarCloud analysis if dependabot update or token not defined
if: env.SONAR_TOKEN != '' && (github.actor != 'dependabot[bot]')
uses: SonarSource/sonarcloud-github-action@v3.1.0
uses: SonarSource/sonarcloud-github-action@v4.0.0
1,284 changes: 637 additions & 647 deletions poetry.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ vardef_client/models/klass_reference.py
vardef_client/models/language_string_type.py
vardef_client/models/owner.py
vardef_client/models/patch.py
vardef_client/models/person.py
vardef_client/models/problem.py
vardef_client/models/rendered_contact.py
vardef_client/models/rendered_variable_definition.py
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.9.0
7.10.0
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def _create_validity_period_serialize(
)

@validate_call
def list_public_validity_periods_0(
def list_public_validity_periods(
self,
variable_definition_id: Annotated[
StrictStr,
Expand Down Expand Up @@ -401,7 +401,7 @@ def list_public_validity_periods_0(
:type _host_index: int, optional
:return: Returns the result object.
"""
_param = self._list_public_validity_periods_0_serialize(
_param = self._list_public_validity_periods_serialize(
variable_definition_id=variable_definition_id,
accept_language=accept_language,
_request_auth=_request_auth,
Expand All @@ -424,7 +424,7 @@ def list_public_validity_periods_0(
).data

@validate_call
def list_public_validity_periods_0_with_http_info(
def list_public_validity_periods_with_http_info(
self,
variable_definition_id: Annotated[
StrictStr,
Expand Down Expand Up @@ -473,7 +473,7 @@ def list_public_validity_periods_0_with_http_info(
:type _host_index: int, optional
:return: Returns the result object.
"""
_param = self._list_public_validity_periods_0_serialize(
_param = self._list_public_validity_periods_serialize(
variable_definition_id=variable_definition_id,
accept_language=accept_language,
_request_auth=_request_auth,
Expand All @@ -496,7 +496,7 @@ def list_public_validity_periods_0_with_http_info(
)

@validate_call
def list_public_validity_periods_0_without_preload_content(
def list_public_validity_periods_without_preload_content(
self,
variable_definition_id: Annotated[
StrictStr,
Expand Down Expand Up @@ -545,7 +545,7 @@ def list_public_validity_periods_0_without_preload_content(
:type _host_index: int, optional
:return: Returns the result object.
"""
_param = self._list_public_validity_periods_0_serialize(
_param = self._list_public_validity_periods_serialize(
variable_definition_id=variable_definition_id,
accept_language=accept_language,
_request_auth=_request_auth,
Expand All @@ -563,7 +563,7 @@ def list_public_validity_periods_0_without_preload_content(
)
return response_data.response

def _list_public_validity_periods_0_serialize(
def _list_public_validity_periods_serialize(
self,
variable_definition_id,
accept_language,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self, api_client=None) -> None:
self.api_client = api_client

@validate_call
def get_public_variable_definition_by_id_0(
def get_public_variable_definition_by_id(
self,
variable_definition_id: Annotated[
StrictStr,
Expand Down Expand Up @@ -98,7 +98,7 @@ def get_public_variable_definition_by_id_0(
:type _host_index: int, optional
:return: Returns the result object.
"""
_param = self._get_public_variable_definition_by_id_0_serialize(
_param = self._get_public_variable_definition_by_id_serialize(
variable_definition_id=variable_definition_id,
accept_language=accept_language,
date_of_validity=date_of_validity,
Expand All @@ -123,7 +123,7 @@ def get_public_variable_definition_by_id_0(
).data

@validate_call
def get_public_variable_definition_by_id_0_with_http_info(
def get_public_variable_definition_by_id_with_http_info(
self,
variable_definition_id: Annotated[
StrictStr,
Expand Down Expand Up @@ -180,7 +180,7 @@ def get_public_variable_definition_by_id_0_with_http_info(
:type _host_index: int, optional
:return: Returns the result object.
"""
_param = self._get_public_variable_definition_by_id_0_serialize(
_param = self._get_public_variable_definition_by_id_serialize(
variable_definition_id=variable_definition_id,
accept_language=accept_language,
date_of_validity=date_of_validity,
Expand All @@ -205,7 +205,7 @@ def get_public_variable_definition_by_id_0_with_http_info(
)

@validate_call
def get_public_variable_definition_by_id_0_without_preload_content(
def get_public_variable_definition_by_id_without_preload_content(
self,
variable_definition_id: Annotated[
StrictStr,
Expand Down Expand Up @@ -262,7 +262,7 @@ def get_public_variable_definition_by_id_0_without_preload_content(
:type _host_index: int, optional
:return: Returns the result object.
"""
_param = self._get_public_variable_definition_by_id_0_serialize(
_param = self._get_public_variable_definition_by_id_serialize(
variable_definition_id=variable_definition_id,
accept_language=accept_language,
date_of_validity=date_of_validity,
Expand All @@ -282,7 +282,7 @@ def get_public_variable_definition_by_id_0_without_preload_content(
)
return response_data.response

def _get_public_variable_definition_by_id_0_serialize(
def _get_public_variable_definition_by_id_serialize(
self,
variable_definition_id,
accept_language,
Expand Down Expand Up @@ -651,7 +651,7 @@ def _get_variable_definition_by_id_serialize(
)

@validate_call
def list_public_variable_definitions_0(
def list_public_variable_definitions(
self,
accept_language: Annotated[
SupportedLanguages,
Expand Down Expand Up @@ -702,7 +702,7 @@ def list_public_variable_definitions_0(
:type _host_index: int, optional
:return: Returns the result object.
"""
_param = self._list_public_variable_definitions_0_serialize(
_param = self._list_public_variable_definitions_serialize(
accept_language=accept_language,
date_of_validity=date_of_validity,
_request_auth=_request_auth,
Expand All @@ -725,7 +725,7 @@ def list_public_variable_definitions_0(
).data

@validate_call
def list_public_variable_definitions_0_with_http_info(
def list_public_variable_definitions_with_http_info(
self,
accept_language: Annotated[
SupportedLanguages,
Expand Down Expand Up @@ -776,7 +776,7 @@ def list_public_variable_definitions_0_with_http_info(
:type _host_index: int, optional
:return: Returns the result object.
"""
_param = self._list_public_variable_definitions_0_serialize(
_param = self._list_public_variable_definitions_serialize(
accept_language=accept_language,
date_of_validity=date_of_validity,
_request_auth=_request_auth,
Expand All @@ -799,7 +799,7 @@ def list_public_variable_definitions_0_with_http_info(
)

@validate_call
def list_public_variable_definitions_0_without_preload_content(
def list_public_variable_definitions_without_preload_content(
self,
accept_language: Annotated[
SupportedLanguages,
Expand Down Expand Up @@ -850,7 +850,7 @@ def list_public_variable_definitions_0_without_preload_content(
:type _host_index: int, optional
:return: Returns the result object.
"""
_param = self._list_public_variable_definitions_0_serialize(
_param = self._list_public_variable_definitions_serialize(
accept_language=accept_language,
date_of_validity=date_of_validity,
_request_auth=_request_auth,
Expand All @@ -868,7 +868,7 @@ def list_public_variable_definitions_0_without_preload_content(
)
return response_data.response

def _list_public_variable_definitions_0_serialize(
def _list_public_variable_definitions_serialize(
self,
accept_language,
date_of_validity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from ..models.language_string_type import LanguageStringType
from ..models.owner import Owner
from ..models.patch import Patch
from ..models.person import Person
from ..models.problem import Problem
from ..models.rendered_contact import RenderedContact
from ..models.rendered_variable_definition import RenderedVariableDefinition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
from ..models.contact import Contact
from ..models.language_string_type import LanguageStringType
from ..models.owner import Owner
from ..models.person import Person
from ..models.variable_status import VariableStatus


Expand Down Expand Up @@ -93,14 +92,14 @@ class CompleteResponse(BaseModel):
created_at: datetime = Field(
description="The timestamp at which this variable definition was first created."
)
created_by: Person | None = Field(
default=None, description="The user who created this variable definition."
created_by: StrictStr = Field(
description="The user who created this variable definition."
)
last_updated_at: datetime = Field(
description="The timestamp at which this variable definition was last modified."
)
last_updated_by: Person | None = Field(
default=None, description="The user who last modified this variable definition."
last_updated_by: StrictStr = Field(
description="The user who last modified this variable definition."
)
__properties: ClassVar[list[str]] = [
"id",
Expand Down Expand Up @@ -179,12 +178,6 @@ def to_dict(self) -> dict[str, Any]:
# override the default output from pydantic by calling `to_dict()` of contact
if self.contact:
_dict["contact"] = self.contact.to_dict()
# override the default output from pydantic by calling `to_dict()` of created_by
if self.created_by:
_dict["created_by"] = self.created_by.to_dict()
# override the default output from pydantic by calling `to_dict()` of last_updated_by
if self.last_updated_by:
_dict["last_updated_by"] = self.last_updated_by.to_dict()
# set to None if classification_reference (nullable) is None
# and model_fields_set contains the field
if (
Expand Down Expand Up @@ -237,16 +230,6 @@ def to_dict(self) -> dict[str, Any]:
if self.contact is None and "contact" in self.model_fields_set:
_dict["contact"] = None

# set to None if created_by (nullable) is None
# and model_fields_set contains the field
if self.created_by is None and "created_by" in self.model_fields_set:
_dict["created_by"] = None

# set to None if last_updated_by (nullable) is None
# and model_fields_set contains the field
if self.last_updated_by is None and "last_updated_by" in self.model_fields_set:
_dict["last_updated_by"] = None

return _dict

@classmethod
Expand Down Expand Up @@ -293,13 +276,9 @@ def from_dict(cls, obj: dict[str, Any] | None) -> Self | None:
if obj.get("contact") is not None
else None,
"created_at": obj.get("created_at"),
"created_by": Person.from_dict(obj["created_by"])
if obj.get("created_by") is not None
else None,
"created_by": obj.get("created_by"),
"last_updated_at": obj.get("last_updated_at"),
"last_updated_by": Person.from_dict(obj["last_updated_by"])
if obj.get("last_updated_by") is not None
else None,
"last_updated_by": obj.get("last_updated_by"),
}
)
return _obj
7 changes: 2 additions & 5 deletions tests/variable_definitions/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
from dapla_metadata.variable_definitions.generated.vardef_client.models.patch import (
Patch,
)
from dapla_metadata.variable_definitions.generated.vardef_client.models.person import (
Person,
)
from dapla_metadata.variable_definitions.generated.vardef_client.models.update_draft import (
UpdateDraft,
)
Expand Down Expand Up @@ -115,9 +112,9 @@ def sample_variable_definition() -> VariableDefinition:
),
owner=Owner(team="my_team", groups=["my_team_developers"]),
created_at=date(2024, 11, 1),
created_by=Person(code="724", name="name"),
created_by="[email protected]",
last_updated_at=date(2024, 11, 1),
last_updated_by=Person(code="724", name="name"),
last_updated_by="[email protected]",
)


Expand Down
Loading

0 comments on commit e513d8e

Please sign in to comment.