Skip to content

Commit a933fe3

Browse files
Generate sfs
1 parent 1616198 commit a933fe3

13 files changed

Lines changed: 139 additions & 16 deletions

‎services/sfs/oas_commit‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8ccf08fdae6320251259ca695f1e7180eeb21275
1+
ef9232ba8d49c72fc3397a365b09ca1a8205b25e

‎services/sfs/src/stackit/sfs/__init__.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"ApiKeyError",
2828
"ApiAttributeError",
2929
"ApiException",
30+
"ConflictError",
3031
"CreateResourcePoolPayload",
3132
"CreateResourcePoolResponse",
3233
"CreateResourcePoolSnapshotPayload",
@@ -95,6 +96,7 @@
9596
from stackit.sfs.exceptions import OpenApiException as OpenApiException
9697

9798
# import models into sdk package
99+
from stackit.sfs.models.conflict_error import ConflictError as ConflictError
98100
from stackit.sfs.models.create_resource_pool_payload import (
99101
CreateResourcePoolPayload as CreateResourcePoolPayload,
100102
)

‎services/sfs/src/stackit/sfs/api/default_api.py‎

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ def create_resource_pool(
157157
"200": "CreateResourcePoolResponse",
158158
"400": "ValidationError",
159159
"401": "str",
160+
"409": "ConflictError",
160161
"500": "Error",
161162
}
162163
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -228,6 +229,7 @@ def create_resource_pool_with_http_info(
228229
"200": "CreateResourcePoolResponse",
229230
"400": "ValidationError",
230231
"401": "str",
232+
"409": "ConflictError",
231233
"500": "Error",
232234
}
233235
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -299,6 +301,7 @@ def create_resource_pool_without_preload_content(
299301
"200": "CreateResourcePoolResponse",
300302
"400": "ValidationError",
301303
"401": "str",
304+
"409": "ConflictError",
302305
"500": "Error",
303306
}
304307
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -436,6 +439,7 @@ def create_resource_pool_snapshot(
436439
"200": "CreateResourcePoolSnapshotResponse",
437440
"400": "ValidationError",
438441
"401": "str",
442+
"409": "ConflictError",
439443
"500": "Error",
440444
}
441445
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -511,6 +515,7 @@ def create_resource_pool_snapshot_with_http_info(
511515
"200": "CreateResourcePoolSnapshotResponse",
512516
"400": "ValidationError",
513517
"401": "str",
518+
"409": "ConflictError",
514519
"500": "Error",
515520
}
516521
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -586,6 +591,7 @@ def create_resource_pool_snapshot_without_preload_content(
586591
"200": "CreateResourcePoolSnapshotResponse",
587592
"400": "ValidationError",
588593
"401": "str",
594+
"409": "ConflictError",
589595
"500": "Error",
590596
}
591597
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -726,6 +732,7 @@ def create_share(
726732
"200": "CreateShareResponse",
727733
"400": "ValidationError",
728734
"401": "str",
735+
"409": "ConflictError",
729736
"500": "Error",
730737
}
731738
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -801,6 +808,7 @@ def create_share_with_http_info(
801808
"200": "CreateShareResponse",
802809
"400": "ValidationError",
803810
"401": "str",
811+
"409": "ConflictError",
804812
"500": "Error",
805813
}
806814
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -876,6 +884,7 @@ def create_share_without_preload_content(
876884
"200": "CreateShareResponse",
877885
"400": "ValidationError",
878886
"401": "str",
887+
"409": "ConflictError",
879888
"500": "Error",
880889
}
881890
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -1012,6 +1021,7 @@ def create_share_export_policy(
10121021
"200": "CreateShareExportPolicyResponse",
10131022
"400": "ValidationError",
10141023
"401": "str",
1024+
"409": "ConflictError",
10151025
"500": "Error",
10161026
}
10171027
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -1083,6 +1093,7 @@ def create_share_export_policy_with_http_info(
10831093
"200": "CreateShareExportPolicyResponse",
10841094
"400": "ValidationError",
10851095
"401": "str",
1096+
"409": "ConflictError",
10861097
"500": "Error",
10871098
}
10881099
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -1154,6 +1165,7 @@ def create_share_export_policy_without_preload_content(
11541165
"200": "CreateShareExportPolicyResponse",
11551166
"400": "ValidationError",
11561167
"401": "str",
1168+
"409": "ConflictError",
11571169
"500": "Error",
11581170
}
11591171
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -1287,6 +1299,7 @@ def delete_resource_pool(
12871299
"200": "object",
12881300
"400": "ValidationError",
12891301
"401": "str",
1302+
"409": "ConflictError",
12901303
"500": "Error",
12911304
}
12921305
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -1358,6 +1371,7 @@ def delete_resource_pool_with_http_info(
13581371
"200": "object",
13591372
"400": "ValidationError",
13601373
"401": "str",
1374+
"409": "ConflictError",
13611375
"500": "Error",
13621376
}
13631377
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -1429,6 +1443,7 @@ def delete_resource_pool_without_preload_content(
14291443
"200": "object",
14301444
"400": "ValidationError",
14311445
"401": "str",
1446+
"409": "ConflictError",
14321447
"500": "Error",
14331448
}
14341449
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -1558,6 +1573,7 @@ def delete_resource_pool_snapshot(
15581573
"200": "object",
15591574
"400": "ValidationError",
15601575
"401": "str",
1576+
"409": "ConflictError",
15611577
"500": "Error",
15621578
}
15631579
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -1633,6 +1649,7 @@ def delete_resource_pool_snapshot_with_http_info(
16331649
"200": "object",
16341650
"400": "ValidationError",
16351651
"401": "str",
1652+
"409": "ConflictError",
16361653
"500": "Error",
16371654
}
16381655
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -1708,6 +1725,7 @@ def delete_resource_pool_snapshot_without_preload_content(
17081725
"200": "object",
17091726
"400": "ValidationError",
17101727
"401": "str",
1728+
"409": "ConflictError",
17111729
"500": "Error",
17121730
}
17131731
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -2379,6 +2397,7 @@ def disable_lock(
23792397

23802398
_response_types_map: Dict[str, Optional[str]] = {
23812399
"200": "object",
2400+
"409": "ConflictError",
23822401
}
23832402
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
23842403
response_data.read()
@@ -2443,6 +2462,7 @@ def disable_lock_with_http_info(
24432462

24442463
_response_types_map: Dict[str, Optional[str]] = {
24452464
"200": "object",
2465+
"409": "ConflictError",
24462466
}
24472467
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
24482468
response_data.read()
@@ -2507,6 +2527,7 @@ def disable_lock_without_preload_content(
25072527

25082528
_response_types_map: Dict[str, Optional[str]] = {
25092529
"200": "object",
2530+
"409": "ConflictError",
25102531
}
25112532
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
25122533
return response_data.response
@@ -2544,7 +2565,9 @@ def _disable_lock_serialize(
25442565

25452566
# set the HTTP header `Accept`
25462567
if "Accept" not in _header_params:
2547-
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
2568+
_header_params["Accept"] = self.api_client.select_header_accept(
2569+
["application/json", "application/problem+json"]
2570+
)
25482571

25492572
# authentication setting
25502573
_auth_settings: List[str] = []
@@ -2620,6 +2643,7 @@ def enable_lock(
26202643

26212644
_response_types_map: Dict[str, Optional[str]] = {
26222645
"200": "EnableLockResponse",
2646+
"409": "ConflictError",
26232647
}
26242648
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
26252649
response_data.read()
@@ -2684,6 +2708,7 @@ def enable_lock_with_http_info(
26842708

26852709
_response_types_map: Dict[str, Optional[str]] = {
26862710
"200": "EnableLockResponse",
2711+
"409": "ConflictError",
26872712
}
26882713
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
26892714
response_data.read()
@@ -2748,6 +2773,7 @@ def enable_lock_without_preload_content(
27482773

27492774
_response_types_map: Dict[str, Optional[str]] = {
27502775
"200": "EnableLockResponse",
2776+
"409": "ConflictError",
27512777
}
27522778
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
27532779
return response_data.response
@@ -2785,7 +2811,9 @@ def _enable_lock_serialize(
27852811

27862812
# set the HTTP header `Accept`
27872813
if "Accept" not in _header_params:
2788-
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
2814+
_header_params["Accept"] = self.api_client.select_header_accept(
2815+
["application/json", "application/problem+json"]
2816+
)
27892817

27902818
# authentication setting
27912819
_auth_settings: List[str] = []
@@ -6418,6 +6446,7 @@ def update_resource_pool(
64186446
"200": "UpdateResourcePoolResponse",
64196447
"400": "ValidationError",
64206448
"401": "str",
6449+
"409": "ConflictError",
64216450
"500": "Error",
64226451
}
64236452
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -6493,6 +6522,7 @@ def update_resource_pool_with_http_info(
64936522
"200": "UpdateResourcePoolResponse",
64946523
"400": "ValidationError",
64956524
"401": "str",
6525+
"409": "ConflictError",
64966526
"500": "Error",
64976527
}
64986528
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -6568,6 +6598,7 @@ def update_resource_pool_without_preload_content(
65686598
"200": "UpdateResourcePoolResponse",
65696599
"400": "ValidationError",
65706600
"401": "str",
6601+
"409": "ConflictError",
65716602
"500": "Error",
65726603
}
65736604
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

‎services/sfs/src/stackit/sfs/models/__init__.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
""" # noqa: E501
1414

1515
# import models into model package
16+
from stackit.sfs.models.conflict_error import ConflictError
1617
from stackit.sfs.models.create_resource_pool_payload import CreateResourcePoolPayload
1718
from stackit.sfs.models.create_resource_pool_response import CreateResourcePoolResponse
1819
from stackit.sfs.models.create_resource_pool_snapshot_payload import (
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# coding: utf-8
2+
3+
"""
4+
STACKIT File Storage (SFS)
5+
6+
API used to create and manage NFS Shares.
7+
8+
The version of the OpenAPI document: 1.0.0
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
10+
11+
Do not edit the class manually.
12+
""" # noqa: E501
13+
14+
from __future__ import annotations
15+
16+
import json
17+
import pprint
18+
from typing import Any, ClassVar, Dict, List, Optional, Set
19+
20+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
21+
from pydantic_core import to_jsonable_python
22+
from typing_extensions import Self
23+
24+
25+
class ConflictError(BaseModel):
26+
"""
27+
Conflict error response
28+
""" # noqa: E501
29+
30+
detail: StrictStr = Field(description="Human-readable explanation of the specific problem")
31+
error_description: StrictStr = Field(description="Human-readable string of the error that occurred")
32+
status_code: StrictInt = Field(description="The HTTP status code")
33+
type: StrictStr = Field(
34+
description="URI Uniquely identifies the error type. It will be in the format of storage.stackit.cloud/<error-type> e.g. storage.stackit.cloud/conflict"
35+
)
36+
__properties: ClassVar[List[str]] = ["detail", "error_description", "status_code", "type"]
37+
38+
model_config = ConfigDict(
39+
validate_by_name=True,
40+
validate_by_alias=True,
41+
validate_assignment=True,
42+
protected_namespaces=(),
43+
)
44+
45+
def to_str(self) -> str:
46+
"""Returns the string representation of the model using alias"""
47+
return pprint.pformat(self.model_dump(by_alias=True))
48+
49+
def to_json(self) -> str:
50+
"""Returns the JSON representation of the model using alias"""
51+
return json.dumps(to_jsonable_python(self.to_dict()))
52+
53+
@classmethod
54+
def from_json(cls, json_str: str) -> Optional[Self]:
55+
"""Create an instance of ConflictError from a JSON string"""
56+
return cls.from_dict(json.loads(json_str))
57+
58+
def to_dict(self) -> Dict[str, Any]:
59+
"""Return the dictionary representation of the model using alias.
60+
61+
This has the following differences from calling pydantic's
62+
`self.model_dump(by_alias=True)`:
63+
64+
* `None` is only added to the output dict for nullable fields that
65+
were set at model initialization. Other fields with value `None`
66+
are ignored.
67+
"""
68+
excluded_fields: Set[str] = set([])
69+
70+
_dict = self.model_dump(
71+
by_alias=True,
72+
exclude=excluded_fields,
73+
exclude_none=True,
74+
)
75+
return _dict
76+
77+
@classmethod
78+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79+
"""Create an instance of ConflictError from a dict"""
80+
if obj is None:
81+
return None
82+
83+
if not isinstance(obj, dict):
84+
return cls.model_validate(obj)
85+
86+
_obj = cls.model_validate(
87+
{
88+
"detail": obj.get("detail"),
89+
"error_description": obj.get("error_description"),
90+
"status_code": obj.get("status_code"),
91+
"type": obj.get("type"),
92+
}
93+
)
94+
return _obj

‎services/sfs/src/stackit/sfs/models/create_resource_pool_payload.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ class CreateResourcePoolPayload(BaseModel):
4040
alias="ipAcl",
4141
)
4242
labels: Optional[Dict[str, StrictStr]] = Field(
43-
default=None,
44-
description="An optional object that represents the labels associated with the resource pool keys are validated using the following regex '^[\\\\p{Ll}][\\\\p{Ll}\\\\p{N}_-]*$' and cannot be empty values are validated using the following regex '^[\\\\p{Ll}\\\\p{N}_-]*$'",
43+
default=None, description="An optional object that represents the labels associated with the resource pool."
4544
)
4645
name: StrictStr = Field(description="Name of the Resource Pool")
4746
performance_class: StrictStr = Field(description="Name of the performance class", alias="performanceClass")

‎services/sfs/src/stackit/sfs/models/create_share_export_policy_payload.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class CreateShareExportPolicyPayload(BaseModel):
3333

3434
labels: Optional[Dict[str, StrictStr]] = Field(
3535
default=None,
36-
description="An optional object that represents the labels associated with the share export policy keys are validated using the following regex '^[\\\\p{Ll}][\\\\p{Ll}\\\\p{N}_-]*$' and cannot be empty values are validated using the following regex '^[\\\\p{Ll}\\\\p{N}_-]*$'",
36+
description="An optional object that represents the labels associated with the share export policy.",
3737
)
3838
name: StrictStr = Field(description="Name of the Share Export Policy")
3939
rules: Optional[List[CreateShareExportPolicyRequestRule]] = Field(

‎services/sfs/src/stackit/sfs/models/create_share_payload.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ class CreateSharePayload(BaseModel):
3333
alias="exportPolicyName",
3434
)
3535
labels: Optional[Dict[str, StrictStr]] = Field(
36-
default=None,
37-
description="An optional object that represents the labels associated with the share keys are validated using the following regex '^[\\\\p{Ll}][\\\\p{Ll}\\\\p{N}_-]*$' and cannot be empty values are validated using the following regex '^[\\\\p{Ll}\\\\p{N}_-]*$'",
36+
default=None, description="An optional object that represents the labels associated with the share."
3837
)
3938
name: StrictStr = Field(description="Name of the Share")
4039
space_hard_limit_gigabytes: StrictInt = Field(

‎services/sfs/src/stackit/sfs/models/share.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ class Share(BaseModel):
3939
)
4040
id: Optional[StrictStr] = Field(default=None, description="ID of the Share")
4141
labels: Optional[Dict[str, StrictStr]] = Field(
42-
default=None,
43-
description="An optional object that represents the labels associated with the share keys are validated using the following regex '^[\\\\p{Ll}][\\\\p{Ll}\\\\p{N}_-]*$' and cannot be empty values are validated using the following regex '^[\\\\p{Ll}\\\\p{N}_-]*$'",
42+
default=None, description="An optional object that represents the labels associated with the share."
4443
)
4544
mount_path: Optional[StrictStr] = Field(
4645
default=None, description="Mount path of the Share, used to mount the Share", alias="mountPath"

0 commit comments

Comments
 (0)