From 74608d6e0db6d4bbf704ddad1f8311f3c67dd352 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Mon, 19 Oct 2026 07:06:54 +0000 Subject: [PATCH 1/2] Generate objectstorage --- services/objectstorage/oas_commit | 2 +- .../src/stackit/objectstorage/__init__.py | 4 + .../stackit/objectstorage/api/default_api.py | 283 ++++++++++++++++++ .../stackit/objectstorage/models/__init__.py | 1 + .../objectstorage/models/project_status.py | 7 +- .../models/update_service_payload.py | 82 +++++ 6 files changed, 376 insertions(+), 3 deletions(-) create mode 100644 services/objectstorage/src/stackit/objectstorage/models/update_service_payload.py diff --git a/services/objectstorage/oas_commit b/services/objectstorage/oas_commit index e71b273d5..0962e389d 100644 --- a/services/objectstorage/oas_commit +++ b/services/objectstorage/oas_commit @@ -1 +1 @@ -c5681f3e228ca69c4dd3debc19e7711e8a6fab56 +b155367fdf354045bbd1d2403a19bf4e363e76a3 diff --git a/services/objectstorage/src/stackit/objectstorage/__init__.py b/services/objectstorage/src/stackit/objectstorage/__init__.py index 3cc44c44a..11fea9766 100644 --- a/services/objectstorage/src/stackit/objectstorage/__init__.py +++ b/services/objectstorage/src/stackit/objectstorage/__init__.py @@ -56,6 +56,7 @@ "RateLimitError", "RetentionMode", "SetDefaultRetentionPayload", + "UpdateServicePayload", "ValidationError", ] @@ -145,6 +146,9 @@ from stackit.objectstorage.models.set_default_retention_payload import ( SetDefaultRetentionPayload as SetDefaultRetentionPayload, ) +from stackit.objectstorage.models.update_service_payload import ( + UpdateServicePayload as UpdateServicePayload, +) from stackit.objectstorage.models.validation_error import ( ValidationError as ValidationError, ) diff --git a/services/objectstorage/src/stackit/objectstorage/api/default_api.py b/services/objectstorage/src/stackit/objectstorage/api/default_api.py index 3b1615246..30e200fdb 100644 --- a/services/objectstorage/src/stackit/objectstorage/api/default_api.py +++ b/services/objectstorage/src/stackit/objectstorage/api/default_api.py @@ -61,6 +61,7 @@ from stackit.objectstorage.models.set_default_retention_payload import ( SetDefaultRetentionPayload, ) +from stackit.objectstorage.models.update_service_payload import UpdateServicePayload from stackit.objectstorage.rest import RESTResponseType @@ -5519,3 +5520,285 @@ def _set_default_retention_serialize( _host=_host, _request_auth=_request_auth, ) + + @validate_call + def update_service( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + update_service_payload: UpdateServicePayload, + _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, + ) -> ProjectStatus: + """Update Project + + Update project details. + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: str + :param update_service_payload: (required) + :type update_service_payload: UpdateServicePayload + :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 + + _param = self._update_service_serialize( + project_id=project_id, + region=region, + update_service_payload=update_service_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProjectStatus", + "401": "ErrorMessage", + "403": "ErrorMessage", + "404": "ErrorMessage", + "422": "HTTPValidationError", + "429": "RateLimitError", + "500": "ErrorMessage", + } + 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 update_service_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + update_service_payload: UpdateServicePayload, + _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[ProjectStatus]: + """Update Project + + Update project details. + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: str + :param update_service_payload: (required) + :type update_service_payload: UpdateServicePayload + :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 + + _param = self._update_service_serialize( + project_id=project_id, + region=region, + update_service_payload=update_service_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProjectStatus", + "401": "ErrorMessage", + "403": "ErrorMessage", + "404": "ErrorMessage", + "422": "HTTPValidationError", + "429": "RateLimitError", + "500": "ErrorMessage", + } + 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 update_service_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + update_service_payload: UpdateServicePayload, + _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: + """Update Project + + Update project details. + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: str + :param update_service_payload: (required) + :type update_service_payload: UpdateServicePayload + :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 + + _param = self._update_service_serialize( + project_id=project_id, + region=region, + update_service_payload=update_service_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProjectStatus", + "401": "ErrorMessage", + "403": "ErrorMessage", + "404": "ErrorMessage", + "422": "HTTPValidationError", + "429": "RateLimitError", + "500": "ErrorMessage", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _update_service_serialize( + self, + project_id, + region, + update_service_payload, + _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, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if update_service_payload is not None: + _body_params = update_service_payload + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/v2/project/{projectId}/regions/{region}", + 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, + ) diff --git a/services/objectstorage/src/stackit/objectstorage/models/__init__.py b/services/objectstorage/src/stackit/objectstorage/models/__init__.py index 1043bfb93..4ced35d1e 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/__init__.py +++ b/services/objectstorage/src/stackit/objectstorage/models/__init__.py @@ -68,4 +68,5 @@ from stackit.objectstorage.models.set_default_retention_payload import ( SetDefaultRetentionPayload, ) +from stackit.objectstorage.models.update_service_payload import UpdateServicePayload from stackit.objectstorage.models.validation_error import ValidationError diff --git a/services/objectstorage/src/stackit/objectstorage/models/project_status.py b/services/objectstorage/src/stackit/objectstorage/models/project_status.py index e75ea2a83..d70075d4c 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/project_status.py +++ b/services/objectstorage/src/stackit/objectstorage/models/project_status.py @@ -29,9 +29,10 @@ class ProjectStatus(BaseModel): ProjectStatus """ # noqa: E501 + labels: Optional[Dict[str, StrictStr]] = Field(default=None, description="Project labels") project: StrictStr = Field(description="Project ID") scope: ProjectScope = Field(description="Project Scope") - __properties: ClassVar[List[str]] = ["project", "scope"] + __properties: ClassVar[List[str]] = ["labels", "project", "scope"] model_config = ConfigDict( validate_by_name=True, @@ -81,5 +82,7 @@ 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({"project": obj.get("project"), "scope": obj.get("scope")}) + _obj = cls.model_validate( + {"labels": obj.get("labels"), "project": obj.get("project"), "scope": obj.get("scope")} + ) return _obj diff --git a/services/objectstorage/src/stackit/objectstorage/models/update_service_payload.py b/services/objectstorage/src/stackit/objectstorage/models/update_service_payload.py new file mode 100644 index 000000000..1887eb119 --- /dev/null +++ b/services/objectstorage/src/stackit/objectstorage/models/update_service_payload.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" +STACKIT Object Storage API + +STACKIT API to manage the Object Storage + +The version of the OpenAPI document: 2.0.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic_core import to_jsonable_python +from typing_extensions import Self + + +class UpdateServicePayload(BaseModel): + """ + UpdateServicePayload + """ # noqa: E501 + + labels: Dict[str, StrictStr] = Field(description="Project labels") + __properties: ClassVar[List[str]] = ["labels"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateServicePayload 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 UpdateServicePayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"labels": obj.get("labels")}) + return _obj From 3c3175d81b73df48cfcabf07ad6edd901719dc63 Mon Sep 17 00:00:00 2001 From: Marcel Jacek <72880145+marceljk@users.noreply.github.com> Date: Mon, 19 Oct 2026 11:41:44 +0200 Subject: [PATCH 2/2] add changelog --- CHANGELOG.md | 3 +++ services/objectstorage/CHANGELOG.md | 4 ++++ services/objectstorage/pyproject.toml | 2 +- services/objectstorage/uv.lock | 5 +++-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59d5dec0e..455af354e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,9 @@ - **Improvement:** `Label.key`/`CreateLabelPayload.key` now accepts up to 314 characters (previously 63), supporting prefixed label keys (e.g. `example.com/environment`) - **Breaking Change:** `PartialUpdateZonePayload.extensions` type changed from `ZoneExtensions` to `DomainExtensions`, now also exposing `observability_extension.state` - `objectstorage`: + - [v1.7.0](services/objectstorage/CHANGELOG.md#v170) + - **Feature:** New field `Labels` in `ProjectStatus` model struct + - **Feature:** New API client method `UpdateService` - [v1.6.0](services/objectstorage/CHANGELOG.md#v160) - **Feature:** New model class `RateLimitError` - **Improvement:** Add HTTP 429 rate limit error responses in API operations diff --git a/services/objectstorage/CHANGELOG.md b/services/objectstorage/CHANGELOG.md index bd7a60c46..caff0a93d 100644 --- a/services/objectstorage/CHANGELOG.md +++ b/services/objectstorage/CHANGELOG.md @@ -1,3 +1,7 @@ +## v1.7.0 +- **Feature:** New field `Labels` in `ProjectStatus` model struct +- **Feature:** New API client method `UpdateService` + ## v1.6.0 - **Feature:** New model class `RateLimitError` - **Improvement:** Add HTTP 429 rate limit error responses in API operations diff --git a/services/objectstorage/pyproject.toml b/services/objectstorage/pyproject.toml index 9484ec394..83adaf4c5 100644 --- a/services/objectstorage/pyproject.toml +++ b/services/objectstorage/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "stackit-objectstorage" -version = "v1.6.0" +version = "v1.7.0" description = "STACKIT Object Storage API" authors = [{ name = "STACKIT Developer Tools", email = "developer-tools@stackit.cloud" }] requires-python = ">=3.10,<4.0" diff --git a/services/objectstorage/uv.lock b/services/objectstorage/uv.lock index 12e62cdbd..35f38aadf 100644 --- a/services/objectstorage/uv.lock +++ b/services/objectstorage/uv.lock @@ -1,5 +1,5 @@ version = 1 -revision = 3 +revision = 5 requires-python = ">=3.10, <4.0" resolution-markers = [ "python_full_version >= '3.12'", @@ -1057,8 +1057,9 @@ dev = [ [[package]] name = "stackit-objectstorage" -version = "1.6.0" +version = "1.7.0" source = { editable = "." } +default-groups = "all" dependencies = [ { name = "pydantic" }, { name = "python-dateutil" },