Skip to content

Commit bea10c7

Browse files
Generate modelserving
1 parent 815ef3e commit bea10c7

7 files changed

Lines changed: 62 additions & 11 deletions

File tree

services/modelserving/oas_commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4437823ea19bd04c638f5de3d6fa40b866aa144c
1+
c4128703f9d3ed3951e55d042b5a6ecc57011f2e

services/modelserving/src/stackit/modelserving/api/default_api.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,6 +1601,7 @@ def list_tokens(
16011601
self,
16021602
region_id: Annotated[StrictStr, Field(description="region name")],
16031603
project_id: Annotated[UUID, Field(description="portal project id")],
1604+
label_selector: Annotated[Optional[StrictStr], Field(description="Filter token resource by labels")] = None,
16041605
_request_timeout: Union[
16051606
None,
16061607
Annotated[StrictFloat, Field(gt=0)],
@@ -1619,6 +1620,8 @@ def list_tokens(
16191620
:type region_id: str
16201621
:param project_id: portal project id (required)
16211622
:type project_id: UUID
1623+
:param label_selector: Filter token resource by labels
1624+
:type label_selector: str
16221625
:param _request_timeout: timeout setting for this request. If one
16231626
number provided, it will be total request
16241627
timeout. It can also be a pair (tuple) of
@@ -1644,6 +1647,7 @@ def list_tokens(
16441647
_param = self._list_tokens_serialize(
16451648
region_id=region_id,
16461649
project_id=project_id,
1650+
label_selector=label_selector,
16471651
_request_auth=_request_auth,
16481652
_content_type=_content_type,
16491653
_headers=_headers,
@@ -1668,6 +1672,7 @@ def list_tokens_with_http_info(
16681672
self,
16691673
region_id: Annotated[StrictStr, Field(description="region name")],
16701674
project_id: Annotated[UUID, Field(description="portal project id")],
1675+
label_selector: Annotated[Optional[StrictStr], Field(description="Filter token resource by labels")] = None,
16711676
_request_timeout: Union[
16721677
None,
16731678
Annotated[StrictFloat, Field(gt=0)],
@@ -1686,6 +1691,8 @@ def list_tokens_with_http_info(
16861691
:type region_id: str
16871692
:param project_id: portal project id (required)
16881693
:type project_id: UUID
1694+
:param label_selector: Filter token resource by labels
1695+
:type label_selector: str
16891696
:param _request_timeout: timeout setting for this request. If one
16901697
number provided, it will be total request
16911698
timeout. It can also be a pair (tuple) of
@@ -1711,6 +1718,7 @@ def list_tokens_with_http_info(
17111718
_param = self._list_tokens_serialize(
17121719
region_id=region_id,
17131720
project_id=project_id,
1721+
label_selector=label_selector,
17141722
_request_auth=_request_auth,
17151723
_content_type=_content_type,
17161724
_headers=_headers,
@@ -1735,6 +1743,7 @@ def list_tokens_without_preload_content(
17351743
self,
17361744
region_id: Annotated[StrictStr, Field(description="region name")],
17371745
project_id: Annotated[UUID, Field(description="portal project id")],
1746+
label_selector: Annotated[Optional[StrictStr], Field(description="Filter token resource by labels")] = None,
17381747
_request_timeout: Union[
17391748
None,
17401749
Annotated[StrictFloat, Field(gt=0)],
@@ -1753,6 +1762,8 @@ def list_tokens_without_preload_content(
17531762
:type region_id: str
17541763
:param project_id: portal project id (required)
17551764
:type project_id: UUID
1765+
:param label_selector: Filter token resource by labels
1766+
:type label_selector: str
17561767
:param _request_timeout: timeout setting for this request. If one
17571768
number provided, it will be total request
17581769
timeout. It can also be a pair (tuple) of
@@ -1778,6 +1789,7 @@ def list_tokens_without_preload_content(
17781789
_param = self._list_tokens_serialize(
17791790
region_id=region_id,
17801791
project_id=project_id,
1792+
label_selector=label_selector,
17811793
_request_auth=_request_auth,
17821794
_content_type=_content_type,
17831795
_headers=_headers,
@@ -1797,6 +1809,7 @@ def _list_tokens_serialize(
17971809
self,
17981810
region_id,
17991811
project_id,
1812+
label_selector,
18001813
_request_auth,
18011814
_content_type,
18021815
_headers,
@@ -1820,6 +1833,10 @@ def _list_tokens_serialize(
18201833
if project_id is not None:
18211834
_path_params["projectId"] = project_id
18221835
# process the query parameters
1836+
if label_selector is not None:
1837+
1838+
_query_params.append(("label_selector", label_selector))
1839+
18231840
# process the header parameters
18241841
# process the form parameters
18251842
# process the body parameter

services/modelserving/src/stackit/modelserving/exceptions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None) ->
4646
full_msg = msg
4747
if path_to_item:
4848
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
49-
super(ApiTypeError, self).__init__(full_msg)
49+
super(ApiTypeError, self).__init__(full_msg, path_to_item, valid_classes, key_type)
5050

5151

5252
class ApiValueError(OpenApiException, ValueError):
@@ -64,7 +64,7 @@ def __init__(self, msg, path_to_item=None) -> None:
6464
full_msg = msg
6565
if path_to_item:
6666
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
67-
super(ApiValueError, self).__init__(full_msg)
67+
super(ApiValueError, self).__init__(full_msg, path_to_item)
6868

6969

7070
class ApiAttributeError(OpenApiException, AttributeError):
@@ -83,7 +83,7 @@ def __init__(self, msg, path_to_item=None) -> None:
8383
full_msg = msg
8484
if path_to_item:
8585
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
86-
super(ApiAttributeError, self).__init__(full_msg)
86+
super(ApiAttributeError, self).__init__(full_msg, path_to_item)
8787

8888

8989
class ApiKeyError(OpenApiException, KeyError):
@@ -100,7 +100,7 @@ def __init__(self, msg, path_to_item=None) -> None:
100100
full_msg = msg
101101
if path_to_item:
102102
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
103-
super(ApiKeyError, self).__init__(full_msg)
103+
super(ApiKeyError, self).__init__(full_msg, path_to_item)
104104

105105

106106
class ApiException(OpenApiException):

services/modelserving/src/stackit/modelserving/models/create_token_payload.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,17 @@ class CreateTokenPayload(BaseModel):
3030
""" # noqa: E501
3131

3232
description: Optional[Annotated[str, Field(strict=True, max_length=2000)]] = None
33+
labels: Optional[Dict[str, Annotated[str, Field(strict=True)]]] = Field(
34+
default=None,
35+
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.",
36+
)
3337
name: Annotated[str, Field(min_length=1, strict=True, max_length=200)]
3438
ttl_duration: Optional[StrictStr] = Field(
3539
default=None,
3640
description="time to live duration. Must be valid duration string. If not set the token will never expire.",
3741
alias="ttlDuration",
3842
)
39-
__properties: ClassVar[List[str]] = ["description", "name", "ttlDuration"]
43+
__properties: ClassVar[List[str]] = ["description", "labels", "name", "ttlDuration"]
4044

4145
@field_validator("description")
4246
def description_validate_regular_expression(cls, value):
@@ -110,6 +114,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
110114
return cls.model_validate(obj)
111115

112116
_obj = cls.model_validate(
113-
{"description": obj.get("description"), "name": obj.get("name"), "ttlDuration": obj.get("ttlDuration")}
117+
{
118+
"description": obj.get("description"),
119+
"labels": obj.get("labels"),
120+
"name": obj.get("name"),
121+
"ttlDuration": obj.get("ttlDuration"),
122+
}
114123
)
115124
return _obj

services/modelserving/src/stackit/modelserving/models/partial_update_token_payload.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ class PartialUpdateTokenPayload(BaseModel):
3030
""" # noqa: E501
3131

3232
description: Optional[Annotated[str, Field(strict=True, max_length=2000)]] = None
33+
labels: Optional[Dict[str, Optional[Annotated[str, Field(strict=True)]]]] = Field(
34+
default=None,
35+
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.",
36+
)
3337
name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = None
34-
__properties: ClassVar[List[str]] = ["description", "name"]
38+
__properties: ClassVar[List[str]] = ["description", "labels", "name"]
3539

3640
@field_validator("description")
3741
def description_validate_regular_expression(cls, value):
@@ -107,5 +111,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
107111
if not isinstance(obj, dict):
108112
return cls.model_validate(obj)
109113

110-
_obj = cls.model_validate({"description": obj.get("description"), "name": obj.get("name")})
114+
_obj = cls.model_validate(
115+
{"description": obj.get("description"), "labels": obj.get("labels"), "name": obj.get("name")}
116+
)
111117
return _obj

services/modelserving/src/stackit/modelserving/models/token.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,15 @@ class Token(BaseModel):
3333

3434
description: Optional[Annotated[str, Field(strict=True, max_length=2000)]] = None
3535
id: UUID
36+
labels: Optional[Dict[str, Annotated[str, Field(strict=True)]]] = Field(
37+
default=None,
38+
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.",
39+
)
3640
name: Annotated[str, Field(min_length=1, strict=True, max_length=200)]
3741
region: StrictStr
3842
state: StrictStr
3943
valid_until: datetime = Field(alias="validUntil")
40-
__properties: ClassVar[List[str]] = ["description", "id", "name", "region", "state", "validUntil"]
44+
__properties: ClassVar[List[str]] = ["description", "id", "labels", "name", "region", "state", "validUntil"]
4145

4246
@field_validator("description")
4347
def description_validate_regular_expression(cls, value):
@@ -134,6 +138,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
134138
{
135139
"description": obj.get("description"),
136140
"id": obj.get("id"),
141+
"labels": obj.get("labels"),
137142
"name": obj.get("name"),
138143
"region": obj.get("region"),
139144
"state": obj.get("state"),

services/modelserving/src/stackit/modelserving/models/token_created.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,24 @@ class TokenCreated(BaseModel):
3434
content: Annotated[str, Field(min_length=1, strict=True, max_length=200)]
3535
description: Optional[Annotated[str, Field(strict=True, max_length=2000)]] = None
3636
id: UUID
37+
labels: Optional[Dict[str, Annotated[str, Field(strict=True)]]] = Field(
38+
default=None,
39+
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.",
40+
)
3741
name: Annotated[str, Field(min_length=1, strict=True, max_length=200)]
3842
region: StrictStr
3943
state: StrictStr
4044
valid_until: datetime = Field(alias="validUntil")
41-
__properties: ClassVar[List[str]] = ["content", "description", "id", "name", "region", "state", "validUntil"]
45+
__properties: ClassVar[List[str]] = [
46+
"content",
47+
"description",
48+
"id",
49+
"labels",
50+
"name",
51+
"region",
52+
"state",
53+
"validUntil",
54+
]
4255

4356
@field_validator("content")
4457
def content_validate_regular_expression(cls, value):
@@ -146,6 +159,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
146159
"content": obj.get("content"),
147160
"description": obj.get("description"),
148161
"id": obj.get("id"),
162+
"labels": obj.get("labels"),
149163
"name": obj.get("name"),
150164
"region": obj.get("region"),
151165
"state": obj.get("state"),

0 commit comments

Comments
 (0)