Skip to content

Generator: Update SDK /services/sqlserverflex #1195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
- **Breaking Change:** Added organization id to `VendorSubscription`
- `ske`: [v0.4.2](services/ske/CHANGELOG.md#v042-2025-05-13)
- **Feature:** Added `ClusterError`
- `sqlserverflex`: [v1.0.2](services/sqlserverflex/CHANGELOG.md#v102-2025-05-14)
- **Feature:** Added new method `list_metrics`

## Release (2025-05-09)
- `stackitmarketplace`:
Expand Down
3 changes: 3 additions & 0 deletions services/sqlserverflex/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v1.0.2 (2025-05-14)
- **Feature:** Add new method `list_metrics`

## v1.0.1 (2025-05-09)
- **Feature:** Update user-agent header

Expand Down
2 changes: 1 addition & 1 deletion services/sqlserverflex/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "stackit-sqlserverflex"

[tool.poetry]
name = "stackit-sqlserverflex"
version = "v1.0.1"
version = "v1.0.2"
authors = [
"STACKIT Developer Tools <[email protected]>",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
from stackit.sqlserverflex.models.create_instance_response import CreateInstanceResponse
from stackit.sqlserverflex.models.create_user_payload import CreateUserPayload
from stackit.sqlserverflex.models.create_user_response import CreateUserResponse
from stackit.sqlserverflex.models.data_point import DataPoint
from stackit.sqlserverflex.models.database import Database
from stackit.sqlserverflex.models.database_documentation_create_database_request_options import (
DatabaseDocumentationCreateDatabaseRequestOptions,
Expand All @@ -55,6 +56,8 @@
from stackit.sqlserverflex.models.get_database_response import GetDatabaseResponse
from stackit.sqlserverflex.models.get_instance_response import GetInstanceResponse
from stackit.sqlserverflex.models.get_user_response import GetUserResponse
from stackit.sqlserverflex.models.host import Host
from stackit.sqlserverflex.models.host_metric import HostMetric
from stackit.sqlserverflex.models.instance import Instance
from stackit.sqlserverflex.models.instance_documentation_acl import (
InstanceDocumentationACL,
Expand All @@ -77,6 +80,7 @@
from stackit.sqlserverflex.models.list_databases_response import ListDatabasesResponse
from stackit.sqlserverflex.models.list_flavors_response import ListFlavorsResponse
from stackit.sqlserverflex.models.list_instances_response import ListInstancesResponse
from stackit.sqlserverflex.models.list_metrics_response import ListMetricsResponse
from stackit.sqlserverflex.models.list_restore_jobs_response import (
ListRestoreJobsResponse,
)
Expand Down
394 changes: 394 additions & 0 deletions services/sqlserverflex/src/stackit/sqlserverflex/api/default_api.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from stackit.sqlserverflex.models.create_instance_response import CreateInstanceResponse
from stackit.sqlserverflex.models.create_user_payload import CreateUserPayload
from stackit.sqlserverflex.models.create_user_response import CreateUserResponse
from stackit.sqlserverflex.models.data_point import DataPoint
from stackit.sqlserverflex.models.database import Database
from stackit.sqlserverflex.models.database_documentation_create_database_request_options import (
DatabaseDocumentationCreateDatabaseRequestOptions,
Expand All @@ -36,6 +37,8 @@
from stackit.sqlserverflex.models.get_database_response import GetDatabaseResponse
from stackit.sqlserverflex.models.get_instance_response import GetInstanceResponse
from stackit.sqlserverflex.models.get_user_response import GetUserResponse
from stackit.sqlserverflex.models.host import Host
from stackit.sqlserverflex.models.host_metric import HostMetric
from stackit.sqlserverflex.models.instance import Instance
from stackit.sqlserverflex.models.instance_documentation_acl import (
InstanceDocumentationACL,
Expand All @@ -58,6 +61,7 @@
from stackit.sqlserverflex.models.list_databases_response import ListDatabasesResponse
from stackit.sqlserverflex.models.list_flavors_response import ListFlavorsResponse
from stackit.sqlserverflex.models.list_instances_response import ListInstancesResponse
from stackit.sqlserverflex.models.list_metrics_response import ListMetricsResponse
from stackit.sqlserverflex.models.list_restore_jobs_response import (
ListRestoreJobsResponse,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# coding: utf-8

"""
STACKIT MSSQL Service API

This is the documentation for the STACKIT MSSQL service

The version of the OpenAPI document: 2.0.0
Contact: [email protected]
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501 docstring might be too long

from __future__ import annotations

import json
import pprint
from typing import Any, ClassVar, Dict, List, Optional, Set, Union

from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
from typing_extensions import Self


class DataPoint(BaseModel):
"""
DataPoint
"""

timestamp: Optional[StrictStr] = None
value: Optional[Union[StrictFloat, StrictInt]] = None
__properties: ClassVar[List[str]] = ["timestamp", "value"]

model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)

def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of DataPoint from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:

* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([])

_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of DataPoint from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate({"timestamp": obj.get("timestamp"), "value": obj.get("value")})
return _obj
101 changes: 101 additions & 0 deletions services/sqlserverflex/src/stackit/sqlserverflex/models/host.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# coding: utf-8

"""
STACKIT MSSQL Service API

This is the documentation for the STACKIT MSSQL service

The version of the OpenAPI document: 2.0.0
Contact: [email protected]
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501 docstring might be too long

from __future__ import annotations

import json
import pprint
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing_extensions import Self

from stackit.sqlserverflex.models.host_metric import HostMetric


class Host(BaseModel):
"""
Host
"""

host_metrics: Optional[List[HostMetric]] = Field(default=None, alias="hostMetrics")
id: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["hostMetrics", "id"]

model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)

def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of Host from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:

* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([])

_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in host_metrics (list)
_items = []
if self.host_metrics:
for _item in self.host_metrics:
if _item:
_items.append(_item.to_dict())
_dict["hostMetrics"] = _items
return _dict

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of Host from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate(
{
"hostMetrics": (
[HostMetric.from_dict(_item) for _item in obj["hostMetrics"]]
if obj.get("hostMetrics") is not None
else None
),
"id": obj.get("id"),
}
)
return _obj
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# coding: utf-8

"""
STACKIT MSSQL Service API

This is the documentation for the STACKIT MSSQL service

The version of the OpenAPI document: 2.0.0
Contact: [email protected]
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501 docstring might be too long

from __future__ import annotations

import json
import pprint
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, StrictStr
from typing_extensions import Self

from stackit.sqlserverflex.models.data_point import DataPoint


class HostMetric(BaseModel):
"""
HostMetric
"""

datapoints: Optional[List[DataPoint]] = None
name: Optional[StrictStr] = None
units: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["datapoints", "name", "units"]

model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)

def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of HostMetric from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:

* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([])

_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in datapoints (list)
_items = []
if self.datapoints:
for _item in self.datapoints:
if _item:
_items.append(_item.to_dict())
_dict["datapoints"] = _items
return _dict

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of HostMetric from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate(
{
"datapoints": (
[DataPoint.from_dict(_item) for _item in obj["datapoints"]]
if obj.get("datapoints") is not None
else None
),
"name": obj.get("name"),
"units": obj.get("units"),
}
)
return _obj
Loading
Loading