stackit-scf 0.1.0__tar.gz → 0.2.1__tar.gz

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 (54) hide show
  1. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/PKG-INFO +5 -2
  2. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/pyproject.toml +1 -1
  3. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/__init__.py +8 -0
  4. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/__init__.py +4 -0
  5. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/org_manager.py +31 -1
  6. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/org_manager_response.py +28 -1
  7. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/organization.py +35 -1
  8. stackit_scf-0.2.1/src/stackit/scf/models/organization_create_bff_response.py +105 -0
  9. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/organizations_list_item.py +35 -1
  10. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/quota.py +28 -1
  11. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/space.py +28 -1
  12. stackit_scf-0.2.1/src/stackit/scf/models/space_created_bff_response.py +105 -0
  13. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/LICENSE.md +0 -0
  14. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/NOTICE.txt +0 -0
  15. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/README.md +0 -0
  16. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/api/__init__.py +0 -0
  17. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/api/default_api.py +0 -0
  18. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/api_client.py +0 -0
  19. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/api_response.py +0 -0
  20. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/configuration.py +0 -0
  21. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/exceptions.py +0 -0
  22. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/apply_organization_quota_payload.py +0 -0
  23. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/create_org_role_payload.py +0 -0
  24. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/create_organization_payload.py +0 -0
  25. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/create_space_payload.py +0 -0
  26. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/create_space_role_payload.py +0 -0
  27. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/error_response.py +0 -0
  28. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/org_manager_delete_response.py +0 -0
  29. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/org_role_create_bff_request.py +0 -0
  30. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/org_role_response.py +0 -0
  31. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/org_role_type.py +0 -0
  32. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/organization_create_response.py +0 -0
  33. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/organization_delete_response.py +0 -0
  34. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/organization_quota.py +0 -0
  35. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/organization_usage_summary.py +0 -0
  36. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/organizations_list.py +0 -0
  37. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/pagination.py +0 -0
  38. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/platform_list.py +0 -0
  39. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/platforms.py +0 -0
  40. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/quota_apps.py +0 -0
  41. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/quota_domains.py +0 -0
  42. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/quota_routes.py +0 -0
  43. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/quota_services.py +0 -0
  44. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/space_delete_response.py +0 -0
  45. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/space_role_create_bff_request.py +0 -0
  46. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/space_role_create_bff_response.py +0 -0
  47. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/space_role_create_response.py +0 -0
  48. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/space_role_type.py +0 -0
  49. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/spaces_list.py +0 -0
  50. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/update_organization_payload.py +0 -0
  51. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/update_space_payload.py +0 -0
  52. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/models/usage_summary.py +0 -0
  53. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/py.typed +0 -0
  54. {stackit_scf-0.1.0 → stackit_scf-0.2.1}/src/stackit/scf/rest.py +0 -0
@@ -1,7 +1,9 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: stackit-scf
3
- Version: 0.1.0
3
+ Version: 0.2.1
4
4
  Summary: STACKIT Cloud Foundry API
5
+ License-File: LICENSE.md
6
+ License-File: NOTICE.txt
5
7
  Author: STACKIT Developer Tools
6
8
  Author-email: developer-tools@stackit.cloud
7
9
  Requires-Python: >=3.9,<4.0
@@ -13,6 +15,7 @@ Classifier: Programming Language :: Python :: 3.10
13
15
  Classifier: Programming Language :: Python :: 3.11
14
16
  Classifier: Programming Language :: Python :: 3.12
15
17
  Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
16
19
  Requires-Dist: pydantic (>=2.9.2)
17
20
  Requires-Dist: python-dateutil (>=2.9.0.post0)
18
21
  Requires-Dist: requests (>=2.32.3)
@@ -3,7 +3,7 @@ name = "stackit-scf"
3
3
 
4
4
  [tool.poetry]
5
5
  name = "stackit-scf"
6
- version = "v0.1.0"
6
+ version = "v0.2.1"
7
7
  authors = [
8
8
  "STACKIT Developer Tools <developer-tools@stackit.cloud>",
9
9
  ]
@@ -42,6 +42,7 @@ __all__ = [
42
42
  "OrgRoleResponse",
43
43
  "OrgRoleType",
44
44
  "Organization",
45
+ "OrganizationCreateBffResponse",
45
46
  "OrganizationCreateResponse",
46
47
  "OrganizationDeleteResponse",
47
48
  "OrganizationQuota",
@@ -57,6 +58,7 @@ __all__ = [
57
58
  "QuotaRoutes",
58
59
  "QuotaServices",
59
60
  "Space",
61
+ "SpaceCreatedBffResponse",
60
62
  "SpaceDeleteResponse",
61
63
  "SpaceRoleCreateBffRequest",
62
64
  "SpaceRoleCreateBffResponse",
@@ -112,6 +114,9 @@ from stackit.scf.models.org_role_create_bff_request import (
112
114
  from stackit.scf.models.org_role_response import OrgRoleResponse as OrgRoleResponse
113
115
  from stackit.scf.models.org_role_type import OrgRoleType as OrgRoleType
114
116
  from stackit.scf.models.organization import Organization as Organization
117
+ from stackit.scf.models.organization_create_bff_response import (
118
+ OrganizationCreateBffResponse as OrganizationCreateBffResponse,
119
+ )
115
120
  from stackit.scf.models.organization_create_response import (
116
121
  OrganizationCreateResponse as OrganizationCreateResponse,
117
122
  )
@@ -135,6 +140,9 @@ from stackit.scf.models.quota_domains import QuotaDomains as QuotaDomains
135
140
  from stackit.scf.models.quota_routes import QuotaRoutes as QuotaRoutes
136
141
  from stackit.scf.models.quota_services import QuotaServices as QuotaServices
137
142
  from stackit.scf.models.space import Space as Space
143
+ from stackit.scf.models.space_created_bff_response import (
144
+ SpaceCreatedBffResponse as SpaceCreatedBffResponse,
145
+ )
138
146
  from stackit.scf.models.space_delete_response import (
139
147
  SpaceDeleteResponse as SpaceDeleteResponse,
140
148
  )
@@ -30,6 +30,9 @@ from stackit.scf.models.org_role_create_bff_request import OrgRoleCreateBffReque
30
30
  from stackit.scf.models.org_role_response import OrgRoleResponse
31
31
  from stackit.scf.models.org_role_type import OrgRoleType
32
32
  from stackit.scf.models.organization import Organization
33
+ from stackit.scf.models.organization_create_bff_response import (
34
+ OrganizationCreateBffResponse,
35
+ )
33
36
  from stackit.scf.models.organization_create_response import OrganizationCreateResponse
34
37
  from stackit.scf.models.organization_delete_response import OrganizationDeleteResponse
35
38
  from stackit.scf.models.organization_quota import OrganizationQuota
@@ -45,6 +48,7 @@ from stackit.scf.models.quota_domains import QuotaDomains
45
48
  from stackit.scf.models.quota_routes import QuotaRoutes
46
49
  from stackit.scf.models.quota_services import QuotaServices
47
50
  from stackit.scf.models.space import Space
51
+ from stackit.scf.models.space_created_bff_response import SpaceCreatedBffResponse
48
52
  from stackit.scf.models.space_delete_response import SpaceDeleteResponse
49
53
  from stackit.scf.models.space_role_create_bff_request import SpaceRoleCreateBffRequest
50
54
  from stackit.scf.models.space_role_create_bff_response import SpaceRoleCreateBffResponse
@@ -16,10 +16,11 @@ from __future__ import annotations
16
16
 
17
17
  import json
18
18
  import pprint
19
+ import re # noqa: F401
19
20
  from datetime import datetime
20
21
  from typing import Any, ClassVar, Dict, List, Optional, Set
21
22
 
22
- from pydantic import BaseModel, ConfigDict, Field, StrictStr
23
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
23
24
  from typing_extensions import Self
24
25
 
25
26
 
@@ -30,6 +31,7 @@ class OrgManager(BaseModel):
30
31
 
31
32
  created_at: datetime = Field(alias="createdAt")
32
33
  guid: StrictStr
34
+ org_id: StrictStr = Field(alias="orgId")
33
35
  platform_id: StrictStr = Field(alias="platformId")
34
36
  project_id: StrictStr = Field(alias="projectId")
35
37
  region: StrictStr
@@ -38,6 +40,7 @@ class OrgManager(BaseModel):
38
40
  __properties: ClassVar[List[str]] = [
39
41
  "createdAt",
40
42
  "guid",
43
+ "orgId",
41
44
  "platformId",
42
45
  "projectId",
43
46
  "region",
@@ -45,6 +48,32 @@ class OrgManager(BaseModel):
45
48
  "username",
46
49
  ]
47
50
 
51
+ @field_validator("created_at", mode="before")
52
+ def created_at_change_year_zero_to_one(cls, value):
53
+ """Workaround which prevents year 0 issue"""
54
+ if isinstance(value, str):
55
+ # Check for year "0000" at the beginning of the string
56
+ # This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
57
+ if value.startswith("0000-01-01T") and re.match(
58
+ r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
59
+ ):
60
+ # Workaround: Replace "0000" with "0001"
61
+ return "0001" + value[4:] # Take "0001" and append the rest of the string
62
+ return value
63
+
64
+ @field_validator("updated_at", mode="before")
65
+ def updated_at_change_year_zero_to_one(cls, value):
66
+ """Workaround which prevents year 0 issue"""
67
+ if isinstance(value, str):
68
+ # Check for year "0000" at the beginning of the string
69
+ # This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
70
+ if value.startswith("0000-01-01T") and re.match(
71
+ r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
72
+ ):
73
+ # Workaround: Replace "0000" with "0001"
74
+ return "0001" + value[4:] # Take "0001" and append the rest of the string
75
+ return value
76
+
48
77
  model_config = ConfigDict(
49
78
  populate_by_name=True,
50
79
  validate_assignment=True,
@@ -97,6 +126,7 @@ class OrgManager(BaseModel):
97
126
  {
98
127
  "createdAt": obj.get("createdAt"),
99
128
  "guid": obj.get("guid"),
129
+ "orgId": obj.get("orgId"),
100
130
  "platformId": obj.get("platformId"),
101
131
  "projectId": obj.get("projectId"),
102
132
  "region": obj.get("region"),
@@ -16,10 +16,11 @@ from __future__ import annotations
16
16
 
17
17
  import json
18
18
  import pprint
19
+ import re # noqa: F401
19
20
  from datetime import datetime
20
21
  from typing import Any, ClassVar, Dict, List, Optional, Set
21
22
 
22
- from pydantic import BaseModel, ConfigDict, Field, StrictStr
23
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
23
24
  from typing_extensions import Self
24
25
 
25
26
 
@@ -49,6 +50,32 @@ class OrgManagerResponse(BaseModel):
49
50
  "username",
50
51
  ]
51
52
 
53
+ @field_validator("created_at", mode="before")
54
+ def created_at_change_year_zero_to_one(cls, value):
55
+ """Workaround which prevents year 0 issue"""
56
+ if isinstance(value, str):
57
+ # Check for year "0000" at the beginning of the string
58
+ # This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
59
+ if value.startswith("0000-01-01T") and re.match(
60
+ r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
61
+ ):
62
+ # Workaround: Replace "0000" with "0001"
63
+ return "0001" + value[4:] # Take "0001" and append the rest of the string
64
+ return value
65
+
66
+ @field_validator("updated_at", mode="before")
67
+ def updated_at_change_year_zero_to_one(cls, value):
68
+ """Workaround which prevents year 0 issue"""
69
+ if isinstance(value, str):
70
+ # Check for year "0000" at the beginning of the string
71
+ # This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
72
+ if value.startswith("0000-01-01T") and re.match(
73
+ r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
74
+ ):
75
+ # Workaround: Replace "0000" with "0001"
76
+ return "0001" + value[4:] # Take "0001" and append the rest of the string
77
+ return value
78
+
52
79
  model_config = ConfigDict(
53
80
  populate_by_name=True,
54
81
  validate_assignment=True,
@@ -16,10 +16,18 @@ from __future__ import annotations
16
16
 
17
17
  import json
18
18
  import pprint
19
+ import re # noqa: F401
19
20
  from datetime import datetime
20
21
  from typing import Any, ClassVar, Dict, List, Optional, Set
21
22
 
22
- from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
23
+ from pydantic import (
24
+ BaseModel,
25
+ ConfigDict,
26
+ Field,
27
+ StrictBool,
28
+ StrictStr,
29
+ field_validator,
30
+ )
23
31
  from typing_extensions import Self
24
32
 
25
33
 
@@ -53,6 +61,32 @@ class Organization(BaseModel):
53
61
  "updatedAt",
54
62
  ]
55
63
 
64
+ @field_validator("created_at", mode="before")
65
+ def created_at_change_year_zero_to_one(cls, value):
66
+ """Workaround which prevents year 0 issue"""
67
+ if isinstance(value, str):
68
+ # Check for year "0000" at the beginning of the string
69
+ # This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
70
+ if value.startswith("0000-01-01T") and re.match(
71
+ r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
72
+ ):
73
+ # Workaround: Replace "0000" with "0001"
74
+ return "0001" + value[4:] # Take "0001" and append the rest of the string
75
+ return value
76
+
77
+ @field_validator("updated_at", mode="before")
78
+ def updated_at_change_year_zero_to_one(cls, value):
79
+ """Workaround which prevents year 0 issue"""
80
+ if isinstance(value, str):
81
+ # Check for year "0000" at the beginning of the string
82
+ # This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
83
+ if value.startswith("0000-01-01T") and re.match(
84
+ r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
85
+ ):
86
+ # Workaround: Replace "0000" with "0001"
87
+ return "0001" + value[4:] # Take "0001" and append the rest of the string
88
+ return value
89
+
56
90
  model_config = ConfigDict(
57
91
  populate_by_name=True,
58
92
  validate_assignment=True,
@@ -0,0 +1,105 @@
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
22
+ from typing_extensions import Self
23
+
24
+ from stackit.scf.models.org_role_response import OrgRoleResponse
25
+ from stackit.scf.models.organization_create_response import OrganizationCreateResponse
26
+
27
+
28
+ class OrganizationCreateBffResponse(BaseModel):
29
+ """
30
+ OrganizationCreateBffResponse
31
+ """ # noqa: E501
32
+
33
+ org: OrganizationCreateResponse
34
+ roles: Dict[str, OrgRoleResponse]
35
+ __properties: ClassVar[List[str]] = ["org", "roles"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of OrganizationCreateBffResponse 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 org
75
+ if self.org:
76
+ _dict["org"] = self.org.to_dict()
77
+ # override the default output from pydantic by calling `to_dict()` of each value in roles (dict)
78
+ _field_dict = {}
79
+ if self.roles:
80
+ for _key in self.roles:
81
+ if self.roles[_key]:
82
+ _field_dict[_key] = self.roles[_key].to_dict()
83
+ _dict["roles"] = _field_dict
84
+ return _dict
85
+
86
+ @classmethod
87
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
88
+ """Create an instance of OrganizationCreateBffResponse from a dict"""
89
+ if obj is None:
90
+ return None
91
+
92
+ if not isinstance(obj, dict):
93
+ return cls.model_validate(obj)
94
+
95
+ _obj = cls.model_validate(
96
+ {
97
+ "org": OrganizationCreateResponse.from_dict(obj["org"]) if obj.get("org") is not None else None,
98
+ "roles": (
99
+ dict((_k, OrgRoleResponse.from_dict(_v)) for _k, _v in obj["roles"].items())
100
+ if obj.get("roles") is not None
101
+ else None
102
+ ),
103
+ }
104
+ )
105
+ return _obj
@@ -16,10 +16,18 @@ from __future__ import annotations
16
16
 
17
17
  import json
18
18
  import pprint
19
+ import re # noqa: F401
19
20
  from datetime import datetime
20
21
  from typing import Any, ClassVar, Dict, List, Optional, Set
21
22
 
22
- from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
23
+ from pydantic import (
24
+ BaseModel,
25
+ ConfigDict,
26
+ Field,
27
+ StrictBool,
28
+ StrictStr,
29
+ field_validator,
30
+ )
23
31
  from typing_extensions import Self
24
32
 
25
33
 
@@ -53,6 +61,32 @@ class OrganizationsListItem(BaseModel):
53
61
  "updatedAt",
54
62
  ]
55
63
 
64
+ @field_validator("created_at", mode="before")
65
+ def created_at_change_year_zero_to_one(cls, value):
66
+ """Workaround which prevents year 0 issue"""
67
+ if isinstance(value, str):
68
+ # Check for year "0000" at the beginning of the string
69
+ # This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
70
+ if value.startswith("0000-01-01T") and re.match(
71
+ r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
72
+ ):
73
+ # Workaround: Replace "0000" with "0001"
74
+ return "0001" + value[4:] # Take "0001" and append the rest of the string
75
+ return value
76
+
77
+ @field_validator("updated_at", mode="before")
78
+ def updated_at_change_year_zero_to_one(cls, value):
79
+ """Workaround which prevents year 0 issue"""
80
+ if isinstance(value, str):
81
+ # Check for year "0000" at the beginning of the string
82
+ # This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
83
+ if value.startswith("0000-01-01T") and re.match(
84
+ r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
85
+ ):
86
+ # Workaround: Replace "0000" with "0001"
87
+ return "0001" + value[4:] # Take "0001" and append the rest of the string
88
+ return value
89
+
56
90
  model_config = ConfigDict(
57
91
  populate_by_name=True,
58
92
  validate_assignment=True,
@@ -16,10 +16,11 @@ from __future__ import annotations
16
16
 
17
17
  import json
18
18
  import pprint
19
+ import re # noqa: F401
19
20
  from datetime import datetime
20
21
  from typing import Any, ClassVar, Dict, List, Optional, Set
21
22
 
22
- from pydantic import BaseModel, ConfigDict, Field, StrictStr
23
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
23
24
  from typing_extensions import Self
24
25
 
25
26
  from stackit.scf.models.quota_apps import QuotaApps
@@ -60,6 +61,32 @@ class Quota(BaseModel):
60
61
  "updatedAt",
61
62
  ]
62
63
 
64
+ @field_validator("created_at", mode="before")
65
+ def created_at_change_year_zero_to_one(cls, value):
66
+ """Workaround which prevents year 0 issue"""
67
+ if isinstance(value, str):
68
+ # Check for year "0000" at the beginning of the string
69
+ # This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
70
+ if value.startswith("0000-01-01T") and re.match(
71
+ r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
72
+ ):
73
+ # Workaround: Replace "0000" with "0001"
74
+ return "0001" + value[4:] # Take "0001" and append the rest of the string
75
+ return value
76
+
77
+ @field_validator("updated_at", mode="before")
78
+ def updated_at_change_year_zero_to_one(cls, value):
79
+ """Workaround which prevents year 0 issue"""
80
+ if isinstance(value, str):
81
+ # Check for year "0000" at the beginning of the string
82
+ # This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
83
+ if value.startswith("0000-01-01T") and re.match(
84
+ r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
85
+ ):
86
+ # Workaround: Replace "0000" with "0001"
87
+ return "0001" + value[4:] # Take "0001" and append the rest of the string
88
+ return value
89
+
63
90
  model_config = ConfigDict(
64
91
  populate_by_name=True,
65
92
  validate_assignment=True,
@@ -16,10 +16,11 @@ from __future__ import annotations
16
16
 
17
17
  import json
18
18
  import pprint
19
+ import re # noqa: F401
19
20
  from datetime import datetime
20
21
  from typing import Any, ClassVar, Dict, List, Optional, Set
21
22
 
22
- from pydantic import BaseModel, ConfigDict, Field, StrictStr
23
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
23
24
  from typing_extensions import Self
24
25
 
25
26
 
@@ -47,6 +48,32 @@ class Space(BaseModel):
47
48
  "updatedAt",
48
49
  ]
49
50
 
51
+ @field_validator("created_at", mode="before")
52
+ def created_at_change_year_zero_to_one(cls, value):
53
+ """Workaround which prevents year 0 issue"""
54
+ if isinstance(value, str):
55
+ # Check for year "0000" at the beginning of the string
56
+ # This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
57
+ if value.startswith("0000-01-01T") and re.match(
58
+ r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
59
+ ):
60
+ # Workaround: Replace "0000" with "0001"
61
+ return "0001" + value[4:] # Take "0001" and append the rest of the string
62
+ return value
63
+
64
+ @field_validator("updated_at", mode="before")
65
+ def updated_at_change_year_zero_to_one(cls, value):
66
+ """Workaround which prevents year 0 issue"""
67
+ if isinstance(value, str):
68
+ # Check for year "0000" at the beginning of the string
69
+ # This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
70
+ if value.startswith("0000-01-01T") and re.match(
71
+ r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
72
+ ):
73
+ # Workaround: Replace "0000" with "0001"
74
+ return "0001" + value[4:] # Take "0001" and append the rest of the string
75
+ return value
76
+
50
77
  model_config = ConfigDict(
51
78
  populate_by_name=True,
52
79
  validate_assignment=True,
@@ -0,0 +1,105 @@
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 Self
23
+
24
+ from stackit.scf.models.org_role_response import OrgRoleResponse
25
+ from stackit.scf.models.space import Space
26
+ from stackit.scf.models.space_role_create_response import SpaceRoleCreateResponse
27
+
28
+
29
+ class SpaceCreatedBffResponse(BaseModel):
30
+ """
31
+ SpaceCreatedBffResponse
32
+ """ # noqa: E501
33
+
34
+ org_role: Optional[OrgRoleResponse] = Field(default=None, alias="orgRole")
35
+ space: Space
36
+ space_role: SpaceRoleCreateResponse = Field(alias="spaceRole")
37
+ __properties: ClassVar[List[str]] = ["orgRole", "space", "spaceRole"]
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 SpaceCreatedBffResponse 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
+ # override the default output from pydantic by calling `to_dict()` of org_role
77
+ if self.org_role:
78
+ _dict["orgRole"] = self.org_role.to_dict()
79
+ # override the default output from pydantic by calling `to_dict()` of space
80
+ if self.space:
81
+ _dict["space"] = self.space.to_dict()
82
+ # override the default output from pydantic by calling `to_dict()` of space_role
83
+ if self.space_role:
84
+ _dict["spaceRole"] = self.space_role.to_dict()
85
+ return _dict
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
+ """Create an instance of SpaceCreatedBffResponse 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
+ {
98
+ "orgRole": OrgRoleResponse.from_dict(obj["orgRole"]) if obj.get("orgRole") is not None else None,
99
+ "space": Space.from_dict(obj["space"]) if obj.get("space") is not None else None,
100
+ "spaceRole": (
101
+ SpaceRoleCreateResponse.from_dict(obj["spaceRole"]) if obj.get("spaceRole") is not None else None
102
+ ),
103
+ }
104
+ )
105
+ return _obj
File without changes
File without changes
File without changes