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,98 @@
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, StrictStr
22
+ from typing_extensions import Self
23
+
24
+ from stackit.scf.models.org_role_type import OrgRoleType
25
+
26
+
27
+ class OrgRoleResponse(BaseModel):
28
+ """
29
+ OrgRoleResponse
30
+ """ # noqa: E501
31
+
32
+ guid: StrictStr
33
+ org_id: StrictStr = Field(alias="orgId")
34
+ platform_id: StrictStr = Field(alias="platformId")
35
+ project_id: StrictStr = Field(alias="projectId")
36
+ region: StrictStr
37
+ type: OrgRoleType
38
+ __properties: ClassVar[List[str]] = ["guid", "orgId", "platformId", "projectId", "region", "type"]
39
+
40
+ model_config = ConfigDict(
41
+ populate_by_name=True,
42
+ validate_assignment=True,
43
+ protected_namespaces=(),
44
+ )
45
+
46
+ def to_str(self) -> str:
47
+ """Returns the string representation of the model using alias"""
48
+ return pprint.pformat(self.model_dump(by_alias=True))
49
+
50
+ def to_json(self) -> str:
51
+ """Returns the JSON representation of the model using alias"""
52
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
53
+ return json.dumps(self.to_dict())
54
+
55
+ @classmethod
56
+ def from_json(cls, json_str: str) -> Optional[Self]:
57
+ """Create an instance of OrgRoleResponse from a JSON string"""
58
+ return cls.from_dict(json.loads(json_str))
59
+
60
+ def to_dict(self) -> Dict[str, Any]:
61
+ """Return the dictionary representation of the model using alias.
62
+
63
+ This has the following differences from calling pydantic's
64
+ `self.model_dump(by_alias=True)`:
65
+
66
+ * `None` is only added to the output dict for nullable fields that
67
+ were set at model initialization. Other fields with value `None`
68
+ are ignored.
69
+ """
70
+ excluded_fields: Set[str] = set([])
71
+
72
+ _dict = self.model_dump(
73
+ by_alias=True,
74
+ exclude=excluded_fields,
75
+ exclude_none=True,
76
+ )
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81
+ """Create an instance of OrgRoleResponse 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
+ "guid": obj.get("guid"),
91
+ "orgId": obj.get("orgId"),
92
+ "platformId": obj.get("platformId"),
93
+ "projectId": obj.get("projectId"),
94
+ "region": obj.get("region"),
95
+ "type": obj.get("type"),
96
+ }
97
+ )
98
+ return _obj
@@ -0,0 +1,39 @@
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
+ from enum import Enum
19
+
20
+ from typing_extensions import Self
21
+
22
+
23
+ class OrgRoleType(str, Enum):
24
+ """
25
+ OrgRoleType
26
+ """
27
+
28
+ """
29
+ allowed enum values
30
+ """
31
+ ORGANIZATION_USER = "organization_user"
32
+ ORGANIZATION_AUDITOR = "organization_auditor"
33
+ ORGANIZATION_MANAGER = "organization_manager"
34
+ ORGANIZATION_BILLING_MANAGER = "organization_billing_manager"
35
+
36
+ @classmethod
37
+ def from_json(cls, json_str: str) -> Self:
38
+ """Create an instance of OrgRoleType from a JSON string"""
39
+ return cls(json.loads(json_str))
@@ -0,0 +1,118 @@
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, StrictBool, StrictStr
23
+ from typing_extensions import Self
24
+
25
+
26
+ class Organization(BaseModel):
27
+ """
28
+ Organization
29
+ """ # noqa: E501
30
+
31
+ created_at: datetime = Field(alias="createdAt")
32
+ guid: StrictStr
33
+ name: StrictStr
34
+ platform_id: StrictStr = Field(alias="platformId")
35
+ project_id: StrictStr = Field(alias="projectId")
36
+ quota_id: StrictStr = Field(alias="quotaId")
37
+ region: StrictStr
38
+ status: StrictStr = Field(
39
+ description="The organization's status. The status value starts with `deleting` when a deleting request is in progress. The status value starts with `delete_failed` when the deletion failed. The status value can be different from `deleting` and `delete_failed`. Additional details can be provided in the future. "
40
+ )
41
+ suspended: StrictBool
42
+ updated_at: datetime = Field(alias="updatedAt")
43
+ __properties: ClassVar[List[str]] = [
44
+ "createdAt",
45
+ "guid",
46
+ "name",
47
+ "platformId",
48
+ "projectId",
49
+ "quotaId",
50
+ "region",
51
+ "status",
52
+ "suspended",
53
+ "updatedAt",
54
+ ]
55
+
56
+ model_config = ConfigDict(
57
+ populate_by_name=True,
58
+ validate_assignment=True,
59
+ protected_namespaces=(),
60
+ )
61
+
62
+ def to_str(self) -> str:
63
+ """Returns the string representation of the model using alias"""
64
+ return pprint.pformat(self.model_dump(by_alias=True))
65
+
66
+ def to_json(self) -> str:
67
+ """Returns the JSON representation of the model using alias"""
68
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
69
+ return json.dumps(self.to_dict())
70
+
71
+ @classmethod
72
+ def from_json(cls, json_str: str) -> Optional[Self]:
73
+ """Create an instance of Organization from a JSON string"""
74
+ return cls.from_dict(json.loads(json_str))
75
+
76
+ def to_dict(self) -> Dict[str, Any]:
77
+ """Return the dictionary representation of the model using alias.
78
+
79
+ This has the following differences from calling pydantic's
80
+ `self.model_dump(by_alias=True)`:
81
+
82
+ * `None` is only added to the output dict for nullable fields that
83
+ were set at model initialization. Other fields with value `None`
84
+ are ignored.
85
+ """
86
+ excluded_fields: Set[str] = set([])
87
+
88
+ _dict = self.model_dump(
89
+ by_alias=True,
90
+ exclude=excluded_fields,
91
+ exclude_none=True,
92
+ )
93
+ return _dict
94
+
95
+ @classmethod
96
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
97
+ """Create an instance of Organization from a dict"""
98
+ if obj is None:
99
+ return None
100
+
101
+ if not isinstance(obj, dict):
102
+ return cls.model_validate(obj)
103
+
104
+ _obj = cls.model_validate(
105
+ {
106
+ "createdAt": obj.get("createdAt"),
107
+ "guid": obj.get("guid"),
108
+ "name": obj.get("name"),
109
+ "platformId": obj.get("platformId"),
110
+ "projectId": obj.get("projectId"),
111
+ "quotaId": obj.get("quotaId"),
112
+ "region": obj.get("region"),
113
+ "status": obj.get("status"),
114
+ "suspended": obj.get("suspended"),
115
+ "updatedAt": obj.get("updatedAt"),
116
+ }
117
+ )
118
+ return _obj
@@ -0,0 +1,92 @@
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, StrictStr
22
+ from typing_extensions import Self
23
+
24
+
25
+ class OrganizationCreateResponse(BaseModel):
26
+ """
27
+ OrganizationCreateResponse
28
+ """ # noqa: E501
29
+
30
+ guid: StrictStr
31
+ platform_id: StrictStr = Field(alias="platformId")
32
+ project_id: StrictStr = Field(alias="projectId")
33
+ region: StrictStr
34
+ __properties: ClassVar[List[str]] = ["guid", "platformId", "projectId", "region"]
35
+
36
+ model_config = ConfigDict(
37
+ populate_by_name=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of OrganizationCreateResponse from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ return _dict
74
+
75
+ @classmethod
76
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
+ """Create an instance of OrganizationCreateResponse from a dict"""
78
+ if obj is None:
79
+ return None
80
+
81
+ if not isinstance(obj, dict):
82
+ return cls.model_validate(obj)
83
+
84
+ _obj = cls.model_validate(
85
+ {
86
+ "guid": obj.get("guid"),
87
+ "platformId": obj.get("platformId"),
88
+ "projectId": obj.get("projectId"),
89
+ "region": obj.get("region"),
90
+ }
91
+ )
92
+ return _obj
@@ -0,0 +1,92 @@
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, StrictStr
22
+ from typing_extensions import Self
23
+
24
+
25
+ class OrganizationDeleteResponse(BaseModel):
26
+ """
27
+ OrganizationDeleteResponse
28
+ """ # noqa: E501
29
+
30
+ guid: StrictStr
31
+ platform_id: StrictStr = Field(alias="platformId")
32
+ project_id: StrictStr = Field(alias="projectId")
33
+ region: StrictStr
34
+ __properties: ClassVar[List[str]] = ["guid", "platformId", "projectId", "region"]
35
+
36
+ model_config = ConfigDict(
37
+ populate_by_name=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of OrganizationDeleteResponse from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ return _dict
74
+
75
+ @classmethod
76
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
+ """Create an instance of OrganizationDeleteResponse from a dict"""
78
+ if obj is None:
79
+ return None
80
+
81
+ if not isinstance(obj, dict):
82
+ return cls.model_validate(obj)
83
+
84
+ _obj = cls.model_validate(
85
+ {
86
+ "guid": obj.get("guid"),
87
+ "platformId": obj.get("platformId"),
88
+ "projectId": obj.get("projectId"),
89
+ "region": obj.get("region"),
90
+ }
91
+ )
92
+ return _obj
@@ -0,0 +1,94 @@
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, StrictStr
22
+ from typing_extensions import Self
23
+
24
+
25
+ class OrganizationQuota(BaseModel):
26
+ """
27
+ OrganizationQuota
28
+ """ # noqa: E501
29
+
30
+ org_id: StrictStr = Field(alias="orgId")
31
+ platform_id: StrictStr = Field(alias="platformId")
32
+ project_id: StrictStr = Field(alias="projectId")
33
+ quota_id: StrictStr = Field(alias="quotaId")
34
+ region: StrictStr
35
+ __properties: ClassVar[List[str]] = ["orgId", "platformId", "projectId", "quotaId", "region"]
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 OrganizationQuota 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
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
+ """Create an instance of OrganizationQuota from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate(
86
+ {
87
+ "orgId": obj.get("orgId"),
88
+ "platformId": obj.get("platformId"),
89
+ "projectId": obj.get("projectId"),
90
+ "quotaId": obj.get("quotaId"),
91
+ "region": obj.get("region"),
92
+ }
93
+ )
94
+ return _obj
@@ -0,0 +1,101 @@
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, StrictStr
22
+ from typing_extensions import Self
23
+
24
+ from stackit.scf.models.usage_summary import UsageSummary
25
+
26
+
27
+ class OrganizationUsageSummary(BaseModel):
28
+ """
29
+ OrganizationUsageSummary
30
+ """ # noqa: E501
31
+
32
+ org_id: StrictStr = Field(alias="orgId")
33
+ platform_id: StrictStr = Field(alias="platformId")
34
+ project_id: StrictStr = Field(alias="projectId")
35
+ region: StrictStr
36
+ usage_summary: UsageSummary = Field(alias="usageSummary")
37
+ __properties: ClassVar[List[str]] = ["orgId", "platformId", "projectId", "region", "usageSummary"]
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 OrganizationUsageSummary 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 usage_summary
77
+ if self.usage_summary:
78
+ _dict["usageSummary"] = self.usage_summary.to_dict()
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of OrganizationUsageSummary from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate(
91
+ {
92
+ "orgId": obj.get("orgId"),
93
+ "platformId": obj.get("platformId"),
94
+ "projectId": obj.get("projectId"),
95
+ "region": obj.get("region"),
96
+ "usageSummary": (
97
+ UsageSummary.from_dict(obj["usageSummary"]) if obj.get("usageSummary") is not None else None
98
+ ),
99
+ }
100
+ )
101
+ return _obj