From bea10c769841140260b079a48839595d7fa0b04a Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Thu, 16 Jul 2026 13:53:13 +0000 Subject: [PATCH] Generate modelserving --- services/modelserving/oas_commit | 2 +- .../src/stackit/modelserving/api/default_api.py | 17 +++++++++++++++++ .../src/stackit/modelserving/exceptions.py | 8 ++++---- .../modelserving/models/create_token_payload.py | 13 +++++++++++-- .../models/partial_update_token_payload.py | 10 ++++++++-- .../src/stackit/modelserving/models/token.py | 7 ++++++- .../modelserving/models/token_created.py | 16 +++++++++++++++- 7 files changed, 62 insertions(+), 11 deletions(-) diff --git a/services/modelserving/oas_commit b/services/modelserving/oas_commit index 9ac506bc2..338ccfc45 100644 --- a/services/modelserving/oas_commit +++ b/services/modelserving/oas_commit @@ -1 +1 @@ -4437823ea19bd04c638f5de3d6fa40b866aa144c +c4128703f9d3ed3951e55d042b5a6ecc57011f2e diff --git a/services/modelserving/src/stackit/modelserving/api/default_api.py b/services/modelserving/src/stackit/modelserving/api/default_api.py index 11eac6797..d9018063a 100644 --- a/services/modelserving/src/stackit/modelserving/api/default_api.py +++ b/services/modelserving/src/stackit/modelserving/api/default_api.py @@ -1601,6 +1601,7 @@ def list_tokens( self, region_id: Annotated[StrictStr, Field(description="region name")], project_id: Annotated[UUID, Field(description="portal project id")], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter token resource by labels")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1619,6 +1620,8 @@ def list_tokens( :type region_id: str :param project_id: portal project id (required) :type project_id: UUID + :param label_selector: Filter token resource by labels + :type label_selector: 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 @@ -1644,6 +1647,7 @@ def list_tokens( _param = self._list_tokens_serialize( region_id=region_id, project_id=project_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1668,6 +1672,7 @@ def list_tokens_with_http_info( self, region_id: Annotated[StrictStr, Field(description="region name")], project_id: Annotated[UUID, Field(description="portal project id")], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter token resource by labels")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1686,6 +1691,8 @@ def list_tokens_with_http_info( :type region_id: str :param project_id: portal project id (required) :type project_id: UUID + :param label_selector: Filter token resource by labels + :type label_selector: 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 @@ -1711,6 +1718,7 @@ def list_tokens_with_http_info( _param = self._list_tokens_serialize( region_id=region_id, project_id=project_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1735,6 +1743,7 @@ def list_tokens_without_preload_content( self, region_id: Annotated[StrictStr, Field(description="region name")], project_id: Annotated[UUID, Field(description="portal project id")], + label_selector: Annotated[Optional[StrictStr], Field(description="Filter token resource by labels")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1753,6 +1762,8 @@ def list_tokens_without_preload_content( :type region_id: str :param project_id: portal project id (required) :type project_id: UUID + :param label_selector: Filter token resource by labels + :type label_selector: 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 @@ -1778,6 +1789,7 @@ def list_tokens_without_preload_content( _param = self._list_tokens_serialize( region_id=region_id, project_id=project_id, + label_selector=label_selector, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1797,6 +1809,7 @@ def _list_tokens_serialize( self, region_id, project_id, + label_selector, _request_auth, _content_type, _headers, @@ -1820,6 +1833,10 @@ def _list_tokens_serialize( if project_id is not None: _path_params["projectId"] = project_id # process the query parameters + if label_selector is not None: + + _query_params.append(("label_selector", label_selector)) + # process the header parameters # process the form parameters # process the body parameter diff --git a/services/modelserving/src/stackit/modelserving/exceptions.py b/services/modelserving/src/stackit/modelserving/exceptions.py index 02e9fc41f..6daa269fc 100644 --- a/services/modelserving/src/stackit/modelserving/exceptions.py +++ b/services/modelserving/src/stackit/modelserving/exceptions.py @@ -46,7 +46,7 @@ def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None) -> full_msg = msg if path_to_item: full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) + super(ApiTypeError, self).__init__(full_msg, path_to_item, valid_classes, key_type) class ApiValueError(OpenApiException, ValueError): @@ -64,7 +64,7 @@ def __init__(self, msg, path_to_item=None) -> None: full_msg = msg if path_to_item: full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) + super(ApiValueError, self).__init__(full_msg, path_to_item) class ApiAttributeError(OpenApiException, AttributeError): @@ -83,7 +83,7 @@ def __init__(self, msg, path_to_item=None) -> None: full_msg = msg if path_to_item: full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiAttributeError, self).__init__(full_msg) + super(ApiAttributeError, self).__init__(full_msg, path_to_item) class ApiKeyError(OpenApiException, KeyError): @@ -100,7 +100,7 @@ def __init__(self, msg, path_to_item=None) -> None: full_msg = msg if path_to_item: full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) + super(ApiKeyError, self).__init__(full_msg, path_to_item) class ApiException(OpenApiException): diff --git a/services/modelserving/src/stackit/modelserving/models/create_token_payload.py b/services/modelserving/src/stackit/modelserving/models/create_token_payload.py index a7f3e2eac..faec99b3b 100644 --- a/services/modelserving/src/stackit/modelserving/models/create_token_payload.py +++ b/services/modelserving/src/stackit/modelserving/models/create_token_payload.py @@ -30,13 +30,17 @@ class CreateTokenPayload(BaseModel): """ # noqa: E501 description: Optional[Annotated[str, Field(strict=True, max_length=2000)]] = None + labels: Optional[Dict[str, Annotated[str, Field(strict=True)]]] = Field( + default=None, + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. Send empty object {} to remove all labels. The `stackit` prefix is reserved and cannot be used for Keys.", + ) name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] ttl_duration: Optional[StrictStr] = Field( default=None, description="time to live duration. Must be valid duration string. If not set the token will never expire.", alias="ttlDuration", ) - __properties: ClassVar[List[str]] = ["description", "name", "ttlDuration"] + __properties: ClassVar[List[str]] = ["description", "labels", "name", "ttlDuration"] @field_validator("description") def description_validate_regular_expression(cls, value): @@ -110,6 +114,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate( - {"description": obj.get("description"), "name": obj.get("name"), "ttlDuration": obj.get("ttlDuration")} + { + "description": obj.get("description"), + "labels": obj.get("labels"), + "name": obj.get("name"), + "ttlDuration": obj.get("ttlDuration"), + } ) return _obj diff --git a/services/modelserving/src/stackit/modelserving/models/partial_update_token_payload.py b/services/modelserving/src/stackit/modelserving/models/partial_update_token_payload.py index e877325d5..4cb462800 100644 --- a/services/modelserving/src/stackit/modelserving/models/partial_update_token_payload.py +++ b/services/modelserving/src/stackit/modelserving/models/partial_update_token_payload.py @@ -30,8 +30,12 @@ class PartialUpdateTokenPayload(BaseModel): """ # noqa: E501 description: Optional[Annotated[str, Field(strict=True, max_length=2000)]] = None + labels: Optional[Dict[str, Optional[Annotated[str, Field(strict=True)]]]] = Field( + default=None, + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. Send empty object {} to remove all labels. The `stackit` prefix is reserved and cannot be used for Keys.", + ) name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = None - __properties: ClassVar[List[str]] = ["description", "name"] + __properties: ClassVar[List[str]] = ["description", "labels", "name"] @field_validator("description") def description_validate_regular_expression(cls, value): @@ -107,5 +111,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({"description": obj.get("description"), "name": obj.get("name")}) + _obj = cls.model_validate( + {"description": obj.get("description"), "labels": obj.get("labels"), "name": obj.get("name")} + ) return _obj diff --git a/services/modelserving/src/stackit/modelserving/models/token.py b/services/modelserving/src/stackit/modelserving/models/token.py index d0cce24d6..9643b7062 100644 --- a/services/modelserving/src/stackit/modelserving/models/token.py +++ b/services/modelserving/src/stackit/modelserving/models/token.py @@ -33,11 +33,15 @@ class Token(BaseModel): description: Optional[Annotated[str, Field(strict=True, max_length=2000)]] = None id: UUID + labels: Optional[Dict[str, Annotated[str, Field(strict=True)]]] = Field( + default=None, + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. Send empty object {} to remove all labels. The `stackit` prefix is reserved and cannot be used for Keys.", + ) name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] region: StrictStr state: StrictStr valid_until: datetime = Field(alias="validUntil") - __properties: ClassVar[List[str]] = ["description", "id", "name", "region", "state", "validUntil"] + __properties: ClassVar[List[str]] = ["description", "id", "labels", "name", "region", "state", "validUntil"] @field_validator("description") def description_validate_regular_expression(cls, value): @@ -134,6 +138,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: { "description": obj.get("description"), "id": obj.get("id"), + "labels": obj.get("labels"), "name": obj.get("name"), "region": obj.get("region"), "state": obj.get("state"), diff --git a/services/modelserving/src/stackit/modelserving/models/token_created.py b/services/modelserving/src/stackit/modelserving/models/token_created.py index 494c54dc6..fb8f8a7d7 100644 --- a/services/modelserving/src/stackit/modelserving/models/token_created.py +++ b/services/modelserving/src/stackit/modelserving/models/token_created.py @@ -34,11 +34,24 @@ class TokenCreated(BaseModel): content: Annotated[str, Field(min_length=1, strict=True, max_length=200)] description: Optional[Annotated[str, Field(strict=True, max_length=2000)]] = None id: UUID + labels: Optional[Dict[str, Annotated[str, Field(strict=True)]]] = Field( + default=None, + description="Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. Send empty object {} to remove all labels. The `stackit` prefix is reserved and cannot be used for Keys.", + ) name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] region: StrictStr state: StrictStr valid_until: datetime = Field(alias="validUntil") - __properties: ClassVar[List[str]] = ["content", "description", "id", "name", "region", "state", "validUntil"] + __properties: ClassVar[List[str]] = [ + "content", + "description", + "id", + "labels", + "name", + "region", + "state", + "validUntil", + ] @field_validator("content") def content_validate_regular_expression(cls, value): @@ -146,6 +159,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "content": obj.get("content"), "description": obj.get("description"), "id": obj.get("id"), + "labels": obj.get("labels"), "name": obj.get("name"), "region": obj.get("region"), "state": obj.get("state"),