stackit-sqlserverflex 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/sqlserverflex/__init__.py +107 -0
  2. stackit/sqlserverflex/api/__init__.py +4 -0
  3. stackit/sqlserverflex/api/default_api.py +7045 -0
  4. stackit/sqlserverflex/api_client.py +627 -0
  5. stackit/sqlserverflex/api_response.py +23 -0
  6. stackit/sqlserverflex/configuration.py +112 -0
  7. stackit/sqlserverflex/exceptions.py +199 -0
  8. stackit/sqlserverflex/models/__init__.py +88 -0
  9. stackit/sqlserverflex/models/acl.py +82 -0
  10. stackit/sqlserverflex/models/backup.py +100 -0
  11. stackit/sqlserverflex/models/backup_list_backups_response_grouped.py +99 -0
  12. stackit/sqlserverflex/models/create_database_payload.py +99 -0
  13. stackit/sqlserverflex/models/create_database_response.py +82 -0
  14. stackit/sqlserverflex/models/create_instance_payload.py +141 -0
  15. stackit/sqlserverflex/models/create_instance_response.py +82 -0
  16. stackit/sqlserverflex/models/create_user_payload.py +90 -0
  17. stackit/sqlserverflex/models/create_user_response.py +87 -0
  18. stackit/sqlserverflex/models/database.py +84 -0
  19. stackit/sqlserverflex/models/database_documentation_create_database_request_options.py +92 -0
  20. stackit/sqlserverflex/models/database_options.py +94 -0
  21. stackit/sqlserverflex/models/flavor.py +92 -0
  22. stackit/sqlserverflex/models/get_backup_response.py +100 -0
  23. stackit/sqlserverflex/models/get_database_response.py +89 -0
  24. stackit/sqlserverflex/models/get_instance_response.py +87 -0
  25. stackit/sqlserverflex/models/get_user_response.py +89 -0
  26. stackit/sqlserverflex/models/instance.py +128 -0
  27. stackit/sqlserverflex/models/instance_documentation_acl.py +82 -0
  28. stackit/sqlserverflex/models/instance_documentation_options.py +92 -0
  29. stackit/sqlserverflex/models/instance_documentation_storage.py +90 -0
  30. stackit/sqlserverflex/models/instance_error.py +94 -0
  31. stackit/sqlserverflex/models/instance_flavor_entry.py +94 -0
  32. stackit/sqlserverflex/models/instance_list_instance.py +84 -0
  33. stackit/sqlserverflex/models/instance_list_user.py +83 -0
  34. stackit/sqlserverflex/models/list_backups_response.py +101 -0
  35. stackit/sqlserverflex/models/list_collations_response.py +99 -0
  36. stackit/sqlserverflex/models/list_compatibility_response.py +101 -0
  37. stackit/sqlserverflex/models/list_databases_response.py +99 -0
  38. stackit/sqlserverflex/models/list_flavors_response.py +99 -0
  39. stackit/sqlserverflex/models/list_instances_response.py +101 -0
  40. stackit/sqlserverflex/models/list_restore_jobs_response.py +99 -0
  41. stackit/sqlserverflex/models/list_roles_response.py +82 -0
  42. stackit/sqlserverflex/models/list_storages_response.py +95 -0
  43. stackit/sqlserverflex/models/list_users_response.py +101 -0
  44. stackit/sqlserverflex/models/list_versions_response.py +82 -0
  45. stackit/sqlserverflex/models/mssql_database_collation.py +83 -0
  46. stackit/sqlserverflex/models/mssql_database_compatibility.py +85 -0
  47. stackit/sqlserverflex/models/partial_update_instance_payload.py +110 -0
  48. stackit/sqlserverflex/models/reset_user_response.py +87 -0
  49. stackit/sqlserverflex/models/restore_running_restore.py +100 -0
  50. stackit/sqlserverflex/models/single_database.py +95 -0
  51. stackit/sqlserverflex/models/single_user.py +109 -0
  52. stackit/sqlserverflex/models/storage.py +83 -0
  53. stackit/sqlserverflex/models/storage_range.py +83 -0
  54. stackit/sqlserverflex/models/trigger_database_restore_payload.py +85 -0
  55. stackit/sqlserverflex/models/type.py +41 -0
  56. stackit/sqlserverflex/models/update_instance_payload.py +108 -0
  57. stackit/sqlserverflex/models/update_instance_response.py +87 -0
  58. stackit/sqlserverflex/models/user.py +100 -0
  59. stackit/sqlserverflex/models/user_response_user.py +96 -0
  60. stackit/sqlserverflex/py.typed +0 -0
  61. stackit/sqlserverflex/rest.py +149 -0
  62. stackit_sqlserverflex-0.0.1a0.dist-info/METADATA +45 -0
  63. stackit_sqlserverflex-0.0.1a0.dist-info/RECORD +64 -0
  64. stackit_sqlserverflex-0.0.1a0.dist-info/WHEEL +4 -0
@@ -0,0 +1,110 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT MSSQL Service API
5
+
6
+ This is the documentation for the STACKIT MSSQL service
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, Field, StrictStr
22
+ from typing_extensions import Self
23
+
24
+ from stackit.sqlserverflex.models.instance_documentation_acl import (
25
+ InstanceDocumentationACL,
26
+ )
27
+
28
+
29
+ class PartialUpdateInstancePayload(BaseModel):
30
+ """
31
+ PartialUpdateInstancePayload
32
+ """
33
+
34
+ acl: Optional[InstanceDocumentationACL] = Field(
35
+ default=None,
36
+ description="ACL is the Access Control List defining the IP ranges allowed to connect to the database",
37
+ )
38
+ backup_schedule: Optional[StrictStr] = Field(
39
+ default=None,
40
+ description="Cronjob for the daily full backup if not provided a job will generated between 00:00 and 04:59",
41
+ alias="backupSchedule",
42
+ )
43
+ flavor_id: Optional[StrictStr] = Field(default=None, description="Id of the selected flavor", alias="flavorId")
44
+ labels: Optional[Dict[str, Any]] = Field(default=None, description="Labels for the instance")
45
+ name: Optional[StrictStr] = Field(default=None, description="Name of the instance")
46
+ version: Optional[StrictStr] = Field(default="2022", description="Version of the MSSQL Server")
47
+ __properties: ClassVar[List[str]] = ["acl", "backupSchedule", "flavorId", "labels", "name", "version"]
48
+
49
+ model_config = ConfigDict(
50
+ populate_by_name=True,
51
+ validate_assignment=True,
52
+ protected_namespaces=(),
53
+ )
54
+
55
+ def to_str(self) -> str:
56
+ """Returns the string representation of the model using alias"""
57
+ return pprint.pformat(self.model_dump(by_alias=True))
58
+
59
+ def to_json(self) -> str:
60
+ """Returns the JSON representation of the model using alias"""
61
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
62
+ return json.dumps(self.to_dict())
63
+
64
+ @classmethod
65
+ def from_json(cls, json_str: str) -> Optional[Self]:
66
+ """Create an instance of PartialUpdateInstancePayload from a JSON string"""
67
+ return cls.from_dict(json.loads(json_str))
68
+
69
+ def to_dict(self) -> Dict[str, Any]:
70
+ """Return the dictionary representation of the model using alias.
71
+
72
+ This has the following differences from calling pydantic's
73
+ `self.model_dump(by_alias=True)`:
74
+
75
+ * `None` is only added to the output dict for nullable fields that
76
+ were set at model initialization. Other fields with value `None`
77
+ are ignored.
78
+ """
79
+ excluded_fields: Set[str] = set([])
80
+
81
+ _dict = self.model_dump(
82
+ by_alias=True,
83
+ exclude=excluded_fields,
84
+ exclude_none=True,
85
+ )
86
+ # override the default output from pydantic by calling `to_dict()` of acl
87
+ if self.acl:
88
+ _dict["acl"] = self.acl.to_dict()
89
+ return _dict
90
+
91
+ @classmethod
92
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93
+ """Create an instance of PartialUpdateInstancePayload from a dict"""
94
+ if obj is None:
95
+ return None
96
+
97
+ if not isinstance(obj, dict):
98
+ return cls.model_validate(obj)
99
+
100
+ _obj = cls.model_validate(
101
+ {
102
+ "acl": InstanceDocumentationACL.from_dict(obj["acl"]) if obj.get("acl") is not None else None,
103
+ "backupSchedule": obj.get("backupSchedule"),
104
+ "flavorId": obj.get("flavorId"),
105
+ "labels": obj.get("labels"),
106
+ "name": obj.get("name"),
107
+ "version": obj.get("version") if obj.get("version") is not None else "2022",
108
+ }
109
+ )
110
+ return _obj
@@ -0,0 +1,87 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT MSSQL Service API
5
+
6
+ This is the documentation for the STACKIT MSSQL service
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.sqlserverflex.models.single_user import SingleUser
25
+
26
+
27
+ class ResetUserResponse(BaseModel):
28
+ """
29
+ ResetUserResponse
30
+ """
31
+
32
+ item: Optional[SingleUser] = None
33
+ __properties: ClassVar[List[str]] = ["item"]
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 ResetUserResponse 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 item
73
+ if self.item:
74
+ _dict["item"] = self.item.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 ResetUserResponse 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({"item": SingleUser.from_dict(obj["item"]) if obj.get("item") is not None else None})
87
+ return _obj
@@ -0,0 +1,100 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT MSSQL Service API
5
+
6
+ This is the documentation for the STACKIT MSSQL service
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 RestoreRunningRestore(BaseModel):
26
+ """
27
+ RestoreRunningRestore
28
+ """
29
+
30
+ command: Optional[StrictStr] = None
31
+ database_name: Optional[StrictStr] = None
32
+ estimated_completion_time: Optional[StrictStr] = None
33
+ percent_complete: Optional[StrictInt] = None
34
+ start_time: Optional[StrictStr] = None
35
+ __properties: ClassVar[List[str]] = [
36
+ "command",
37
+ "database_name",
38
+ "estimated_completion_time",
39
+ "percent_complete",
40
+ "start_time",
41
+ ]
42
+
43
+ model_config = ConfigDict(
44
+ populate_by_name=True,
45
+ validate_assignment=True,
46
+ protected_namespaces=(),
47
+ )
48
+
49
+ def to_str(self) -> str:
50
+ """Returns the string representation of the model using alias"""
51
+ return pprint.pformat(self.model_dump(by_alias=True))
52
+
53
+ def to_json(self) -> str:
54
+ """Returns the JSON representation of the model using alias"""
55
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
56
+ return json.dumps(self.to_dict())
57
+
58
+ @classmethod
59
+ def from_json(cls, json_str: str) -> Optional[Self]:
60
+ """Create an instance of RestoreRunningRestore 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 RestoreRunningRestore 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
+ "command": obj.get("command"),
94
+ "database_name": obj.get("database_name"),
95
+ "estimated_completion_time": obj.get("estimated_completion_time"),
96
+ "percent_complete": obj.get("percent_complete"),
97
+ "start_time": obj.get("start_time"),
98
+ }
99
+ )
100
+ return _obj
@@ -0,0 +1,95 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT MSSQL Service API
5
+
6
+ This is the documentation for the STACKIT MSSQL service
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, Field, StrictStr
22
+ from typing_extensions import Self
23
+
24
+ from stackit.sqlserverflex.models.database_options import DatabaseOptions
25
+
26
+
27
+ class SingleDatabase(BaseModel):
28
+ """
29
+ SingleDatabase
30
+ """
31
+
32
+ id: Optional[StrictStr] = Field(default=None, description="Database id")
33
+ name: Optional[StrictStr] = Field(default=None, description="Database name")
34
+ options: Optional[DatabaseOptions] = Field(default=None, description="Database specific options")
35
+ __properties: ClassVar[List[str]] = ["id", "name", "options"]
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 SingleDatabase 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 options
75
+ if self.options:
76
+ _dict["options"] = self.options.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 SingleDatabase 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
+ "id": obj.get("id"),
91
+ "name": obj.get("name"),
92
+ "options": DatabaseOptions.from_dict(obj["options"]) if obj.get("options") is not None else None,
93
+ }
94
+ )
95
+ return _obj
@@ -0,0 +1,109 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT MSSQL Service API
5
+
6
+ This is the documentation for the STACKIT MSSQL service
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 SingleUser(BaseModel):
26
+ """
27
+ SingleUser
28
+ """
29
+
30
+ default_database: Optional[StrictStr] = None
31
+ host: Optional[StrictStr] = None
32
+ id: Optional[StrictStr] = None
33
+ password: Optional[StrictStr] = None
34
+ port: Optional[StrictInt] = None
35
+ roles: Optional[List[StrictStr]] = None
36
+ uri: Optional[StrictStr] = None
37
+ username: Optional[StrictStr] = None
38
+ __properties: ClassVar[List[str]] = [
39
+ "default_database",
40
+ "host",
41
+ "id",
42
+ "password",
43
+ "port",
44
+ "roles",
45
+ "uri",
46
+ "username",
47
+ ]
48
+
49
+ model_config = ConfigDict(
50
+ populate_by_name=True,
51
+ validate_assignment=True,
52
+ protected_namespaces=(),
53
+ )
54
+
55
+ def to_str(self) -> str:
56
+ """Returns the string representation of the model using alias"""
57
+ return pprint.pformat(self.model_dump(by_alias=True))
58
+
59
+ def to_json(self) -> str:
60
+ """Returns the JSON representation of the model using alias"""
61
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
62
+ return json.dumps(self.to_dict())
63
+
64
+ @classmethod
65
+ def from_json(cls, json_str: str) -> Optional[Self]:
66
+ """Create an instance of SingleUser from a JSON string"""
67
+ return cls.from_dict(json.loads(json_str))
68
+
69
+ def to_dict(self) -> Dict[str, Any]:
70
+ """Return the dictionary representation of the model using alias.
71
+
72
+ This has the following differences from calling pydantic's
73
+ `self.model_dump(by_alias=True)`:
74
+
75
+ * `None` is only added to the output dict for nullable fields that
76
+ were set at model initialization. Other fields with value `None`
77
+ are ignored.
78
+ """
79
+ excluded_fields: Set[str] = set([])
80
+
81
+ _dict = self.model_dump(
82
+ by_alias=True,
83
+ exclude=excluded_fields,
84
+ exclude_none=True,
85
+ )
86
+ return _dict
87
+
88
+ @classmethod
89
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
90
+ """Create an instance of SingleUser from a dict"""
91
+ if obj is None:
92
+ return None
93
+
94
+ if not isinstance(obj, dict):
95
+ return cls.model_validate(obj)
96
+
97
+ _obj = cls.model_validate(
98
+ {
99
+ "default_database": obj.get("default_database"),
100
+ "host": obj.get("host"),
101
+ "id": obj.get("id"),
102
+ "password": obj.get("password"),
103
+ "port": obj.get("port"),
104
+ "roles": obj.get("roles"),
105
+ "uri": obj.get("uri"),
106
+ "username": obj.get("username"),
107
+ }
108
+ )
109
+ return _obj
@@ -0,0 +1,83 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT MSSQL Service API
5
+
6
+ This is the documentation for the STACKIT MSSQL service
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, Field, StrictInt, StrictStr
22
+ from typing_extensions import Self
23
+
24
+
25
+ class Storage(BaseModel):
26
+ """
27
+ Storage
28
+ """
29
+
30
+ var_class: Optional[StrictStr] = Field(default=None, alias="class")
31
+ size: Optional[StrictInt] = None
32
+ __properties: ClassVar[List[str]] = ["class", "size"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=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
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of Storage from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of Storage from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({"class": obj.get("class"), "size": obj.get("size")})
83
+ return _obj
@@ -0,0 +1,83 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT MSSQL Service API
5
+
6
+ This is the documentation for the STACKIT MSSQL service
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
+
25
+ class StorageRange(BaseModel):
26
+ """
27
+ StorageRange
28
+ """
29
+
30
+ max: Optional[StrictInt] = None
31
+ min: Optional[StrictInt] = None
32
+ __properties: ClassVar[List[str]] = ["max", "min"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=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
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of StorageRange from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of StorageRange from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({"max": obj.get("max"), "min": obj.get("min")})
83
+ return _obj