stackit-valkey 0.0.1__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 (40) hide show
  1. src/stackit/valkey/__init__.py +134 -0
  2. src/stackit/valkey/api/__init__.py +4 -0
  3. src/stackit/valkey/api/default_api.py +5235 -0
  4. src/stackit/valkey/api_client.py +649 -0
  5. src/stackit/valkey/api_response.py +22 -0
  6. src/stackit/valkey/configuration.py +162 -0
  7. src/stackit/valkey/exceptions.py +217 -0
  8. src/stackit/valkey/models/__init__.py +48 -0
  9. src/stackit/valkey/models/backup.py +102 -0
  10. src/stackit/valkey/models/create_backup_response_item.py +83 -0
  11. src/stackit/valkey/models/create_credentials_payload.py +82 -0
  12. src/stackit/valkey/models/create_instance_payload.py +97 -0
  13. src/stackit/valkey/models/create_instance_response.py +82 -0
  14. src/stackit/valkey/models/credentials.py +98 -0
  15. src/stackit/valkey/models/credentials_list_item.py +82 -0
  16. src/stackit/valkey/models/credentials_response.py +95 -0
  17. src/stackit/valkey/models/error.py +83 -0
  18. src/stackit/valkey/models/get_metrics_response.py +161 -0
  19. src/stackit/valkey/models/instance.py +148 -0
  20. src/stackit/valkey/models/instance_last_operation.py +100 -0
  21. src/stackit/valkey/models/instance_parameters.py +240 -0
  22. src/stackit/valkey/models/instance_schema.py +96 -0
  23. src/stackit/valkey/models/list_credentials_response.py +99 -0
  24. src/stackit/valkey/models/list_instances_response.py +99 -0
  25. src/stackit/valkey/models/list_offerings_response.py +99 -0
  26. src/stackit/valkey/models/list_restores_response.py +99 -0
  27. src/stackit/valkey/models/model_schema.py +82 -0
  28. src/stackit/valkey/models/offering.py +135 -0
  29. src/stackit/valkey/models/partial_update_instance_payload.py +97 -0
  30. src/stackit/valkey/models/plan.py +100 -0
  31. src/stackit/valkey/models/raw_credentials.py +89 -0
  32. src/stackit/valkey/models/restore.py +94 -0
  33. src/stackit/valkey/models/trigger_restore_response.py +82 -0
  34. src/stackit/valkey/models/update_backups_config_payload.py +82 -0
  35. src/stackit/valkey/models/update_backups_config_response.py +82 -0
  36. src/stackit/valkey/py.typed +0 -0
  37. src/stackit/valkey/rest.py +163 -0
  38. stackit_valkey-0.0.1.dist-info/METADATA +46 -0
  39. stackit_valkey-0.0.1.dist-info/RECORD +40 -0
  40. stackit_valkey-0.0.1.dist-info/WHEEL +4 -0
@@ -0,0 +1,135 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Key Value Store API
5
+
6
+ The STACKIT Key Value Store API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects.
7
+
8
+ The version of the OpenAPI document: 2.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 (
21
+ BaseModel,
22
+ ConfigDict,
23
+ Field,
24
+ StrictBool,
25
+ StrictInt,
26
+ StrictStr,
27
+ )
28
+ from pydantic_core import to_jsonable_python
29
+ from typing_extensions import Self
30
+
31
+ from stackit.valkey.models.instance_schema import InstanceSchema
32
+ from stackit.valkey.models.plan import Plan
33
+
34
+
35
+ class Offering(BaseModel):
36
+ """
37
+ Offering
38
+ """ # noqa: E501
39
+
40
+ description: StrictStr
41
+ documentation_url: StrictStr = Field(alias="documentationUrl")
42
+ image_url: StrictStr = Field(alias="imageUrl")
43
+ latest: StrictBool
44
+ lifecycle: Optional[StrictStr] = None
45
+ name: StrictStr
46
+ plans: List[Plan]
47
+ quota_count: StrictInt = Field(alias="quotaCount")
48
+ var_schema: Optional[InstanceSchema] = Field(default=None, alias="schema")
49
+ version: StrictStr
50
+ __properties: ClassVar[List[str]] = [
51
+ "description",
52
+ "documentationUrl",
53
+ "imageUrl",
54
+ "latest",
55
+ "lifecycle",
56
+ "name",
57
+ "plans",
58
+ "quotaCount",
59
+ "schema",
60
+ "version",
61
+ ]
62
+
63
+ model_config = ConfigDict(
64
+ validate_by_name=True,
65
+ validate_by_alias=True,
66
+ validate_assignment=True,
67
+ protected_namespaces=(),
68
+ )
69
+
70
+ def to_str(self) -> str:
71
+ """Returns the string representation of the model using alias"""
72
+ return pprint.pformat(self.model_dump(by_alias=True))
73
+
74
+ def to_json(self) -> str:
75
+ """Returns the JSON representation of the model using alias"""
76
+ return json.dumps(to_jsonable_python(self.to_dict()))
77
+
78
+ @classmethod
79
+ def from_json(cls, json_str: str) -> Optional[Self]:
80
+ """Create an instance of Offering from a JSON string"""
81
+ return cls.from_dict(json.loads(json_str))
82
+
83
+ def to_dict(self) -> Dict[str, Any]:
84
+ """Return the dictionary representation of the model using alias.
85
+
86
+ This has the following differences from calling pydantic's
87
+ `self.model_dump(by_alias=True)`:
88
+
89
+ * `None` is only added to the output dict for nullable fields that
90
+ were set at model initialization. Other fields with value `None`
91
+ are ignored.
92
+ """
93
+ excluded_fields: Set[str] = set([])
94
+
95
+ _dict = self.model_dump(
96
+ by_alias=True,
97
+ exclude=excluded_fields,
98
+ exclude_none=True,
99
+ )
100
+ # override the default output from pydantic by calling `to_dict()` of each item in plans (list)
101
+ _items = []
102
+ if self.plans:
103
+ for _item_plans in self.plans:
104
+ if _item_plans:
105
+ _items.append(_item_plans.to_dict())
106
+ _dict["plans"] = _items
107
+ # override the default output from pydantic by calling `to_dict()` of var_schema
108
+ if self.var_schema:
109
+ _dict["schema"] = self.var_schema.to_dict()
110
+ return _dict
111
+
112
+ @classmethod
113
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
114
+ """Create an instance of Offering from a dict"""
115
+ if obj is None:
116
+ return None
117
+
118
+ if not isinstance(obj, dict):
119
+ return cls.model_validate(obj)
120
+
121
+ _obj = cls.model_validate(
122
+ {
123
+ "description": obj.get("description"),
124
+ "documentationUrl": obj.get("documentationUrl"),
125
+ "imageUrl": obj.get("imageUrl"),
126
+ "latest": obj.get("latest"),
127
+ "lifecycle": obj.get("lifecycle"),
128
+ "name": obj.get("name"),
129
+ "plans": [Plan.from_dict(_item) for _item in obj["plans"]] if obj.get("plans") is not None else None,
130
+ "quotaCount": obj.get("quotaCount"),
131
+ "schema": InstanceSchema.from_dict(obj["schema"]) if obj.get("schema") is not None else None,
132
+ "version": obj.get("version"),
133
+ }
134
+ )
135
+ return _obj
@@ -0,0 +1,97 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Key Value Store API
5
+
6
+ The STACKIT Key Value Store API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects.
7
+
8
+ The version of the OpenAPI document: 2.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, StrictStr
21
+ from pydantic_core import to_jsonable_python
22
+ from typing_extensions import Self
23
+
24
+ from stackit.valkey.models.instance_parameters import InstanceParameters
25
+
26
+
27
+ class PartialUpdateInstancePayload(BaseModel):
28
+ """
29
+ PartialUpdateInstancePayload
30
+ """ # noqa: E501
31
+
32
+ instance_name: Optional[StrictStr] = Field(default=None, alias="instanceName")
33
+ parameters: Optional[InstanceParameters] = None
34
+ plan_id: Optional[StrictStr] = Field(default=None, alias="planId")
35
+ __properties: ClassVar[List[str]] = ["instanceName", "parameters", "planId"]
36
+
37
+ model_config = ConfigDict(
38
+ validate_by_name=True,
39
+ validate_by_alias=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ return json.dumps(to_jsonable_python(self.to_dict()))
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of PartialUpdateInstancePayload 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 parameters
75
+ if self.parameters:
76
+ _dict["parameters"] = self.parameters.to_dict()
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81
+ """Create an instance of PartialUpdateInstancePayload 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
+ "instanceName": obj.get("instanceName"),
91
+ "parameters": (
92
+ InstanceParameters.from_dict(obj["parameters"]) if obj.get("parameters") is not None else None
93
+ ),
94
+ "planId": obj.get("planId"),
95
+ }
96
+ )
97
+ return _obj
@@ -0,0 +1,100 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Key Value Store API
5
+
6
+ The STACKIT Key Value Store API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects.
7
+
8
+ The version of the OpenAPI document: 2.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 (
21
+ BaseModel,
22
+ ConfigDict,
23
+ Field,
24
+ StrictBool,
25
+ StrictStr,
26
+ )
27
+ from pydantic_core import to_jsonable_python
28
+ from typing_extensions import Self
29
+
30
+
31
+ class Plan(BaseModel):
32
+ """
33
+ Plan
34
+ """ # noqa: E501
35
+
36
+ description: StrictStr
37
+ free: StrictBool
38
+ id: StrictStr
39
+ name: StrictStr
40
+ sku_name: StrictStr = Field(alias="skuName")
41
+ __properties: ClassVar[List[str]] = ["description", "free", "id", "name", "skuName"]
42
+
43
+ model_config = ConfigDict(
44
+ validate_by_name=True,
45
+ validate_by_alias=True,
46
+ validate_assignment=True,
47
+ protected_namespaces=(),
48
+ )
49
+
50
+ def to_str(self) -> str:
51
+ """Returns the string representation of the model using alias"""
52
+ return pprint.pformat(self.model_dump(by_alias=True))
53
+
54
+ def to_json(self) -> str:
55
+ """Returns the JSON representation of the model using alias"""
56
+ return json.dumps(to_jsonable_python(self.to_dict()))
57
+
58
+ @classmethod
59
+ def from_json(cls, json_str: str) -> Optional[Self]:
60
+ """Create an instance of Plan from a JSON string"""
61
+ return cls.from_dict(json.loads(json_str))
62
+
63
+ def to_dict(self) -> Dict[str, Any]:
64
+ """Return the dictionary representation of the model using alias.
65
+
66
+ This has the following differences from calling pydantic's
67
+ `self.model_dump(by_alias=True)`:
68
+
69
+ * `None` is only added to the output dict for nullable fields that
70
+ were set at model initialization. Other fields with value `None`
71
+ are ignored.
72
+ """
73
+ excluded_fields: Set[str] = set([])
74
+
75
+ _dict = self.model_dump(
76
+ by_alias=True,
77
+ exclude=excluded_fields,
78
+ exclude_none=True,
79
+ )
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of Plan from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate(
92
+ {
93
+ "description": obj.get("description"),
94
+ "free": obj.get("free"),
95
+ "id": obj.get("id"),
96
+ "name": obj.get("name"),
97
+ "skuName": obj.get("skuName"),
98
+ }
99
+ )
100
+ return _obj
@@ -0,0 +1,89 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Key Value Store API
5
+
6
+ The STACKIT Key Value Store API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects.
7
+
8
+ The version of the OpenAPI document: 2.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
21
+ from pydantic_core import to_jsonable_python
22
+ from typing_extensions import Self
23
+
24
+ from stackit.valkey.models.credentials import Credentials
25
+
26
+
27
+ class RawCredentials(BaseModel):
28
+ """
29
+ RawCredentials
30
+ """ # noqa: E501
31
+
32
+ credentials: Credentials
33
+ __properties: ClassVar[List[str]] = ["credentials"]
34
+
35
+ model_config = ConfigDict(
36
+ validate_by_name=True,
37
+ validate_by_alias=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
+ return json.dumps(to_jsonable_python(self.to_dict()))
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of RawCredentials 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
+ # override the default output from pydantic by calling `to_dict()` of credentials
73
+ if self.credentials:
74
+ _dict["credentials"] = self.credentials.to_dict()
75
+ return _dict
76
+
77
+ @classmethod
78
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79
+ """Create an instance of RawCredentials 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
+ {"credentials": Credentials.from_dict(obj["credentials"]) if obj.get("credentials") is not None else None}
88
+ )
89
+ return _obj
@@ -0,0 +1,94 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Key Value Store API
5
+
6
+ The STACKIT Key Value Store API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects.
7
+
8
+ The version of the OpenAPI document: 2.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, StrictInt, StrictStr
21
+ from pydantic_core import to_jsonable_python
22
+ from typing_extensions import Self
23
+
24
+
25
+ class Restore(BaseModel):
26
+ """
27
+ Restore
28
+ """ # noqa: E501
29
+
30
+ backup_id: StrictInt
31
+ finished_at: StrictStr
32
+ id: StrictInt
33
+ status: StrictStr
34
+ triggered_at: Optional[StrictStr] = None
35
+ __properties: ClassVar[List[str]] = ["backup_id", "finished_at", "id", "status", "triggered_at"]
36
+
37
+ model_config = ConfigDict(
38
+ validate_by_name=True,
39
+ validate_by_alias=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ return json.dumps(to_jsonable_python(self.to_dict()))
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of Restore 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 Restore 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
+ "backup_id": obj.get("backup_id"),
88
+ "finished_at": obj.get("finished_at"),
89
+ "id": obj.get("id"),
90
+ "status": obj.get("status"),
91
+ "triggered_at": obj.get("triggered_at"),
92
+ }
93
+ )
94
+ return _obj
@@ -0,0 +1,82 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Key Value Store API
5
+
6
+ The STACKIT Key Value Store API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects.
7
+
8
+ The version of the OpenAPI document: 2.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, StrictInt
21
+ from pydantic_core import to_jsonable_python
22
+ from typing_extensions import Self
23
+
24
+
25
+ class TriggerRestoreResponse(BaseModel):
26
+ """
27
+ TriggerRestoreResponse
28
+ """ # noqa: E501
29
+
30
+ id: StrictInt
31
+ __properties: ClassVar[List[str]] = ["id"]
32
+
33
+ model_config = ConfigDict(
34
+ validate_by_name=True,
35
+ validate_by_alias=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ return json.dumps(to_jsonable_python(self.to_dict()))
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of TriggerRestoreResponse from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([])
64
+
65
+ _dict = self.model_dump(
66
+ by_alias=True,
67
+ exclude=excluded_fields,
68
+ exclude_none=True,
69
+ )
70
+ return _dict
71
+
72
+ @classmethod
73
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
74
+ """Create an instance of TriggerRestoreResponse from a dict"""
75
+ if obj is None:
76
+ return None
77
+
78
+ if not isinstance(obj, dict):
79
+ return cls.model_validate(obj)
80
+
81
+ _obj = cls.model_validate({"id": obj.get("id")})
82
+ return _obj
@@ -0,0 +1,82 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Key Value Store API
5
+
6
+ The STACKIT Key Value Store API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects.
7
+
8
+ The version of the OpenAPI document: 2.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, StrictStr
21
+ from pydantic_core import to_jsonable_python
22
+ from typing_extensions import Self
23
+
24
+
25
+ class UpdateBackupsConfigPayload(BaseModel):
26
+ """
27
+ UpdateBackupsConfigPayload
28
+ """ # noqa: E501
29
+
30
+ encryption_key: Optional[StrictStr] = None
31
+ __properties: ClassVar[List[str]] = ["encryption_key"]
32
+
33
+ model_config = ConfigDict(
34
+ validate_by_name=True,
35
+ validate_by_alias=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ return json.dumps(to_jsonable_python(self.to_dict()))
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of UpdateBackupsConfigPayload from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([])
64
+
65
+ _dict = self.model_dump(
66
+ by_alias=True,
67
+ exclude=excluded_fields,
68
+ exclude_none=True,
69
+ )
70
+ return _dict
71
+
72
+ @classmethod
73
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
74
+ """Create an instance of UpdateBackupsConfigPayload from a dict"""
75
+ if obj is None:
76
+ return None
77
+
78
+ if not isinstance(obj, dict):
79
+ return cls.model_validate(obj)
80
+
81
+ _obj = cls.model_validate({"encryption_key": obj.get("encryption_key")})
82
+ return _obj