stackit-modelexperiments 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- src/stackit/modelexperiments/__init__.py +120 -0
- src/stackit/modelexperiments/api/__init__.py +4 -0
- src/stackit/modelexperiments/api/default_api.py +2913 -0
- src/stackit/modelexperiments/api_client.py +651 -0
- src/stackit/modelexperiments/api_response.py +23 -0
- src/stackit/modelexperiments/configuration.py +164 -0
- src/stackit/modelexperiments/exceptions.py +218 -0
- src/stackit/modelexperiments/models/__init__.py +61 -0
- src/stackit/modelexperiments/models/create_instance_payload.py +141 -0
- src/stackit/modelexperiments/models/create_instance_response.py +94 -0
- src/stackit/modelexperiments/models/create_instance_token_payload.py +124 -0
- src/stackit/modelexperiments/models/create_instance_token_response.py +94 -0
- src/stackit/modelexperiments/models/delete_instance_response.py +94 -0
- src/stackit/modelexperiments/models/delete_instance_token_response.py +94 -0
- src/stackit/modelexperiments/models/error_response.py +85 -0
- src/stackit/modelexperiments/models/get_instance_response.py +94 -0
- src/stackit/modelexperiments/models/get_instance_token_response.py +94 -0
- src/stackit/modelexperiments/models/instance.py +197 -0
- src/stackit/modelexperiments/models/list_instance_tokens_response.py +102 -0
- src/stackit/modelexperiments/models/list_instances_response.py +102 -0
- src/stackit/modelexperiments/models/partial_update_instance_payload.py +144 -0
- src/stackit/modelexperiments/models/partial_update_instance_response.py +94 -0
- src/stackit/modelexperiments/models/partial_update_instance_token_payload.py +117 -0
- src/stackit/modelexperiments/models/partial_update_instance_token_response.py +94 -0
- src/stackit/modelexperiments/models/token.py +164 -0
- src/stackit/modelexperiments/models/token_metadata.py +143 -0
- src/stackit/modelexperiments/models/token_state.py +39 -0
- src/stackit/modelexperiments/py.typed +0 -0
- src/stackit/modelexperiments/rest.py +165 -0
- stackit_modelexperiments-0.1.0.dist-info/METADATA +48 -0
- stackit_modelexperiments-0.1.0.dist-info/RECORD +34 -0
- stackit_modelexperiments-0.1.0.dist-info/WHEEL +4 -0
- stackit_modelexperiments-0.1.0.dist-info/licenses/LICENSE.md +201 -0
- stackit_modelexperiments-0.1.0.dist-info/licenses/NOTICE.txt +2 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT AI Model Experiments API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for the STACKIT AI Model Experiments api
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: stackit-model-experiments@stackit.cloud
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
import re # noqa: F401
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
21
|
+
from uuid import UUID
|
|
22
|
+
|
|
23
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
24
|
+
from pydantic_core import to_jsonable_python
|
|
25
|
+
from typing_extensions import Annotated, Self
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class Instance(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
Instance
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
|
|
33
|
+
bucket_name: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, alias="bucketName")
|
|
34
|
+
deleted_experiment_retention: Optional[Annotated[str, Field(strict=True)]] = Field(
|
|
35
|
+
default=None,
|
|
36
|
+
description="The duration to retain experiments marked for deletion before they are permanently purged. Min: 1d, Max: 90d.",
|
|
37
|
+
alias="deletedExperimentRetention",
|
|
38
|
+
)
|
|
39
|
+
description: Optional[Annotated[str, Field(strict=True, max_length=160)]] = None
|
|
40
|
+
error_message: Optional[StrictStr] = Field(default=None, alias="errorMessage")
|
|
41
|
+
id: UUID
|
|
42
|
+
labels: Optional[Dict[str, Annotated[str, Field(strict=True, max_length=63)]]] = Field(
|
|
43
|
+
default=None,
|
|
44
|
+
description="Object that represents the labels of an object. Regex for keys: `^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys.",
|
|
45
|
+
)
|
|
46
|
+
name: Annotated[str, Field(min_length=1, strict=True, max_length=64)]
|
|
47
|
+
region: Optional[StrictStr] = None
|
|
48
|
+
state: StrictStr
|
|
49
|
+
url: Annotated[str, Field(strict=True, max_length=1000)]
|
|
50
|
+
__properties: ClassVar[List[str]] = [
|
|
51
|
+
"bucketName",
|
|
52
|
+
"deletedExperimentRetention",
|
|
53
|
+
"description",
|
|
54
|
+
"errorMessage",
|
|
55
|
+
"id",
|
|
56
|
+
"labels",
|
|
57
|
+
"name",
|
|
58
|
+
"region",
|
|
59
|
+
"state",
|
|
60
|
+
"url",
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
@field_validator("bucket_name")
|
|
64
|
+
def bucket_name_validate_regular_expression(cls, value):
|
|
65
|
+
"""Validates the regular expression"""
|
|
66
|
+
if value is None:
|
|
67
|
+
return value
|
|
68
|
+
|
|
69
|
+
if not isinstance(value, str):
|
|
70
|
+
value = str(value)
|
|
71
|
+
|
|
72
|
+
if not re.match(r"^model-experiments-[a-zA-Z0-9]+$", value):
|
|
73
|
+
raise ValueError(r"must validate the regular expression /^model-experiments-[a-zA-Z0-9]+$/")
|
|
74
|
+
return value
|
|
75
|
+
|
|
76
|
+
@field_validator("deleted_experiment_retention")
|
|
77
|
+
def deleted_experiment_retention_validate_regular_expression(cls, value):
|
|
78
|
+
"""Validates the regular expression"""
|
|
79
|
+
if value is None:
|
|
80
|
+
return value
|
|
81
|
+
|
|
82
|
+
if not isinstance(value, str):
|
|
83
|
+
value = str(value)
|
|
84
|
+
|
|
85
|
+
if not re.match(
|
|
86
|
+
r"^([0-9]+(\.[0-9]+)?d)?([0-9]+(\.[0-9]+)?h)?([0-9]+(\.[0-9]+)?m)?([0-9]+(\.[0-9]+)?s)?$", value
|
|
87
|
+
):
|
|
88
|
+
raise ValueError(
|
|
89
|
+
r"must validate the regular expression /^([0-9]+(\.[0-9]+)?d)?([0-9]+(\.[0-9]+)?h)?([0-9]+(\.[0-9]+)?m)?([0-9]+(\.[0-9]+)?s)?$/"
|
|
90
|
+
)
|
|
91
|
+
return value
|
|
92
|
+
|
|
93
|
+
@field_validator("description")
|
|
94
|
+
def description_validate_regular_expression(cls, value):
|
|
95
|
+
"""Validates the regular expression"""
|
|
96
|
+
if value is None:
|
|
97
|
+
return value
|
|
98
|
+
|
|
99
|
+
if not isinstance(value, str):
|
|
100
|
+
value = str(value)
|
|
101
|
+
|
|
102
|
+
if not re.match(r"^[0-9a-zA-Z\s.:\/\-]+$", value):
|
|
103
|
+
raise ValueError(r"must validate the regular expression /^[0-9a-zA-Z\s.:\/\-]+$/")
|
|
104
|
+
return value
|
|
105
|
+
|
|
106
|
+
@field_validator("name")
|
|
107
|
+
def name_validate_regular_expression(cls, value):
|
|
108
|
+
"""Validates the regular expression"""
|
|
109
|
+
if not isinstance(value, str):
|
|
110
|
+
value = str(value)
|
|
111
|
+
|
|
112
|
+
if not re.match(r"^[0-9a-zA-Z\s_-]+$", value):
|
|
113
|
+
raise ValueError(r"must validate the regular expression /^[0-9a-zA-Z\s_-]+$/")
|
|
114
|
+
return value
|
|
115
|
+
|
|
116
|
+
@field_validator("state")
|
|
117
|
+
def state_validate_enum(cls, value):
|
|
118
|
+
"""Validates the enum"""
|
|
119
|
+
if value not in set(["pending", "creating", "updating", "active", "deleting", "impaired", "reconciling"]):
|
|
120
|
+
raise ValueError(
|
|
121
|
+
"must be one of enum values ('pending', 'creating', 'updating', 'active', 'deleting', 'impaired', 'reconciling')"
|
|
122
|
+
)
|
|
123
|
+
return value
|
|
124
|
+
|
|
125
|
+
@field_validator("url")
|
|
126
|
+
def url_validate_regular_expression(cls, value):
|
|
127
|
+
"""Validates the regular expression"""
|
|
128
|
+
if not isinstance(value, str):
|
|
129
|
+
value = str(value)
|
|
130
|
+
|
|
131
|
+
if not re.match(r"^[0-9a-zA-Z\s.:\/\-]+$", value):
|
|
132
|
+
raise ValueError(r"must validate the regular expression /^[0-9a-zA-Z\s.:\/\-]+$/")
|
|
133
|
+
return value
|
|
134
|
+
|
|
135
|
+
model_config = ConfigDict(
|
|
136
|
+
validate_by_name=True,
|
|
137
|
+
validate_by_alias=True,
|
|
138
|
+
validate_assignment=True,
|
|
139
|
+
protected_namespaces=(),
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
def to_str(self) -> str:
|
|
143
|
+
"""Returns the string representation of the model using alias"""
|
|
144
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
145
|
+
|
|
146
|
+
def to_json(self) -> str:
|
|
147
|
+
"""Returns the JSON representation of the model using alias"""
|
|
148
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
149
|
+
|
|
150
|
+
@classmethod
|
|
151
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
152
|
+
"""Create an instance of Instance from a JSON string"""
|
|
153
|
+
return cls.from_dict(json.loads(json_str))
|
|
154
|
+
|
|
155
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
156
|
+
"""Return the dictionary representation of the model using alias.
|
|
157
|
+
|
|
158
|
+
This has the following differences from calling pydantic's
|
|
159
|
+
`self.model_dump(by_alias=True)`:
|
|
160
|
+
|
|
161
|
+
* `None` is only added to the output dict for nullable fields that
|
|
162
|
+
were set at model initialization. Other fields with value `None`
|
|
163
|
+
are ignored.
|
|
164
|
+
"""
|
|
165
|
+
excluded_fields: Set[str] = set([])
|
|
166
|
+
|
|
167
|
+
_dict = self.model_dump(
|
|
168
|
+
by_alias=True,
|
|
169
|
+
exclude=excluded_fields,
|
|
170
|
+
exclude_none=True,
|
|
171
|
+
)
|
|
172
|
+
return _dict
|
|
173
|
+
|
|
174
|
+
@classmethod
|
|
175
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
176
|
+
"""Create an instance of Instance from a dict"""
|
|
177
|
+
if obj is None:
|
|
178
|
+
return None
|
|
179
|
+
|
|
180
|
+
if not isinstance(obj, dict):
|
|
181
|
+
return cls.model_validate(obj)
|
|
182
|
+
|
|
183
|
+
_obj = cls.model_validate(
|
|
184
|
+
{
|
|
185
|
+
"bucketName": obj.get("bucketName"),
|
|
186
|
+
"deletedExperimentRetention": obj.get("deletedExperimentRetention"),
|
|
187
|
+
"description": obj.get("description"),
|
|
188
|
+
"errorMessage": obj.get("errorMessage"),
|
|
189
|
+
"id": obj.get("id"),
|
|
190
|
+
"labels": obj.get("labels"),
|
|
191
|
+
"name": obj.get("name"),
|
|
192
|
+
"region": obj.get("region"),
|
|
193
|
+
"state": obj.get("state"),
|
|
194
|
+
"url": obj.get("url"),
|
|
195
|
+
}
|
|
196
|
+
)
|
|
197
|
+
return _obj
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT AI Model Experiments API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for the STACKIT AI Model Experiments api
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: stackit-model-experiments@stackit.cloud
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
22
|
+
from pydantic_core import to_jsonable_python
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
from stackit.modelexperiments.models.token_metadata import TokenMetadata
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class ListInstanceTokensResponse(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
ListInstanceTokensResponse
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
|
|
33
|
+
message: Optional[StrictStr] = None
|
|
34
|
+
tokens: List[TokenMetadata]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["message", "tokens"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
validate_by_name=True,
|
|
39
|
+
validate_by_alias=True,
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of ListInstanceTokensResponse from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of each item in tokens (list)
|
|
75
|
+
_items = []
|
|
76
|
+
if self.tokens:
|
|
77
|
+
for _item_tokens in self.tokens:
|
|
78
|
+
if _item_tokens:
|
|
79
|
+
_items.append(_item_tokens.to_dict())
|
|
80
|
+
_dict["tokens"] = _items
|
|
81
|
+
return _dict
|
|
82
|
+
|
|
83
|
+
@classmethod
|
|
84
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
85
|
+
"""Create an instance of ListInstanceTokensResponse from a dict"""
|
|
86
|
+
if obj is None:
|
|
87
|
+
return None
|
|
88
|
+
|
|
89
|
+
if not isinstance(obj, dict):
|
|
90
|
+
return cls.model_validate(obj)
|
|
91
|
+
|
|
92
|
+
_obj = cls.model_validate(
|
|
93
|
+
{
|
|
94
|
+
"message": obj.get("message"),
|
|
95
|
+
"tokens": (
|
|
96
|
+
[TokenMetadata.from_dict(_item) for _item in obj["tokens"]]
|
|
97
|
+
if obj.get("tokens") is not None
|
|
98
|
+
else None
|
|
99
|
+
),
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
return _obj
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT AI Model Experiments API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for the STACKIT AI Model Experiments api
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: stackit-model-experiments@stackit.cloud
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
22
|
+
from pydantic_core import to_jsonable_python
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
from stackit.modelexperiments.models.instance import Instance
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class ListInstancesResponse(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
ListInstancesResponse
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
|
|
33
|
+
instances: List[Instance]
|
|
34
|
+
message: Optional[StrictStr] = None
|
|
35
|
+
__properties: ClassVar[List[str]] = ["instances", "message"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
validate_by_name=True,
|
|
39
|
+
validate_by_alias=True,
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of ListInstancesResponse from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of each item in instances (list)
|
|
75
|
+
_items = []
|
|
76
|
+
if self.instances:
|
|
77
|
+
for _item_instances in self.instances:
|
|
78
|
+
if _item_instances:
|
|
79
|
+
_items.append(_item_instances.to_dict())
|
|
80
|
+
_dict["instances"] = _items
|
|
81
|
+
return _dict
|
|
82
|
+
|
|
83
|
+
@classmethod
|
|
84
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
85
|
+
"""Create an instance of ListInstancesResponse from a dict"""
|
|
86
|
+
if obj is None:
|
|
87
|
+
return None
|
|
88
|
+
|
|
89
|
+
if not isinstance(obj, dict):
|
|
90
|
+
return cls.model_validate(obj)
|
|
91
|
+
|
|
92
|
+
_obj = cls.model_validate(
|
|
93
|
+
{
|
|
94
|
+
"instances": (
|
|
95
|
+
[Instance.from_dict(_item) for _item in obj["instances"]]
|
|
96
|
+
if obj.get("instances") is not None
|
|
97
|
+
else None
|
|
98
|
+
),
|
|
99
|
+
"message": obj.get("message"),
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
return _obj
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT AI Model Experiments API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for the STACKIT AI Model Experiments api
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: stackit-model-experiments@stackit.cloud
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
import re # noqa: F401
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
21
|
+
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
|
23
|
+
from pydantic_core import to_jsonable_python
|
|
24
|
+
from typing_extensions import Annotated, Self
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class PartialUpdateInstancePayload(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
PartialUpdateInstancePayload
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
|
|
32
|
+
deleted_experiment_retention: Optional[Annotated[str, Field(strict=True)]] = Field(
|
|
33
|
+
default=None,
|
|
34
|
+
description="The duration to retain experiments marked for deletion before they are permanently purged. Min: 1d, Max: 90d.",
|
|
35
|
+
alias="deletedExperimentRetention",
|
|
36
|
+
)
|
|
37
|
+
description: Optional[Annotated[str, Field(strict=True, max_length=160)]] = None
|
|
38
|
+
labels: Optional[Dict[str, Optional[Annotated[str, Field(strict=True, max_length=63)]]]] = Field(
|
|
39
|
+
default=None,
|
|
40
|
+
description="Object that represents the labels of an object. Regex for keys: `^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys.",
|
|
41
|
+
)
|
|
42
|
+
name: Optional[Annotated[str, Field(strict=True, max_length=64)]] = None
|
|
43
|
+
__properties: ClassVar[List[str]] = ["deletedExperimentRetention", "description", "labels", "name"]
|
|
44
|
+
|
|
45
|
+
@field_validator("deleted_experiment_retention")
|
|
46
|
+
def deleted_experiment_retention_validate_regular_expression(cls, value):
|
|
47
|
+
"""Validates the regular expression"""
|
|
48
|
+
if value is None:
|
|
49
|
+
return value
|
|
50
|
+
|
|
51
|
+
if not isinstance(value, str):
|
|
52
|
+
value = str(value)
|
|
53
|
+
|
|
54
|
+
if not re.match(
|
|
55
|
+
r"^([0-9]+(\.[0-9]+)?d)?([0-9]+(\.[0-9]+)?h)?([0-9]+(\.[0-9]+)?m)?([0-9]+(\.[0-9]+)?s)?$", value
|
|
56
|
+
):
|
|
57
|
+
raise ValueError(
|
|
58
|
+
r"must validate the regular expression /^([0-9]+(\.[0-9]+)?d)?([0-9]+(\.[0-9]+)?h)?([0-9]+(\.[0-9]+)?m)?([0-9]+(\.[0-9]+)?s)?$/"
|
|
59
|
+
)
|
|
60
|
+
return value
|
|
61
|
+
|
|
62
|
+
@field_validator("description")
|
|
63
|
+
def description_validate_regular_expression(cls, value):
|
|
64
|
+
"""Validates the regular expression"""
|
|
65
|
+
if value is None:
|
|
66
|
+
return value
|
|
67
|
+
|
|
68
|
+
if not isinstance(value, str):
|
|
69
|
+
value = str(value)
|
|
70
|
+
|
|
71
|
+
if not re.match(r"^[0-9a-zA-Z\s.:\/\-]*$", value):
|
|
72
|
+
raise ValueError(r"must validate the regular expression /^[0-9a-zA-Z\s.:\/\-]*$/")
|
|
73
|
+
return value
|
|
74
|
+
|
|
75
|
+
@field_validator("name")
|
|
76
|
+
def name_validate_regular_expression(cls, value):
|
|
77
|
+
"""Validates the regular expression"""
|
|
78
|
+
if value is None:
|
|
79
|
+
return value
|
|
80
|
+
|
|
81
|
+
if not isinstance(value, str):
|
|
82
|
+
value = str(value)
|
|
83
|
+
|
|
84
|
+
if not re.match(r"^[0-9a-zA-Z\s_-]*$", value):
|
|
85
|
+
raise ValueError(r"must validate the regular expression /^[0-9a-zA-Z\s_-]*$/")
|
|
86
|
+
return value
|
|
87
|
+
|
|
88
|
+
model_config = ConfigDict(
|
|
89
|
+
validate_by_name=True,
|
|
90
|
+
validate_by_alias=True,
|
|
91
|
+
validate_assignment=True,
|
|
92
|
+
protected_namespaces=(),
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
def to_str(self) -> str:
|
|
96
|
+
"""Returns the string representation of the model using alias"""
|
|
97
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
98
|
+
|
|
99
|
+
def to_json(self) -> str:
|
|
100
|
+
"""Returns the JSON representation of the model using alias"""
|
|
101
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
102
|
+
|
|
103
|
+
@classmethod
|
|
104
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
105
|
+
"""Create an instance of PartialUpdateInstancePayload from a JSON string"""
|
|
106
|
+
return cls.from_dict(json.loads(json_str))
|
|
107
|
+
|
|
108
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
109
|
+
"""Return the dictionary representation of the model using alias.
|
|
110
|
+
|
|
111
|
+
This has the following differences from calling pydantic's
|
|
112
|
+
`self.model_dump(by_alias=True)`:
|
|
113
|
+
|
|
114
|
+
* `None` is only added to the output dict for nullable fields that
|
|
115
|
+
were set at model initialization. Other fields with value `None`
|
|
116
|
+
are ignored.
|
|
117
|
+
"""
|
|
118
|
+
excluded_fields: Set[str] = set([])
|
|
119
|
+
|
|
120
|
+
_dict = self.model_dump(
|
|
121
|
+
by_alias=True,
|
|
122
|
+
exclude=excluded_fields,
|
|
123
|
+
exclude_none=True,
|
|
124
|
+
)
|
|
125
|
+
return _dict
|
|
126
|
+
|
|
127
|
+
@classmethod
|
|
128
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
129
|
+
"""Create an instance of PartialUpdateInstancePayload from a dict"""
|
|
130
|
+
if obj is None:
|
|
131
|
+
return None
|
|
132
|
+
|
|
133
|
+
if not isinstance(obj, dict):
|
|
134
|
+
return cls.model_validate(obj)
|
|
135
|
+
|
|
136
|
+
_obj = cls.model_validate(
|
|
137
|
+
{
|
|
138
|
+
"deletedExperimentRetention": obj.get("deletedExperimentRetention"),
|
|
139
|
+
"description": obj.get("description"),
|
|
140
|
+
"labels": obj.get("labels"),
|
|
141
|
+
"name": obj.get("name"),
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
return _obj
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT AI Model Experiments API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for the STACKIT AI Model Experiments api
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: stackit-model-experiments@stackit.cloud
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
22
|
+
from pydantic_core import to_jsonable_python
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
from stackit.modelexperiments.models.instance import Instance
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class PartialUpdateInstanceResponse(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
PartialUpdateInstanceResponse
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
|
|
33
|
+
instance: Instance
|
|
34
|
+
message: Optional[StrictStr] = None
|
|
35
|
+
__properties: ClassVar[List[str]] = ["instance", "message"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
validate_by_name=True,
|
|
39
|
+
validate_by_alias=True,
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of PartialUpdateInstanceResponse from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of instance
|
|
75
|
+
if self.instance:
|
|
76
|
+
_dict["instance"] = self.instance.to_dict()
|
|
77
|
+
return _dict
|
|
78
|
+
|
|
79
|
+
@classmethod
|
|
80
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
81
|
+
"""Create an instance of PartialUpdateInstanceResponse from a dict"""
|
|
82
|
+
if obj is None:
|
|
83
|
+
return None
|
|
84
|
+
|
|
85
|
+
if not isinstance(obj, dict):
|
|
86
|
+
return cls.model_validate(obj)
|
|
87
|
+
|
|
88
|
+
_obj = cls.model_validate(
|
|
89
|
+
{
|
|
90
|
+
"instance": Instance.from_dict(obj["instance"]) if obj.get("instance") is not None else None,
|
|
91
|
+
"message": obj.get("message"),
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
return _obj
|