stackit-mongodbflex 0.0.1a0__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 (64) hide show
  1. stackit/mongodbflex/__init__.py +103 -0
  2. stackit/mongodbflex/api/__init__.py +4 -0
  3. stackit/mongodbflex/api/default_api.py +6867 -0
  4. stackit/mongodbflex/api_client.py +627 -0
  5. stackit/mongodbflex/api_response.py +23 -0
  6. stackit/mongodbflex/configuration.py +112 -0
  7. stackit/mongodbflex/exceptions.py +199 -0
  8. stackit/mongodbflex/models/__init__.py +84 -0
  9. stackit/mongodbflex/models/acl.py +82 -0
  10. stackit/mongodbflex/models/backup.py +100 -0
  11. stackit/mongodbflex/models/backup_schedule.py +103 -0
  12. stackit/mongodbflex/models/clone_instance_payload.py +83 -0
  13. stackit/mongodbflex/models/clone_instance_response.py +82 -0
  14. stackit/mongodbflex/models/create_instance_payload.py +121 -0
  15. stackit/mongodbflex/models/create_instance_response.py +82 -0
  16. stackit/mongodbflex/models/create_user_payload.py +86 -0
  17. stackit/mongodbflex/models/create_user_response.py +87 -0
  18. stackit/mongodbflex/models/data_point.py +83 -0
  19. stackit/mongodbflex/models/error.py +92 -0
  20. stackit/mongodbflex/models/flavor.py +92 -0
  21. stackit/mongodbflex/models/get_backup_response.py +87 -0
  22. stackit/mongodbflex/models/get_instance_response.py +87 -0
  23. stackit/mongodbflex/models/get_user_response.py +89 -0
  24. stackit/mongodbflex/models/handlers_infra_flavor.py +94 -0
  25. stackit/mongodbflex/models/handlers_infra_get_flavors_response.py +99 -0
  26. stackit/mongodbflex/models/handlers_instances_get_instance_response.py +87 -0
  27. stackit/mongodbflex/models/handlers_instances_slow_queries_response.py +103 -0
  28. stackit/mongodbflex/models/handlers_instances_suggested_indexes_response.py +118 -0
  29. stackit/mongodbflex/models/host.py +101 -0
  30. stackit/mongodbflex/models/host_metric.py +103 -0
  31. stackit/mongodbflex/models/instance.py +128 -0
  32. stackit/mongodbflex/models/instance_list_instance.py +84 -0
  33. stackit/mongodbflex/models/instance_response_user.py +96 -0
  34. stackit/mongodbflex/models/list_backups_response.py +97 -0
  35. stackit/mongodbflex/models/list_flavors_response.py +99 -0
  36. stackit/mongodbflex/models/list_instances_response.py +101 -0
  37. stackit/mongodbflex/models/list_metrics_response.py +93 -0
  38. stackit/mongodbflex/models/list_restore_jobs_response.py +99 -0
  39. stackit/mongodbflex/models/list_storages_response.py +95 -0
  40. stackit/mongodbflex/models/list_user.py +83 -0
  41. stackit/mongodbflex/models/list_users_response.py +99 -0
  42. stackit/mongodbflex/models/list_versions_response.py +82 -0
  43. stackit/mongodbflex/models/mongodbatlas_operation.py +97 -0
  44. stackit/mongodbflex/models/mongodbatlas_stats.py +98 -0
  45. stackit/mongodbflex/models/partial_update_instance_payload.py +121 -0
  46. stackit/mongodbflex/models/partial_update_user_payload.py +83 -0
  47. stackit/mongodbflex/models/restore_instance_payload.py +83 -0
  48. stackit/mongodbflex/models/restore_instance_response.py +89 -0
  49. stackit/mongodbflex/models/restore_instance_status.py +94 -0
  50. stackit/mongodbflex/models/shape.py +122 -0
  51. stackit/mongodbflex/models/slow_query.py +83 -0
  52. stackit/mongodbflex/models/storage.py +83 -0
  53. stackit/mongodbflex/models/storage_range.py +83 -0
  54. stackit/mongodbflex/models/suggested_index.py +102 -0
  55. stackit/mongodbflex/models/update_backup_schedule_payload.py +103 -0
  56. stackit/mongodbflex/models/update_instance_payload.py +121 -0
  57. stackit/mongodbflex/models/update_instance_response.py +87 -0
  58. stackit/mongodbflex/models/update_user_payload.py +83 -0
  59. stackit/mongodbflex/models/user.py +100 -0
  60. stackit/mongodbflex/py.typed +0 -0
  61. stackit/mongodbflex/rest.py +149 -0
  62. stackit_mongodbflex-0.0.1a0.dist-info/METADATA +45 -0
  63. stackit_mongodbflex-0.0.1a0.dist-info/RECORD +64 -0
  64. stackit_mongodbflex-0.0.1a0.dist-info/WHEEL +4 -0
@@ -0,0 +1,84 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT MongoDB Service API
5
+
6
+ This is the documentation for the STACKIT MongoDB Flex Service API
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 docstring might be too long
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, StrictStr
22
+ from typing_extensions import Self
23
+
24
+
25
+ class InstanceListInstance(BaseModel):
26
+ """
27
+ InstanceListInstance
28
+ """
29
+
30
+ id: Optional[StrictStr] = None
31
+ name: Optional[StrictStr] = None
32
+ status: Optional[StrictStr] = None
33
+ __properties: ClassVar[List[str]] = ["id", "name", "status"]
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 InstanceListInstance 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
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of InstanceListInstance from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj)
82
+
83
+ _obj = cls.model_validate({"id": obj.get("id"), "name": obj.get("name"), "status": obj.get("status")})
84
+ return _obj
@@ -0,0 +1,96 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT MongoDB Service API
5
+
6
+ This is the documentation for the STACKIT MongoDB Flex Service API
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 docstring might be too long
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, StrictInt, StrictStr
22
+ from typing_extensions import Self
23
+
24
+
25
+ class InstanceResponseUser(BaseModel):
26
+ """
27
+ InstanceResponseUser
28
+ """
29
+
30
+ database: Optional[StrictStr] = None
31
+ host: Optional[StrictStr] = None
32
+ id: Optional[StrictStr] = None
33
+ port: Optional[StrictInt] = None
34
+ roles: Optional[List[StrictStr]] = None
35
+ username: Optional[StrictStr] = None
36
+ __properties: ClassVar[List[str]] = ["database", "host", "id", "port", "roles", "username"]
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 InstanceResponseUser from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([])
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ return _dict
76
+
77
+ @classmethod
78
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79
+ """Create an instance of InstanceResponseUser from a dict"""
80
+ if obj is None:
81
+ return None
82
+
83
+ if not isinstance(obj, dict):
84
+ return cls.model_validate(obj)
85
+
86
+ _obj = cls.model_validate(
87
+ {
88
+ "database": obj.get("database"),
89
+ "host": obj.get("host"),
90
+ "id": obj.get("id"),
91
+ "port": obj.get("port"),
92
+ "roles": obj.get("roles"),
93
+ "username": obj.get("username"),
94
+ }
95
+ )
96
+ return _obj
@@ -0,0 +1,97 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT MongoDB Service API
5
+
6
+ This is the documentation for the STACKIT MongoDB Flex Service API
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 docstring might be too long
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, StrictInt
22
+ from typing_extensions import Self
23
+
24
+ from stackit.mongodbflex.models.backup import Backup
25
+
26
+
27
+ class ListBackupsResponse(BaseModel):
28
+ """
29
+ ListBackupsResponse
30
+ """
31
+
32
+ count: Optional[StrictInt] = None
33
+ items: Optional[List[Backup]] = None
34
+ __properties: ClassVar[List[str]] = ["count", "items"]
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 ListBackupsResponse 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
+ # override the default output from pydantic by calling `to_dict()` of each item in items (list)
74
+ _items = []
75
+ if self.items:
76
+ for _item in self.items:
77
+ if _item:
78
+ _items.append(_item.to_dict())
79
+ _dict["items"] = _items
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of ListBackupsResponse 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
+ "count": obj.get("count"),
94
+ "items": [Backup.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
95
+ }
96
+ )
97
+ return _obj
@@ -0,0 +1,99 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT MongoDB Service API
5
+
6
+ This is the documentation for the STACKIT MongoDB Flex Service API
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 docstring might be too long
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.mongodbflex.models.handlers_infra_flavor import HandlersInfraFlavor
25
+
26
+
27
+ class ListFlavorsResponse(BaseModel):
28
+ """
29
+ ListFlavorsResponse
30
+ """
31
+
32
+ flavors: Optional[List[HandlersInfraFlavor]] = None
33
+ __properties: ClassVar[List[str]] = ["flavors"]
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 ListFlavorsResponse 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 each item in flavors (list)
73
+ _items = []
74
+ if self.flavors:
75
+ for _item in self.flavors:
76
+ if _item:
77
+ _items.append(_item.to_dict())
78
+ _dict["flavors"] = _items
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of ListFlavorsResponse 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
+ "flavors": (
93
+ [HandlersInfraFlavor.from_dict(_item) for _item in obj["flavors"]]
94
+ if obj.get("flavors") is not None
95
+ else None
96
+ )
97
+ }
98
+ )
99
+ return _obj
@@ -0,0 +1,101 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT MongoDB Service API
5
+
6
+ This is the documentation for the STACKIT MongoDB Flex Service API
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 docstring might be too long
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, StrictInt
22
+ from typing_extensions import Self
23
+
24
+ from stackit.mongodbflex.models.instance_list_instance import InstanceListInstance
25
+
26
+
27
+ class ListInstancesResponse(BaseModel):
28
+ """
29
+ ListInstancesResponse
30
+ """
31
+
32
+ count: Optional[StrictInt] = None
33
+ items: Optional[List[InstanceListInstance]] = None
34
+ __properties: ClassVar[List[str]] = ["count", "items"]
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 ListInstancesResponse 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
+ # override the default output from pydantic by calling `to_dict()` of each item in items (list)
74
+ _items = []
75
+ if self.items:
76
+ for _item in self.items:
77
+ if _item:
78
+ _items.append(_item.to_dict())
79
+ _dict["items"] = _items
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of ListInstancesResponse 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
+ "count": obj.get("count"),
94
+ "items": (
95
+ [InstanceListInstance.from_dict(_item) for _item in obj["items"]]
96
+ if obj.get("items") is not None
97
+ else None
98
+ ),
99
+ }
100
+ )
101
+ return _obj
@@ -0,0 +1,93 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT MongoDB Service API
5
+
6
+ This is the documentation for the STACKIT MongoDB Flex Service API
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 docstring might be too long
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.mongodbflex.models.host import Host
25
+
26
+
27
+ class ListMetricsResponse(BaseModel):
28
+ """
29
+ ListMetricsResponse
30
+ """
31
+
32
+ hosts: Optional[List[Host]] = None
33
+ __properties: ClassVar[List[str]] = ["hosts"]
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 ListMetricsResponse 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 each item in hosts (list)
73
+ _items = []
74
+ if self.hosts:
75
+ for _item in self.hosts:
76
+ if _item:
77
+ _items.append(_item.to_dict())
78
+ _dict["hosts"] = _items
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of ListMetricsResponse 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
+ {"hosts": [Host.from_dict(_item) for _item in obj["hosts"]] if obj.get("hosts") is not None else None}
92
+ )
93
+ return _obj
@@ -0,0 +1,99 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT MongoDB Service API
5
+
6
+ This is the documentation for the STACKIT MongoDB Flex Service API
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 docstring might be too long
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.mongodbflex.models.restore_instance_status import RestoreInstanceStatus
25
+
26
+
27
+ class ListRestoreJobsResponse(BaseModel):
28
+ """
29
+ ListRestoreJobsResponse
30
+ """
31
+
32
+ items: Optional[List[RestoreInstanceStatus]] = None
33
+ __properties: ClassVar[List[str]] = ["items"]
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 ListRestoreJobsResponse 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 each item in items (list)
73
+ _items = []
74
+ if self.items:
75
+ for _item in self.items:
76
+ if _item:
77
+ _items.append(_item.to_dict())
78
+ _dict["items"] = _items
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of ListRestoreJobsResponse 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
+ "items": (
93
+ [RestoreInstanceStatus.from_dict(_item) for _item in obj["items"]]
94
+ if obj.get("items") is not None
95
+ else None
96
+ )
97
+ }
98
+ )
99
+ return _obj