From 33640008a09e52f33318c740b979cbd406b716c8 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Thu, 26 Jun 2025 08:04:48 +0000 Subject: [PATCH 1/6] Generate dns --- .../dns/models/create_record_set_payload.py | 8 +++-- .../dns/src/stackit/dns/models/record_set.py | 34 +++++++++++++++++-- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/services/dns/src/stackit/dns/models/create_record_set_payload.py b/services/dns/src/stackit/dns/models/create_record_set_payload.py index 77c1a86b..089b6325 100644 --- a/services/dns/src/stackit/dns/models/create_record_set_payload.py +++ b/services/dns/src/stackit/dns/models/create_record_set_payload.py @@ -33,7 +33,7 @@ class CreateRecordSetPayload(BaseModel): default=None, description="user comment" ) name: Annotated[str, Field(min_length=1, strict=True, max_length=253)] = Field( - description="name of the record which should be a valid domain according to rfc1035 Section 2.3.4" + description="name of the record which should be a valid domain according to rfc1035 Section 2.3.4. For APEX records (same as zone name), the zone name itself has to be put in here." ) records: List[RecordPayload] = Field(description="records") ttl: Optional[Annotated[int, Field(le=99999999, strict=True, ge=60)]] = Field( @@ -68,10 +68,14 @@ def type_validate_enum(cls, value): "URI", "CERT", "SVCB", + "TYPE", + "CSYNC", + "HINFO", + "HTTPS", ] ): raise ValueError( - "must be one of enum values ('A', 'AAAA', 'SOA', 'CNAME', 'NS', 'MX', 'TXT', 'SRV', 'PTR', 'ALIAS', 'DNAME', 'CAA', 'DNSKEY', 'DS', 'LOC', 'NAPTR', 'SSHFP', 'TLSA', 'URI', 'CERT', 'SVCB')" + "must be one of enum values ('A', 'AAAA', 'SOA', 'CNAME', 'NS', 'MX', 'TXT', 'SRV', 'PTR', 'ALIAS', 'DNAME', 'CAA', 'DNSKEY', 'DS', 'LOC', 'NAPTR', 'SSHFP', 'TLSA', 'URI', 'CERT', 'SVCB', 'TYPE', 'CSYNC', 'HINFO', 'HTTPS')" ) return value diff --git a/services/dns/src/stackit/dns/models/record_set.py b/services/dns/src/stackit/dns/models/record_set.py index bb38d4a2..4533fa12 100644 --- a/services/dns/src/stackit/dns/models/record_set.py +++ b/services/dns/src/stackit/dns/models/record_set.py @@ -45,7 +45,7 @@ class RecordSet(BaseModel): ) id: StrictStr = Field(description="rr set id") name: Annotated[str, Field(min_length=1, strict=True, max_length=253)] = Field( - description="name of the record which should be a valid domain according to rfc1035 Section 2.3.4" + description="name of the record which should be a valid domain according to rfc1035 Section 2.3.4. For APEX records (same as zone name), the zone name itself has to be put in here." ) records: Annotated[List[Record], Field(min_length=1)] = Field(description="records") state: StrictStr = Field(description="record set state") @@ -93,9 +93,37 @@ def state_validate_enum(cls, value): @field_validator("type") def type_validate_enum(cls, value): """Validates the enum""" - if value not in set(["A", "AAAA", "SOA", "CNAME", "NS", "MX", "TXT", "SRV", "PTR", "ALIAS", "DNAME", "CAA"]): + if value not in set( + [ + "A", + "AAAA", + "SOA", + "CNAME", + "NS", + "MX", + "TXT", + "SRV", + "PTR", + "ALIAS", + "DNAME", + "CAA", + "DNSKEY", + "DS", + "LOC", + "NAPTR", + "SSHFP", + "TLSA", + "URI", + "CERT", + "SVCB", + "TYPE", + "CSYNC", + "HINFO", + "HTTPS", + ] + ): raise ValueError( - "must be one of enum values ('A', 'AAAA', 'SOA', 'CNAME', 'NS', 'MX', 'TXT', 'SRV', 'PTR', 'ALIAS', 'DNAME', 'CAA')" + "must be one of enum values ('A', 'AAAA', 'SOA', 'CNAME', 'NS', 'MX', 'TXT', 'SRV', 'PTR', 'ALIAS', 'DNAME', 'CAA', 'DNSKEY', 'DS', 'LOC', 'NAPTR', 'SSHFP', 'TLSA', 'URI', 'CERT', 'SVCB', 'TYPE', 'CSYNC', 'HINFO', 'HTTPS')" ) return value From 1b4517de0f3e857a8365f5e442001e9be29ee812 Mon Sep 17 00:00:00 2001 From: Alexander Dahmen Date: Fri, 27 Jun 2025 08:05:46 +0200 Subject: [PATCH 2/6] Add changelogs Signed-off-by: Alexander Dahmen --- CHANGELOG.md | 4 ++++ services/dns/CHANGELOG.md | 4 ++++ services/dns/pyproject.toml | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b00d5c6e..19360ddd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ ## Release (2025-XX-YY) + +- `dns`: [v0.4.0](services/dns/CHANGELOG.md#v040) + - **Feature:** Add new record set types + - **Feature:** Improve documentation for APEX records in `RecordSet` and `CreateRecordSetPayload` models - `cdn`: [v1.2.0](services/cdn/CHANGELOG.md#v120) - **Feature:** Add `default_cache_duration` attribute to `Config`, `ConfigPatch` and `CreateDistributionPayload` model - Add `originUrlRelated` to available options given in `sort_by` description diff --git a/services/dns/CHANGELOG.md b/services/dns/CHANGELOG.md index 4d501096..eb037677 100644 --- a/services/dns/CHANGELOG.md +++ b/services/dns/CHANGELOG.md @@ -1,3 +1,7 @@ +## v0.4.0 +- **Feature:** Add new record set types +- **Feature:** Improve documentation for APEX records in `RecordSet` and `CreateRecordSetPayload` models + ## v0.3.2 (2025-05-09) - **Feature:** Update user-agent header diff --git a/services/dns/pyproject.toml b/services/dns/pyproject.toml index ab6b9328..d7a29d3e 100644 --- a/services/dns/pyproject.toml +++ b/services/dns/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-dns" [tool.poetry] name = "stackit-dns" -version = "v0.3.2" +version = "v0.4.0" authors = ["STACKIT Developer Tools "] description = "STACKIT DNS API" readme = "README.md" From eed3d61029c8c5a35149a38a2472ec2d1fa8275c Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Thu, 26 Jun 2025 08:04:54 +0000 Subject: [PATCH 3/6] Generate git --- services/git/src/stackit/git/__init__.py | 7 +- .../git/src/stackit/git/api/default_api.py | 504 ++++++++++++------ services/git/src/stackit/git/api_client.py | 4 +- services/git/src/stackit/git/configuration.py | 4 +- services/git/src/stackit/git/exceptions.py | 4 +- .../git/src/stackit/git/models/__init__.py | 7 +- .../git/models/create_instance_payload.py | 24 +- services/git/src/stackit/git/models/flavor.py | 99 ++++ .../git/models/generic_error_response.py | 83 +++ .../git/src/stackit/git/models/instance.py | 59 +- .../models/internal_server_error_response.py | 4 +- .../src/stackit/git/models/list_flavors.py | 97 ++++ .../src/stackit/git/models/list_instances.py | 8 +- .../git/models/unauthorized_response.py | 4 +- services/git/src/stackit/git/rest.py | 4 +- 15 files changed, 709 insertions(+), 203 deletions(-) create mode 100644 services/git/src/stackit/git/models/flavor.py create mode 100644 services/git/src/stackit/git/models/generic_error_response.py create mode 100644 services/git/src/stackit/git/models/list_flavors.py diff --git a/services/git/src/stackit/git/__init__.py b/services/git/src/stackit/git/__init__.py index 47f69996..8f166806 100644 --- a/services/git/src/stackit/git/__init__.py +++ b/services/git/src/stackit/git/__init__.py @@ -5,9 +5,9 @@ """ STACKIT Git API - Manage STACKIT Git instances. + STACKIT Git management API. - The version of the OpenAPI document: 1beta.0.3 + The version of the OpenAPI document: 1beta.0.4 Contact: git@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -35,9 +35,12 @@ # import models into sdk package from stackit.git.models.create_instance_payload import CreateInstancePayload +from stackit.git.models.flavor import Flavor +from stackit.git.models.generic_error_response import GenericErrorResponse from stackit.git.models.instance import Instance from stackit.git.models.internal_server_error_response import ( InternalServerErrorResponse, ) +from stackit.git.models.list_flavors import ListFlavors from stackit.git.models.list_instances import ListInstances from stackit.git.models.unauthorized_response import UnauthorizedResponse diff --git a/services/git/src/stackit/git/api/default_api.py b/services/git/src/stackit/git/api/default_api.py index bec029b1..80fdffec 100644 --- a/services/git/src/stackit/git/api/default_api.py +++ b/services/git/src/stackit/git/api/default_api.py @@ -3,9 +3,9 @@ """ STACKIT Git API - Manage STACKIT Git instances. + STACKIT Git management API. - The version of the OpenAPI document: 1beta.0.3 + The version of the OpenAPI document: 1beta.0.4 Contact: git@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -14,7 +14,13 @@ from typing import Any, Dict, List, Optional, Tuple, Union -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call +from pydantic import ( + Field, + StrictFloat, + StrictInt, + StrictStr, + validate_call, +) from stackit.core.configuration import Configuration from typing_extensions import Annotated @@ -22,6 +28,7 @@ from stackit.git.api_response import ApiResponse from stackit.git.models.create_instance_payload import CreateInstancePayload from stackit.git.models.instance import Instance +from stackit.git.models.list_flavors import ListFlavors from stackit.git.models.list_instances import ListInstances from stackit.git.rest import RESTResponseType @@ -42,17 +49,8 @@ def __init__(self, configuration: Configuration = None) -> None: @validate_call def create_instance( self, - project_id: Annotated[ - str, - Field( - strict=True, - max_length=36, - description="The STACKIT portal project UUID the STACKIT Git instance is part of.", - ), - ], - create_instance_payload: Annotated[ - CreateInstancePayload, Field(description="Provides the options to use when creating the instance.") - ], + project_id: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="Project identifier.")], + create_instance_payload: Annotated[CreateInstancePayload, Field(description="Instance configuration options.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -63,13 +61,13 @@ def create_instance( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> Instance: - """Creates a new STACKIT Git instance within the project. + """Create an Instance. - Users with write-access to a project may create a new STACKIT Git instance by posting the instance creation request to this endpoint, which will schedule the creation of a new STACKIT Git instance within that project. + Creates a new STACKIT Git instance as a project resource. - :param project_id: The STACKIT portal project UUID the STACKIT Git instance is part of. (required) + :param project_id: Project identifier. (required) :type project_id: str - :param create_instance_payload: Provides the options to use when creating the instance. (required) + :param create_instance_payload: Instance configuration options. (required) :type create_instance_payload: CreateInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -104,10 +102,10 @@ def create_instance( _response_types_map: Dict[str, Optional[str]] = { "201": "Instance", - "400": None, + "400": "GenericErrorResponse", "401": "UnauthorizedResponse", - "409": None, - "500": "InternalServerErrorResponse", + "409": "GenericErrorResponse", + "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -119,17 +117,8 @@ def create_instance( @validate_call def create_instance_with_http_info( self, - project_id: Annotated[ - str, - Field( - strict=True, - max_length=36, - description="The STACKIT portal project UUID the STACKIT Git instance is part of.", - ), - ], - create_instance_payload: Annotated[ - CreateInstancePayload, Field(description="Provides the options to use when creating the instance.") - ], + project_id: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="Project identifier.")], + create_instance_payload: Annotated[CreateInstancePayload, Field(description="Instance configuration options.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -140,13 +129,13 @@ def create_instance_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[Instance]: - """Creates a new STACKIT Git instance within the project. + """Create an Instance. - Users with write-access to a project may create a new STACKIT Git instance by posting the instance creation request to this endpoint, which will schedule the creation of a new STACKIT Git instance within that project. + Creates a new STACKIT Git instance as a project resource. - :param project_id: The STACKIT portal project UUID the STACKIT Git instance is part of. (required) + :param project_id: Project identifier. (required) :type project_id: str - :param create_instance_payload: Provides the options to use when creating the instance. (required) + :param create_instance_payload: Instance configuration options. (required) :type create_instance_payload: CreateInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -181,10 +170,10 @@ def create_instance_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "201": "Instance", - "400": None, + "400": "GenericErrorResponse", "401": "UnauthorizedResponse", - "409": None, - "500": "InternalServerErrorResponse", + "409": "GenericErrorResponse", + "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -196,17 +185,8 @@ def create_instance_with_http_info( @validate_call def create_instance_without_preload_content( self, - project_id: Annotated[ - str, - Field( - strict=True, - max_length=36, - description="The STACKIT portal project UUID the STACKIT Git instance is part of.", - ), - ], - create_instance_payload: Annotated[ - CreateInstancePayload, Field(description="Provides the options to use when creating the instance.") - ], + project_id: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="Project identifier.")], + create_instance_payload: Annotated[CreateInstancePayload, Field(description="Instance configuration options.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -217,13 +197,13 @@ def create_instance_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Creates a new STACKIT Git instance within the project. + """Create an Instance. - Users with write-access to a project may create a new STACKIT Git instance by posting the instance creation request to this endpoint, which will schedule the creation of a new STACKIT Git instance within that project. + Creates a new STACKIT Git instance as a project resource. - :param project_id: The STACKIT portal project UUID the STACKIT Git instance is part of. (required) + :param project_id: Project identifier. (required) :type project_id: str - :param create_instance_payload: Provides the options to use when creating the instance. (required) + :param create_instance_payload: Instance configuration options. (required) :type create_instance_payload: CreateInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -258,10 +238,10 @@ def create_instance_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "201": "Instance", - "400": None, + "400": "GenericErrorResponse", "401": "UnauthorizedResponse", - "409": None, - "500": "InternalServerErrorResponse", + "409": "GenericErrorResponse", + "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -330,15 +310,10 @@ def _create_instance_serialize( @validate_call def delete_instance( self, - project_id: Annotated[ - str, - Field( - strict=True, - max_length=36, - description="The STACKIT portal project UUID the STACKIT Git instance is part of.", - ), + project_id: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="Project identifier.")], + instance_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="Instance identifier.") ], - instance_id: Annotated[str, Field(strict=True, max_length=36, description="The STACKIT Git instance UUID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -349,13 +324,13 @@ def delete_instance( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Deletes the given STACKIT Git instance. + """Delete Instance. - Allows a user with write-access to a project to schedule the deletion of a STACKIT Git instance, which will soon eliminate all repositories & user metadata associated with that instance. This is a destructive operation. + Deletes a STACKIT Git instance and destroys all associated data. - :param project_id: The STACKIT portal project UUID the STACKIT Git instance is part of. (required) + :param project_id: Project identifier. (required) :type project_id: str - :param instance_id: The STACKIT Git instance UUID. (required) + :param instance_id: Instance identifier. (required) :type instance_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -390,11 +365,11 @@ def delete_instance( _response_types_map: Dict[str, Optional[str]] = { "202": None, - "400": None, + "400": "GenericErrorResponse", "401": "UnauthorizedResponse", "404": None, "409": None, - "500": "InternalServerErrorResponse", + "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -406,15 +381,10 @@ def delete_instance( @validate_call def delete_instance_with_http_info( self, - project_id: Annotated[ - str, - Field( - strict=True, - max_length=36, - description="The STACKIT portal project UUID the STACKIT Git instance is part of.", - ), + project_id: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="Project identifier.")], + instance_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="Instance identifier.") ], - instance_id: Annotated[str, Field(strict=True, max_length=36, description="The STACKIT Git instance UUID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -425,13 +395,13 @@ def delete_instance_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Deletes the given STACKIT Git instance. + """Delete Instance. - Allows a user with write-access to a project to schedule the deletion of a STACKIT Git instance, which will soon eliminate all repositories & user metadata associated with that instance. This is a destructive operation. + Deletes a STACKIT Git instance and destroys all associated data. - :param project_id: The STACKIT portal project UUID the STACKIT Git instance is part of. (required) + :param project_id: Project identifier. (required) :type project_id: str - :param instance_id: The STACKIT Git instance UUID. (required) + :param instance_id: Instance identifier. (required) :type instance_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -466,11 +436,11 @@ def delete_instance_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "202": None, - "400": None, + "400": "GenericErrorResponse", "401": "UnauthorizedResponse", "404": None, "409": None, - "500": "InternalServerErrorResponse", + "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -482,15 +452,10 @@ def delete_instance_with_http_info( @validate_call def delete_instance_without_preload_content( self, - project_id: Annotated[ - str, - Field( - strict=True, - max_length=36, - description="The STACKIT portal project UUID the STACKIT Git instance is part of.", - ), + project_id: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="Project identifier.")], + instance_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="Instance identifier.") ], - instance_id: Annotated[str, Field(strict=True, max_length=36, description="The STACKIT Git instance UUID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -501,13 +466,13 @@ def delete_instance_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Deletes the given STACKIT Git instance. + """Delete Instance. - Allows a user with write-access to a project to schedule the deletion of a STACKIT Git instance, which will soon eliminate all repositories & user metadata associated with that instance. This is a destructive operation. + Deletes a STACKIT Git instance and destroys all associated data. - :param project_id: The STACKIT portal project UUID the STACKIT Git instance is part of. (required) + :param project_id: Project identifier. (required) :type project_id: str - :param instance_id: The STACKIT Git instance UUID. (required) + :param instance_id: Instance identifier. (required) :type instance_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -542,11 +507,11 @@ def delete_instance_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "202": None, - "400": None, + "400": "GenericErrorResponse", "401": "UnauthorizedResponse", "404": None, "409": None, - "500": "InternalServerErrorResponse", + "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -607,15 +572,10 @@ def _delete_instance_serialize( @validate_call def get_instance( self, - project_id: Annotated[ - str, - Field( - strict=True, - max_length=36, - description="The STACKIT portal project UUID the STACKIT Git instance is part of.", - ), + project_id: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="Project identifier.")], + instance_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="Instance identifier.") ], - instance_id: Annotated[str, Field(strict=True, max_length=36, description="The STACKIT Git instance UUID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -626,13 +586,13 @@ def get_instance( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> Instance: - """Returns the details for the given STACKIT Git instance. + """Get Instance information. - Provides detailed information about the state of an instance within the specified project including information about how to access the instance for further use. + Retrieves information about a STACKIT Git instance. - :param project_id: The STACKIT portal project UUID the STACKIT Git instance is part of. (required) + :param project_id: Project identifier. (required) :type project_id: str - :param instance_id: The STACKIT Git instance UUID. (required) + :param instance_id: Instance identifier. (required) :type instance_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -667,10 +627,10 @@ def get_instance( _response_types_map: Dict[str, Optional[str]] = { "200": "Instance", - "400": None, + "400": "GenericErrorResponse", "401": "UnauthorizedResponse", "404": None, - "500": "InternalServerErrorResponse", + "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -682,15 +642,10 @@ def get_instance( @validate_call def get_instance_with_http_info( self, - project_id: Annotated[ - str, - Field( - strict=True, - max_length=36, - description="The STACKIT portal project UUID the STACKIT Git instance is part of.", - ), + project_id: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="Project identifier.")], + instance_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="Instance identifier.") ], - instance_id: Annotated[str, Field(strict=True, max_length=36, description="The STACKIT Git instance UUID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -701,13 +656,13 @@ def get_instance_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[Instance]: - """Returns the details for the given STACKIT Git instance. + """Get Instance information. - Provides detailed information about the state of an instance within the specified project including information about how to access the instance for further use. + Retrieves information about a STACKIT Git instance. - :param project_id: The STACKIT portal project UUID the STACKIT Git instance is part of. (required) + :param project_id: Project identifier. (required) :type project_id: str - :param instance_id: The STACKIT Git instance UUID. (required) + :param instance_id: Instance identifier. (required) :type instance_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -742,10 +697,10 @@ def get_instance_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "Instance", - "400": None, + "400": "GenericErrorResponse", "401": "UnauthorizedResponse", "404": None, - "500": "InternalServerErrorResponse", + "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -757,15 +712,10 @@ def get_instance_with_http_info( @validate_call def get_instance_without_preload_content( self, - project_id: Annotated[ - str, - Field( - strict=True, - max_length=36, - description="The STACKIT portal project UUID the STACKIT Git instance is part of.", - ), + project_id: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="Project identifier.")], + instance_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36, description="Instance identifier.") ], - instance_id: Annotated[str, Field(strict=True, max_length=36, description="The STACKIT Git instance UUID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -776,13 +726,13 @@ def get_instance_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Returns the details for the given STACKIT Git instance. + """Get Instance information. - Provides detailed information about the state of an instance within the specified project including information about how to access the instance for further use. + Retrieves information about a STACKIT Git instance. - :param project_id: The STACKIT portal project UUID the STACKIT Git instance is part of. (required) + :param project_id: Project identifier. (required) :type project_id: str - :param instance_id: The STACKIT Git instance UUID. (required) + :param instance_id: Instance identifier. (required) :type instance_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -817,10 +767,10 @@ def get_instance_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "Instance", - "400": None, + "400": "GenericErrorResponse", "401": "UnauthorizedResponse", "404": None, - "500": "InternalServerErrorResponse", + "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -879,7 +829,7 @@ def _get_instance_serialize( ) @validate_call - def list_instances( + def list_flavors( self, project_id: Annotated[ str, @@ -898,10 +848,10 @@ def list_instances( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListInstances: - """Returns a list of all STACKIT Git instances within the project. + ) -> ListFlavors: + """Returns the details for the given STACKIT Git flavors. - STACKIT Git instances exist within a project, and a project may have zero or more instances. This endpoint allows a user with read-access to a project to list all instances that exist within the specified project. + Provides detailed information about possible Git Flavors. :param project_id: The STACKIT portal project UUID the STACKIT Git instance is part of. (required) :type project_id: str @@ -927,7 +877,7 @@ def list_instances( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_instances_serialize( + _param = self._list_flavors_serialize( project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, @@ -936,9 +886,10 @@ def list_instances( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListInstances", + "200": "ListFlavors", "400": None, "401": "UnauthorizedResponse", + "404": None, "500": "InternalServerErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -949,7 +900,7 @@ def list_instances( ).data @validate_call - def list_instances_with_http_info( + def list_flavors_with_http_info( self, project_id: Annotated[ str, @@ -968,10 +919,10 @@ def list_instances_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListInstances]: - """Returns a list of all STACKIT Git instances within the project. + ) -> ApiResponse[ListFlavors]: + """Returns the details for the given STACKIT Git flavors. - STACKIT Git instances exist within a project, and a project may have zero or more instances. This endpoint allows a user with read-access to a project to list all instances that exist within the specified project. + Provides detailed information about possible Git Flavors. :param project_id: The STACKIT portal project UUID the STACKIT Git instance is part of. (required) :type project_id: str @@ -997,7 +948,7 @@ def list_instances_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_instances_serialize( + _param = self._list_flavors_serialize( project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1006,9 +957,10 @@ def list_instances_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListInstances", + "200": "ListFlavors", "400": None, "401": "UnauthorizedResponse", + "404": None, "500": "InternalServerErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1019,7 +971,7 @@ def list_instances_with_http_info( ) @validate_call - def list_instances_without_preload_content( + def list_flavors_without_preload_content( self, project_id: Annotated[ str, @@ -1039,9 +991,9 @@ def list_instances_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Returns a list of all STACKIT Git instances within the project. + """Returns the details for the given STACKIT Git flavors. - STACKIT Git instances exist within a project, and a project may have zero or more instances. This endpoint allows a user with read-access to a project to list all instances that exist within the specified project. + Provides detailed information about possible Git Flavors. :param project_id: The STACKIT portal project UUID the STACKIT Git instance is part of. (required) :type project_id: str @@ -1067,7 +1019,7 @@ def list_instances_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_instances_serialize( + _param = self._list_flavors_serialize( project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1076,14 +1028,250 @@ def list_instances_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListInstances", + "200": "ListFlavors", "400": None, "401": "UnauthorizedResponse", + "404": None, "500": "InternalServerErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response + def _list_flavors_serialize( + self, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1beta/projects/{projectId}/flavors", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_instances( + self, + project_id: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="Project identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListInstances: + """List Instances. + + Lists all STACKIT Git instances within a project. + + :param project_id: Project identifier. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_instances_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListInstances", + "400": "GenericErrorResponse", + "401": "UnauthorizedResponse", + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_instances_with_http_info( + self, + project_id: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="Project identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListInstances]: + """List Instances. + + Lists all STACKIT Git instances within a project. + + :param project_id: Project identifier. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_instances_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListInstances", + "400": "GenericErrorResponse", + "401": "UnauthorizedResponse", + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_instances_without_preload_content( + self, + project_id: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="Project identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Instances. + + Lists all STACKIT Git instances within a project. + + :param project_id: Project identifier. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_instances_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListInstances", + "400": "GenericErrorResponse", + "401": "UnauthorizedResponse", + "500": "GenericErrorResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + def _list_instances_serialize( self, project_id, diff --git a/services/git/src/stackit/git/api_client.py b/services/git/src/stackit/git/api_client.py index 494553c2..59ef9b98 100644 --- a/services/git/src/stackit/git/api_client.py +++ b/services/git/src/stackit/git/api_client.py @@ -3,9 +3,9 @@ """ STACKIT Git API - Manage STACKIT Git instances. + STACKIT Git management API. - The version of the OpenAPI document: 1beta.0.3 + The version of the OpenAPI document: 1beta.0.4 Contact: git@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/services/git/src/stackit/git/configuration.py b/services/git/src/stackit/git/configuration.py index 41a0a98c..a4b58c22 100644 --- a/services/git/src/stackit/git/configuration.py +++ b/services/git/src/stackit/git/configuration.py @@ -8,9 +8,9 @@ """ STACKIT Git API - Manage STACKIT Git instances. + STACKIT Git management API. - The version of the OpenAPI document: 1beta.0.3 + The version of the OpenAPI document: 1beta.0.4 Contact: git@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/services/git/src/stackit/git/exceptions.py b/services/git/src/stackit/git/exceptions.py index eae1d129..38d6acf3 100644 --- a/services/git/src/stackit/git/exceptions.py +++ b/services/git/src/stackit/git/exceptions.py @@ -3,9 +3,9 @@ """ STACKIT Git API - Manage STACKIT Git instances. + STACKIT Git management API. - The version of the OpenAPI document: 1beta.0.3 + The version of the OpenAPI document: 1beta.0.4 Contact: git@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/services/git/src/stackit/git/models/__init__.py b/services/git/src/stackit/git/models/__init__.py index b7b3ca04..66afcf29 100644 --- a/services/git/src/stackit/git/models/__init__.py +++ b/services/git/src/stackit/git/models/__init__.py @@ -4,9 +4,9 @@ """ STACKIT Git API - Manage STACKIT Git instances. + STACKIT Git management API. - The version of the OpenAPI document: 1beta.0.3 + The version of the OpenAPI document: 1beta.0.4 Contact: git@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -16,9 +16,12 @@ # import models into model package from stackit.git.models.create_instance_payload import CreateInstancePayload +from stackit.git.models.flavor import Flavor +from stackit.git.models.generic_error_response import GenericErrorResponse from stackit.git.models.instance import Instance from stackit.git.models.internal_server_error_response import ( InternalServerErrorResponse, ) +from stackit.git.models.list_flavors import ListFlavors from stackit.git.models.list_instances import ListInstances from stackit.git.models.unauthorized_response import UnauthorizedResponse diff --git a/services/git/src/stackit/git/models/create_instance_payload.py b/services/git/src/stackit/git/models/create_instance_payload.py index 793f64da..ab930f32 100644 --- a/services/git/src/stackit/git/models/create_instance_payload.py +++ b/services/git/src/stackit/git/models/create_instance_payload.py @@ -3,9 +3,9 @@ """ STACKIT Git API - Manage STACKIT Git instances. + STACKIT Git management API. - The version of the OpenAPI document: 1beta.0.3 + The version of the OpenAPI document: 1beta.0.4 Contact: git@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,19 +19,25 @@ import re from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing_extensions import Annotated, Self class CreateInstancePayload(BaseModel): """ - Request a STACKIT Git instance to be created with these properties. + Instance creation configuration options. """ + acl: Optional[Annotated[List[StrictStr], Field(max_length=5)]] = Field( + default=None, description="Restricted ACL for instance access." + ) + flavor: Optional[StrictStr] = Field( + default="git-100", description="Instance flavor. Defaults to git-100 if not specified." + ) name: Annotated[str, Field(min_length=5, strict=True, max_length=32)] = Field( description="A user chosen name to distinguish multiple STACKIT Git instances." ) - __properties: ClassVar[List[str]] = ["name"] + __properties: ClassVar[List[str]] = ["acl", "flavor", "name"] @field_validator("name") def name_validate_regular_expression(cls, value): @@ -88,5 +94,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"name": obj.get("name")}) + _obj = cls.model_validate( + { + "acl": obj.get("acl"), + "flavor": obj.get("flavor") if obj.get("flavor") is not None else "git-100", + "name": obj.get("name"), + } + ) return _obj diff --git a/services/git/src/stackit/git/models/flavor.py b/services/git/src/stackit/git/models/flavor.py new file mode 100644 index 00000000..5475660f --- /dev/null +++ b/services/git/src/stackit/git/models/flavor.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + STACKIT Git API + + STACKIT Git management API. + + The version of the OpenAPI document: 1beta.0.4 + Contact: git@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing_extensions import Annotated, Self + + +class Flavor(BaseModel): + """ + Describes a STACKIT Git Flavor. + """ + + availability: StrictStr = Field(description="Defines the flavor availability.") + description: StrictStr = Field(description="Flavor description.") + display_name: StrictStr = Field(description="The display name that will be shown in the Portal.") + id: Annotated[str, Field(strict=True, max_length=36)] = Field(description="Flavor id.") + __properties: ClassVar[List[str]] = ["availability", "description", "display_name", "id"] + + @field_validator("availability") + def availability_validate_enum(cls, value): + """Validates the enum""" + if value not in set(["available", "unavailable", "internal", "deprecated"]): + raise ValueError("must be one of enum values ('available', 'unavailable', 'internal', 'deprecated')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Flavor from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Flavor from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "availability": obj.get("availability"), + "description": obj.get("description"), + "display_name": obj.get("display_name"), + "id": obj.get("id"), + } + ) + return _obj diff --git a/services/git/src/stackit/git/models/generic_error_response.py b/services/git/src/stackit/git/models/generic_error_response.py new file mode 100644 index 00000000..36ffb1b6 --- /dev/null +++ b/services/git/src/stackit/git/models/generic_error_response.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + STACKIT Git API + + STACKIT Git management API. + + The version of the OpenAPI document: 1beta.0.4 + Contact: git@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing_extensions import Self + + +class GenericErrorResponse(BaseModel): + """ + Generic Error Response. + """ + + details: Optional[List[StrictStr]] = None + message: StrictStr + __properties: ClassVar[List[str]] = ["details", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GenericErrorResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GenericErrorResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"details": obj.get("details"), "message": obj.get("message")}) + return _obj diff --git a/services/git/src/stackit/git/models/instance.py b/services/git/src/stackit/git/models/instance.py index f500b2d2..aeabd26e 100644 --- a/services/git/src/stackit/git/models/instance.py +++ b/services/git/src/stackit/git/models/instance.py @@ -3,9 +3,9 @@ """ STACKIT Git API - Manage STACKIT Git instances. + STACKIT Git management API. - The version of the OpenAPI document: 1beta.0.3 + The version of the OpenAPI document: 1beta.0.4 Contact: git@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -16,35 +16,52 @@ import json import pprint +import re from datetime import datetime from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing_extensions import Annotated, Self class Instance(BaseModel): """ - Describes a STACKIT Git instance. + Information about an Instance. """ - created: datetime = Field(description="The date and time the creation of the STACKIT Git instance was triggered.") - id: Annotated[str, Field(strict=True, max_length=36)] = Field( - description="A auto generated unique id which identifies the STACKIT Git instances." - ) - name: Annotated[str, Field(strict=True, max_length=32)] = Field( - description="A user chosen name to distinguish multiple STACKIT Git instances." - ) + acl: List[StrictStr] = Field(description="Restricted ACL for instance access.") + consumed_disk: StrictStr = Field(description="How many bytes of disk space is consumed. Read Only.") + consumed_object_storage: StrictStr = Field(description="How many bytes of Object Storage is consumed. Read Only.") + created: datetime = Field(description="Instance creation timestamp in RFC3339 format.") + flavor: StrictStr = Field(description="Instance flavor.") + id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field(description="Instance identifier.") + name: Annotated[str, Field(strict=True, max_length=32)] = Field(description="Instance name.") state: Annotated[str, Field(strict=True, max_length=32)] = Field( - description="The current state of the STACKIT Git instance." - ) - url: Annotated[str, Field(strict=True, max_length=2048)] = Field( - description="The URL for reaching the STACKIT Git instance." - ) - version: Annotated[str, Field(strict=True, max_length=20)] = Field( - description="The current version of STACKIT Git deployed to the instance." + description="Indicate the readiness state of the instance." ) - __properties: ClassVar[List[str]] = ["created", "id", "name", "state", "url", "version"] + url: Annotated[str, Field(strict=True, max_length=512)] = Field(description="Instance url.") + version: Annotated[str, Field(strict=True, max_length=20)] = Field(description="STACKIT Git version indicator.") + __properties: ClassVar[List[str]] = [ + "acl", + "consumed_disk", + "consumed_object_storage", + "created", + "flavor", + "id", + "name", + "state", + "url", + "version", + ] + + @field_validator("id") + def id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", value): + raise ValueError( + r"must validate the regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/" + ) + return value @field_validator("state") def state_validate_enum(cls, value): @@ -105,7 +122,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { + "acl": obj.get("acl"), + "consumed_disk": obj.get("consumed_disk"), + "consumed_object_storage": obj.get("consumed_object_storage"), "created": obj.get("created"), + "flavor": obj.get("flavor"), "id": obj.get("id"), "name": obj.get("name"), "state": obj.get("state"), diff --git a/services/git/src/stackit/git/models/internal_server_error_response.py b/services/git/src/stackit/git/models/internal_server_error_response.py index bae89830..0789f80c 100644 --- a/services/git/src/stackit/git/models/internal_server_error_response.py +++ b/services/git/src/stackit/git/models/internal_server_error_response.py @@ -3,9 +3,9 @@ """ STACKIT Git API - Manage STACKIT Git instances. + STACKIT Git management API. - The version of the OpenAPI document: 1beta.0.3 + The version of the OpenAPI document: 1beta.0.4 Contact: git@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/services/git/src/stackit/git/models/list_flavors.py b/services/git/src/stackit/git/models/list_flavors.py new file mode 100644 index 00000000..1d2fb2d8 --- /dev/null +++ b/services/git/src/stackit/git/models/list_flavors.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + STACKIT Git API + + STACKIT Git management API. + + The version of the OpenAPI document: 1beta.0.4 + Contact: git@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict +from typing_extensions import Self + +from stackit.git.models.flavor import Flavor + + +class ListFlavors(BaseModel): + """ + A list of STACKIT Git flavors. + """ + + flavors: List[Flavor] + __properties: ClassVar[List[str]] = ["flavors"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListFlavors from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in flavors (list) + _items = [] + if self.flavors: + for _item in self.flavors: + if _item: + _items.append(_item.to_dict()) + _dict["flavors"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListFlavors from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "flavors": ( + [Flavor.from_dict(_item) for _item in obj["flavors"]] if obj.get("flavors") is not None else None + ) + } + ) + return _obj diff --git a/services/git/src/stackit/git/models/list_instances.py b/services/git/src/stackit/git/models/list_instances.py index 76ccd7ee..f4afc5bf 100644 --- a/services/git/src/stackit/git/models/list_instances.py +++ b/services/git/src/stackit/git/models/list_instances.py @@ -3,9 +3,9 @@ """ STACKIT Git API - Manage STACKIT Git instances. + STACKIT Git management API. - The version of the OpenAPI document: 1beta.0.3 + The version of the OpenAPI document: 1beta.0.4 Contact: git@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -26,10 +26,10 @@ class ListInstances(BaseModel): """ - A list of STACKIT Git instances. + List of Instances. """ - instances: Annotated[List[Instance], Field(max_length=50)] + instances: Annotated[List[Instance], Field(max_length=100)] __properties: ClassVar[List[str]] = ["instances"] model_config = ConfigDict( diff --git a/services/git/src/stackit/git/models/unauthorized_response.py b/services/git/src/stackit/git/models/unauthorized_response.py index b5f5b673..caeb666d 100644 --- a/services/git/src/stackit/git/models/unauthorized_response.py +++ b/services/git/src/stackit/git/models/unauthorized_response.py @@ -3,9 +3,9 @@ """ STACKIT Git API - Manage STACKIT Git instances. + STACKIT Git management API. - The version of the OpenAPI document: 1beta.0.3 + The version of the OpenAPI document: 1beta.0.4 Contact: git@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/services/git/src/stackit/git/rest.py b/services/git/src/stackit/git/rest.py index 209072ea..6d2aaf59 100644 --- a/services/git/src/stackit/git/rest.py +++ b/services/git/src/stackit/git/rest.py @@ -3,9 +3,9 @@ """ STACKIT Git API - Manage STACKIT Git instances. + STACKIT Git management API. - The version of the OpenAPI document: 1beta.0.3 + The version of the OpenAPI document: 1beta.0.4 Contact: git@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) From 8538557a730a614d04e1ffcb3467490628477a3d Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Thu, 26 Jun 2025 08:05:04 +0000 Subject: [PATCH 4/6] Generate ske --- services/ske/src/stackit/ske/models/cluster_error.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/ske/src/stackit/ske/models/cluster_error.py b/services/ske/src/stackit/ske/models/cluster_error.py index 9e0e0223..9a1c2da8 100644 --- a/services/ske/src/stackit/ske/models/cluster_error.py +++ b/services/ske/src/stackit/ske/models/cluster_error.py @@ -40,13 +40,15 @@ def code_validate_enum(cls, value): [ "SKE_OBSERVABILITY_INSTANCE_NOT_FOUND", "SKE_DNS_ZONE_NOT_FOUND", - "SKE_NODE_MISCONFIGURED_PDB", "SKE_NODE_NO_VALID_HOST_FOUND", + "SKE_NODE_MISCONFIGURED_PDB", "SKE_NODE_MACHINE_TYPE_NOT_FOUND", + "SKE_INFRA_SNA_NETWORK_NOT_FOUND", + "SKE_FETCHING_ERRORS_NOT_POSSIBLE", ] ): raise ValueError( - "must be one of enum values ('SKE_OBSERVABILITY_INSTANCE_NOT_FOUND', 'SKE_DNS_ZONE_NOT_FOUND', 'SKE_NODE_MISCONFIGURED_PDB', 'SKE_NODE_NO_VALID_HOST_FOUND', 'SKE_NODE_MACHINE_TYPE_NOT_FOUND')" + "must be one of enum values ('SKE_OBSERVABILITY_INSTANCE_NOT_FOUND', 'SKE_DNS_ZONE_NOT_FOUND', 'SKE_NODE_NO_VALID_HOST_FOUND', 'SKE_NODE_MISCONFIGURED_PDB', 'SKE_NODE_MACHINE_TYPE_NOT_FOUND', 'SKE_INFRA_SNA_NETWORK_NOT_FOUND', 'SKE_FETCHING_ERRORS_NOT_POSSIBLE')" ) return value From 3d9958260a0fd05d3b24f7261a321f3046adc72a Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Thu, 26 Jun 2025 08:05:16 +0000 Subject: [PATCH 5/6] Generate stackitmarketplace --- .../stackit/stackitmarketplace/__init__.py | 4 + .../stackitmarketplace/models/__init__.py | 4 + .../stackitmarketplace/models/assets.py | 95 +++++++++++++++ .../models/catalog_product_detail.py | 7 ++ .../models/catalog_product_pricing_option.py | 9 ++ .../models/localized_version.py | 112 ++++++++++++++++++ .../models/notice_period.py | 95 +++++++++++++++ .../models/service_certificate.py | 89 ++++++++++++++ .../models/subscription_product.py | 7 ++ 9 files changed, 422 insertions(+) create mode 100644 services/stackitmarketplace/src/stackit/stackitmarketplace/models/assets.py create mode 100644 services/stackitmarketplace/src/stackit/stackitmarketplace/models/localized_version.py create mode 100644 services/stackitmarketplace/src/stackit/stackitmarketplace/models/notice_period.py create mode 100644 services/stackitmarketplace/src/stackit/stackitmarketplace/models/service_certificate.py diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/__init__.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/__init__.py index cb4ffcfe..a2c31bc1 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/__init__.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/__init__.py @@ -37,6 +37,7 @@ from stackit.stackitmarketplace.models.approve_subscription_payload import ( ApproveSubscriptionPayload, ) +from stackit.stackitmarketplace.models.assets import Assets from stackit.stackitmarketplace.models.become_vendor import BecomeVendor from stackit.stackitmarketplace.models.catalog_pricing_option_highlight import ( CatalogPricingOptionHighlight, @@ -89,6 +90,8 @@ from stackit.stackitmarketplace.models.list_vendor_subscriptions_response import ( ListVendorSubscriptionsResponse, ) +from stackit.stackitmarketplace.models.localized_version import LocalizedVersion +from stackit.stackitmarketplace.models.notice_period import NoticePeriod from stackit.stackitmarketplace.models.offer_type import OfferType from stackit.stackitmarketplace.models.price_type import PriceType from stackit.stackitmarketplace.models.pricing_option_unit import PricingOptionUnit @@ -99,6 +102,7 @@ from stackit.stackitmarketplace.models.resolve_customer_payload import ( ResolveCustomerPayload, ) +from stackit.stackitmarketplace.models.service_certificate import ServiceCertificate from stackit.stackitmarketplace.models.subscription_lifecycle_state import ( SubscriptionLifecycleState, ) diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/__init__.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/__init__.py index 6f537b8b..e078b229 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/__init__.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/__init__.py @@ -18,6 +18,7 @@ from stackit.stackitmarketplace.models.approve_subscription_payload import ( ApproveSubscriptionPayload, ) +from stackit.stackitmarketplace.models.assets import Assets from stackit.stackitmarketplace.models.become_vendor import BecomeVendor from stackit.stackitmarketplace.models.catalog_pricing_option_highlight import ( CatalogPricingOptionHighlight, @@ -70,6 +71,8 @@ from stackit.stackitmarketplace.models.list_vendor_subscriptions_response import ( ListVendorSubscriptionsResponse, ) +from stackit.stackitmarketplace.models.localized_version import LocalizedVersion +from stackit.stackitmarketplace.models.notice_period import NoticePeriod from stackit.stackitmarketplace.models.offer_type import OfferType from stackit.stackitmarketplace.models.price_type import PriceType from stackit.stackitmarketplace.models.pricing_option_unit import PricingOptionUnit @@ -80,6 +83,7 @@ from stackit.stackitmarketplace.models.resolve_customer_payload import ( ResolveCustomerPayload, ) +from stackit.stackitmarketplace.models.service_certificate import ServiceCertificate from stackit.stackitmarketplace.models.subscription_lifecycle_state import ( SubscriptionLifecycleState, ) diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/assets.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/assets.py new file mode 100644 index 00000000..a8bdafd5 --- /dev/null +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/assets.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + STACKIT Marketplace API + + API to manage STACKIT Marketplace. + + The version of the OpenAPI document: 1 + Contact: marketplace@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self + +from stackit.stackitmarketplace.models.service_certificate import ServiceCertificate + + +class Assets(BaseModel): + """ + The assets associated with the product. + """ + + service_certificate: Optional[ServiceCertificate] = Field(default=None, alias="serviceCertificate") + __properties: ClassVar[List[str]] = ["serviceCertificate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Assets from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of service_certificate + if self.service_certificate: + _dict["serviceCertificate"] = self.service_certificate.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Assets from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "serviceCertificate": ( + ServiceCertificate.from_dict(obj["serviceCertificate"]) + if obj.get("serviceCertificate") is not None + else None + ) + } + ) + return _obj diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_detail.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_detail.py index 4414a1fc..90985f3a 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_detail.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_detail.py @@ -30,6 +30,7 @@ ) from typing_extensions import Annotated, Self +from stackit.stackitmarketplace.models.assets import Assets from stackit.stackitmarketplace.models.catalog_product_details_vendor import ( CatalogProductDetailsVendor, ) @@ -57,6 +58,7 @@ class CatalogProductDetail(BaseModel): CatalogProductDetail """ + assets: Optional[Assets] = None categories: Optional[List[StrictStr]] = Field( default=None, description="The list of categories associated to the product." ) @@ -103,6 +105,7 @@ class CatalogProductDetail(BaseModel): description="The video URL.", alias="videoUrl" ) __properties: ClassVar[List[str]] = [ + "assets", "categories", "deliveryMethod", "description", @@ -207,6 +210,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of assets + if self.assets: + _dict["assets"] = self.assets.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in highlights (list) _items = [] if self.highlights: @@ -251,6 +257,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { + "assets": Assets.from_dict(obj["assets"]) if obj.get("assets") is not None else None, "categories": obj.get("categories"), "deliveryMethod": obj.get("deliveryMethod"), "description": obj.get("description"), diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_pricing_option.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_pricing_option.py index 1cfb562c..b8916f21 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_pricing_option.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_pricing_option.py @@ -24,6 +24,7 @@ from stackit.stackitmarketplace.models.catalog_pricing_option_highlight import ( CatalogPricingOptionHighlight, ) +from stackit.stackitmarketplace.models.notice_period import NoticePeriod from stackit.stackitmarketplace.models.price_type import PriceType from stackit.stackitmarketplace.models.pricing_option_unit import PricingOptionUnit @@ -36,6 +37,7 @@ class CatalogProductPricingOption(BaseModel): description: StrictStr = Field(description="The pricing option description.") highlights: List[CatalogPricingOptionHighlight] = Field(description="The list of highlights.") name: StrictStr = Field(description="The pricing option name.") + notice_period: Optional[NoticePeriod] = Field(default=None, alias="noticePeriod") price_type: Optional[PriceType] = Field(default=None, alias="priceType") pricing_plan: Optional[StrictStr] = Field( default=None, description="Additional price type information.", alias="pricingPlan" @@ -51,6 +53,7 @@ class CatalogProductPricingOption(BaseModel): "description", "highlights", "name", + "noticePeriod", "priceType", "pricingPlan", "rate", @@ -104,6 +107,9 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict["highlights"] = _items + # override the default output from pydantic by calling `to_dict()` of notice_period + if self.notice_period: + _dict["noticePeriod"] = self.notice_period.to_dict() return _dict @classmethod @@ -124,6 +130,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: else None ), "name": obj.get("name"), + "noticePeriod": ( + NoticePeriod.from_dict(obj["noticePeriod"]) if obj.get("noticePeriod") is not None else None + ), "priceType": obj.get("priceType"), "pricingPlan": obj.get("pricingPlan"), "rate": obj.get("rate"), diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/localized_version.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/localized_version.py new file mode 100644 index 00000000..6c669ed9 --- /dev/null +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/localized_version.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + STACKIT Marketplace API + + API to manage STACKIT Marketplace. + + The version of the OpenAPI document: 1 + Contact: marketplace@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +import re +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing_extensions import Annotated, Self + + +class LocalizedVersion(BaseModel): + """ + The localized version (file name) of a file. + """ + + de: Optional[Annotated[str, Field(strict=True)]] = Field( + default=None, description="The file version matching the file name (localized)." + ) + en: Optional[Annotated[str, Field(strict=True)]] = Field( + default=None, description="The file version matching the file name (localized)." + ) + __properties: ClassVar[List[str]] = ["de", "en"] + + @field_validator("de") + def de_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^\d{4}_\d{2}_\d{2}_\d{3}_[a-zA-Z0-9_-]+_(DE|EN)\.$", value): + raise ValueError( + r"must validate the regular expression /^\d{4}_\d{2}_\d{2}_\d{3}_[a-zA-Z0-9_-]+_(DE|EN)\.$/" + ) + return value + + @field_validator("en") + def en_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^\d{4}_\d{2}_\d{2}_\d{3}_[a-zA-Z0-9_-]+_(DE|EN)\.$", value): + raise ValueError( + r"must validate the regular expression /^\d{4}_\d{2}_\d{2}_\d{3}_[a-zA-Z0-9_-]+_(DE|EN)\.$/" + ) + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LocalizedVersion from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LocalizedVersion from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"de": obj.get("de"), "en": obj.get("en")}) + return _obj diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/notice_period.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/notice_period.py new file mode 100644 index 00000000..7b0e1b45 --- /dev/null +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/notice_period.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + STACKIT Marketplace API + + API to manage STACKIT Marketplace. + + The version of the OpenAPI document: 1 + Contact: marketplace@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing_extensions import Self + + +class NoticePeriod(BaseModel): + """ + The notice period for a product and plan. + """ + + type: Optional[StrictStr] = Field(default=None, description="The notice period type.") + value: Optional[StrictInt] = Field( + default=None, description="The value of the corresponding type. Omitted for _SAME_DAY_." + ) + __properties: ClassVar[List[str]] = ["type", "value"] + + @field_validator("type") + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(["SAME_DAY", "DAYS", "MONTHS"]): + raise ValueError("must be one of enum values ('SAME_DAY', 'DAYS', 'MONTHS')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NoticePeriod from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NoticePeriod from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"type": obj.get("type"), "value": obj.get("value")}) + return _obj diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/service_certificate.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/service_certificate.py new file mode 100644 index 00000000..d2f00b8c --- /dev/null +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/service_certificate.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + STACKIT Marketplace API + + API to manage STACKIT Marketplace. + + The version of the OpenAPI document: 1 + Contact: marketplace@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict +from typing_extensions import Self + +from stackit.stackitmarketplace.models.localized_version import LocalizedVersion + + +class ServiceCertificate(BaseModel): + """ + The related service certificate of the (subscription) product. + """ + + version: Optional[LocalizedVersion] = None + __properties: ClassVar[List[str]] = ["version"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ServiceCertificate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of version + if self.version: + _dict["version"] = self.version.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ServiceCertificate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"version": LocalizedVersion.from_dict(obj["version"]) if obj.get("version") is not None else None} + ) + return _obj diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_product.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_product.py index c3f8698d..b27a03c8 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_product.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_product.py @@ -22,6 +22,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing_extensions import Annotated, Self +from stackit.stackitmarketplace.models.assets import Assets from stackit.stackitmarketplace.models.delivery_method import DeliveryMethod from stackit.stackitmarketplace.models.price_type import PriceType from stackit.stackitmarketplace.models.product_lifecycle_state import ( @@ -34,6 +35,7 @@ class SubscriptionProduct(BaseModel): The product of a subscription """ + assets: Optional[Assets] = None delivery_method: DeliveryMethod = Field(alias="deliveryMethod") lifecycle_state: ProductLifecycleState = Field(alias="lifecycleState") price_type: PriceType = Field(alias="priceType") @@ -57,6 +59,7 @@ class SubscriptionProduct(BaseModel): description="The vendor's website.", alias="vendorWebsiteUrl" ) __properties: ClassVar[List[str]] = [ + "assets", "deliveryMethod", "lifecycleState", "priceType", @@ -156,6 +159,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of assets + if self.assets: + _dict["assets"] = self.assets.to_dict() return _dict @classmethod @@ -169,6 +175,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { + "assets": Assets.from_dict(obj["assets"]) if obj.get("assets") is not None else None, "deliveryMethod": obj.get("deliveryMethod"), "lifecycleState": obj.get("lifecycleState"), "priceType": obj.get("priceType"), From d9448043e4eb8c4373fefb9e0b1e10d99c3006f5 Mon Sep 17 00:00:00 2001 From: Alexander Dahmen Date: Fri, 27 Jun 2025 08:20:01 +0200 Subject: [PATCH 6/6] Add changelogs Signed-off-by: Alexander Dahmen --- CHANGELOG.md | 10 ++++++++++ services/git/CHANGELOG.md | 4 ++++ services/git/pyproject.toml | 2 +- services/ske/CHANGELOG.md | 3 +++ services/ske/pyproject.toml | 2 +- services/stackitmarketplace/CHANGELOG.md | 6 ++++++ services/stackitmarketplace/pyproject.toml | 2 +- 7 files changed, 26 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19360ddd..36cc4ee1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,16 @@ - `dns`: [v0.4.0](services/dns/CHANGELOG.md#v040) - **Feature:** Add new record set types - **Feature:** Improve documentation for APEX records in `RecordSet` and `CreateRecordSetPayload` models +- `git`: [v0.2.0](services/git/CHANGELOG.md#v020) + - **Feature:** Add support for `Flavors` for STACKIT git instance + - **Improvement:** Error handling and documentation improved +- `ske` [v0.6.0](services/ske/CHANGELOG.md#v060) + - **Feature:** Add new `ClusterErrorCode` types: `CLUSTERERRORCODE_INFRA_SNA_NETWORK_NOT_FOUND`, `CLUSTERERRORCODE_FETCHING_ERRORS_NOT_POSSIBLE` +- `stackitmarketplace`: [v1.5.0](services/stackitmarketplace/CHANGELOG.md#v150) + - **Feature:** Add new `Assets` model for managing service certificate assets + - **Feature:** Add new `LocalizedVersion` model for localized content management + - **Feature:** Add new `NoticePeriod` model with types: `SAME_DAY`, `DAYS`, `MONTHS` + - **Feature:** Add new `ServiceCertificate` model for service certification - `cdn`: [v1.2.0](services/cdn/CHANGELOG.md#v120) - **Feature:** Add `default_cache_duration` attribute to `Config`, `ConfigPatch` and `CreateDistributionPayload` model - Add `originUrlRelated` to available options given in `sort_by` description diff --git a/services/git/CHANGELOG.md b/services/git/CHANGELOG.md index 6abfc047..5b7dd0af 100644 --- a/services/git/CHANGELOG.md +++ b/services/git/CHANGELOG.md @@ -1,3 +1,7 @@ +## v0.2.0 +- **Feature:** Add support for `Flavors` for STACKIT git instance +- **Improvement:** Error handling and documentation improved + ## v0.1.2 (2025-05-09) - **Feature:** Update user-agent header diff --git a/services/git/pyproject.toml b/services/git/pyproject.toml index 74406af5..7c3849dd 100644 --- a/services/git/pyproject.toml +++ b/services/git/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-git" [tool.poetry] name = "stackit-git" -version = "v0.1.2" +version = "v0.2.0" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/ske/CHANGELOG.md b/services/ske/CHANGELOG.md index 93c66e27..6411efd7 100644 --- a/services/ske/CHANGELOG.md +++ b/services/ske/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.6.0 +- **Feature:** Add new `ClusterErrorCode` types: `CLUSTERERRORCODE_INFRA_SNA_NETWORK_NOT_FOUND`, `CLUSTERERRORCODE_FETCHING_ERRORS_NOT_POSSIBLE` + ## v0.5.0 (2025-06-10) - **Feature:** Add new field `pod_address_ranges` to `ClusterStatus` diff --git a/services/ske/pyproject.toml b/services/ske/pyproject.toml index f1777183..c0d1f2c4 100644 --- a/services/ske/pyproject.toml +++ b/services/ske/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-ske" [tool.poetry] name = "stackit-ske" -version = "v0.5.0" +version = "v0.6.0" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/stackitmarketplace/CHANGELOG.md b/services/stackitmarketplace/CHANGELOG.md index 89a61c55..64e07caa 100644 --- a/services/stackitmarketplace/CHANGELOG.md +++ b/services/stackitmarketplace/CHANGELOG.md @@ -1,3 +1,9 @@ +## v1.5.0 +- **Feature:** Add new `Assets` model for managing service certificate assets +- **Feature:** Add new `LocalizedVersion` model for localized content management +- **Feature:** Add new `NoticePeriod` model with types: `SAME_DAY`, `DAYS`, `MONTHS` +- **Feature:** Add new `ServiceCertificate` model for service certification + ## v1.4.0 - **Feature:** Add support for offer types - new model `OfferType` diff --git a/services/stackitmarketplace/pyproject.toml b/services/stackitmarketplace/pyproject.toml index 83f282e7..2b33b2d9 100644 --- a/services/stackitmarketplace/pyproject.toml +++ b/services/stackitmarketplace/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-stackitmarketplace" [tool.poetry] name = "stackit-stackitmarketplace" -version = "v1.4.0" +version = "v1.5.0" authors = [ "STACKIT Developer Tools ", ]