Skip to content

Commit fd7c004

Browse files
Generate sqlserverflex
1 parent 415d2dc commit fd7c004

File tree

7 files changed

+782
-0
lines changed

7 files changed

+782
-0
lines changed

services/sqlserverflex/src/stackit/sqlserverflex/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
from stackit.sqlserverflex.models.create_instance_response import CreateInstanceResponse
4646
from stackit.sqlserverflex.models.create_user_payload import CreateUserPayload
4747
from stackit.sqlserverflex.models.create_user_response import CreateUserResponse
48+
from stackit.sqlserverflex.models.data_point import DataPoint
4849
from stackit.sqlserverflex.models.database import Database
4950
from stackit.sqlserverflex.models.database_documentation_create_database_request_options import (
5051
DatabaseDocumentationCreateDatabaseRequestOptions,
@@ -55,6 +56,8 @@
5556
from stackit.sqlserverflex.models.get_database_response import GetDatabaseResponse
5657
from stackit.sqlserverflex.models.get_instance_response import GetInstanceResponse
5758
from stackit.sqlserverflex.models.get_user_response import GetUserResponse
59+
from stackit.sqlserverflex.models.host import Host
60+
from stackit.sqlserverflex.models.host_metric import HostMetric
5861
from stackit.sqlserverflex.models.instance import Instance
5962
from stackit.sqlserverflex.models.instance_documentation_acl import (
6063
InstanceDocumentationACL,
@@ -77,6 +80,7 @@
7780
from stackit.sqlserverflex.models.list_databases_response import ListDatabasesResponse
7881
from stackit.sqlserverflex.models.list_flavors_response import ListFlavorsResponse
7982
from stackit.sqlserverflex.models.list_instances_response import ListInstancesResponse
83+
from stackit.sqlserverflex.models.list_metrics_response import ListMetricsResponse
8084
from stackit.sqlserverflex.models.list_restore_jobs_response import (
8185
ListRestoreJobsResponse,
8286
)

services/sqlserverflex/src/stackit/sqlserverflex/api/default_api.py

+394
Large diffs are not rendered by default.

services/sqlserverflex/src/stackit/sqlserverflex/models/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from stackit.sqlserverflex.models.create_instance_response import CreateInstanceResponse
2727
from stackit.sqlserverflex.models.create_user_payload import CreateUserPayload
2828
from stackit.sqlserverflex.models.create_user_response import CreateUserResponse
29+
from stackit.sqlserverflex.models.data_point import DataPoint
2930
from stackit.sqlserverflex.models.database import Database
3031
from stackit.sqlserverflex.models.database_documentation_create_database_request_options import (
3132
DatabaseDocumentationCreateDatabaseRequestOptions,
@@ -36,6 +37,8 @@
3637
from stackit.sqlserverflex.models.get_database_response import GetDatabaseResponse
3738
from stackit.sqlserverflex.models.get_instance_response import GetInstanceResponse
3839
from stackit.sqlserverflex.models.get_user_response import GetUserResponse
40+
from stackit.sqlserverflex.models.host import Host
41+
from stackit.sqlserverflex.models.host_metric import HostMetric
3942
from stackit.sqlserverflex.models.instance import Instance
4043
from stackit.sqlserverflex.models.instance_documentation_acl import (
4144
InstanceDocumentationACL,
@@ -58,6 +61,7 @@
5861
from stackit.sqlserverflex.models.list_databases_response import ListDatabasesResponse
5962
from stackit.sqlserverflex.models.list_flavors_response import ListFlavorsResponse
6063
from stackit.sqlserverflex.models.list_instances_response import ListInstancesResponse
64+
from stackit.sqlserverflex.models.list_metrics_response import ListMetricsResponse
6165
from stackit.sqlserverflex.models.list_restore_jobs_response import (
6266
ListRestoreJobsResponse,
6367
)
Original file line numberDiff line numberDiff line change
@@ -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: 2.0.0
9+
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, Union
20+
21+
from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
22+
from typing_extensions import Self
23+
24+
25+
class DataPoint(BaseModel):
26+
"""
27+
DataPoint
28+
"""
29+
30+
timestamp: Optional[StrictStr] = None
31+
value: Optional[Union[StrictFloat, StrictInt]] = None
32+
__properties: ClassVar[List[str]] = ["timestamp", "value"]
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 DataPoint 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 DataPoint 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({"timestamp": obj.get("timestamp"), "value": obj.get("value")})
83+
return _obj
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
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: 2.0.0
9+
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.host_metric import HostMetric
25+
26+
27+
class Host(BaseModel):
28+
"""
29+
Host
30+
"""
31+
32+
host_metrics: Optional[List[HostMetric]] = Field(default=None, alias="hostMetrics")
33+
id: Optional[StrictStr] = None
34+
__properties: ClassVar[List[str]] = ["hostMetrics", "id"]
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 Host 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 host_metrics (list)
74+
_items = []
75+
if self.host_metrics:
76+
for _item in self.host_metrics:
77+
if _item:
78+
_items.append(_item.to_dict())
79+
_dict["hostMetrics"] = _items
80+
return _dict
81+
82+
@classmethod
83+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84+
"""Create an instance of Host 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+
"hostMetrics": (
94+
[HostMetric.from_dict(_item) for _item in obj["hostMetrics"]]
95+
if obj.get("hostMetrics") is not None
96+
else None
97+
),
98+
"id": obj.get("id"),
99+
}
100+
)
101+
return _obj
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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: 2.0.0
9+
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+
from stackit.sqlserverflex.models.data_point import DataPoint
25+
26+
27+
class HostMetric(BaseModel):
28+
"""
29+
HostMetric
30+
"""
31+
32+
datapoints: Optional[List[DataPoint]] = None
33+
name: Optional[StrictStr] = None
34+
units: Optional[StrictStr] = None
35+
__properties: ClassVar[List[str]] = ["datapoints", "name", "units"]
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 HostMetric 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 each item in datapoints (list)
75+
_items = []
76+
if self.datapoints:
77+
for _item in self.datapoints:
78+
if _item:
79+
_items.append(_item.to_dict())
80+
_dict["datapoints"] = _items
81+
return _dict
82+
83+
@classmethod
84+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85+
"""Create an instance of HostMetric from a dict"""
86+
if obj is None:
87+
return None
88+
89+
if not isinstance(obj, dict):
90+
return cls.model_validate(obj)
91+
92+
_obj = cls.model_validate(
93+
{
94+
"datapoints": (
95+
[DataPoint.from_dict(_item) for _item in obj["datapoints"]]
96+
if obj.get("datapoints") is not None
97+
else None
98+
),
99+
"name": obj.get("name"),
100+
"units": obj.get("units"),
101+
}
102+
)
103+
return _obj

0 commit comments

Comments
 (0)