stackit-scf 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.
Files changed (52) hide show
  1. stackit/scf/__init__.py +158 -0
  2. stackit/scf/api/__init__.py +4 -0
  3. stackit/scf/api/default_api.py +6710 -0
  4. stackit/scf/api_client.py +640 -0
  5. stackit/scf/api_response.py +23 -0
  6. stackit/scf/configuration.py +164 -0
  7. stackit/scf/exceptions.py +218 -0
  8. stackit/scf/models/__init__.py +56 -0
  9. stackit/scf/models/apply_organization_quota_payload.py +82 -0
  10. stackit/scf/models/create_org_role_payload.py +88 -0
  11. stackit/scf/models/create_organization_payload.py +83 -0
  12. stackit/scf/models/create_space_payload.py +82 -0
  13. stackit/scf/models/create_space_role_payload.py +88 -0
  14. stackit/scf/models/error_response.py +83 -0
  15. stackit/scf/models/org_manager.py +107 -0
  16. stackit/scf/models/org_manager_delete_response.py +90 -0
  17. stackit/scf/models/org_manager_response.py +113 -0
  18. stackit/scf/models/org_role_create_bff_request.py +84 -0
  19. stackit/scf/models/org_role_response.py +98 -0
  20. stackit/scf/models/org_role_type.py +39 -0
  21. stackit/scf/models/organization.py +118 -0
  22. stackit/scf/models/organization_create_response.py +92 -0
  23. stackit/scf/models/organization_delete_response.py +92 -0
  24. stackit/scf/models/organization_quota.py +94 -0
  25. stackit/scf/models/organization_usage_summary.py +101 -0
  26. stackit/scf/models/organizations_list.py +105 -0
  27. stackit/scf/models/organizations_list_item.py +118 -0
  28. stackit/scf/models/pagination.py +83 -0
  29. stackit/scf/models/platform_list.py +105 -0
  30. stackit/scf/models/platforms.py +96 -0
  31. stackit/scf/models/quota.py +139 -0
  32. stackit/scf/models/quota_apps.py +138 -0
  33. stackit/scf/models/quota_domains.py +89 -0
  34. stackit/scf/models/quota_routes.py +99 -0
  35. stackit/scf/models/quota_services.py +104 -0
  36. stackit/scf/models/space.py +110 -0
  37. stackit/scf/models/space_delete_response.py +90 -0
  38. stackit/scf/models/space_role_create_bff_request.py +84 -0
  39. stackit/scf/models/space_role_create_bff_response.py +99 -0
  40. stackit/scf/models/space_role_create_response.py +100 -0
  41. stackit/scf/models/space_role_type.py +39 -0
  42. stackit/scf/models/spaces_list.py +103 -0
  43. stackit/scf/models/update_organization_payload.py +85 -0
  44. stackit/scf/models/update_space_payload.py +82 -0
  45. stackit/scf/models/usage_summary.py +109 -0
  46. stackit/scf/py.typed +0 -0
  47. stackit/scf/rest.py +149 -0
  48. stackit_scf-0.1.0.dist-info/LICENSE.md +201 -0
  49. stackit_scf-0.1.0.dist-info/METADATA +46 -0
  50. stackit_scf-0.1.0.dist-info/NOTICE.txt +2 -0
  51. stackit_scf-0.1.0.dist-info/RECORD +52 -0
  52. stackit_scf-0.1.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,138 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Cloud Foundry API
5
+
6
+ API endpoints for managing STACKIT Cloud Foundry
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: support@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, Field
22
+ from typing_extensions import Annotated, Self
23
+
24
+
25
+ class QuotaApps(BaseModel):
26
+ """
27
+ QuotaApps
28
+ """ # noqa: E501
29
+
30
+ log_rate_limit_in_bytes_per_second: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(
31
+ description="The value `null` means `unlimited`. ", alias="logRateLimitInBytesPerSecond"
32
+ )
33
+ per_app_tasks: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(
34
+ description="The value `null` means `unlimited`. ", alias="perAppTasks"
35
+ )
36
+ per_process_memory_in_mb: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(
37
+ description="The value `null` means `unlimited`. ", alias="perProcessMemoryInMb"
38
+ )
39
+ total_instances: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(
40
+ description="The value `null` means `unlimited`. ", alias="totalInstances"
41
+ )
42
+ total_memory_in_mb: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(
43
+ description="The value `null` means `unlimited`. ", alias="totalMemoryInMb"
44
+ )
45
+ __properties: ClassVar[List[str]] = [
46
+ "logRateLimitInBytesPerSecond",
47
+ "perAppTasks",
48
+ "perProcessMemoryInMb",
49
+ "totalInstances",
50
+ "totalMemoryInMb",
51
+ ]
52
+
53
+ model_config = ConfigDict(
54
+ populate_by_name=True,
55
+ validate_assignment=True,
56
+ protected_namespaces=(),
57
+ )
58
+
59
+ def to_str(self) -> str:
60
+ """Returns the string representation of the model using alias"""
61
+ return pprint.pformat(self.model_dump(by_alias=True))
62
+
63
+ def to_json(self) -> str:
64
+ """Returns the JSON representation of the model using alias"""
65
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
66
+ return json.dumps(self.to_dict())
67
+
68
+ @classmethod
69
+ def from_json(cls, json_str: str) -> Optional[Self]:
70
+ """Create an instance of QuotaApps from a JSON string"""
71
+ return cls.from_dict(json.loads(json_str))
72
+
73
+ def to_dict(self) -> Dict[str, Any]:
74
+ """Return the dictionary representation of the model using alias.
75
+
76
+ This has the following differences from calling pydantic's
77
+ `self.model_dump(by_alias=True)`:
78
+
79
+ * `None` is only added to the output dict for nullable fields that
80
+ were set at model initialization. Other fields with value `None`
81
+ are ignored.
82
+ """
83
+ excluded_fields: Set[str] = set([])
84
+
85
+ _dict = self.model_dump(
86
+ by_alias=True,
87
+ exclude=excluded_fields,
88
+ exclude_none=True,
89
+ )
90
+ # set to None if log_rate_limit_in_bytes_per_second (nullable) is None
91
+ # and model_fields_set contains the field
92
+ if (
93
+ self.log_rate_limit_in_bytes_per_second is None
94
+ and "log_rate_limit_in_bytes_per_second" in self.model_fields_set
95
+ ):
96
+ _dict["logRateLimitInBytesPerSecond"] = None
97
+
98
+ # set to None if per_app_tasks (nullable) is None
99
+ # and model_fields_set contains the field
100
+ if self.per_app_tasks is None and "per_app_tasks" in self.model_fields_set:
101
+ _dict["perAppTasks"] = None
102
+
103
+ # set to None if per_process_memory_in_mb (nullable) is None
104
+ # and model_fields_set contains the field
105
+ if self.per_process_memory_in_mb is None and "per_process_memory_in_mb" in self.model_fields_set:
106
+ _dict["perProcessMemoryInMb"] = None
107
+
108
+ # set to None if total_instances (nullable) is None
109
+ # and model_fields_set contains the field
110
+ if self.total_instances is None and "total_instances" in self.model_fields_set:
111
+ _dict["totalInstances"] = None
112
+
113
+ # set to None if total_memory_in_mb (nullable) is None
114
+ # and model_fields_set contains the field
115
+ if self.total_memory_in_mb is None and "total_memory_in_mb" in self.model_fields_set:
116
+ _dict["totalMemoryInMb"] = None
117
+
118
+ return _dict
119
+
120
+ @classmethod
121
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
122
+ """Create an instance of QuotaApps from a dict"""
123
+ if obj is None:
124
+ return None
125
+
126
+ if not isinstance(obj, dict):
127
+ return cls.model_validate(obj)
128
+
129
+ _obj = cls.model_validate(
130
+ {
131
+ "logRateLimitInBytesPerSecond": obj.get("logRateLimitInBytesPerSecond"),
132
+ "perAppTasks": obj.get("perAppTasks"),
133
+ "perProcessMemoryInMb": obj.get("perProcessMemoryInMb"),
134
+ "totalInstances": obj.get("totalInstances"),
135
+ "totalMemoryInMb": obj.get("totalMemoryInMb"),
136
+ }
137
+ )
138
+ return _obj
@@ -0,0 +1,89 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Cloud Foundry API
5
+
6
+ API endpoints for managing STACKIT Cloud Foundry
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: support@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, Field
22
+ from typing_extensions import Annotated, Self
23
+
24
+
25
+ class QuotaDomains(BaseModel):
26
+ """
27
+ QuotaDomains
28
+ """ # noqa: E501
29
+
30
+ total_domains: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(
31
+ description="The value `null` means `unlimited`. ", alias="totalDomains"
32
+ )
33
+ __properties: ClassVar[List[str]] = ["totalDomains"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of QuotaDomains from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # set to None if total_domains (nullable) is None
73
+ # and model_fields_set contains the field
74
+ if self.total_domains is None and "total_domains" in self.model_fields_set:
75
+ _dict["totalDomains"] = None
76
+
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81
+ """Create an instance of QuotaDomains 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({"totalDomains": obj.get("totalDomains")})
89
+ return _obj
@@ -0,0 +1,99 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Cloud Foundry API
5
+
6
+ API endpoints for managing STACKIT Cloud Foundry
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: support@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, Field
22
+ from typing_extensions import Annotated, Self
23
+
24
+
25
+ class QuotaRoutes(BaseModel):
26
+ """
27
+ QuotaRoutes
28
+ """ # noqa: E501
29
+
30
+ total_reserved_ports: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(
31
+ description="The value `null` means `unlimited`. ", alias="totalReservedPorts"
32
+ )
33
+ total_routes: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(
34
+ description="The value `null` means `unlimited`. ", alias="totalRoutes"
35
+ )
36
+ __properties: ClassVar[List[str]] = ["totalReservedPorts", "totalRoutes"]
37
+
38
+ model_config = ConfigDict(
39
+ populate_by_name=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
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of QuotaRoutes 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
+ # set to None if total_reserved_ports (nullable) is None
76
+ # and model_fields_set contains the field
77
+ if self.total_reserved_ports is None and "total_reserved_ports" in self.model_fields_set:
78
+ _dict["totalReservedPorts"] = None
79
+
80
+ # set to None if total_routes (nullable) is None
81
+ # and model_fields_set contains the field
82
+ if self.total_routes is None and "total_routes" in self.model_fields_set:
83
+ _dict["totalRoutes"] = None
84
+
85
+ return _dict
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
+ """Create an instance of QuotaRoutes from a dict"""
90
+ if obj is None:
91
+ return None
92
+
93
+ if not isinstance(obj, dict):
94
+ return cls.model_validate(obj)
95
+
96
+ _obj = cls.model_validate(
97
+ {"totalReservedPorts": obj.get("totalReservedPorts"), "totalRoutes": obj.get("totalRoutes")}
98
+ )
99
+ return _obj
@@ -0,0 +1,104 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Cloud Foundry API
5
+
6
+ API endpoints for managing STACKIT Cloud Foundry
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: support@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, Field, StrictBool
22
+ from typing_extensions import Annotated, Self
23
+
24
+
25
+ class QuotaServices(BaseModel):
26
+ """
27
+ QuotaServices
28
+ """ # noqa: E501
29
+
30
+ paid_services_allowed: StrictBool = Field(alias="paidServicesAllowed")
31
+ total_service_instances: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(
32
+ description="The value `null` means `unlimited`. ", alias="totalServiceInstances"
33
+ )
34
+ total_service_keys: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(
35
+ description="The value `null` means `unlimited`. ", alias="totalServiceKeys"
36
+ )
37
+ __properties: ClassVar[List[str]] = ["paidServicesAllowed", "totalServiceInstances", "totalServiceKeys"]
38
+
39
+ model_config = ConfigDict(
40
+ populate_by_name=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
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
+ """Create an instance of QuotaServices from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ """
69
+ excluded_fields: Set[str] = set([])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ # set to None if total_service_instances (nullable) is None
77
+ # and model_fields_set contains the field
78
+ if self.total_service_instances is None and "total_service_instances" in self.model_fields_set:
79
+ _dict["totalServiceInstances"] = None
80
+
81
+ # set to None if total_service_keys (nullable) is None
82
+ # and model_fields_set contains the field
83
+ if self.total_service_keys is None and "total_service_keys" in self.model_fields_set:
84
+ _dict["totalServiceKeys"] = None
85
+
86
+ return _dict
87
+
88
+ @classmethod
89
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
90
+ """Create an instance of QuotaServices from a dict"""
91
+ if obj is None:
92
+ return None
93
+
94
+ if not isinstance(obj, dict):
95
+ return cls.model_validate(obj)
96
+
97
+ _obj = cls.model_validate(
98
+ {
99
+ "paidServicesAllowed": obj.get("paidServicesAllowed"),
100
+ "totalServiceInstances": obj.get("totalServiceInstances"),
101
+ "totalServiceKeys": obj.get("totalServiceKeys"),
102
+ }
103
+ )
104
+ return _obj
@@ -0,0 +1,110 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Cloud Foundry API
5
+
6
+ API endpoints for managing STACKIT Cloud Foundry
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: support@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 datetime import datetime
20
+ from typing import Any, ClassVar, Dict, List, Optional, Set
21
+
22
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
23
+ from typing_extensions import Self
24
+
25
+
26
+ class Space(BaseModel):
27
+ """
28
+ Space
29
+ """ # noqa: E501
30
+
31
+ created_at: datetime = Field(alias="createdAt")
32
+ guid: StrictStr
33
+ name: StrictStr
34
+ org_id: StrictStr = Field(alias="orgId")
35
+ platform_id: StrictStr = Field(alias="platformId")
36
+ project_id: StrictStr = Field(alias="projectId")
37
+ region: StrictStr
38
+ updated_at: datetime = Field(alias="updatedAt")
39
+ __properties: ClassVar[List[str]] = [
40
+ "createdAt",
41
+ "guid",
42
+ "name",
43
+ "orgId",
44
+ "platformId",
45
+ "projectId",
46
+ "region",
47
+ "updatedAt",
48
+ ]
49
+
50
+ model_config = ConfigDict(
51
+ populate_by_name=True,
52
+ validate_assignment=True,
53
+ protected_namespaces=(),
54
+ )
55
+
56
+ def to_str(self) -> str:
57
+ """Returns the string representation of the model using alias"""
58
+ return pprint.pformat(self.model_dump(by_alias=True))
59
+
60
+ def to_json(self) -> str:
61
+ """Returns the JSON representation of the model using alias"""
62
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
63
+ return json.dumps(self.to_dict())
64
+
65
+ @classmethod
66
+ def from_json(cls, json_str: str) -> Optional[Self]:
67
+ """Create an instance of Space from a JSON string"""
68
+ return cls.from_dict(json.loads(json_str))
69
+
70
+ def to_dict(self) -> Dict[str, Any]:
71
+ """Return the dictionary representation of the model using alias.
72
+
73
+ This has the following differences from calling pydantic's
74
+ `self.model_dump(by_alias=True)`:
75
+
76
+ * `None` is only added to the output dict for nullable fields that
77
+ were set at model initialization. Other fields with value `None`
78
+ are ignored.
79
+ """
80
+ excluded_fields: Set[str] = set([])
81
+
82
+ _dict = self.model_dump(
83
+ by_alias=True,
84
+ exclude=excluded_fields,
85
+ exclude_none=True,
86
+ )
87
+ return _dict
88
+
89
+ @classmethod
90
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
91
+ """Create an instance of Space from a dict"""
92
+ if obj is None:
93
+ return None
94
+
95
+ if not isinstance(obj, dict):
96
+ return cls.model_validate(obj)
97
+
98
+ _obj = cls.model_validate(
99
+ {
100
+ "createdAt": obj.get("createdAt"),
101
+ "guid": obj.get("guid"),
102
+ "name": obj.get("name"),
103
+ "orgId": obj.get("orgId"),
104
+ "platformId": obj.get("platformId"),
105
+ "projectId": obj.get("projectId"),
106
+ "region": obj.get("region"),
107
+ "updatedAt": obj.get("updatedAt"),
108
+ }
109
+ )
110
+ return _obj
@@ -0,0 +1,90 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Cloud Foundry API
5
+
6
+ API endpoints for managing STACKIT Cloud Foundry
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: support@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 typing_extensions import Annotated, Self
24
+
25
+
26
+ class SpaceDeleteResponse(BaseModel):
27
+ """
28
+ SpaceDeleteResponse
29
+ """ # noqa: E501
30
+
31
+ message: Annotated[str, Field(strict=True, max_length=1024)]
32
+ __properties: ClassVar[List[str]] = ["message"]
33
+
34
+ @field_validator("message")
35
+ def message_validate_regular_expression(cls, value):
36
+ """Validates the regular expression"""
37
+ if not re.match(r"^[a-zA-Z0-9\/_]+$", value):
38
+ raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9\/_]+$/")
39
+ return value
40
+
41
+ model_config = ConfigDict(
42
+ populate_by_name=True,
43
+ validate_assignment=True,
44
+ protected_namespaces=(),
45
+ )
46
+
47
+ def to_str(self) -> str:
48
+ """Returns the string representation of the model using alias"""
49
+ return pprint.pformat(self.model_dump(by_alias=True))
50
+
51
+ def to_json(self) -> str:
52
+ """Returns the JSON representation of the model using alias"""
53
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
54
+ return json.dumps(self.to_dict())
55
+
56
+ @classmethod
57
+ def from_json(cls, json_str: str) -> Optional[Self]:
58
+ """Create an instance of SpaceDeleteResponse from a JSON string"""
59
+ return cls.from_dict(json.loads(json_str))
60
+
61
+ def to_dict(self) -> Dict[str, Any]:
62
+ """Return the dictionary representation of the model using alias.
63
+
64
+ This has the following differences from calling pydantic's
65
+ `self.model_dump(by_alias=True)`:
66
+
67
+ * `None` is only added to the output dict for nullable fields that
68
+ were set at model initialization. Other fields with value `None`
69
+ are ignored.
70
+ """
71
+ excluded_fields: Set[str] = set([])
72
+
73
+ _dict = self.model_dump(
74
+ by_alias=True,
75
+ exclude=excluded_fields,
76
+ exclude_none=True,
77
+ )
78
+ return _dict
79
+
80
+ @classmethod
81
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
82
+ """Create an instance of SpaceDeleteResponse from a dict"""
83
+ if obj is None:
84
+ return None
85
+
86
+ if not isinstance(obj, dict):
87
+ return cls.model_validate(obj)
88
+
89
+ _obj = cls.model_validate({"message": obj.get("message")})
90
+ return _obj