diff --git a/CHANGELOG.md b/CHANGELOG.md index adf9f3c9..2d3b500c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,30 +1,102 @@ ## Release (2025-XX-YY) -- `kms`: [v0.0.5](services/kms/CHANGELOG.md#v005) - - **Improvement:** Updated validators -- `dns`: [v0.4.0](services/dns/CHANGELOG.md#v040) - - **Feature:** Add new record set types - - **Feature:** Improve documentation for APEX records in `RecordSet` and `CreateRecordSetPayload` models -- `git`: [v0.2.0](services/git/CHANGELOG.md#v020) - - **Feature:** Add support for `Flavors` for STACKIT git instance - - **Improvement:** Error handling and documentation improved -- `ske` [v0.6.0](services/ske/CHANGELOG.md#v060) - - **Feature:** Add new `ClusterErrorCode` types: `CLUSTERERRORCODE_INFRA_SNA_NETWORK_NOT_FOUND`, `CLUSTERERRORCODE_FETCHING_ERRORS_NOT_POSSIBLE` -- `stackitmarketplace`: [v1.5.0](services/stackitmarketplace/CHANGELOG.md#v150) - - **Feature:** Add new `Assets` model for managing service certificate assets - - **Feature:** Add new `LocalizedVersion` model for localized content management - - **Feature:** Add new `NoticePeriod` model with types: `SAME_DAY`, `DAYS`, `MONTHS` - - **Feature:** Add new `ServiceCertificate` model for service certification -- `cdn`: [v1.2.0](services/cdn/CHANGELOG.md#v120) - - **Feature:** Add `default_cache_duration` attribute to `Config`, `ConfigPatch` and `CreateDistributionPayload` model - - Add `originUrlRelated` to available options given in `sort_by` description -- `opensearch`: [v0.3.0](services/opensearch/CHANGELOG.md#v030) - - **Breaking change:** Attribute `tls_protocols` of `InstanceParameters` model is now of type `List[StrictStr]` (previously `StrictStr`) -- `stackitmarketplace`: [v1.4.0](services/stackitmarketplace/CHANGELOG.md#v140) - - **Feature:** Add support for offer types - - new model `OfferType` - - new attribute `CatalogProductDetail` for `CatalogProductDetail` model - - Attribute `is_product_listing` in `CatalogProductDetail` is now of type `Optional[StrictBool]` (previously `StrictBool`) +- `alb`: [v0.3.1](services/alb/CHANGELOG.md#v031) + - **Internal:** Improve deserializing and error types +- `authorization`: [v0.2.5](services/authorization/CHANGELOG.md#v025) + - **Internal:** Improve deserializing and error types +- `certificates`: [v1.0.2](services/certificates/CHANGELOG.md#v102) + - **Internal:** Improve deserializing and error types +- `lbapplication`: [v0.3.4](services/lbapplication/CHANGELOG.md#v034) + - **Internal:** Improve deserializing and error types +- `loadbalancer`: [v0.4.1](services/loadbalancer/CHANGELOG.md#v041) + - **Internal:** Improve deserializing and error types +- `logme`: [v0.3.2](services/logme/CHANGELOG.md#v032) + - **Internal:** Improve deserializing and error types +- `mariadb`: [v0.2.3](services/mariadb/CHANGELOG.md#v023) + - **Internal:** Improve deserializing and error types +- `modelserving`: [v0.1.2](services/modelserving/CHANGELOG.md#v012) + - **Internal:** Improve deserializing and error types +- `objectstorage`: [v1.0.4](services/objectstorage/CHANGELOG.md#v104) + - **Internal:** Improve deserializing and error types +- `observability`: [v0.5.1](services/observability/CHANGELOG.md#v051) + - **Internal:** Improve deserializing and error types +- `postgresflex`: [v1.0.2](services/postgresflex/CHANGELOG.md#v102) + - **Internal:** Improve deserializing and error types +- `rabbitmq`: [v0.2.2](services/rabbitmq/CHANGELOG.md#v022) + - **Internal:** Improve deserializing and error types +- `redis`: [v0.2.2](services/redis/CHANGELOG.md#v022) + - **Internal:** Improve deserializing and error types +- `resourcemanager`: [v0.5.1](services/resourcemanager/CHANGELOG.md#v051) + - **Internal:** Improve deserializing and error types +- `runcommand`: [v1.0.2](services/runcommand/CHANGELOG.md#v102) + - **Internal:** Improve deserializing and error types +- `secretsmanager`: [v0.2.3](services/secretsmanager/CHANGELOG.md#v023) + - **Internal:** Improve deserializing and error types +- `serverbackup`: [v1.0.2](services/serverbackup/CHANGELOG.md#v102) + - **Feature:** Add `force` parameter to `delete_backup` and `delete_volume_backup` methods + - **Internal:** Improve deserializing and error types +- `serverupdate`: [v1.0.3](services/serverupdate/CHANGELOG.md#v103) + - **Internal:** Improve deserializing and error types +- `serviceaccount`: [v0.2.2](services/serviceaccount/CHANGELOG.md#v022) + - **Internal:** Improve deserializing and error types +- `serviceenablement`: [v1.0.2](services/serviceenablement/CHANGELOG.md#v102) + - **Internal:** Improve deserializing and error types +- `sqlserverflex`: [v1.0.3](services/sqlserverflex/CHANGELOG.md#v103) + - **Internal:** Improve deserializing and error types +- `kms`: + - [v0.0.6](services/kms/CHANGELOG.md#v006) + - **Internal:** Improve deserializing and error types + - [v0.0.5](services/kms/CHANGELOG.md#v005) + - **Improvement:** Updated validators +- `dns`: + - [v0.4.1](services/dns/CHANGELOG.md#v041) + - **Internal:** Improve deserializing and error types + - [v0.4.0](services/dns/CHANGELOG.md#v040) + - **Feature:** Add new record set types + - **Feature:** Improve documentation for APEX records in `RecordSet` and `CreateRecordSetPayload` models +- `git`: + - [v0.3.0](services/git/CHANGELOG.md#v030) + - **Feature:** Add validation for field `flavor` in `CreateInstancePayload` model + - **Feature:** Add field `sku` in `Flavor` model + - **Internal:** Improve deserializing and error types + - [v0.2.0](services/git/CHANGELOG.md#v020) + - **Feature:** Add support for `Flavors` for STACKIT git instance + - **Improvement:** Error handling and documentation improved +- `ske` + - [v1.0.0](services/ske/CHANGELOG.md#v100) + - **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. + - **Breaking Change:** Renamed `Argus` model to `Observability` + - **Breaking Change:** Renamed `argus` field to `observability` in `Extension` model + - **Breaking Change:** Removed enum validation in `code` field in `ClusterError` model + - **Deprecated:** Remove deprecated `allow_privileged_containers` field in `Kubernetes` model + - **Internal:** Improve deserializing and error types + - [v0.6.0](services/ske/CHANGELOG.md#v060) + - **Feature:** Add new `ClusterErrorCode` types: `CLUSTERERRORCODE_INFRA_SNA_NETWORK_NOT_FOUND`, `CLUSTERERRORCODE_FETCHING_ERRORS_NOT_POSSIBLE` +- `stackitmarketplace`: + - [v1.5.1](services/stackitmarketplace/CHANGELOG.md#v151) + - **Internal:** Improve deserializing and error types + - [v1.5.0](services/stackitmarketplace/CHANGELOG.md#v150) + - **Feature:** Add new `Assets` model for managing service certificate assets + - **Feature:** Add new `LocalizedVersion` model for localized content management + - **Feature:** Add new `NoticePeriod` model with types: `SAME_DAY`, `DAYS`, `MONTHS` + - **Feature:** Add new `ServiceCertificate` model for service certification + - [v1.4.0](services/stackitmarketplace/CHANGELOG.md#v140) + - **Feature:** Add support for offer types + - new model `OfferType` + - new attribute `CatalogProductDetail` for `CatalogProductDetail` model + - Attribute `is_product_listing` in `CatalogProductDetail` is now of type `Optional[StrictBool]` (previously `StrictBool`) +- `cdn`: + - [v1.3.0](services/cdn/CHANGELOG.md#v130) + - **Breaking change:** Replace oneOf `ConfigBackend` with `HttpBackend` + - **Internal:** Improve deserializing and error types + - [v1.2.0](services/cdn/CHANGELOG.md#v120) + - **Feature:** Add `default_cache_duration` attribute to `Config`, `ConfigPatch` and `CreateDistributionPayload` model + - Add `originUrlRelated` to available options given in `sort_by` description +- `opensearch`: + - [v0.3.1](services/opensearch/CHANGELOG.md#v031) + - **Internal:** Improve deserializing and error types + - [v0.3.0](services/opensearch/CHANGELOG.md#v030) + - **Breaking change:** Attribute `tls_protocols` of `InstanceParameters` model is now of type `List[StrictStr]` (previously `StrictStr`) - `iaas`: [v0.5.4](services/iaas/CHANGELOG.md#v054) - **Improvement:** Increase max length of `machine_type` and `volume_performance_class` fields from 63 to 127 characters in API methods - **Improvement:** Increase max length of `name` fields from 63 to 127 characters for various models: diff --git a/services/alb/CHANGELOG.md b/services/alb/CHANGELOG.md index 1a5696c9..ae4e3bf3 100644 --- a/services/alb/CHANGELOG.md +++ b/services/alb/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.3.1 +- **Internal:** Improve deserializing and error types + ## v0.3.0 (2025-06-12) - **Feature:** Add new fields `disable_target_security_group_assignment` and `target_security_group` in `LoadBalancer`, `CreateLoadBalancerPayload` and `UpdateLoadBalancerPayload` Models diff --git a/services/alb/pyproject.toml b/services/alb/pyproject.toml index 7f45c13e..a217e2e7 100644 --- a/services/alb/pyproject.toml +++ b/services/alb/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-alb" [tool.poetry] name = "stackit-alb" -version = "v0.3.0" +version = "v0.3.1" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/alb/src/stackit/alb/__init__.py b/services/alb/src/stackit/alb/__init__.py index d9b53c72..4235173e 100644 --- a/services/alb/src/stackit/alb/__init__.py +++ b/services/alb/src/stackit/alb/__init__.py @@ -11,69 +11,163 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "ActiveHealthCheck", + "CertificateConfig", + "CookiePersistence", + "CreateCredentialsPayload", + "CreateCredentialsResponse", + "CreateLoadBalancerPayload", + "CredentialsResponse", + "GetCredentialsResponse", + "GetQuotaResponse", + "GoogleProtobufAny", + "HostConfig", + "HttpHeader", + "HttpHealthChecks", + "ListCredentialsResponse", + "ListLoadBalancersResponse", + "ListPlansResponse", + "Listener", + "LoadBalancer", + "LoadBalancerError", + "LoadBalancerOptions", + "LoadbalancerOptionAccessControl", + "LoadbalancerOptionLogs", + "LoadbalancerOptionMetrics", + "LoadbalancerOptionObservability", + "Network", + "Path", + "PlanDetails", + "ProtocolOptionsHTTP", + "ProtocolOptionsHTTPS", + "QueryParameter", + "Rule", + "SecurityGroup", + "Status", + "Target", + "TargetPool", + "TargetPoolTlsConfig", + "UpdateCredentialsPayload", + "UpdateCredentialsResponse", + "UpdateLoadBalancerPayload", + "UpdateTargetPoolPayload", +] + # import apis into sdk package -from stackit.alb.api.default_api import DefaultApi -from stackit.alb.api_client import ApiClient +from stackit.alb.api.default_api import DefaultApi as DefaultApi +from stackit.alb.api_client import ApiClient as ApiClient # import ApiClient -from stackit.alb.api_response import ApiResponse -from stackit.alb.configuration import HostConfiguration -from stackit.alb.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.alb.api_response import ApiResponse as ApiResponse +from stackit.alb.configuration import HostConfiguration as HostConfiguration +from stackit.alb.exceptions import ApiAttributeError as ApiAttributeError +from stackit.alb.exceptions import ApiException as ApiException +from stackit.alb.exceptions import ApiKeyError as ApiKeyError +from stackit.alb.exceptions import ApiTypeError as ApiTypeError +from stackit.alb.exceptions import ApiValueError as ApiValueError +from stackit.alb.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.alb.models.active_health_check import ActiveHealthCheck -from stackit.alb.models.certificate_config import CertificateConfig -from stackit.alb.models.cookie_persistence import CookiePersistence -from stackit.alb.models.create_credentials_payload import CreateCredentialsPayload -from stackit.alb.models.create_credentials_response import CreateCredentialsResponse -from stackit.alb.models.create_load_balancer_payload import CreateLoadBalancerPayload -from stackit.alb.models.credentials_response import CredentialsResponse -from stackit.alb.models.get_credentials_response import GetCredentialsResponse -from stackit.alb.models.get_quota_response import GetQuotaResponse -from stackit.alb.models.google_protobuf_any import GoogleProtobufAny -from stackit.alb.models.host_config import HostConfig -from stackit.alb.models.http_header import HttpHeader -from stackit.alb.models.http_health_checks import HttpHealthChecks -from stackit.alb.models.list_credentials_response import ListCredentialsResponse -from stackit.alb.models.list_load_balancers_response import ListLoadBalancersResponse -from stackit.alb.models.list_plans_response import ListPlansResponse -from stackit.alb.models.listener import Listener -from stackit.alb.models.load_balancer import LoadBalancer -from stackit.alb.models.load_balancer_error import LoadBalancerError -from stackit.alb.models.load_balancer_options import LoadBalancerOptions +from stackit.alb.models.active_health_check import ( + ActiveHealthCheck as ActiveHealthCheck, +) +from stackit.alb.models.certificate_config import CertificateConfig as CertificateConfig +from stackit.alb.models.cookie_persistence import CookiePersistence as CookiePersistence +from stackit.alb.models.create_credentials_payload import ( + CreateCredentialsPayload as CreateCredentialsPayload, +) +from stackit.alb.models.create_credentials_response import ( + CreateCredentialsResponse as CreateCredentialsResponse, +) +from stackit.alb.models.create_load_balancer_payload import ( + CreateLoadBalancerPayload as CreateLoadBalancerPayload, +) +from stackit.alb.models.credentials_response import ( + CredentialsResponse as CredentialsResponse, +) +from stackit.alb.models.get_credentials_response import ( + GetCredentialsResponse as GetCredentialsResponse, +) +from stackit.alb.models.get_quota_response import GetQuotaResponse as GetQuotaResponse +from stackit.alb.models.google_protobuf_any import ( + GoogleProtobufAny as GoogleProtobufAny, +) +from stackit.alb.models.host_config import HostConfig as HostConfig +from stackit.alb.models.http_header import HttpHeader as HttpHeader +from stackit.alb.models.http_health_checks import HttpHealthChecks as HttpHealthChecks +from stackit.alb.models.list_credentials_response import ( + ListCredentialsResponse as ListCredentialsResponse, +) +from stackit.alb.models.list_load_balancers_response import ( + ListLoadBalancersResponse as ListLoadBalancersResponse, +) +from stackit.alb.models.list_plans_response import ( + ListPlansResponse as ListPlansResponse, +) +from stackit.alb.models.listener import Listener as Listener +from stackit.alb.models.load_balancer import LoadBalancer as LoadBalancer +from stackit.alb.models.load_balancer_error import ( + LoadBalancerError as LoadBalancerError, +) +from stackit.alb.models.load_balancer_options import ( + LoadBalancerOptions as LoadBalancerOptions, +) from stackit.alb.models.loadbalancer_option_access_control import ( - LoadbalancerOptionAccessControl, + LoadbalancerOptionAccessControl as LoadbalancerOptionAccessControl, +) +from stackit.alb.models.loadbalancer_option_logs import ( + LoadbalancerOptionLogs as LoadbalancerOptionLogs, +) +from stackit.alb.models.loadbalancer_option_metrics import ( + LoadbalancerOptionMetrics as LoadbalancerOptionMetrics, ) -from stackit.alb.models.loadbalancer_option_logs import LoadbalancerOptionLogs -from stackit.alb.models.loadbalancer_option_metrics import LoadbalancerOptionMetrics from stackit.alb.models.loadbalancer_option_observability import ( - LoadbalancerOptionObservability, -) -from stackit.alb.models.network import Network -from stackit.alb.models.path import Path -from stackit.alb.models.plan_details import PlanDetails -from stackit.alb.models.protocol_options_http import ProtocolOptionsHTTP -from stackit.alb.models.protocol_options_https import ProtocolOptionsHTTPS -from stackit.alb.models.query_parameter import QueryParameter -from stackit.alb.models.rule import Rule -from stackit.alb.models.security_group import SecurityGroup -from stackit.alb.models.status import Status -from stackit.alb.models.target import Target -from stackit.alb.models.target_pool import TargetPool -from stackit.alb.models.target_pool_tls_config import TargetPoolTlsConfig -from stackit.alb.models.update_credentials_payload import UpdateCredentialsPayload -from stackit.alb.models.update_credentials_response import UpdateCredentialsResponse -from stackit.alb.models.update_load_balancer_payload import UpdateLoadBalancerPayload -from stackit.alb.models.update_target_pool_payload import UpdateTargetPoolPayload + LoadbalancerOptionObservability as LoadbalancerOptionObservability, +) +from stackit.alb.models.network import Network as Network +from stackit.alb.models.path import Path as Path +from stackit.alb.models.plan_details import PlanDetails as PlanDetails +from stackit.alb.models.protocol_options_http import ( + ProtocolOptionsHTTP as ProtocolOptionsHTTP, +) +from stackit.alb.models.protocol_options_https import ( + ProtocolOptionsHTTPS as ProtocolOptionsHTTPS, +) +from stackit.alb.models.query_parameter import QueryParameter as QueryParameter +from stackit.alb.models.rule import Rule as Rule +from stackit.alb.models.security_group import SecurityGroup as SecurityGroup +from stackit.alb.models.status import Status as Status +from stackit.alb.models.target import Target as Target +from stackit.alb.models.target_pool import TargetPool as TargetPool +from stackit.alb.models.target_pool_tls_config import ( + TargetPoolTlsConfig as TargetPoolTlsConfig, +) +from stackit.alb.models.update_credentials_payload import ( + UpdateCredentialsPayload as UpdateCredentialsPayload, +) +from stackit.alb.models.update_credentials_response import ( + UpdateCredentialsResponse as UpdateCredentialsResponse, +) +from stackit.alb.models.update_load_balancer_payload import ( + UpdateLoadBalancerPayload as UpdateLoadBalancerPayload, +) +from stackit.alb.models.update_target_pool_payload import ( + UpdateTargetPoolPayload as UpdateTargetPoolPayload, +) diff --git a/services/alb/src/stackit/alb/api/default_api.py b/services/alb/src/stackit/alb/api/default_api.py index 9c4c6f83..e3ae463b 100644 --- a/services/alb/src/stackit/alb/api/default_api.py +++ b/services/alb/src/stackit/alb/api/default_api.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -98,7 +98,7 @@ def create_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( project_id=project_id, @@ -174,7 +174,7 @@ def create_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( project_id=project_id, @@ -250,7 +250,7 @@ def create_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( project_id=project_id, @@ -293,7 +293,7 @@ def _create_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -389,7 +389,7 @@ def create_load_balancer( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_load_balancer_serialize( project_id=project_id, @@ -466,7 +466,7 @@ def create_load_balancer_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_load_balancer_serialize( project_id=project_id, @@ -543,7 +543,7 @@ def create_load_balancer_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_load_balancer_serialize( project_id=project_id, @@ -587,7 +587,7 @@ def _create_load_balancer_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -680,7 +680,7 @@ def delete_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( project_id=project_id, @@ -752,7 +752,7 @@ def delete_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( project_id=project_id, @@ -824,7 +824,7 @@ def delete_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( project_id=project_id, @@ -865,7 +865,7 @@ def _delete_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -948,7 +948,7 @@ def delete_load_balancer( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_load_balancer_serialize( project_id=project_id, @@ -1020,7 +1020,7 @@ def delete_load_balancer_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_load_balancer_serialize( project_id=project_id, @@ -1092,7 +1092,7 @@ def delete_load_balancer_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_load_balancer_serialize( project_id=project_id, @@ -1133,7 +1133,7 @@ def _delete_load_balancer_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1216,7 +1216,7 @@ def get_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( project_id=project_id, @@ -1289,7 +1289,7 @@ def get_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( project_id=project_id, @@ -1362,7 +1362,7 @@ def get_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( project_id=project_id, @@ -1404,7 +1404,7 @@ def _get_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1487,7 +1487,7 @@ def get_load_balancer( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_load_balancer_serialize( project_id=project_id, @@ -1560,7 +1560,7 @@ def get_load_balancer_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_load_balancer_serialize( project_id=project_id, @@ -1633,7 +1633,7 @@ def get_load_balancer_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_load_balancer_serialize( project_id=project_id, @@ -1675,7 +1675,7 @@ def _get_load_balancer_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1755,7 +1755,7 @@ def get_quota( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_quota_serialize( project_id=project_id, @@ -1823,7 +1823,7 @@ def get_quota_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_quota_serialize( project_id=project_id, @@ -1891,7 +1891,7 @@ def get_quota_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_quota_serialize( project_id=project_id, @@ -1930,7 +1930,7 @@ def _get_quota_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2008,7 +2008,7 @@ def list_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( project_id=project_id, @@ -2076,7 +2076,7 @@ def list_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( project_id=project_id, @@ -2144,7 +2144,7 @@ def list_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( project_id=project_id, @@ -2183,7 +2183,7 @@ def _list_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2277,7 +2277,7 @@ def list_load_balancers( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_load_balancers_serialize( project_id=project_id, @@ -2363,7 +2363,7 @@ def list_load_balancers_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_load_balancers_serialize( project_id=project_id, @@ -2449,7 +2449,7 @@ def list_load_balancers_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_load_balancers_serialize( project_id=project_id, @@ -2492,7 +2492,7 @@ def _list_load_balancers_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2575,7 +2575,7 @@ def list_plans( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_plans_serialize( region=region, @@ -2639,7 +2639,7 @@ def list_plans_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_plans_serialize( region=region, @@ -2703,7 +2703,7 @@ def list_plans_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_plans_serialize( region=region, @@ -2740,7 +2740,7 @@ def _list_plans_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2822,7 +2822,7 @@ def update_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_credentials_serialize( project_id=project_id, @@ -2899,7 +2899,7 @@ def update_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_credentials_serialize( project_id=project_id, @@ -2976,7 +2976,7 @@ def update_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_credentials_serialize( project_id=project_id, @@ -3020,7 +3020,7 @@ def _update_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3116,7 +3116,7 @@ def update_load_balancer( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_load_balancer_serialize( project_id=project_id, @@ -3193,7 +3193,7 @@ def update_load_balancer_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_load_balancer_serialize( project_id=project_id, @@ -3270,7 +3270,7 @@ def update_load_balancer_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_load_balancer_serialize( project_id=project_id, @@ -3314,7 +3314,7 @@ def _update_load_balancer_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3413,7 +3413,7 @@ def update_target_pool( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_target_pool_serialize( project_id=project_id, @@ -3493,7 +3493,7 @@ def update_target_pool_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_target_pool_serialize( project_id=project_id, @@ -3573,7 +3573,7 @@ def update_target_pool_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_target_pool_serialize( project_id=project_id, @@ -3618,7 +3618,7 @@ def _update_target_pool_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/alb/src/stackit/alb/api_client.py b/services/alb/src/stackit/alb/api_client.py index eeca45f8..1fb92ac1 100644 --- a/services/alb/src/stackit/alb/api_client.py +++ b/services/alb/src/stackit/alb/api_client.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -331,6 +331,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -350,12 +354,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -457,7 +461,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -473,7 +477,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -488,6 +495,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/alb/src/stackit/alb/configuration.py b/services/alb/src/stackit/alb/configuration.py index 667c33d4..9f65aaef 100644 --- a/services/alb/src/stackit/alb/configuration.py +++ b/services/alb/src/stackit/alb/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ Application Load Balancer API @@ -14,7 +9,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -53,7 +70,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -71,7 +88,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -111,7 +133,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -130,12 +152,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/alb/src/stackit/alb/exceptions.py b/services/alb/src/stackit/alb/exceptions.py index a387fd19..f919b719 100644 --- a/services/alb/src/stackit/alb/exceptions.py +++ b/services/alb/src/stackit/alb/exceptions.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -151,6 +151,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -187,6 +194,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/alb/src/stackit/alb/models/__init__.py b/services/alb/src/stackit/alb/models/__init__.py index 8d47f4fd..ec86ab38 100644 --- a/services/alb/src/stackit/alb/models/__init__.py +++ b/services/alb/src/stackit/alb/models/__init__.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/alb/src/stackit/alb/models/active_health_check.py b/services/alb/src/stackit/alb/models/active_health_check.py index 263ffcf6..5586023f 100644 --- a/services/alb/src/stackit/alb/models/active_health_check.py +++ b/services/alb/src/stackit/alb/models/active_health_check.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -27,7 +27,7 @@ class ActiveHealthCheck(BaseModel): """ ActiveHealthCheck - """ + """ # noqa: E501 healthy_threshold: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field( default=None, description="Healthy threshold of the health checking", alias="healthyThreshold" diff --git a/services/alb/src/stackit/alb/models/certificate_config.py b/services/alb/src/stackit/alb/models/certificate_config.py index 228fe62f..45e3bda2 100644 --- a/services/alb/src/stackit/alb/models/certificate_config.py +++ b/services/alb/src/stackit/alb/models/certificate_config.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CertificateConfig(BaseModel): """ CertificateConfig - """ + """ # noqa: E501 certificate_ids: Optional[List[StrictStr]] = Field( default=None, description="Certificate IDs for TLS termination.", alias="certificateIds" diff --git a/services/alb/src/stackit/alb/models/cookie_persistence.py b/services/alb/src/stackit/alb/models/cookie_persistence.py index 4d88eea8..624b24a6 100644 --- a/services/alb/src/stackit/alb/models/cookie_persistence.py +++ b/services/alb/src/stackit/alb/models/cookie_persistence.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class CookiePersistence(BaseModel): """ CookiePersistence - """ + """ # noqa: E501 name: Optional[StrictStr] = Field(default=None, description="Cookie is the name of the cookie to use.") ttl: Optional[Annotated[str, Field(strict=True)]] = Field( diff --git a/services/alb/src/stackit/alb/models/create_credentials_payload.py b/services/alb/src/stackit/alb/models/create_credentials_payload.py index d2c913b5..63ca7303 100644 --- a/services/alb/src/stackit/alb/models/create_credentials_payload.py +++ b/services/alb/src/stackit/alb/models/create_credentials_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class CreateCredentialsPayload(BaseModel): """ CreateCredentialsPayload - """ + """ # noqa: E501 display_name: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, description="Credential name", alias="displayName" diff --git a/services/alb/src/stackit/alb/models/create_credentials_response.py b/services/alb/src/stackit/alb/models/create_credentials_response.py index ceeef945..0f6956a2 100644 --- a/services/alb/src/stackit/alb/models/create_credentials_response.py +++ b/services/alb/src/stackit/alb/models/create_credentials_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class CreateCredentialsResponse(BaseModel): """ CreateCredentialsResponse - """ + """ # noqa: E501 credential: Optional[CredentialsResponse] = None __properties: ClassVar[List[str]] = ["credential"] diff --git a/services/alb/src/stackit/alb/models/create_load_balancer_payload.py b/services/alb/src/stackit/alb/models/create_load_balancer_payload.py index a3c180fa..146f3f2a 100644 --- a/services/alb/src/stackit/alb/models/create_load_balancer_payload.py +++ b/services/alb/src/stackit/alb/models/create_load_balancer_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import ( @@ -39,7 +39,7 @@ class CreateLoadBalancerPayload(BaseModel): """ CreateLoadBalancerPayload - """ + """ # noqa: E501 disable_target_security_group_assignment: Optional[StrictBool] = Field( default=None, diff --git a/services/alb/src/stackit/alb/models/credentials_response.py b/services/alb/src/stackit/alb/models/credentials_response.py index a0d50608..102302dc 100644 --- a/services/alb/src/stackit/alb/models/credentials_response.py +++ b/services/alb/src/stackit/alb/models/credentials_response.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class CredentialsResponse(BaseModel): """ CredentialsResponse - """ + """ # noqa: E501 credentials_ref: Optional[StrictStr] = Field( default=None, diff --git a/services/alb/src/stackit/alb/models/get_credentials_response.py b/services/alb/src/stackit/alb/models/get_credentials_response.py index c39c6352..feeeed1c 100644 --- a/services/alb/src/stackit/alb/models/get_credentials_response.py +++ b/services/alb/src/stackit/alb/models/get_credentials_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class GetCredentialsResponse(BaseModel): """ GetCredentialsResponse - """ + """ # noqa: E501 credential: Optional[CredentialsResponse] = None __properties: ClassVar[List[str]] = ["credential"] diff --git a/services/alb/src/stackit/alb/models/get_quota_response.py b/services/alb/src/stackit/alb/models/get_quota_response.py index 3d1d1ca9..352c5770 100644 --- a/services/alb/src/stackit/alb/models/get_quota_response.py +++ b/services/alb/src/stackit/alb/models/get_quota_response.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -25,7 +25,7 @@ class GetQuotaResponse(BaseModel): """ GetQuotaResponse - """ + """ # noqa: E501 max_load_balancers: Optional[Annotated[int, Field(le=999, strict=True, ge=-1)]] = Field( default=None, diff --git a/services/alb/src/stackit/alb/models/google_protobuf_any.py b/services/alb/src/stackit/alb/models/google_protobuf_any.py index b87fa5dd..9fa13b1f 100644 --- a/services/alb/src/stackit/alb/models/google_protobuf_any.py +++ b/services/alb/src/stackit/alb/models/google_protobuf_any.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class GoogleProtobufAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. - """ + """ # noqa: E501 type: Optional[StrictStr] = Field(default=None, description="The type of the serialized message.", alias="@type") additional_properties: Dict[str, Any] = {} diff --git a/services/alb/src/stackit/alb/models/host_config.py b/services/alb/src/stackit/alb/models/host_config.py index 5b542100..26a7b58e 100644 --- a/services/alb/src/stackit/alb/models/host_config.py +++ b/services/alb/src/stackit/alb/models/host_config.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class HostConfig(BaseModel): """ HostConfig - """ + """ # noqa: E501 host: Optional[StrictStr] = Field( default=None, description="Hostname to match. Supports wildcards (e.g. *.example.com)." diff --git a/services/alb/src/stackit/alb/models/http_header.py b/services/alb/src/stackit/alb/models/http_header.py index 7d4be82d..e3f70e29 100644 --- a/services/alb/src/stackit/alb/models/http_header.py +++ b/services/alb/src/stackit/alb/models/http_header.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class HttpHeader(BaseModel): """ HttpHeader - """ + """ # noqa: E501 exact_match: Optional[StrictStr] = Field( default=None, description="Exact match for the header value.", alias="exactMatch" diff --git a/services/alb/src/stackit/alb/models/http_health_checks.py b/services/alb/src/stackit/alb/models/http_health_checks.py index c376130e..b3729fa4 100644 --- a/services/alb/src/stackit/alb/models/http_health_checks.py +++ b/services/alb/src/stackit/alb/models/http_health_checks.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class HttpHealthChecks(BaseModel): """ HttpHealthChecks - """ + """ # noqa: E501 ok_statuses: Optional[List[StrictStr]] = Field( default=None, description="List of HTTP status codes that indicate a healthy response", alias="okStatuses" diff --git a/services/alb/src/stackit/alb/models/list_credentials_response.py b/services/alb/src/stackit/alb/models/list_credentials_response.py index 5cff605f..00df53af 100644 --- a/services/alb/src/stackit/alb/models/list_credentials_response.py +++ b/services/alb/src/stackit/alb/models/list_credentials_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListCredentialsResponse(BaseModel): """ ListCredentialsResponse - """ + """ # noqa: E501 credentials: Optional[List[CredentialsResponse]] = None __properties: ClassVar[List[str]] = ["credentials"] diff --git a/services/alb/src/stackit/alb/models/list_load_balancers_response.py b/services/alb/src/stackit/alb/models/list_load_balancers_response.py index c3e05af5..72be9c8e 100644 --- a/services/alb/src/stackit/alb/models/list_load_balancers_response.py +++ b/services/alb/src/stackit/alb/models/list_load_balancers_response.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -27,7 +27,7 @@ class ListLoadBalancersResponse(BaseModel): """ ListLoadBalancersResponse - """ + """ # noqa: E501 load_balancers: Optional[List[LoadBalancer]] = Field(default=None, alias="loadBalancers") next_page_id: Optional[Annotated[str, Field(strict=True)]] = Field( diff --git a/services/alb/src/stackit/alb/models/list_plans_response.py b/services/alb/src/stackit/alb/models/list_plans_response.py index 3038fa5f..1a3a11f2 100644 --- a/services/alb/src/stackit/alb/models/list_plans_response.py +++ b/services/alb/src/stackit/alb/models/list_plans_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListPlansResponse(BaseModel): """ ListPlansResponse - """ + """ # noqa: E501 valid_plans: Optional[List[PlanDetails]] = Field(default=None, alias="validPlans") __properties: ClassVar[List[str]] = ["validPlans"] diff --git a/services/alb/src/stackit/alb/models/listener.py b/services/alb/src/stackit/alb/models/listener.py index 38e376d9..a8a509a8 100644 --- a/services/alb/src/stackit/alb/models/listener.py +++ b/services/alb/src/stackit/alb/models/listener.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class Listener(BaseModel): """ Listener - """ + """ # noqa: E501 http: Optional[ProtocolOptionsHTTP] = None https: Optional[ProtocolOptionsHTTPS] = None diff --git a/services/alb/src/stackit/alb/models/load_balancer.py b/services/alb/src/stackit/alb/models/load_balancer.py index b174e34b..87427c76 100644 --- a/services/alb/src/stackit/alb/models/load_balancer.py +++ b/services/alb/src/stackit/alb/models/load_balancer.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import ( @@ -39,7 +39,7 @@ class LoadBalancer(BaseModel): """ LoadBalancer - """ + """ # noqa: E501 disable_target_security_group_assignment: Optional[StrictBool] = Field( default=None, diff --git a/services/alb/src/stackit/alb/models/load_balancer_error.py b/services/alb/src/stackit/alb/models/load_balancer_error.py index 1a31862e..f968228a 100644 --- a/services/alb/src/stackit/alb/models/load_balancer_error.py +++ b/services/alb/src/stackit/alb/models/load_balancer_error.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class LoadBalancerError(BaseModel): """ LoadBalancerError - """ + """ # noqa: E501 description: Optional[StrictStr] = Field( default=None, diff --git a/services/alb/src/stackit/alb/models/load_balancer_options.py b/services/alb/src/stackit/alb/models/load_balancer_options.py index 48248c1e..7cec7a33 100644 --- a/services/alb/src/stackit/alb/models/load_balancer_options.py +++ b/services/alb/src/stackit/alb/models/load_balancer_options.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -31,7 +31,7 @@ class LoadBalancerOptions(BaseModel): """ Defines any optional functionality you want to have enabled on your application load balancer. - """ + """ # noqa: E501 access_control: Optional[LoadbalancerOptionAccessControl] = Field(default=None, alias="accessControl") ephemeral_address: Optional[StrictBool] = Field(default=None, alias="ephemeralAddress") diff --git a/services/alb/src/stackit/alb/models/loadbalancer_option_access_control.py b/services/alb/src/stackit/alb/models/loadbalancer_option_access_control.py index 1b9f2e99..992960f7 100644 --- a/services/alb/src/stackit/alb/models/loadbalancer_option_access_control.py +++ b/services/alb/src/stackit/alb/models/loadbalancer_option_access_control.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class LoadbalancerOptionAccessControl(BaseModel): """ Use this option to limit the IP ranges that can use the application load balancer. - """ + """ # noqa: E501 allowed_source_ranges: Optional[List[StrictStr]] = Field( default=None, diff --git a/services/alb/src/stackit/alb/models/loadbalancer_option_logs.py b/services/alb/src/stackit/alb/models/loadbalancer_option_logs.py index 5a1805fa..2566456d 100644 --- a/services/alb/src/stackit/alb/models/loadbalancer_option_logs.py +++ b/services/alb/src/stackit/alb/models/loadbalancer_option_logs.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class LoadbalancerOptionLogs(BaseModel): """ LoadbalancerOptionLogs - """ + """ # noqa: E501 credentials_ref: Optional[StrictStr] = Field( default=None, diff --git a/services/alb/src/stackit/alb/models/loadbalancer_option_metrics.py b/services/alb/src/stackit/alb/models/loadbalancer_option_metrics.py index 9a53f641..10fde81e 100644 --- a/services/alb/src/stackit/alb/models/loadbalancer_option_metrics.py +++ b/services/alb/src/stackit/alb/models/loadbalancer_option_metrics.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class LoadbalancerOptionMetrics(BaseModel): """ LoadbalancerOptionMetrics - """ + """ # noqa: E501 credentials_ref: Optional[StrictStr] = Field( default=None, diff --git a/services/alb/src/stackit/alb/models/loadbalancer_option_observability.py b/services/alb/src/stackit/alb/models/loadbalancer_option_observability.py index 19821a21..6e9b14a9 100644 --- a/services/alb/src/stackit/alb/models/loadbalancer_option_observability.py +++ b/services/alb/src/stackit/alb/models/loadbalancer_option_observability.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class LoadbalancerOptionObservability(BaseModel): """ We offer Application Load Balancer metrics observability via ARGUS or external solutions. Not changeable after creation. - """ + """ # noqa: E501 logs: Optional[LoadbalancerOptionLogs] = None metrics: Optional[LoadbalancerOptionMetrics] = None diff --git a/services/alb/src/stackit/alb/models/network.py b/services/alb/src/stackit/alb/models/network.py index be6fb0ed..b6b4fdd0 100644 --- a/services/alb/src/stackit/alb/models/network.py +++ b/services/alb/src/stackit/alb/models/network.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class Network(BaseModel): """ Network - """ + """ # noqa: E501 network_id: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, description="Openstack network ID", alias="networkId" diff --git a/services/alb/src/stackit/alb/models/path.py b/services/alb/src/stackit/alb/models/path.py index c3f28f86..afde94cf 100644 --- a/services/alb/src/stackit/alb/models/path.py +++ b/services/alb/src/stackit/alb/models/path.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Path(BaseModel): """ Path - """ + """ # noqa: E501 exact: Optional[StrictStr] = Field( default=None, diff --git a/services/alb/src/stackit/alb/models/plan_details.py b/services/alb/src/stackit/alb/models/plan_details.py index 0f81a2ab..dab9b30b 100644 --- a/services/alb/src/stackit/alb/models/plan_details.py +++ b/services/alb/src/stackit/alb/models/plan_details.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class PlanDetails(BaseModel): """ PlanDetails - """ + """ # noqa: E501 description: Optional[StrictStr] = Field(default=None, description="Description") flavor_name: Optional[StrictStr] = Field(default=None, description="Flavor Name", alias="flavorName") diff --git a/services/alb/src/stackit/alb/models/protocol_options_http.py b/services/alb/src/stackit/alb/models/protocol_options_http.py index 10211fce..5cb3615f 100644 --- a/services/alb/src/stackit/alb/models/protocol_options_http.py +++ b/services/alb/src/stackit/alb/models/protocol_options_http.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ProtocolOptionsHTTP(BaseModel): """ ProtocolOptionsHTTP - """ + """ # noqa: E501 hosts: Optional[List[HostConfig]] = Field(default=None, description="Defines routing rules grouped by hostname.") __properties: ClassVar[List[str]] = ["hosts"] diff --git a/services/alb/src/stackit/alb/models/protocol_options_https.py b/services/alb/src/stackit/alb/models/protocol_options_https.py index a0d66efa..0f699f71 100644 --- a/services/alb/src/stackit/alb/models/protocol_options_https.py +++ b/services/alb/src/stackit/alb/models/protocol_options_https.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ProtocolOptionsHTTPS(BaseModel): """ ProtocolOptionsHTTPS - """ + """ # noqa: E501 certificate_config: Optional[CertificateConfig] = Field(default=None, alias="certificateConfig") __properties: ClassVar[List[str]] = ["certificateConfig"] diff --git a/services/alb/src/stackit/alb/models/query_parameter.py b/services/alb/src/stackit/alb/models/query_parameter.py index ce6d2feb..64d82792 100644 --- a/services/alb/src/stackit/alb/models/query_parameter.py +++ b/services/alb/src/stackit/alb/models/query_parameter.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class QueryParameter(BaseModel): """ QueryParameter - """ + """ # noqa: E501 exact_match: Optional[StrictStr] = Field( default=None, description="Exact match for the parameter value.", alias="exactMatch" diff --git a/services/alb/src/stackit/alb/models/rule.py b/services/alb/src/stackit/alb/models/rule.py index 9b4cc2e4..0e10e80d 100644 --- a/services/alb/src/stackit/alb/models/rule.py +++ b/services/alb/src/stackit/alb/models/rule.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class Rule(BaseModel): """ Rule - """ + """ # noqa: E501 cookie_persistence: Optional[CookiePersistence] = Field(default=None, alias="cookiePersistence") headers: Optional[List[HttpHeader]] = Field(default=None, description="Headers for the rule.") diff --git a/services/alb/src/stackit/alb/models/security_group.py b/services/alb/src/stackit/alb/models/security_group.py index 3aecdffd..b28f0882 100644 --- a/services/alb/src/stackit/alb/models/security_group.py +++ b/services/alb/src/stackit/alb/models/security_group.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class SecurityGroup(BaseModel): """ SecurityGroup - """ + """ # noqa: E501 id: Optional[StrictStr] = Field(default=None, description="ID of the security Group") name: Optional[StrictStr] = Field(default=None, description="Name of the security Group") diff --git a/services/alb/src/stackit/alb/models/status.py b/services/alb/src/stackit/alb/models/status.py index f20a1623..71d48d36 100644 --- a/services/alb/src/stackit/alb/models/status.py +++ b/services/alb/src/stackit/alb/models/status.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class Status(BaseModel): """ The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). - """ + """ # noqa: E501 code: Optional[StrictInt] = Field( default=None, diff --git a/services/alb/src/stackit/alb/models/target.py b/services/alb/src/stackit/alb/models/target.py index c4d37436..b4281f7d 100644 --- a/services/alb/src/stackit/alb/models/target.py +++ b/services/alb/src/stackit/alb/models/target.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class Target(BaseModel): """ Target - """ + """ # noqa: E501 display_name: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, description="Target name", alias="displayName" diff --git a/services/alb/src/stackit/alb/models/target_pool.py b/services/alb/src/stackit/alb/models/target_pool.py index a8767939..fda8244a 100644 --- a/services/alb/src/stackit/alb/models/target_pool.py +++ b/services/alb/src/stackit/alb/models/target_pool.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -29,7 +29,7 @@ class TargetPool(BaseModel): """ TargetPool - """ + """ # noqa: E501 active_health_check: Optional[ActiveHealthCheck] = Field(default=None, alias="activeHealthCheck") name: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Target pool name") diff --git a/services/alb/src/stackit/alb/models/target_pool_tls_config.py b/services/alb/src/stackit/alb/models/target_pool_tls_config.py index 23fb7e2d..847cc3d9 100644 --- a/services/alb/src/stackit/alb/models/target_pool_tls_config.py +++ b/services/alb/src/stackit/alb/models/target_pool_tls_config.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class TargetPoolTlsConfig(BaseModel): """ TargetPoolTlsConfig - """ + """ # noqa: E501 custom_ca: Optional[StrictStr] = Field( default=None, diff --git a/services/alb/src/stackit/alb/models/update_credentials_payload.py b/services/alb/src/stackit/alb/models/update_credentials_payload.py index dde90e1f..5dcdba4b 100644 --- a/services/alb/src/stackit/alb/models/update_credentials_payload.py +++ b/services/alb/src/stackit/alb/models/update_credentials_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class UpdateCredentialsPayload(BaseModel): """ UpdateCredentialsPayload - """ + """ # noqa: E501 display_name: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, description="Credential name", alias="displayName" diff --git a/services/alb/src/stackit/alb/models/update_credentials_response.py b/services/alb/src/stackit/alb/models/update_credentials_response.py index ab5c0867..421f9c05 100644 --- a/services/alb/src/stackit/alb/models/update_credentials_response.py +++ b/services/alb/src/stackit/alb/models/update_credentials_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class UpdateCredentialsResponse(BaseModel): """ UpdateCredentialsResponse - """ + """ # noqa: E501 credential: Optional[CredentialsResponse] = None __properties: ClassVar[List[str]] = ["credential"] diff --git a/services/alb/src/stackit/alb/models/update_load_balancer_payload.py b/services/alb/src/stackit/alb/models/update_load_balancer_payload.py index fec9cdd2..5fb9d41a 100644 --- a/services/alb/src/stackit/alb/models/update_load_balancer_payload.py +++ b/services/alb/src/stackit/alb/models/update_load_balancer_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import ( @@ -39,7 +39,7 @@ class UpdateLoadBalancerPayload(BaseModel): """ UpdateLoadBalancerPayload - """ + """ # noqa: E501 disable_target_security_group_assignment: Optional[StrictBool] = Field( default=None, diff --git a/services/alb/src/stackit/alb/models/update_target_pool_payload.py b/services/alb/src/stackit/alb/models/update_target_pool_payload.py index 06f90ef8..bc59ad14 100644 --- a/services/alb/src/stackit/alb/models/update_target_pool_payload.py +++ b/services/alb/src/stackit/alb/models/update_target_pool_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -29,7 +29,7 @@ class UpdateTargetPoolPayload(BaseModel): """ UpdateTargetPoolPayload - """ + """ # noqa: E501 active_health_check: Optional[ActiveHealthCheck] = Field(default=None, alias="activeHealthCheck") name: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Target pool name") diff --git a/services/alb/src/stackit/alb/rest.py b/services/alb/src/stackit/alb/rest.py index 65bd14d4..36672d93 100644 --- a/services/alb/src/stackit/alb/rest.py +++ b/services/alb/src/stackit/alb/rest.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -124,7 +124,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/authorization/CHANGELOG.md b/services/authorization/CHANGELOG.md index 9490e02a..9387e68c 100644 --- a/services/authorization/CHANGELOG.md +++ b/services/authorization/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.2.5 +- **Internal:** Improve deserializing and error types + ## v0.2.4 (2025-05-13) - **Bugfix:** Updated regex validator diff --git a/services/authorization/pyproject.toml b/services/authorization/pyproject.toml index d879e30c..7f18a611 100644 --- a/services/authorization/pyproject.toml +++ b/services/authorization/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-authorization" [tool.poetry] name = "stackit-authorization" -version = "v0.2.4" +version = "v0.2.5" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/authorization/src/stackit/authorization/__init__.py b/services/authorization/src/stackit/authorization/__init__.py index 1b4ae593..61e6d1c5 100644 --- a/services/authorization/src/stackit/authorization/__init__.py +++ b/services/authorization/src/stackit/authorization/__init__.py @@ -11,47 +11,89 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "AddMembersPayload", + "ErrorResponse", + "ExistingPermission", + "ListMembersResponse", + "ListPermissionsResponse", + "ListUserMembershipsResponse", + "ListUserPermissionsResponse", + "Member", + "MembersResponse", + "Permission", + "RemoveMembersPayload", + "Role", + "RolesResponse", + "UserMembership", + "UserPermission", + "Zookie", +] + # import apis into sdk package -from stackit.authorization.api.default_api import DefaultApi -from stackit.authorization.api_client import ApiClient +from stackit.authorization.api.default_api import DefaultApi as DefaultApi +from stackit.authorization.api_client import ApiClient as ApiClient # import ApiClient -from stackit.authorization.api_response import ApiResponse -from stackit.authorization.configuration import HostConfiguration -from stackit.authorization.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.authorization.api_response import ApiResponse as ApiResponse +from stackit.authorization.configuration import HostConfiguration as HostConfiguration +from stackit.authorization.exceptions import ApiAttributeError as ApiAttributeError +from stackit.authorization.exceptions import ApiException as ApiException +from stackit.authorization.exceptions import ApiKeyError as ApiKeyError +from stackit.authorization.exceptions import ApiTypeError as ApiTypeError +from stackit.authorization.exceptions import ApiValueError as ApiValueError +from stackit.authorization.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.authorization.models.add_members_payload import AddMembersPayload -from stackit.authorization.models.error_response import ErrorResponse -from stackit.authorization.models.existing_permission import ExistingPermission -from stackit.authorization.models.list_members_response import ListMembersResponse +from stackit.authorization.models.add_members_payload import ( + AddMembersPayload as AddMembersPayload, +) +from stackit.authorization.models.error_response import ErrorResponse as ErrorResponse +from stackit.authorization.models.existing_permission import ( + ExistingPermission as ExistingPermission, +) +from stackit.authorization.models.list_members_response import ( + ListMembersResponse as ListMembersResponse, +) from stackit.authorization.models.list_permissions_response import ( - ListPermissionsResponse, + ListPermissionsResponse as ListPermissionsResponse, ) from stackit.authorization.models.list_user_memberships_response import ( - ListUserMembershipsResponse, + ListUserMembershipsResponse as ListUserMembershipsResponse, ) from stackit.authorization.models.list_user_permissions_response import ( - ListUserPermissionsResponse, -) -from stackit.authorization.models.member import Member -from stackit.authorization.models.members_response import MembersResponse -from stackit.authorization.models.permission import Permission -from stackit.authorization.models.remove_members_payload import RemoveMembersPayload -from stackit.authorization.models.role import Role -from stackit.authorization.models.roles_response import RolesResponse -from stackit.authorization.models.user_membership import UserMembership -from stackit.authorization.models.user_permission import UserPermission -from stackit.authorization.models.zookie import Zookie + ListUserPermissionsResponse as ListUserPermissionsResponse, +) +from stackit.authorization.models.member import Member as Member +from stackit.authorization.models.members_response import ( + MembersResponse as MembersResponse, +) +from stackit.authorization.models.permission import Permission as Permission +from stackit.authorization.models.remove_members_payload import ( + RemoveMembersPayload as RemoveMembersPayload, +) +from stackit.authorization.models.role import Role as Role +from stackit.authorization.models.roles_response import RolesResponse as RolesResponse +from stackit.authorization.models.user_membership import ( + UserMembership as UserMembership, +) +from stackit.authorization.models.user_permission import ( + UserPermission as UserPermission, +) +from stackit.authorization.models.zookie import Zookie as Zookie diff --git a/services/authorization/src/stackit/authorization/api/default_api.py b/services/authorization/src/stackit/authorization/api/default_api.py index 5b05c6f2..e1e5fe5e 100644 --- a/services/authorization/src/stackit/authorization/api/default_api.py +++ b/services/authorization/src/stackit/authorization/api/default_api.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -92,7 +92,7 @@ def add_members( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._add_members_serialize( resource_id=resource_id, @@ -159,7 +159,7 @@ def add_members_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._add_members_serialize( resource_id=resource_id, @@ -226,7 +226,7 @@ def add_members_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._add_members_serialize( resource_id=resource_id, @@ -264,7 +264,7 @@ def _add_members_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -353,7 +353,7 @@ def list_members( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_members_serialize( resource_type=resource_type, @@ -424,7 +424,7 @@ def list_members_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_members_serialize( resource_type=resource_type, @@ -495,7 +495,7 @@ def list_members_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_members_serialize( resource_type=resource_type, @@ -535,7 +535,7 @@ def _list_members_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -614,7 +614,7 @@ def list_permissions( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_permissions_serialize( resource_type=resource_type, @@ -677,7 +677,7 @@ def list_permissions_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_permissions_serialize( resource_type=resource_type, @@ -740,7 +740,7 @@ def list_permissions_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_permissions_serialize( resource_type=resource_type, @@ -776,7 +776,7 @@ def _list_permissions_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -854,7 +854,7 @@ def list_roles( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_roles_serialize( resource_type=resource_type, @@ -921,7 +921,7 @@ def list_roles_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_roles_serialize( resource_type=resource_type, @@ -988,7 +988,7 @@ def list_roles_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_roles_serialize( resource_type=resource_type, @@ -1026,7 +1026,7 @@ def _list_roles_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1110,7 +1110,7 @@ def list_user_memberships( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_user_memberships_serialize( email=email, @@ -1185,7 +1185,7 @@ def list_user_memberships_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_user_memberships_serialize( email=email, @@ -1260,7 +1260,7 @@ def list_user_memberships_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_user_memberships_serialize( email=email, @@ -1302,7 +1302,7 @@ def _list_user_memberships_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1396,7 +1396,7 @@ def list_user_permissions( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_user_permissions_serialize( email=email, @@ -1471,7 +1471,7 @@ def list_user_permissions_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_user_permissions_serialize( email=email, @@ -1546,7 +1546,7 @@ def list_user_permissions_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_user_permissions_serialize( email=email, @@ -1590,7 +1590,7 @@ def _list_user_permissions_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1678,7 +1678,7 @@ def remove_members( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._remove_members_serialize( resource_id=resource_id, @@ -1745,7 +1745,7 @@ def remove_members_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._remove_members_serialize( resource_id=resource_id, @@ -1812,7 +1812,7 @@ def remove_members_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._remove_members_serialize( resource_id=resource_id, @@ -1850,7 +1850,7 @@ def _remove_members_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/authorization/src/stackit/authorization/api_client.py b/services/authorization/src/stackit/authorization/api_client.py index f51d1246..2f7d319d 100644 --- a/services/authorization/src/stackit/authorization/api_client.py +++ b/services/authorization/src/stackit/authorization/api_client.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -331,6 +331,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -350,12 +354,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -457,7 +461,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -473,7 +477,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -488,6 +495,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/authorization/src/stackit/authorization/configuration.py b/services/authorization/src/stackit/authorization/configuration.py index 3601d6c4..3a432779 100644 --- a/services/authorization/src/stackit/authorization/configuration.py +++ b/services/authorization/src/stackit/authorization/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT Membership API @@ -14,7 +9,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -53,7 +70,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -71,7 +88,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -111,7 +133,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -130,12 +152,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/authorization/src/stackit/authorization/exceptions.py b/services/authorization/src/stackit/authorization/exceptions.py index a30ff635..379d04b5 100644 --- a/services/authorization/src/stackit/authorization/exceptions.py +++ b/services/authorization/src/stackit/authorization/exceptions.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -151,6 +151,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -187,6 +194,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/authorization/src/stackit/authorization/models/__init__.py b/services/authorization/src/stackit/authorization/models/__init__.py index 6fbe3d98..5e5cb679 100644 --- a/services/authorization/src/stackit/authorization/models/__init__.py +++ b/services/authorization/src/stackit/authorization/models/__init__.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/authorization/src/stackit/authorization/models/add_members_payload.py b/services/authorization/src/stackit/authorization/models/add_members_payload.py index 9e7e60c7..9dcba75f 100644 --- a/services/authorization/src/stackit/authorization/models/add_members_payload.py +++ b/services/authorization/src/stackit/authorization/models/add_members_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -27,7 +27,7 @@ class AddMembersPayload(BaseModel): """ AddMembersPayload - """ + """ # noqa: E501 members: List[Member] resource_type: Annotated[str, Field(strict=True)] = Field(alias="resourceType") diff --git a/services/authorization/src/stackit/authorization/models/error_response.py b/services/authorization/src/stackit/authorization/models/error_response.py index cf20ce52..7476df1b 100644 --- a/services/authorization/src/stackit/authorization/models/error_response.py +++ b/services/authorization/src/stackit/authorization/models/error_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ErrorResponse(BaseModel): """ ErrorResponse - """ + """ # noqa: E501 error: StrictStr message: StrictStr diff --git a/services/authorization/src/stackit/authorization/models/existing_permission.py b/services/authorization/src/stackit/authorization/models/existing_permission.py index 5bcdfe05..c46b4a3e 100644 --- a/services/authorization/src/stackit/authorization/models/existing_permission.py +++ b/services/authorization/src/stackit/authorization/models/existing_permission.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -25,7 +25,7 @@ class ExistingPermission(BaseModel): """ ExistingPermission - """ + """ # noqa: E501 description: Annotated[str, Field(strict=True, max_length=255)] name: Annotated[str, Field(strict=True, max_length=255)] diff --git a/services/authorization/src/stackit/authorization/models/list_members_response.py b/services/authorization/src/stackit/authorization/models/list_members_response.py index 031c88d5..6d39bd69 100644 --- a/services/authorization/src/stackit/authorization/models/list_members_response.py +++ b/services/authorization/src/stackit/authorization/models/list_members_response.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -27,7 +27,7 @@ class ListMembersResponse(BaseModel): """ ListMembersResponse - """ + """ # noqa: E501 members: List[Member] resource_id: Annotated[str, Field(strict=True)] = Field(alias="resourceId") diff --git a/services/authorization/src/stackit/authorization/models/list_permissions_response.py b/services/authorization/src/stackit/authorization/models/list_permissions_response.py index 17e5f5b9..120b03d0 100644 --- a/services/authorization/src/stackit/authorization/models/list_permissions_response.py +++ b/services/authorization/src/stackit/authorization/models/list_permissions_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListPermissionsResponse(BaseModel): """ ListPermissionsResponse - """ + """ # noqa: E501 permissions: List[Permission] __properties: ClassVar[List[str]] = ["permissions"] diff --git a/services/authorization/src/stackit/authorization/models/list_user_memberships_response.py b/services/authorization/src/stackit/authorization/models/list_user_memberships_response.py index b3e03625..d728907a 100644 --- a/services/authorization/src/stackit/authorization/models/list_user_memberships_response.py +++ b/services/authorization/src/stackit/authorization/models/list_user_memberships_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListUserMembershipsResponse(BaseModel): """ ListUserMembershipsResponse - """ + """ # noqa: E501 items: List[UserMembership] __properties: ClassVar[List[str]] = ["items"] diff --git a/services/authorization/src/stackit/authorization/models/list_user_permissions_response.py b/services/authorization/src/stackit/authorization/models/list_user_permissions_response.py index bb9b424d..52b14693 100644 --- a/services/authorization/src/stackit/authorization/models/list_user_permissions_response.py +++ b/services/authorization/src/stackit/authorization/models/list_user_permissions_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListUserPermissionsResponse(BaseModel): """ ListUserPermissionsResponse - """ + """ # noqa: E501 items: List[UserPermission] __properties: ClassVar[List[str]] = ["items"] diff --git a/services/authorization/src/stackit/authorization/models/member.py b/services/authorization/src/stackit/authorization/models/member.py index f1c58ece..5f8454a1 100644 --- a/services/authorization/src/stackit/authorization/models/member.py +++ b/services/authorization/src/stackit/authorization/models/member.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -25,7 +25,7 @@ class Member(BaseModel): """ Member - """ + """ # noqa: E501 role: Annotated[str, Field(strict=True)] subject: Annotated[str, Field(min_length=1, strict=True, max_length=255)] diff --git a/services/authorization/src/stackit/authorization/models/members_response.py b/services/authorization/src/stackit/authorization/models/members_response.py index 565fa2f1..da3fed2c 100644 --- a/services/authorization/src/stackit/authorization/models/members_response.py +++ b/services/authorization/src/stackit/authorization/models/members_response.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -28,7 +28,7 @@ class MembersResponse(BaseModel): """ MembersResponse - """ + """ # noqa: E501 members: List[Member] resource_id: Annotated[str, Field(strict=True)] = Field(alias="resourceId") diff --git a/services/authorization/src/stackit/authorization/models/permission.py b/services/authorization/src/stackit/authorization/models/permission.py index 1ee48273..df24b580 100644 --- a/services/authorization/src/stackit/authorization/models/permission.py +++ b/services/authorization/src/stackit/authorization/models/permission.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -25,7 +25,7 @@ class Permission(BaseModel): """ Permission - """ + """ # noqa: E501 description: Annotated[str, Field(min_length=1, strict=True, max_length=255)] name: Annotated[str, Field(strict=True, max_length=255)] diff --git a/services/authorization/src/stackit/authorization/models/remove_members_payload.py b/services/authorization/src/stackit/authorization/models/remove_members_payload.py index b7bed1ea..49fbc3fa 100644 --- a/services/authorization/src/stackit/authorization/models/remove_members_payload.py +++ b/services/authorization/src/stackit/authorization/models/remove_members_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator @@ -27,7 +27,7 @@ class RemoveMembersPayload(BaseModel): """ RemoveMembersPayload - """ + """ # noqa: E501 force_remove: Optional[StrictBool] = Field(default=None, alias="forceRemove") members: List[Member] diff --git a/services/authorization/src/stackit/authorization/models/role.py b/services/authorization/src/stackit/authorization/models/role.py index b7baa8f3..17bcdda8 100644 --- a/services/authorization/src/stackit/authorization/models/role.py +++ b/services/authorization/src/stackit/authorization/models/role.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -27,7 +27,7 @@ class Role(BaseModel): """ Role - """ + """ # noqa: E501 description: Annotated[str, Field(strict=True, max_length=255)] id: Optional[Annotated[str, Field(strict=True)]] = None diff --git a/services/authorization/src/stackit/authorization/models/roles_response.py b/services/authorization/src/stackit/authorization/models/roles_response.py index 41447724..0d1659d9 100644 --- a/services/authorization/src/stackit/authorization/models/roles_response.py +++ b/services/authorization/src/stackit/authorization/models/roles_response.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -27,7 +27,7 @@ class RolesResponse(BaseModel): """ RolesResponse - """ + """ # noqa: E501 resource_id: Annotated[str, Field(strict=True)] = Field(alias="resourceId") resource_type: Annotated[str, Field(strict=True)] = Field(alias="resourceType") diff --git a/services/authorization/src/stackit/authorization/models/user_membership.py b/services/authorization/src/stackit/authorization/models/user_membership.py index 7b55f7a0..7a547aa0 100644 --- a/services/authorization/src/stackit/authorization/models/user_membership.py +++ b/services/authorization/src/stackit/authorization/models/user_membership.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -25,7 +25,7 @@ class UserMembership(BaseModel): """ UserMembership - """ + """ # noqa: E501 resource_id: Annotated[str, Field(strict=True)] = Field(alias="resourceId") resource_type: Annotated[str, Field(strict=True)] = Field(alias="resourceType") diff --git a/services/authorization/src/stackit/authorization/models/user_permission.py b/services/authorization/src/stackit/authorization/models/user_permission.py index 7bd02648..cc3a5561 100644 --- a/services/authorization/src/stackit/authorization/models/user_permission.py +++ b/services/authorization/src/stackit/authorization/models/user_permission.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -27,7 +27,7 @@ class UserPermission(BaseModel): """ UserPermission - """ + """ # noqa: E501 permissions: List[ExistingPermission] resource_id: Annotated[str, Field(strict=True)] = Field(alias="resourceId") diff --git a/services/authorization/src/stackit/authorization/models/zookie.py b/services/authorization/src/stackit/authorization/models/zookie.py index d40a2891..23423fea 100644 --- a/services/authorization/src/stackit/authorization/models/zookie.py +++ b/services/authorization/src/stackit/authorization/models/zookie.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Zookie(BaseModel): """ Zookie - """ + """ # noqa: E501 zookie: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["zookie"] diff --git a/services/authorization/src/stackit/authorization/rest.py b/services/authorization/src/stackit/authorization/rest.py index 37929c05..b39602e9 100644 --- a/services/authorization/src/stackit/authorization/rest.py +++ b/services/authorization/src/stackit/authorization/rest.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -124,7 +124,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/cdn/CHANGELOG.md b/services/cdn/CHANGELOG.md index 70d3bc15..71a75c9a 100644 --- a/services/cdn/CHANGELOG.md +++ b/services/cdn/CHANGELOG.md @@ -1,3 +1,7 @@ +## v1.3.0 +- **Breaking change:** Replace oneOf `ConfigBackend` with `HttpBackend` +- **Internal:** Improve deserializing and error types + ## v1.2.0 - **Feature:** Add `default_cache_duration` attribute to `Config`, `ConfigPatch` and `CreateDistributionPayload` model - Add `originUrlRelated` to available options given in `sort_by` description diff --git a/services/cdn/pyproject.toml b/services/cdn/pyproject.toml index 7e56e942..3fc3a7db 100644 --- a/services/cdn/pyproject.toml +++ b/services/cdn/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-cdn" [tool.poetry] name = "stackit-cdn" -version = "v1.2.0" +version = "v1.3.0" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/cdn/src/stackit/cdn/__init__.py b/services/cdn/src/stackit/cdn/__init__.py index 8d89dc1a..87a241e1 100644 --- a/services/cdn/src/stackit/cdn/__init__.py +++ b/services/cdn/src/stackit/cdn/__init__.py @@ -11,73 +11,153 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "Config", + "ConfigPatch", + "CreateDistributionPayload", + "CreateDistributionResponse", + "CustomDomain", + "DeleteCustomDomainResponse", + "DeleteDistributionResponse", + "Distribution", + "DistributionLogsRecord", + "DistributionStatisticsRecord", + "DistributionStatisticsRecordEntry", + "DistributionStatisticsRecordRegions", + "Domain", + "DomainStatus", + "ErrorDetails", + "FindCachePathsResponse", + "FindCachePathsResponseEntry", + "GenericJSONResponse", + "GetCacheInfoResponse", + "GetCacheInfoResponseHistoryEntry", + "GetCustomDomainResponse", + "GetDistributionResponse", + "GetLogsResponse", + "GetStatisticsResponse", + "HttpBackend", + "HttpBackendPatch", + "ListDistributionsResponse", + "Optimizer", + "OptimizerPatch", + "PatchDistributionPayload", + "PatchDistributionResponse", + "PurgeCachePayload", + "PutCustomDomainPayload", + "PutCustomDomainResponse", + "Region", + "StatusError", +] + # import apis into sdk package -from stackit.cdn.api.default_api import DefaultApi -from stackit.cdn.api_client import ApiClient +from stackit.cdn.api.default_api import DefaultApi as DefaultApi +from stackit.cdn.api_client import ApiClient as ApiClient # import ApiClient -from stackit.cdn.api_response import ApiResponse -from stackit.cdn.configuration import HostConfiguration -from stackit.cdn.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.cdn.api_response import ApiResponse as ApiResponse +from stackit.cdn.configuration import HostConfiguration as HostConfiguration +from stackit.cdn.exceptions import ApiAttributeError as ApiAttributeError +from stackit.cdn.exceptions import ApiException as ApiException +from stackit.cdn.exceptions import ApiKeyError as ApiKeyError +from stackit.cdn.exceptions import ApiTypeError as ApiTypeError +from stackit.cdn.exceptions import ApiValueError as ApiValueError +from stackit.cdn.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.cdn.models.config import Config -from stackit.cdn.models.config_backend import ConfigBackend -from stackit.cdn.models.config_patch import ConfigPatch -from stackit.cdn.models.config_patch_backend import ConfigPatchBackend -from stackit.cdn.models.create_distribution_payload import CreateDistributionPayload -from stackit.cdn.models.create_distribution_response import CreateDistributionResponse -from stackit.cdn.models.custom_domain import CustomDomain -from stackit.cdn.models.delete_custom_domain_response import DeleteCustomDomainResponse -from stackit.cdn.models.delete_distribution_response import DeleteDistributionResponse -from stackit.cdn.models.distribution import Distribution -from stackit.cdn.models.distribution_logs_record import DistributionLogsRecord +from stackit.cdn.models.config import Config as Config +from stackit.cdn.models.config_patch import ConfigPatch as ConfigPatch +from stackit.cdn.models.create_distribution_payload import ( + CreateDistributionPayload as CreateDistributionPayload, +) +from stackit.cdn.models.create_distribution_response import ( + CreateDistributionResponse as CreateDistributionResponse, +) +from stackit.cdn.models.custom_domain import CustomDomain as CustomDomain +from stackit.cdn.models.delete_custom_domain_response import ( + DeleteCustomDomainResponse as DeleteCustomDomainResponse, +) +from stackit.cdn.models.delete_distribution_response import ( + DeleteDistributionResponse as DeleteDistributionResponse, +) +from stackit.cdn.models.distribution import Distribution as Distribution +from stackit.cdn.models.distribution_logs_record import ( + DistributionLogsRecord as DistributionLogsRecord, +) from stackit.cdn.models.distribution_statistics_record import ( - DistributionStatisticsRecord, + DistributionStatisticsRecord as DistributionStatisticsRecord, ) from stackit.cdn.models.distribution_statistics_record_entry import ( - DistributionStatisticsRecordEntry, + DistributionStatisticsRecordEntry as DistributionStatisticsRecordEntry, ) from stackit.cdn.models.distribution_statistics_record_regions import ( - DistributionStatisticsRecordRegions, + DistributionStatisticsRecordRegions as DistributionStatisticsRecordRegions, +) +from stackit.cdn.models.domain import Domain as Domain +from stackit.cdn.models.domain_status import DomainStatus as DomainStatus +from stackit.cdn.models.error_details import ErrorDetails as ErrorDetails +from stackit.cdn.models.find_cache_paths_response import ( + FindCachePathsResponse as FindCachePathsResponse, ) -from stackit.cdn.models.domain import Domain -from stackit.cdn.models.domain_status import DomainStatus -from stackit.cdn.models.error_details import ErrorDetails -from stackit.cdn.models.find_cache_paths_response import FindCachePathsResponse from stackit.cdn.models.find_cache_paths_response_entry import ( - FindCachePathsResponseEntry, + FindCachePathsResponseEntry as FindCachePathsResponseEntry, +) +from stackit.cdn.models.generic_json_response import ( + GenericJSONResponse as GenericJSONResponse, +) +from stackit.cdn.models.get_cache_info_response import ( + GetCacheInfoResponse as GetCacheInfoResponse, ) -from stackit.cdn.models.generic_json_response import GenericJSONResponse -from stackit.cdn.models.get_cache_info_response import GetCacheInfoResponse from stackit.cdn.models.get_cache_info_response_history_entry import ( - GetCacheInfoResponseHistoryEntry, -) -from stackit.cdn.models.get_custom_domain_response import GetCustomDomainResponse -from stackit.cdn.models.get_distribution_response import GetDistributionResponse -from stackit.cdn.models.get_logs_response import GetLogsResponse -from stackit.cdn.models.get_statistics_response import GetStatisticsResponse -from stackit.cdn.models.http_backend import HttpBackend -from stackit.cdn.models.http_backend_patch import HttpBackendPatch -from stackit.cdn.models.list_distributions_response import ListDistributionsResponse -from stackit.cdn.models.optimizer import Optimizer -from stackit.cdn.models.optimizer_patch import OptimizerPatch -from stackit.cdn.models.patch_distribution_payload import PatchDistributionPayload -from stackit.cdn.models.patch_distribution_response import PatchDistributionResponse -from stackit.cdn.models.purge_cache_payload import PurgeCachePayload -from stackit.cdn.models.put_custom_domain_payload import PutCustomDomainPayload -from stackit.cdn.models.put_custom_domain_response import PutCustomDomainResponse -from stackit.cdn.models.region import Region -from stackit.cdn.models.status_error import StatusError + GetCacheInfoResponseHistoryEntry as GetCacheInfoResponseHistoryEntry, +) +from stackit.cdn.models.get_custom_domain_response import ( + GetCustomDomainResponse as GetCustomDomainResponse, +) +from stackit.cdn.models.get_distribution_response import ( + GetDistributionResponse as GetDistributionResponse, +) +from stackit.cdn.models.get_logs_response import GetLogsResponse as GetLogsResponse +from stackit.cdn.models.get_statistics_response import ( + GetStatisticsResponse as GetStatisticsResponse, +) +from stackit.cdn.models.http_backend import HttpBackend as HttpBackend +from stackit.cdn.models.http_backend_patch import HttpBackendPatch as HttpBackendPatch +from stackit.cdn.models.list_distributions_response import ( + ListDistributionsResponse as ListDistributionsResponse, +) +from stackit.cdn.models.optimizer import Optimizer as Optimizer +from stackit.cdn.models.optimizer_patch import OptimizerPatch as OptimizerPatch +from stackit.cdn.models.patch_distribution_payload import ( + PatchDistributionPayload as PatchDistributionPayload, +) +from stackit.cdn.models.patch_distribution_response import ( + PatchDistributionResponse as PatchDistributionResponse, +) +from stackit.cdn.models.purge_cache_payload import ( + PurgeCachePayload as PurgeCachePayload, +) +from stackit.cdn.models.put_custom_domain_payload import ( + PutCustomDomainPayload as PutCustomDomainPayload, +) +from stackit.cdn.models.put_custom_domain_response import ( + PutCustomDomainResponse as PutCustomDomainResponse, +) +from stackit.cdn.models.region import Region as Region +from stackit.cdn.models.status_error import StatusError as StatusError diff --git a/services/cdn/src/stackit/cdn/api/default_api.py b/services/cdn/src/stackit/cdn/api/default_api.py index 6d430383..8ec31172 100644 --- a/services/cdn/src/stackit/cdn/api/default_api.py +++ b/services/cdn/src/stackit/cdn/api/default_api.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from datetime import datetime from typing import Any, Dict, List, Optional, Tuple, Union @@ -101,7 +101,7 @@ def create_distribution( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_distribution_serialize( project_id=project_id, @@ -169,7 +169,7 @@ def create_distribution_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_distribution_serialize( project_id=project_id, @@ -237,7 +237,7 @@ def create_distribution_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_distribution_serialize( project_id=project_id, @@ -276,7 +276,7 @@ def _create_distribution_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -368,7 +368,7 @@ def delete_custom_domain( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_custom_domain_serialize( project_id=project_id, @@ -443,7 +443,7 @@ def delete_custom_domain_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_custom_domain_serialize( project_id=project_id, @@ -518,7 +518,7 @@ def delete_custom_domain_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_custom_domain_serialize( project_id=project_id, @@ -560,7 +560,7 @@ def _delete_custom_domain_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -652,7 +652,7 @@ def delete_distribution( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_distribution_serialize( project_id=project_id, @@ -728,7 +728,7 @@ def delete_distribution_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_distribution_serialize( project_id=project_id, @@ -804,7 +804,7 @@ def delete_distribution_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_distribution_serialize( project_id=project_id, @@ -844,7 +844,7 @@ def _delete_distribution_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -929,7 +929,7 @@ def find_cache_paths( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._find_cache_paths_serialize( project_id=project_id, @@ -1000,7 +1000,7 @@ def find_cache_paths_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._find_cache_paths_serialize( project_id=project_id, @@ -1071,7 +1071,7 @@ def find_cache_paths_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._find_cache_paths_serialize( project_id=project_id, @@ -1111,7 +1111,7 @@ def _find_cache_paths_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1196,7 +1196,7 @@ def get_cache_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_cache_info_serialize( project_id=project_id, @@ -1267,7 +1267,7 @@ def get_cache_info_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_cache_info_serialize( project_id=project_id, @@ -1338,7 +1338,7 @@ def get_cache_info_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_cache_info_serialize( project_id=project_id, @@ -1378,7 +1378,7 @@ def _get_cache_info_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1463,7 +1463,7 @@ def get_custom_domain( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_custom_domain_serialize( project_id=project_id, @@ -1535,7 +1535,7 @@ def get_custom_domain_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_custom_domain_serialize( project_id=project_id, @@ -1607,7 +1607,7 @@ def get_custom_domain_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_custom_domain_serialize( project_id=project_id, @@ -1648,7 +1648,7 @@ def _get_custom_domain_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1728,7 +1728,7 @@ def get_distribution( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_distribution_serialize( project_id=project_id, @@ -1796,7 +1796,7 @@ def get_distribution_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_distribution_serialize( project_id=project_id, @@ -1864,7 +1864,7 @@ def get_distribution_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_distribution_serialize( project_id=project_id, @@ -1903,7 +1903,7 @@ def _get_distribution_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2020,7 +2020,7 @@ def get_logs( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_logs_serialize( project_id=project_id, @@ -2132,7 +2132,7 @@ def get_logs_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_logs_serialize( project_id=project_id, @@ -2244,7 +2244,7 @@ def get_logs_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_logs_serialize( project_id=project_id, @@ -2294,7 +2294,7 @@ def _get_logs_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2421,7 +2421,7 @@ def get_statistics( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_statistics_serialize( project_id=project_id, @@ -2512,7 +2512,7 @@ def get_statistics_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_statistics_serialize( project_id=project_id, @@ -2603,7 +2603,7 @@ def get_statistics_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_statistics_serialize( project_id=project_id, @@ -2647,7 +2647,7 @@ def _get_statistics_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2765,7 +2765,7 @@ def list_distributions( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_distributions_serialize( project_id=project_id, @@ -2859,7 +2859,7 @@ def list_distributions_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_distributions_serialize( project_id=project_id, @@ -2953,7 +2953,7 @@ def list_distributions_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_distributions_serialize( project_id=project_id, @@ -2997,7 +2997,7 @@ def _list_distributions_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3092,7 +3092,7 @@ def patch_distribution( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._patch_distribution_serialize( project_id=project_id, @@ -3163,7 +3163,7 @@ def patch_distribution_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._patch_distribution_serialize( project_id=project_id, @@ -3234,7 +3234,7 @@ def patch_distribution_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._patch_distribution_serialize( project_id=project_id, @@ -3274,7 +3274,7 @@ def _patch_distribution_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3365,7 +3365,7 @@ def purge_cache( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._purge_cache_serialize( project_id=project_id, @@ -3436,7 +3436,7 @@ def purge_cache_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._purge_cache_serialize( project_id=project_id, @@ -3507,7 +3507,7 @@ def purge_cache_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._purge_cache_serialize( project_id=project_id, @@ -3547,7 +3547,7 @@ def _purge_cache_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3641,7 +3641,7 @@ def put_custom_domain( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._put_custom_domain_serialize( project_id=project_id, @@ -3716,7 +3716,7 @@ def put_custom_domain_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._put_custom_domain_serialize( project_id=project_id, @@ -3791,7 +3791,7 @@ def put_custom_domain_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._put_custom_domain_serialize( project_id=project_id, @@ -3833,7 +3833,7 @@ def _put_custom_domain_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/cdn/src/stackit/cdn/api_client.py b/services/cdn/src/stackit/cdn/api_client.py index 17919553..be2b57c4 100644 --- a/services/cdn/src/stackit/cdn/api_client.py +++ b/services/cdn/src/stackit/cdn/api_client.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -331,6 +331,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -350,12 +354,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -457,7 +461,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -473,7 +477,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -488,6 +495,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/cdn/src/stackit/cdn/configuration.py b/services/cdn/src/stackit/cdn/configuration.py index 44df57ea..48372c37 100644 --- a/services/cdn/src/stackit/cdn/configuration.py +++ b/services/cdn/src/stackit/cdn/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ CDN API @@ -14,7 +9,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -53,7 +70,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -71,7 +88,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -111,7 +133,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -130,12 +152,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/cdn/src/stackit/cdn/exceptions.py b/services/cdn/src/stackit/cdn/exceptions.py index 44646a25..3b596826 100644 --- a/services/cdn/src/stackit/cdn/exceptions.py +++ b/services/cdn/src/stackit/cdn/exceptions.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -151,6 +151,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -187,6 +194,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/cdn/src/stackit/cdn/models/__init__.py b/services/cdn/src/stackit/cdn/models/__init__.py index cfbbda19..df8cccc5 100644 --- a/services/cdn/src/stackit/cdn/models/__init__.py +++ b/services/cdn/src/stackit/cdn/models/__init__.py @@ -10,14 +10,12 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package from stackit.cdn.models.config import Config -from stackit.cdn.models.config_backend import ConfigBackend from stackit.cdn.models.config_patch import ConfigPatch -from stackit.cdn.models.config_patch_backend import ConfigPatchBackend from stackit.cdn.models.create_distribution_payload import CreateDistributionPayload from stackit.cdn.models.create_distribution_response import CreateDistributionResponse from stackit.cdn.models.custom_domain import CustomDomain diff --git a/services/cdn/src/stackit/cdn/models/config.py b/services/cdn/src/stackit/cdn/models/config.py index e5485dcc..95987638 100644 --- a/services/cdn/src/stackit/cdn/models/config.py +++ b/services/cdn/src/stackit/cdn/models/config.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing_extensions import Annotated, Self -from stackit.cdn.models.config_backend import ConfigBackend +from stackit.cdn.models.http_backend import HttpBackend from stackit.cdn.models.optimizer import Optimizer from stackit.cdn.models.region import Region @@ -28,9 +28,9 @@ class Config(BaseModel): """ Config - """ + """ # noqa: E501 - backend: ConfigBackend + backend: HttpBackend blocked_countries: List[StrictStr] = Field( description="Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. ", alias="blockedCountries", @@ -127,7 +127,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "backend": ConfigBackend.from_dict(obj["backend"]) if obj.get("backend") is not None else None, + "backend": HttpBackend.from_dict(obj["backend"]) if obj.get("backend") is not None else None, "blockedCountries": obj.get("blockedCountries"), "blockedIPs": obj.get("blockedIPs"), "defaultCacheDuration": obj.get("defaultCacheDuration"), diff --git a/services/cdn/src/stackit/cdn/models/config_backend.py b/services/cdn/src/stackit/cdn/models/config_backend.py deleted file mode 100644 index 036090fc..00000000 --- a/services/cdn/src/stackit/cdn/models/config_backend.py +++ /dev/null @@ -1,136 +0,0 @@ -# coding: utf-8 - -""" - CDN API - - API used to create and manage your CDN distributions. - - The version of the OpenAPI document: 1beta.0.0 - 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, Dict, Optional, Set, Union - -from pydantic import ( - BaseModel, - ConfigDict, - ValidationError, - field_validator, -) -from typing_extensions import Self - -from stackit.cdn.models.http_backend import HttpBackend - - -CONFIGBACKEND_ONE_OF_SCHEMAS = ["HttpBackend"] - - -class ConfigBackend(BaseModel): - """ - ConfigBackend - """ - - # data type: HttpBackend - oneof_schema_1_validator: Optional[HttpBackend] = None - actual_instance: Optional[Union[HttpBackend]] = None - one_of_schemas: Set[str] = {"HttpBackend"} - - model_config = ConfigDict( - validate_assignment=True, - protected_namespaces=(), - ) - - discriminator_value_class_map: Dict[str, str] = {} - - def __init__(self, *args, **kwargs) -> None: - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @field_validator("actual_instance") - def actual_instance_must_validate_oneof(cls, v): - instance = ConfigBackend.model_construct() - error_messages = [] - match = 0 - # validate data type: HttpBackend - if not isinstance(v, HttpBackend): - error_messages.append(f"Error! Input type `{type(v)}` is not `HttpBackend`") - else: - match += 1 - if match == 0: - # no match - raise ValueError( - "No match found when setting `actual_instance` in ConfigBackend with oneOf schemas: HttpBackend. Details: " - + ", ".join(error_messages) - ) - else: - return v - - @classmethod - def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Returns the object represented by the json string""" - instance = cls.model_construct() - error_messages = [] - match = 0 - - # deserialize data into HttpBackend - try: - instance.actual_instance = HttpBackend.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError( - "Multiple matches found when deserializing the JSON string into ConfigBackend with oneOf schemas: HttpBackend. Details: " - + ", ".join(error_messages) - ) - elif match == 0: - # no match - raise ValueError( - "No match found when deserializing the JSON string into ConfigBackend with oneOf schemas: HttpBackend. Details: " - + ", ".join(error_messages) - ) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> Optional[Union[Dict[str, Any], HttpBackend]]: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.model_dump()) diff --git a/services/cdn/src/stackit/cdn/models/config_patch.py b/services/cdn/src/stackit/cdn/models/config_patch.py index d0aee3f6..143e796b 100644 --- a/services/cdn/src/stackit/cdn/models/config_patch.py +++ b/services/cdn/src/stackit/cdn/models/config_patch.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing_extensions import Annotated, Self -from stackit.cdn.models.config_patch_backend import ConfigPatchBackend +from stackit.cdn.models.http_backend_patch import HttpBackendPatch from stackit.cdn.models.optimizer_patch import OptimizerPatch from stackit.cdn.models.region import Region @@ -28,9 +28,9 @@ class ConfigPatch(BaseModel): """ ConfigPatch - """ + """ # noqa: E501 - backend: Optional[ConfigPatchBackend] = None + backend: Optional[HttpBackendPatch] = None blocked_countries: Optional[List[StrictStr]] = Field( default=None, description="Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. ", @@ -129,7 +129,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "backend": ConfigPatchBackend.from_dict(obj["backend"]) if obj.get("backend") is not None else None, + "backend": HttpBackendPatch.from_dict(obj["backend"]) if obj.get("backend") is not None else None, "blockedCountries": obj.get("blockedCountries"), "blockedIPs": obj.get("blockedIPs"), "defaultCacheDuration": obj.get("defaultCacheDuration"), diff --git a/services/cdn/src/stackit/cdn/models/config_patch_backend.py b/services/cdn/src/stackit/cdn/models/config_patch_backend.py deleted file mode 100644 index f17156d8..00000000 --- a/services/cdn/src/stackit/cdn/models/config_patch_backend.py +++ /dev/null @@ -1,136 +0,0 @@ -# coding: utf-8 - -""" - CDN API - - API used to create and manage your CDN distributions. - - The version of the OpenAPI document: 1beta.0.0 - 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, Dict, Optional, Set, Union - -from pydantic import ( - BaseModel, - ConfigDict, - ValidationError, - field_validator, -) -from typing_extensions import Self - -from stackit.cdn.models.http_backend_patch import HttpBackendPatch - - -CONFIGPATCHBACKEND_ONE_OF_SCHEMAS = ["HttpBackendPatch"] - - -class ConfigPatchBackend(BaseModel): - """ - ConfigPatchBackend - """ - - # data type: HttpBackendPatch - oneof_schema_1_validator: Optional[HttpBackendPatch] = None - actual_instance: Optional[Union[HttpBackendPatch]] = None - one_of_schemas: Set[str] = {"HttpBackendPatch"} - - model_config = ConfigDict( - validate_assignment=True, - protected_namespaces=(), - ) - - discriminator_value_class_map: Dict[str, str] = {} - - def __init__(self, *args, **kwargs) -> None: - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @field_validator("actual_instance") - def actual_instance_must_validate_oneof(cls, v): - instance = ConfigPatchBackend.model_construct() - error_messages = [] - match = 0 - # validate data type: HttpBackendPatch - if not isinstance(v, HttpBackendPatch): - error_messages.append(f"Error! Input type `{type(v)}` is not `HttpBackendPatch`") - else: - match += 1 - if match == 0: - # no match - raise ValueError( - "No match found when setting `actual_instance` in ConfigPatchBackend with oneOf schemas: HttpBackendPatch. Details: " - + ", ".join(error_messages) - ) - else: - return v - - @classmethod - def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Returns the object represented by the json string""" - instance = cls.model_construct() - error_messages = [] - match = 0 - - # deserialize data into HttpBackendPatch - try: - instance.actual_instance = HttpBackendPatch.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError( - "Multiple matches found when deserializing the JSON string into ConfigPatchBackend with oneOf schemas: HttpBackendPatch. Details: " - + ", ".join(error_messages) - ) - elif match == 0: - # no match - raise ValueError( - "No match found when deserializing the JSON string into ConfigPatchBackend with oneOf schemas: HttpBackendPatch. Details: " - + ", ".join(error_messages) - ) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> Optional[Union[Dict[str, Any], HttpBackendPatch]]: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.model_dump()) diff --git a/services/cdn/src/stackit/cdn/models/create_distribution_payload.py b/services/cdn/src/stackit/cdn/models/create_distribution_payload.py index 37e3c431..933962a4 100644 --- a/services/cdn/src/stackit/cdn/models/create_distribution_payload.py +++ b/services/cdn/src/stackit/cdn/models/create_distribution_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class CreateDistributionPayload(BaseModel): """ CreateDistributionPayload - """ + """ # noqa: E501 blocked_countries: Optional[List[StrictStr]] = Field( default=None, diff --git a/services/cdn/src/stackit/cdn/models/create_distribution_response.py b/services/cdn/src/stackit/cdn/models/create_distribution_response.py index 9170e0a3..c9d8fe87 100644 --- a/services/cdn/src/stackit/cdn/models/create_distribution_response.py +++ b/services/cdn/src/stackit/cdn/models/create_distribution_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class CreateDistributionResponse(BaseModel): """ CreateDistributionResponse - """ + """ # noqa: E501 distribution: Distribution __properties: ClassVar[List[str]] = ["distribution"] diff --git a/services/cdn/src/stackit/cdn/models/custom_domain.py b/services/cdn/src/stackit/cdn/models/custom_domain.py index 0dd4f1f6..1fc53bff 100644 --- a/services/cdn/src/stackit/cdn/models/custom_domain.py +++ b/services/cdn/src/stackit/cdn/models/custom_domain.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class CustomDomain(BaseModel): """ Definition of a custom domain - """ + """ # noqa: E501 errors: Optional[Annotated[List[StatusError], Field(min_length=1)]] = Field( default=None, description="This object is present if the custom domain has errors." diff --git a/services/cdn/src/stackit/cdn/models/delete_custom_domain_response.py b/services/cdn/src/stackit/cdn/models/delete_custom_domain_response.py index a8bd8fb5..9c7c47d0 100644 --- a/services/cdn/src/stackit/cdn/models/delete_custom_domain_response.py +++ b/services/cdn/src/stackit/cdn/models/delete_custom_domain_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class DeleteCustomDomainResponse(BaseModel): """ Returns the custom domain that was deleted while the deletion has not completed yet. After the deletion was successful the response will be empty. - """ + """ # noqa: E501 custom_domain: Optional[CustomDomain] = Field(default=None, alias="customDomain") __properties: ClassVar[List[str]] = ["customDomain"] diff --git a/services/cdn/src/stackit/cdn/models/delete_distribution_response.py b/services/cdn/src/stackit/cdn/models/delete_distribution_response.py index fe5d21a6..45472773 100644 --- a/services/cdn/src/stackit/cdn/models/delete_distribution_response.py +++ b/services/cdn/src/stackit/cdn/models/delete_distribution_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class DeleteDistributionResponse(BaseModel): """ DeleteDistributionResponse - """ + """ # noqa: E501 distribution: Optional[Distribution] = None __properties: ClassVar[List[str]] = ["distribution"] diff --git a/services/cdn/src/stackit/cdn/models/distribution.py b/services/cdn/src/stackit/cdn/models/distribution.py index be6d41d8..1ad303dd 100644 --- a/services/cdn/src/stackit/cdn/models/distribution.py +++ b/services/cdn/src/stackit/cdn/models/distribution.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class Distribution(BaseModel): """ Distribution - """ + """ # noqa: E501 config: Config created_at: datetime = Field( diff --git a/services/cdn/src/stackit/cdn/models/distribution_logs_record.py b/services/cdn/src/stackit/cdn/models/distribution_logs_record.py index 590bc99c..8444c7a7 100644 --- a/services/cdn/src/stackit/cdn/models/distribution_logs_record.py +++ b/services/cdn/src/stackit/cdn/models/distribution_logs_record.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class DistributionLogsRecord(BaseModel): """ DistributionLogsRecord - """ + """ # noqa: E501 cache_hit: StrictBool = Field(alias="cacheHit") data_center_region: StrictStr = Field(alias="dataCenterRegion") diff --git a/services/cdn/src/stackit/cdn/models/distribution_statistics_record.py b/services/cdn/src/stackit/cdn/models/distribution_statistics_record.py index 38b05879..97856e86 100644 --- a/services/cdn/src/stackit/cdn/models/distribution_statistics_record.py +++ b/services/cdn/src/stackit/cdn/models/distribution_statistics_record.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class DistributionStatisticsRecord(BaseModel): """ Aggregated statistics of a distribution during a time interval - """ + """ # noqa: E501 cached_requests: StrictInt = Field(description="Number of cached requests that were served", alias="cachedRequests") total_requests: StrictInt = Field(description="Total number of requests that were served", alias="totalRequests") diff --git a/services/cdn/src/stackit/cdn/models/distribution_statistics_record_entry.py b/services/cdn/src/stackit/cdn/models/distribution_statistics_record_entry.py index 824784f1..52d72b21 100644 --- a/services/cdn/src/stackit/cdn/models/distribution_statistics_record_entry.py +++ b/services/cdn/src/stackit/cdn/models/distribution_statistics_record_entry.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class DistributionStatisticsRecordEntry(BaseModel): """ DistributionStatisticsRecordEntry - """ + """ # noqa: E501 cached_requests: StrictInt = Field(description="Number of cached requests that were served", alias="cachedRequests") total_requests: StrictInt = Field(description="Total number of requests that were served", alias="totalRequests") diff --git a/services/cdn/src/stackit/cdn/models/distribution_statistics_record_regions.py b/services/cdn/src/stackit/cdn/models/distribution_statistics_record_regions.py index 9c8cb20f..d3567eee 100644 --- a/services/cdn/src/stackit/cdn/models/distribution_statistics_record_regions.py +++ b/services/cdn/src/stackit/cdn/models/distribution_statistics_record_regions.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -28,7 +28,7 @@ class DistributionStatisticsRecordRegions(BaseModel): """ Mapping of regions to the metrics for this region for the defined time interval All regions are always present. If no traffic was reported for a region, it will still contain 0-filled properties - """ + """ # noqa: E501 af: DistributionStatisticsRecordEntry = Field(alias="AF") asia: DistributionStatisticsRecordEntry = Field(alias="ASIA") diff --git a/services/cdn/src/stackit/cdn/models/domain.py b/services/cdn/src/stackit/cdn/models/domain.py index ea5108cf..c05036ef 100644 --- a/services/cdn/src/stackit/cdn/models/domain.py +++ b/services/cdn/src/stackit/cdn/models/domain.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class Domain(BaseModel): """ Definition of a custom or managed domain without any certificates or keys - """ + """ # noqa: E501 errors: Optional[Annotated[List[StatusError], Field(min_length=1)]] = Field( default=None, description="This object is present if the custom domain has errors." diff --git a/services/cdn/src/stackit/cdn/models/domain_status.py b/services/cdn/src/stackit/cdn/models/domain_status.py index e6c5f51c..7b8ff562 100644 --- a/services/cdn/src/stackit/cdn/models/domain_status.py +++ b/services/cdn/src/stackit/cdn/models/domain_status.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations diff --git a/services/cdn/src/stackit/cdn/models/error_details.py b/services/cdn/src/stackit/cdn/models/error_details.py index 21a41100..3b625206 100644 --- a/services/cdn/src/stackit/cdn/models/error_details.py +++ b/services/cdn/src/stackit/cdn/models/error_details.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class ErrorDetails(BaseModel): """ ErrorDetails - """ + """ # noqa: E501 de: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field( default=None, description="German description of the error" diff --git a/services/cdn/src/stackit/cdn/models/find_cache_paths_response.py b/services/cdn/src/stackit/cdn/models/find_cache_paths_response.py index 28159197..e7c0f2d5 100644 --- a/services/cdn/src/stackit/cdn/models/find_cache_paths_response.py +++ b/services/cdn/src/stackit/cdn/models/find_cache_paths_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -28,7 +28,7 @@ class FindCachePathsResponse(BaseModel): """ FindCachePathsResponse - """ + """ # noqa: E501 response: List[FindCachePathsResponseEntry] __properties: ClassVar[List[str]] = ["response"] diff --git a/services/cdn/src/stackit/cdn/models/find_cache_paths_response_entry.py b/services/cdn/src/stackit/cdn/models/find_cache_paths_response_entry.py index 3a8de447..630dd226 100644 --- a/services/cdn/src/stackit/cdn/models/find_cache_paths_response_entry.py +++ b/services/cdn/src/stackit/cdn/models/find_cache_paths_response_entry.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class FindCachePathsResponseEntry(BaseModel): """ FindCachePathsResponseEntry - """ + """ # noqa: E501 path: Annotated[str, Field(min_length=1, strict=True)] = Field( description="Defines one path that was previously used as part of a granular purge" diff --git a/services/cdn/src/stackit/cdn/models/generic_json_response.py b/services/cdn/src/stackit/cdn/models/generic_json_response.py index 69e58e0c..c93ee9ac 100644 --- a/services/cdn/src/stackit/cdn/models/generic_json_response.py +++ b/services/cdn/src/stackit/cdn/models/generic_json_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class GenericJSONResponse(BaseModel): """ GenericJSONResponse - """ + """ # noqa: E501 details: Optional[List[ErrorDetails]] = Field(default=None, description="Listing of issues with your request") message: Annotated[str, Field(min_length=1, strict=True)] diff --git a/services/cdn/src/stackit/cdn/models/get_cache_info_response.py b/services/cdn/src/stackit/cdn/models/get_cache_info_response.py index 6e3dd6aa..5df4e127 100644 --- a/services/cdn/src/stackit/cdn/models/get_cache_info_response.py +++ b/services/cdn/src/stackit/cdn/models/get_cache_info_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class GetCacheInfoResponse(BaseModel): """ GetCacheInfoResponse - """ + """ # noqa: E501 history: List[GetCacheInfoResponseHistoryEntry] last_purge_time: Optional[datetime] = Field( diff --git a/services/cdn/src/stackit/cdn/models/get_cache_info_response_history_entry.py b/services/cdn/src/stackit/cdn/models/get_cache_info_response_history_entry.py index c41fc70a..643628a2 100644 --- a/services/cdn/src/stackit/cdn/models/get_cache_info_response_history_entry.py +++ b/services/cdn/src/stackit/cdn/models/get_cache_info_response_history_entry.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class GetCacheInfoResponseHistoryEntry(BaseModel): """ GetCacheInfoResponseHistoryEntry - """ + """ # noqa: E501 occured_at: datetime = Field(alias="occuredAt") occurred_at: datetime = Field(alias="occurredAt") diff --git a/services/cdn/src/stackit/cdn/models/get_custom_domain_response.py b/services/cdn/src/stackit/cdn/models/get_custom_domain_response.py index 7dbb3ea4..547c1f47 100644 --- a/services/cdn/src/stackit/cdn/models/get_custom_domain_response.py +++ b/services/cdn/src/stackit/cdn/models/get_custom_domain_response.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -27,7 +27,7 @@ class GetCustomDomainResponse(BaseModel): """ GetCustomDomainResponse - """ + """ # noqa: E501 custom_domain: CustomDomain = Field(alias="customDomain") domain: Annotated[str, Field(strict=True, max_length=72)] diff --git a/services/cdn/src/stackit/cdn/models/get_distribution_response.py b/services/cdn/src/stackit/cdn/models/get_distribution_response.py index 872d6b11..d2fd5223 100644 --- a/services/cdn/src/stackit/cdn/models/get_distribution_response.py +++ b/services/cdn/src/stackit/cdn/models/get_distribution_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class GetDistributionResponse(BaseModel): """ GetDistributionResponse - """ + """ # noqa: E501 distribution: Distribution __properties: ClassVar[List[str]] = ["distribution"] diff --git a/services/cdn/src/stackit/cdn/models/get_logs_response.py b/services/cdn/src/stackit/cdn/models/get_logs_response.py index f48372cf..06478ab4 100644 --- a/services/cdn/src/stackit/cdn/models/get_logs_response.py +++ b/services/cdn/src/stackit/cdn/models/get_logs_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class GetLogsResponse(BaseModel): """ GetLogsResponse - """ + """ # noqa: E501 logs: List[DistributionLogsRecord] next_page_identifier: Optional[StrictStr] = Field(default=None, alias="nextPageIdentifier") diff --git a/services/cdn/src/stackit/cdn/models/get_statistics_response.py b/services/cdn/src/stackit/cdn/models/get_statistics_response.py index 80f19f3b..81e608f0 100644 --- a/services/cdn/src/stackit/cdn/models/get_statistics_response.py +++ b/services/cdn/src/stackit/cdn/models/get_statistics_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -28,7 +28,7 @@ class GetStatisticsResponse(BaseModel): """ GetStatisticsResponse - """ + """ # noqa: E501 records: List[DistributionStatisticsRecord] __properties: ClassVar[List[str]] = ["records"] diff --git a/services/cdn/src/stackit/cdn/models/http_backend.py b/services/cdn/src/stackit/cdn/models/http_backend.py index 13741880..1d96f899 100644 --- a/services/cdn/src/stackit/cdn/models/http_backend.py +++ b/services/cdn/src/stackit/cdn/models/http_backend.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class HttpBackend(BaseModel): """ HttpBackend - """ + """ # noqa: E501 origin_request_headers: Dict[str, StrictStr] = Field( description="Headers that will be sent with every request to the configured origin. **WARNING**: Do not store sensitive values in the headers. The configuration is stored as plain text. ", diff --git a/services/cdn/src/stackit/cdn/models/http_backend_patch.py b/services/cdn/src/stackit/cdn/models/http_backend_patch.py index 92ce66c6..c6660787 100644 --- a/services/cdn/src/stackit/cdn/models/http_backend_patch.py +++ b/services/cdn/src/stackit/cdn/models/http_backend_patch.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class HttpBackendPatch(BaseModel): """ A partial HTTP Backend - """ + """ # noqa: E501 origin_request_headers: Optional[Dict[str, StrictStr]] = Field( default=None, diff --git a/services/cdn/src/stackit/cdn/models/list_distributions_response.py b/services/cdn/src/stackit/cdn/models/list_distributions_response.py index 18357b70..9d08206c 100644 --- a/services/cdn/src/stackit/cdn/models/list_distributions_response.py +++ b/services/cdn/src/stackit/cdn/models/list_distributions_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListDistributionsResponse(BaseModel): """ ListDistributionsResponse - """ + """ # noqa: E501 distributions: List[Distribution] next_page_identifier: Optional[StrictStr] = Field(default=None, alias="nextPageIdentifier") diff --git a/services/cdn/src/stackit/cdn/models/optimizer.py b/services/cdn/src/stackit/cdn/models/optimizer.py index a8505845..1ab8c33d 100644 --- a/services/cdn/src/stackit/cdn/models/optimizer.py +++ b/services/cdn/src/stackit/cdn/models/optimizer.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Optimizer(BaseModel): """ Optimizer is paid feature, a real-time on the fly image manipulation and optimization service that automatically optimizes your images for faster image delivery. - """ + """ # noqa: E501 enabled: StrictBool = Field( description="Determines if the optimizer should be enabled for this distribution and incurs a monthly fee" diff --git a/services/cdn/src/stackit/cdn/models/optimizer_patch.py b/services/cdn/src/stackit/cdn/models/optimizer_patch.py index 15880a00..76ec4657 100644 --- a/services/cdn/src/stackit/cdn/models/optimizer_patch.py +++ b/services/cdn/src/stackit/cdn/models/optimizer_patch.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class OptimizerPatch(BaseModel): """ OptimizerPatch - """ + """ # noqa: E501 enabled: Optional[StrictBool] = None __properties: ClassVar[List[str]] = ["enabled"] diff --git a/services/cdn/src/stackit/cdn/models/patch_distribution_payload.py b/services/cdn/src/stackit/cdn/models/patch_distribution_payload.py index 3c28729e..66f9dcfc 100644 --- a/services/cdn/src/stackit/cdn/models/patch_distribution_payload.py +++ b/services/cdn/src/stackit/cdn/models/patch_distribution_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class PatchDistributionPayload(BaseModel): """ Defines a partial distribution. Set values - """ + """ # noqa: E501 config: Optional[ConfigPatch] = None intent_id: Optional[StrictStr] = Field( diff --git a/services/cdn/src/stackit/cdn/models/patch_distribution_response.py b/services/cdn/src/stackit/cdn/models/patch_distribution_response.py index 84a07fec..dacb3b98 100644 --- a/services/cdn/src/stackit/cdn/models/patch_distribution_response.py +++ b/services/cdn/src/stackit/cdn/models/patch_distribution_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class PatchDistributionResponse(BaseModel): """ PatchDistributionResponse - """ + """ # noqa: E501 distribution: Distribution __properties: ClassVar[List[str]] = ["distribution"] diff --git a/services/cdn/src/stackit/cdn/models/purge_cache_payload.py b/services/cdn/src/stackit/cdn/models/purge_cache_payload.py index 1753aa67..37e995d3 100644 --- a/services/cdn/src/stackit/cdn/models/purge_cache_payload.py +++ b/services/cdn/src/stackit/cdn/models/purge_cache_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class PurgeCachePayload(BaseModel): """ PurgeCachePayload - """ + """ # noqa: E501 path: Optional[StrictStr] = Field( default=None, diff --git a/services/cdn/src/stackit/cdn/models/put_custom_domain_payload.py b/services/cdn/src/stackit/cdn/models/put_custom_domain_payload.py index 55a129ca..e1b55fc2 100644 --- a/services/cdn/src/stackit/cdn/models/put_custom_domain_payload.py +++ b/services/cdn/src/stackit/cdn/models/put_custom_domain_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class PutCustomDomainPayload(BaseModel): """ PutCustomDomainPayload - """ + """ # noqa: E501 intent_id: Optional[StrictStr] = Field( default=None, diff --git a/services/cdn/src/stackit/cdn/models/put_custom_domain_response.py b/services/cdn/src/stackit/cdn/models/put_custom_domain_response.py index 38990bef..0384c7be 100644 --- a/services/cdn/src/stackit/cdn/models/put_custom_domain_response.py +++ b/services/cdn/src/stackit/cdn/models/put_custom_domain_response.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -27,7 +27,7 @@ class PutCustomDomainResponse(BaseModel): """ PutCustomDomainResponse - """ + """ # noqa: E501 custom_domain: CustomDomain = Field(alias="customDomain") domain: Annotated[str, Field(strict=True, max_length=72)] diff --git a/services/cdn/src/stackit/cdn/models/region.py b/services/cdn/src/stackit/cdn/models/region.py index 56926128..ef941477 100644 --- a/services/cdn/src/stackit/cdn/models/region.py +++ b/services/cdn/src/stackit/cdn/models/region.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations diff --git a/services/cdn/src/stackit/cdn/models/status_error.py b/services/cdn/src/stackit/cdn/models/status_error.py index 3153490f..9883bdd8 100644 --- a/services/cdn/src/stackit/cdn/models/status_error.py +++ b/services/cdn/src/stackit/cdn/models/status_error.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class StatusError(BaseModel): """ StatusError - """ + """ # noqa: E501 de: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field( default=None, diff --git a/services/cdn/src/stackit/cdn/rest.py b/services/cdn/src/stackit/cdn/rest.py index e13efe80..394ca0ad 100644 --- a/services/cdn/src/stackit/cdn/rest.py +++ b/services/cdn/src/stackit/cdn/rest.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -124,7 +124,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/certificates/CHANGELOG.md b/services/certificates/CHANGELOG.md index 4e4b0398..894a5178 100644 --- a/services/certificates/CHANGELOG.md +++ b/services/certificates/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.0.2 +- **Internal:** Improve deserializing and error types + ## v1.0.1 (2025-05-09) - **Feature:** Update user-agent header diff --git a/services/certificates/pyproject.toml b/services/certificates/pyproject.toml index f108447f..b60da2ae 100644 --- a/services/certificates/pyproject.toml +++ b/services/certificates/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-certificates" [tool.poetry] name = "stackit-certificates" -version = "v1.0.1" +version = "v1.0.2" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/certificates/src/stackit/certificates/__init__.py b/services/certificates/src/stackit/certificates/__init__.py index 01174645..c4e79e4e 100644 --- a/services/certificates/src/stackit/certificates/__init__.py +++ b/services/certificates/src/stackit/certificates/__init__.py @@ -11,37 +11,59 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "CreateCertificatePayload", + "CreateCertificateResponse", + "GetCertificateResponse", + "GoogleProtobufAny", + "ListCertificatesResponse", + "Status", +] + # import apis into sdk package -from stackit.certificates.api.default_api import DefaultApi -from stackit.certificates.api_client import ApiClient +from stackit.certificates.api.default_api import DefaultApi as DefaultApi +from stackit.certificates.api_client import ApiClient as ApiClient # import ApiClient -from stackit.certificates.api_response import ApiResponse -from stackit.certificates.configuration import HostConfiguration -from stackit.certificates.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.certificates.api_response import ApiResponse as ApiResponse +from stackit.certificates.configuration import HostConfiguration as HostConfiguration +from stackit.certificates.exceptions import ApiAttributeError as ApiAttributeError +from stackit.certificates.exceptions import ApiException as ApiException +from stackit.certificates.exceptions import ApiKeyError as ApiKeyError +from stackit.certificates.exceptions import ApiTypeError as ApiTypeError +from stackit.certificates.exceptions import ApiValueError as ApiValueError +from stackit.certificates.exceptions import OpenApiException as OpenApiException # import models into sdk package from stackit.certificates.models.create_certificate_payload import ( - CreateCertificatePayload, + CreateCertificatePayload as CreateCertificatePayload, ) from stackit.certificates.models.create_certificate_response import ( - CreateCertificateResponse, + CreateCertificateResponse as CreateCertificateResponse, +) +from stackit.certificates.models.get_certificate_response import ( + GetCertificateResponse as GetCertificateResponse, +) +from stackit.certificates.models.google_protobuf_any import ( + GoogleProtobufAny as GoogleProtobufAny, ) -from stackit.certificates.models.get_certificate_response import GetCertificateResponse -from stackit.certificates.models.google_protobuf_any import GoogleProtobufAny from stackit.certificates.models.list_certificates_response import ( - ListCertificatesResponse, + ListCertificatesResponse as ListCertificatesResponse, ) -from stackit.certificates.models.status import Status +from stackit.certificates.models.status import Status as Status diff --git a/services/certificates/src/stackit/certificates/api/default_api.py b/services/certificates/src/stackit/certificates/api/default_api.py index e7af4e12..c91ea420 100644 --- a/services/certificates/src/stackit/certificates/api/default_api.py +++ b/services/certificates/src/stackit/certificates/api/default_api.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -91,7 +91,7 @@ def create_certificate( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_certificate_serialize( project_id=project_id, @@ -163,7 +163,7 @@ def create_certificate_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_certificate_serialize( project_id=project_id, @@ -235,7 +235,7 @@ def create_certificate_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_certificate_serialize( project_id=project_id, @@ -276,7 +276,7 @@ def _create_certificate_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -367,7 +367,7 @@ def delete_certificate( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_certificate_serialize( project_id=project_id, @@ -439,7 +439,7 @@ def delete_certificate_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_certificate_serialize( project_id=project_id, @@ -511,7 +511,7 @@ def delete_certificate_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_certificate_serialize( project_id=project_id, @@ -552,7 +552,7 @@ def _delete_certificate_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -635,7 +635,7 @@ def get_certificate( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_certificate_serialize( project_id=project_id, @@ -708,7 +708,7 @@ def get_certificate_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_certificate_serialize( project_id=project_id, @@ -781,7 +781,7 @@ def get_certificate_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_certificate_serialize( project_id=project_id, @@ -823,7 +823,7 @@ def _get_certificate_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -919,7 +919,7 @@ def list_certificates( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_certificates_serialize( project_id=project_id, @@ -1006,7 +1006,7 @@ def list_certificates_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_certificates_serialize( project_id=project_id, @@ -1093,7 +1093,7 @@ def list_certificates_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_certificates_serialize( project_id=project_id, @@ -1137,7 +1137,7 @@ def _list_certificates_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/certificates/src/stackit/certificates/api_client.py b/services/certificates/src/stackit/certificates/api_client.py index d7bc573a..6f60b670 100644 --- a/services/certificates/src/stackit/certificates/api_client.py +++ b/services/certificates/src/stackit/certificates/api_client.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -331,6 +331,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -350,12 +354,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -457,7 +461,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -473,7 +477,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -488,6 +495,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/certificates/src/stackit/certificates/configuration.py b/services/certificates/src/stackit/certificates/configuration.py index 06035173..eb8bb2a1 100644 --- a/services/certificates/src/stackit/certificates/configuration.py +++ b/services/certificates/src/stackit/certificates/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ Load Balancer Certificates API @@ -14,7 +9,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -53,7 +70,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -71,7 +88,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -111,7 +133,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -130,12 +152,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/certificates/src/stackit/certificates/exceptions.py b/services/certificates/src/stackit/certificates/exceptions.py index df5804a2..0095f064 100644 --- a/services/certificates/src/stackit/certificates/exceptions.py +++ b/services/certificates/src/stackit/certificates/exceptions.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -151,6 +151,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -187,6 +194,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/certificates/src/stackit/certificates/models/__init__.py b/services/certificates/src/stackit/certificates/models/__init__.py index 35ab1726..d658ac5a 100644 --- a/services/certificates/src/stackit/certificates/models/__init__.py +++ b/services/certificates/src/stackit/certificates/models/__init__.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/certificates/src/stackit/certificates/models/create_certificate_payload.py b/services/certificates/src/stackit/certificates/models/create_certificate_payload.py index ac305942..16a36406 100644 --- a/services/certificates/src/stackit/certificates/models/create_certificate_payload.py +++ b/services/certificates/src/stackit/certificates/models/create_certificate_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class CreateCertificatePayload(BaseModel): """ Uploads a PEM encoded X509 public/private key pair - """ + """ # noqa: E501 name: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="TLS certificate name") private_key: Optional[StrictStr] = Field( diff --git a/services/certificates/src/stackit/certificates/models/create_certificate_response.py b/services/certificates/src/stackit/certificates/models/create_certificate_response.py index 9c7f2008..f176a07d 100644 --- a/services/certificates/src/stackit/certificates/models/create_certificate_response.py +++ b/services/certificates/src/stackit/certificates/models/create_certificate_response.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -25,7 +25,7 @@ class CreateCertificateResponse(BaseModel): """ CreateCertificateResponse returns unique resource id - """ + """ # noqa: E501 id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The certificates resource id") region: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Region") diff --git a/services/certificates/src/stackit/certificates/models/get_certificate_response.py b/services/certificates/src/stackit/certificates/models/get_certificate_response.py index dab99f13..97ef2fab 100644 --- a/services/certificates/src/stackit/certificates/models/get_certificate_response.py +++ b/services/certificates/src/stackit/certificates/models/get_certificate_response.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class GetCertificateResponse(BaseModel): """ GetCertificateResponse returns name, id and public key - """ + """ # noqa: E501 id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The certificates resource id") name: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="TLS certificate name") diff --git a/services/certificates/src/stackit/certificates/models/google_protobuf_any.py b/services/certificates/src/stackit/certificates/models/google_protobuf_any.py index d2c1c928..dacf82c5 100644 --- a/services/certificates/src/stackit/certificates/models/google_protobuf_any.py +++ b/services/certificates/src/stackit/certificates/models/google_protobuf_any.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class GoogleProtobufAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. - """ + """ # noqa: E501 type: Optional[StrictStr] = Field(default=None, description="The type of the serialized message.", alias="@type") additional_properties: Dict[str, Any] = {} diff --git a/services/certificates/src/stackit/certificates/models/list_certificates_response.py b/services/certificates/src/stackit/certificates/models/list_certificates_response.py index d984d9f9..a1d83fea 100644 --- a/services/certificates/src/stackit/certificates/models/list_certificates_response.py +++ b/services/certificates/src/stackit/certificates/models/list_certificates_response.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -27,7 +27,7 @@ class ListCertificatesResponse(BaseModel): """ ListCertificateResponse returns a list of certificate responses - """ + """ # noqa: E501 items: Optional[List[GetCertificateResponse]] = None next_page_id: Optional[Annotated[str, Field(strict=True)]] = Field( diff --git a/services/certificates/src/stackit/certificates/models/status.py b/services/certificates/src/stackit/certificates/models/status.py index cc9a56fd..da393ba4 100644 --- a/services/certificates/src/stackit/certificates/models/status.py +++ b/services/certificates/src/stackit/certificates/models/status.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class Status(BaseModel): """ The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). - """ + """ # noqa: E501 code: Optional[StrictInt] = Field( default=None, diff --git a/services/certificates/src/stackit/certificates/rest.py b/services/certificates/src/stackit/certificates/rest.py index 0b85b303..5b4361c8 100644 --- a/services/certificates/src/stackit/certificates/rest.py +++ b/services/certificates/src/stackit/certificates/rest.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -124,7 +124,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/dns/CHANGELOG.md b/services/dns/CHANGELOG.md index eb037677..ecc7fc82 100644 --- a/services/dns/CHANGELOG.md +++ b/services/dns/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.4.1 +- **Internal:** Improve deserializing and error types + ## v0.4.0 - **Feature:** Add new record set types - **Feature:** Improve documentation for APEX records in `RecordSet` and `CreateRecordSetPayload` models diff --git a/services/dns/pyproject.toml b/services/dns/pyproject.toml index d7a29d3e..0d5212bd 100644 --- a/services/dns/pyproject.toml +++ b/services/dns/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-dns" [tool.poetry] name = "stackit-dns" -version = "v0.4.0" +version = "v0.4.1" authors = ["STACKIT Developer Tools "] description = "STACKIT DNS API" readme = "README.md" diff --git a/services/dns/src/stackit/dns/__init__.py b/services/dns/src/stackit/dns/__init__.py index effdf62e..121a3e34 100644 --- a/services/dns/src/stackit/dns/__init__.py +++ b/services/dns/src/stackit/dns/__init__.py @@ -12,67 +12,151 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "CloneZonePayload", + "CreateLabelPayload", + "CreateLabelResponse", + "CreateRecordSetPayload", + "CreateZonePayload", + "DeleteLabelResponse", + "DomainExtensions", + "DomainObservabilityExtension", + "ErrorMessage", + "ExportRecordSetsPayload", + "ImportRecordSetsPayload", + "ImportRecordSetsResponse", + "ImportSummary", + "Label", + "ListLabelsResponse", + "ListRecordSetsResponse", + "ListZonesResponse", + "Message", + "MoveCodeResponse", + "MoveZonePayload", + "PartialUpdateRecordPayload", + "PartialUpdateRecordSetPayload", + "PartialUpdateZonePayload", + "Record", + "RecordDataExchange", + "RecordPayload", + "RecordSet", + "RecordSetResponse", + "ValidateMoveCodePayload", + "Zone", + "ZoneDataExchange", + "ZoneExtensions", + "ZoneModelsImportRecordModel", + "ZoneModelsImportZoneJson", + "ZoneObservabilityExtension", + "ZoneResponse", +] + # import apis into sdk package -from stackit.dns.api.default_api import DefaultApi -from stackit.dns.api_client import ApiClient +from stackit.dns.api.default_api import DefaultApi as DefaultApi +from stackit.dns.api_client import ApiClient as ApiClient # import ApiClient -from stackit.dns.api_response import ApiResponse -from stackit.dns.configuration import HostConfiguration -from stackit.dns.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.dns.api_response import ApiResponse as ApiResponse +from stackit.dns.configuration import HostConfiguration as HostConfiguration +from stackit.dns.exceptions import ApiAttributeError as ApiAttributeError +from stackit.dns.exceptions import ApiException as ApiException +from stackit.dns.exceptions import ApiKeyError as ApiKeyError +from stackit.dns.exceptions import ApiTypeError as ApiTypeError +from stackit.dns.exceptions import ApiValueError as ApiValueError +from stackit.dns.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.dns.models.clone_zone_payload import CloneZonePayload -from stackit.dns.models.create_label_payload import CreateLabelPayload -from stackit.dns.models.create_label_response import CreateLabelResponse -from stackit.dns.models.create_record_set_payload import CreateRecordSetPayload -from stackit.dns.models.create_zone_payload import CreateZonePayload -from stackit.dns.models.delete_label_response import DeleteLabelResponse -from stackit.dns.models.domain_extensions import DomainExtensions +from stackit.dns.models.clone_zone_payload import CloneZonePayload as CloneZonePayload +from stackit.dns.models.create_label_payload import ( + CreateLabelPayload as CreateLabelPayload, +) +from stackit.dns.models.create_label_response import ( + CreateLabelResponse as CreateLabelResponse, +) +from stackit.dns.models.create_record_set_payload import ( + CreateRecordSetPayload as CreateRecordSetPayload, +) +from stackit.dns.models.create_zone_payload import ( + CreateZonePayload as CreateZonePayload, +) +from stackit.dns.models.delete_label_response import ( + DeleteLabelResponse as DeleteLabelResponse, +) +from stackit.dns.models.domain_extensions import DomainExtensions as DomainExtensions from stackit.dns.models.domain_observability_extension import ( - DomainObservabilityExtension, -) -from stackit.dns.models.error_message import ErrorMessage -from stackit.dns.models.export_record_sets_payload import ExportRecordSetsPayload -from stackit.dns.models.import_record_sets_payload import ImportRecordSetsPayload -from stackit.dns.models.import_record_sets_response import ImportRecordSetsResponse -from stackit.dns.models.import_summary import ImportSummary -from stackit.dns.models.label import Label -from stackit.dns.models.list_labels_response import ListLabelsResponse -from stackit.dns.models.list_record_sets_response import ListRecordSetsResponse -from stackit.dns.models.list_zones_response import ListZonesResponse -from stackit.dns.models.message import Message -from stackit.dns.models.move_code_response import MoveCodeResponse -from stackit.dns.models.move_zone_payload import MoveZonePayload -from stackit.dns.models.partial_update_record_payload import PartialUpdateRecordPayload + DomainObservabilityExtension as DomainObservabilityExtension, +) +from stackit.dns.models.error_message import ErrorMessage as ErrorMessage +from stackit.dns.models.export_record_sets_payload import ( + ExportRecordSetsPayload as ExportRecordSetsPayload, +) +from stackit.dns.models.import_record_sets_payload import ( + ImportRecordSetsPayload as ImportRecordSetsPayload, +) +from stackit.dns.models.import_record_sets_response import ( + ImportRecordSetsResponse as ImportRecordSetsResponse, +) +from stackit.dns.models.import_summary import ImportSummary as ImportSummary +from stackit.dns.models.label import Label as Label +from stackit.dns.models.list_labels_response import ( + ListLabelsResponse as ListLabelsResponse, +) +from stackit.dns.models.list_record_sets_response import ( + ListRecordSetsResponse as ListRecordSetsResponse, +) +from stackit.dns.models.list_zones_response import ( + ListZonesResponse as ListZonesResponse, +) +from stackit.dns.models.message import Message as Message +from stackit.dns.models.move_code_response import MoveCodeResponse as MoveCodeResponse +from stackit.dns.models.move_zone_payload import MoveZonePayload as MoveZonePayload +from stackit.dns.models.partial_update_record_payload import ( + PartialUpdateRecordPayload as PartialUpdateRecordPayload, +) from stackit.dns.models.partial_update_record_set_payload import ( - PartialUpdateRecordSetPayload, -) -from stackit.dns.models.partial_update_zone_payload import PartialUpdateZonePayload -from stackit.dns.models.record import Record -from stackit.dns.models.record_data_exchange import RecordDataExchange -from stackit.dns.models.record_payload import RecordPayload -from stackit.dns.models.record_set import RecordSet -from stackit.dns.models.record_set_response import RecordSetResponse -from stackit.dns.models.validate_move_code_payload import ValidateMoveCodePayload -from stackit.dns.models.zone import Zone -from stackit.dns.models.zone_data_exchange import ZoneDataExchange -from stackit.dns.models.zone_extensions import ZoneExtensions + PartialUpdateRecordSetPayload as PartialUpdateRecordSetPayload, +) +from stackit.dns.models.partial_update_zone_payload import ( + PartialUpdateZonePayload as PartialUpdateZonePayload, +) +from stackit.dns.models.record import Record as Record +from stackit.dns.models.record_data_exchange import ( + RecordDataExchange as RecordDataExchange, +) +from stackit.dns.models.record_payload import RecordPayload as RecordPayload +from stackit.dns.models.record_set import RecordSet as RecordSet +from stackit.dns.models.record_set_response import ( + RecordSetResponse as RecordSetResponse, +) +from stackit.dns.models.validate_move_code_payload import ( + ValidateMoveCodePayload as ValidateMoveCodePayload, +) +from stackit.dns.models.zone import Zone as Zone +from stackit.dns.models.zone_data_exchange import ZoneDataExchange as ZoneDataExchange +from stackit.dns.models.zone_extensions import ZoneExtensions as ZoneExtensions from stackit.dns.models.zone_models_import_record_model import ( - ZoneModelsImportRecordModel, + ZoneModelsImportRecordModel as ZoneModelsImportRecordModel, +) +from stackit.dns.models.zone_models_import_zone_json import ( + ZoneModelsImportZoneJson as ZoneModelsImportZoneJson, +) +from stackit.dns.models.zone_observability_extension import ( + ZoneObservabilityExtension as ZoneObservabilityExtension, ) -from stackit.dns.models.zone_models_import_zone_json import ZoneModelsImportZoneJson -from stackit.dns.models.zone_observability_extension import ZoneObservabilityExtension -from stackit.dns.models.zone_response import ZoneResponse +from stackit.dns.models.zone_response import ZoneResponse as ZoneResponse diff --git a/services/dns/src/stackit/dns/api/default_api.py b/services/dns/src/stackit/dns/api/default_api.py index 461fa386..247c0c06 100644 --- a/services/dns/src/stackit/dns/api/default_api.py +++ b/services/dns/src/stackit/dns/api/default_api.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -113,7 +113,7 @@ def clone_zone( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._clone_zone_serialize( project_id=project_id, @@ -186,7 +186,7 @@ def clone_zone_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._clone_zone_serialize( project_id=project_id, @@ -259,7 +259,7 @@ def clone_zone_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._clone_zone_serialize( project_id=project_id, @@ -301,7 +301,7 @@ def _clone_zone_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -392,7 +392,7 @@ def create_label( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_label_serialize( project_id=project_id, @@ -464,7 +464,7 @@ def create_label_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_label_serialize( project_id=project_id, @@ -536,7 +536,7 @@ def create_label_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_label_serialize( project_id=project_id, @@ -577,7 +577,7 @@ def _create_label_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -665,7 +665,7 @@ def create_move_code( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_move_code_serialize( project_id=project_id, @@ -733,7 +733,7 @@ def create_move_code_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_move_code_serialize( project_id=project_id, @@ -801,7 +801,7 @@ def create_move_code_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_move_code_serialize( project_id=project_id, @@ -840,7 +840,7 @@ def _create_move_code_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -921,7 +921,7 @@ def create_record_set( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_record_set_serialize( project_id=project_id, @@ -994,7 +994,7 @@ def create_record_set_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_record_set_serialize( project_id=project_id, @@ -1067,7 +1067,7 @@ def create_record_set_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_record_set_serialize( project_id=project_id, @@ -1109,7 +1109,7 @@ def _create_record_set_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1197,7 +1197,7 @@ def create_zone( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_zone_serialize( project_id=project_id, @@ -1266,7 +1266,7 @@ def create_zone_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_zone_serialize( project_id=project_id, @@ -1335,7 +1335,7 @@ def create_zone_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_zone_serialize( project_id=project_id, @@ -1375,7 +1375,7 @@ def _create_zone_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1464,7 +1464,7 @@ def delete_label( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_label_serialize( project_id=project_id, @@ -1537,7 +1537,7 @@ def delete_label_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_label_serialize( project_id=project_id, @@ -1610,7 +1610,7 @@ def delete_label_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_label_serialize( project_id=project_id, @@ -1652,7 +1652,7 @@ def _delete_label_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1732,7 +1732,7 @@ def delete_move_code( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_move_code_serialize( project_id=project_id, @@ -1800,7 +1800,7 @@ def delete_move_code_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_move_code_serialize( project_id=project_id, @@ -1868,7 +1868,7 @@ def delete_move_code_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_move_code_serialize( project_id=project_id, @@ -1907,7 +1907,7 @@ def _delete_move_code_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1988,7 +1988,7 @@ def delete_record_set( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_record_set_serialize( project_id=project_id, @@ -2060,7 +2060,7 @@ def delete_record_set_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_record_set_serialize( project_id=project_id, @@ -2132,7 +2132,7 @@ def delete_record_set_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_record_set_serialize( project_id=project_id, @@ -2173,7 +2173,7 @@ def _delete_record_set_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2253,7 +2253,7 @@ def delete_zone( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_zone_serialize( project_id=project_id, @@ -2321,7 +2321,7 @@ def delete_zone_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_zone_serialize( project_id=project_id, @@ -2389,7 +2389,7 @@ def delete_zone_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_zone_serialize( project_id=project_id, @@ -2428,7 +2428,7 @@ def _delete_zone_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2509,7 +2509,7 @@ def export_record_sets( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._export_record_sets_serialize( project_id=project_id, @@ -2580,7 +2580,7 @@ def export_record_sets_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._export_record_sets_serialize( project_id=project_id, @@ -2651,7 +2651,7 @@ def export_record_sets_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._export_record_sets_serialize( project_id=project_id, @@ -2691,7 +2691,7 @@ def _export_record_sets_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2784,7 +2784,7 @@ def get_record_set( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_record_set_serialize( project_id=project_id, @@ -2856,7 +2856,7 @@ def get_record_set_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_record_set_serialize( project_id=project_id, @@ -2928,7 +2928,7 @@ def get_record_set_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_record_set_serialize( project_id=project_id, @@ -2969,7 +2969,7 @@ def _get_record_set_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3049,7 +3049,7 @@ def get_zone( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_zone_serialize( project_id=project_id, @@ -3117,7 +3117,7 @@ def get_zone_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_zone_serialize( project_id=project_id, @@ -3185,7 +3185,7 @@ def get_zone_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_zone_serialize( project_id=project_id, @@ -3224,7 +3224,7 @@ def _get_zone_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3313,7 +3313,7 @@ def import_record_sets( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._import_record_sets_serialize( project_id=project_id, @@ -3395,7 +3395,7 @@ def import_record_sets_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._import_record_sets_serialize( project_id=project_id, @@ -3477,7 +3477,7 @@ def import_record_sets_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._import_record_sets_serialize( project_id=project_id, @@ -3522,7 +3522,7 @@ def _import_record_sets_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3620,7 +3620,7 @@ def list_labels( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_labels_serialize( project_id=project_id, @@ -3689,7 +3689,7 @@ def list_labels_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_labels_serialize( project_id=project_id, @@ -3758,7 +3758,7 @@ def list_labels_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_labels_serialize( project_id=project_id, @@ -3798,7 +3798,7 @@ def _list_labels_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4008,7 +4008,7 @@ def list_record_sets( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_record_sets_serialize( project_id=project_id, @@ -4240,7 +4240,7 @@ def list_record_sets_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_record_sets_serialize( project_id=project_id, @@ -4472,7 +4472,7 @@ def list_record_sets_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_record_sets_serialize( project_id=project_id, @@ -4575,7 +4575,7 @@ def _list_record_sets_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4954,7 +4954,7 @@ def list_zones( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_zones_serialize( project_id=project_id, @@ -5238,7 +5238,7 @@ def list_zones_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_zones_serialize( project_id=project_id, @@ -5522,7 +5522,7 @@ def list_zones_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_zones_serialize( project_id=project_id, @@ -5650,7 +5650,7 @@ def _list_zones_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5902,7 +5902,7 @@ def move_zone( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._move_zone_serialize( project_id=project_id, @@ -5970,7 +5970,7 @@ def move_zone_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._move_zone_serialize( project_id=project_id, @@ -6038,7 +6038,7 @@ def move_zone_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._move_zone_serialize( project_id=project_id, @@ -6077,7 +6077,7 @@ def _move_zone_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -6169,7 +6169,7 @@ def partial_update_record( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_record_serialize( project_id=project_id, @@ -6245,7 +6245,7 @@ def partial_update_record_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_record_serialize( project_id=project_id, @@ -6321,7 +6321,7 @@ def partial_update_record_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_record_serialize( project_id=project_id, @@ -6364,7 +6364,7 @@ def _partial_update_record_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -6462,7 +6462,7 @@ def partial_update_record_set( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_record_set_serialize( project_id=project_id, @@ -6540,7 +6540,7 @@ def partial_update_record_set_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_record_set_serialize( project_id=project_id, @@ -6618,7 +6618,7 @@ def partial_update_record_set_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_record_set_serialize( project_id=project_id, @@ -6661,7 +6661,7 @@ def _partial_update_record_set_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -6754,7 +6754,7 @@ def partial_update_zone( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_zone_serialize( project_id=project_id, @@ -6826,7 +6826,7 @@ def partial_update_zone_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_zone_serialize( project_id=project_id, @@ -6898,7 +6898,7 @@ def partial_update_zone_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_zone_serialize( project_id=project_id, @@ -6939,7 +6939,7 @@ def _partial_update_zone_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -7030,7 +7030,7 @@ def restore_record_set( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._restore_record_set_serialize( project_id=project_id, @@ -7102,7 +7102,7 @@ def restore_record_set_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._restore_record_set_serialize( project_id=project_id, @@ -7174,7 +7174,7 @@ def restore_record_set_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._restore_record_set_serialize( project_id=project_id, @@ -7215,7 +7215,7 @@ def _restore_record_set_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -7295,7 +7295,7 @@ def restore_zone( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._restore_zone_serialize( project_id=project_id, @@ -7362,7 +7362,7 @@ def restore_zone_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._restore_zone_serialize( project_id=project_id, @@ -7429,7 +7429,7 @@ def restore_zone_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._restore_zone_serialize( project_id=project_id, @@ -7467,7 +7467,7 @@ def _restore_zone_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -7545,7 +7545,7 @@ def retrieve_zone( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._retrieve_zone_serialize( project_id=project_id, @@ -7612,7 +7612,7 @@ def retrieve_zone_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._retrieve_zone_serialize( project_id=project_id, @@ -7679,7 +7679,7 @@ def retrieve_zone_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._retrieve_zone_serialize( project_id=project_id, @@ -7717,7 +7717,7 @@ def _retrieve_zone_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -7798,7 +7798,7 @@ def validate_move_code( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._validate_move_code_serialize( project_id=project_id, @@ -7869,7 +7869,7 @@ def validate_move_code_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._validate_move_code_serialize( project_id=project_id, @@ -7940,7 +7940,7 @@ def validate_move_code_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._validate_move_code_serialize( project_id=project_id, @@ -7980,7 +7980,7 @@ def _validate_move_code_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/dns/src/stackit/dns/api_client.py b/services/dns/src/stackit/dns/api_client.py index 870261f9..8d1f0602 100644 --- a/services/dns/src/stackit/dns/api_client.py +++ b/services/dns/src/stackit/dns/api_client.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -332,6 +332,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -351,12 +355,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -458,7 +462,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -474,7 +478,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -489,6 +496,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/dns/src/stackit/dns/configuration.py b/services/dns/src/stackit/dns/configuration.py index 82d682cf..b98490a7 100644 --- a/services/dns/src/stackit/dns/configuration.py +++ b/services/dns/src/stackit/dns/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT DNS API @@ -15,7 +10,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -54,7 +71,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -72,7 +89,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -112,7 +134,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -131,12 +153,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/dns/src/stackit/dns/exceptions.py b/services/dns/src/stackit/dns/exceptions.py index 1e4a2aed..c5914dad 100644 --- a/services/dns/src/stackit/dns/exceptions.py +++ b/services/dns/src/stackit/dns/exceptions.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -152,6 +152,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -188,6 +195,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/dns/src/stackit/dns/models/__init__.py b/services/dns/src/stackit/dns/models/__init__.py index 5f278539..c07e4bcb 100644 --- a/services/dns/src/stackit/dns/models/__init__.py +++ b/services/dns/src/stackit/dns/models/__init__.py @@ -11,7 +11,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/dns/src/stackit/dns/models/clone_zone_payload.py b/services/dns/src/stackit/dns/models/clone_zone_payload.py index dfcd8948..5820d2a0 100644 --- a/services/dns/src/stackit/dns/models/clone_zone_payload.py +++ b/services/dns/src/stackit/dns/models/clone_zone_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CloneZonePayload(BaseModel): """ metadata to clone a zone. - """ + """ # noqa: E501 adjust_records: Optional[StrictBool] = Field( default=None, diff --git a/services/dns/src/stackit/dns/models/create_label_payload.py b/services/dns/src/stackit/dns/models/create_label_payload.py index 5ef1216e..d8f5e1fb 100644 --- a/services/dns/src/stackit/dns/models/create_label_payload.py +++ b/services/dns/src/stackit/dns/models/create_label_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateLabelPayload(BaseModel): """ CreateLabelPayload - """ + """ # noqa: E501 key: Annotated[str, Field(min_length=1, strict=True, max_length=63)] value: Annotated[str, Field(min_length=1, strict=True, max_length=63)] diff --git a/services/dns/src/stackit/dns/models/create_label_response.py b/services/dns/src/stackit/dns/models/create_label_response.py index 061f69da..fa37b36f 100644 --- a/services/dns/src/stackit/dns/models/create_label_response.py +++ b/services/dns/src/stackit/dns/models/create_label_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class CreateLabelResponse(BaseModel): """ ResponseUpsertLabel. - """ + """ # noqa: E501 label: Optional[Label] = None message: Optional[StrictStr] = None diff --git a/services/dns/src/stackit/dns/models/create_record_set_payload.py b/services/dns/src/stackit/dns/models/create_record_set_payload.py index 089b6325..a12bdbed 100644 --- a/services/dns/src/stackit/dns/models/create_record_set_payload.py +++ b/services/dns/src/stackit/dns/models/create_record_set_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class CreateRecordSetPayload(BaseModel): """ RRSetPost for rr set info. - """ + """ # noqa: E501 comment: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( default=None, description="user comment" diff --git a/services/dns/src/stackit/dns/models/create_zone_payload.py b/services/dns/src/stackit/dns/models/create_zone_payload.py index 9b5bb90d..d5e61752 100644 --- a/services/dns/src/stackit/dns/models/create_zone_payload.py +++ b/services/dns/src/stackit/dns/models/create_zone_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -34,7 +34,7 @@ class CreateZonePayload(BaseModel): """ Zone to create. - """ + """ # noqa: E501 acl: Optional[Annotated[str, Field(strict=True, max_length=2000)]] = Field( default="0.0.0.0/0,::/0", description="access control list" diff --git a/services/dns/src/stackit/dns/models/delete_label_response.py b/services/dns/src/stackit/dns/models/delete_label_response.py index f6c9bac2..18f28d2a 100644 --- a/services/dns/src/stackit/dns/models/delete_label_response.py +++ b/services/dns/src/stackit/dns/models/delete_label_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class DeleteLabelResponse(BaseModel): """ ResponseDeleteLabel. - """ + """ # noqa: E501 label: Optional[Label] = None message: Optional[StrictStr] = None diff --git a/services/dns/src/stackit/dns/models/domain_extensions.py b/services/dns/src/stackit/dns/models/domain_extensions.py index 1839e8fe..8e62e483 100644 --- a/services/dns/src/stackit/dns/models/domain_extensions.py +++ b/services/dns/src/stackit/dns/models/domain_extensions.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class DomainExtensions(BaseModel): """ DomainExtensions - """ + """ # noqa: E501 observability_extension: Optional[DomainObservabilityExtension] = Field( default=None, alias="observabilityExtension" diff --git a/services/dns/src/stackit/dns/models/domain_observability_extension.py b/services/dns/src/stackit/dns/models/domain_observability_extension.py index cfae9cbd..c88d5f11 100644 --- a/services/dns/src/stackit/dns/models/domain_observability_extension.py +++ b/services/dns/src/stackit/dns/models/domain_observability_extension.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class DomainObservabilityExtension(BaseModel): """ DomainObservabilityExtension - """ + """ # noqa: E501 observability_instance_id: StrictStr = Field(alias="observabilityInstanceId") state: Optional[StrictStr] = None diff --git a/services/dns/src/stackit/dns/models/error_message.py b/services/dns/src/stackit/dns/models/error_message.py index 8127045c..6a77fb40 100644 --- a/services/dns/src/stackit/dns/models/error_message.py +++ b/services/dns/src/stackit/dns/models/error_message.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ErrorMessage(BaseModel): """ ErrorMessage - """ + """ # noqa: E501 error: Optional[StrictStr] = None message: Optional[StrictStr] = None diff --git a/services/dns/src/stackit/dns/models/export_record_sets_payload.py b/services/dns/src/stackit/dns/models/export_record_sets_payload.py index 2239983e..a41fd7ce 100644 --- a/services/dns/src/stackit/dns/models/export_record_sets_payload.py +++ b/services/dns/src/stackit/dns/models/export_record_sets_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -32,7 +32,7 @@ class ExportRecordSetsPayload(BaseModel): """ ExportRecordSetsPayload - """ + """ # noqa: E501 export_as_fqdn: Optional[StrictBool] = Field(default=True, alias="exportAsFQDN") format: Optional[StrictStr] = "csv" diff --git a/services/dns/src/stackit/dns/models/import_record_sets_payload.py b/services/dns/src/stackit/dns/models/import_record_sets_payload.py index c1da0bd5..717e9f7e 100644 --- a/services/dns/src/stackit/dns/models/import_record_sets_payload.py +++ b/services/dns/src/stackit/dns/models/import_record_sets_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class ImportRecordSetsPayload(BaseModel): """ ImportRecordSetsPayload - """ + """ # noqa: E501 rr_sets: Optional[List[ZoneModelsImportRecordModel]] = Field(default=None, alias="rrSets") __properties: ClassVar[List[str]] = ["rrSets"] diff --git a/services/dns/src/stackit/dns/models/import_record_sets_response.py b/services/dns/src/stackit/dns/models/import_record_sets_response.py index e919d6c2..7b886c93 100644 --- a/services/dns/src/stackit/dns/models/import_record_sets_response.py +++ b/services/dns/src/stackit/dns/models/import_record_sets_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ImportRecordSetsResponse(BaseModel): """ ImportSummaryResponse is the response of the import. - """ + """ # noqa: E501 message: Optional[StrictStr] = None summary: ImportSummary diff --git a/services/dns/src/stackit/dns/models/import_summary.py b/services/dns/src/stackit/dns/models/import_summary.py index 2f2865c0..8be19baa 100644 --- a/services/dns/src/stackit/dns/models/import_summary.py +++ b/services/dns/src/stackit/dns/models/import_summary.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ImportSummary(BaseModel): """ ImportSummary is the summary of the import. - """ + """ # noqa: E501 created_rr_sets: Optional[Annotated[int, Field(le=10000, strict=True, ge=0)]] = Field( default=None, alias="createdRRSets" diff --git a/services/dns/src/stackit/dns/models/label.py b/services/dns/src/stackit/dns/models/label.py index 85e92ca7..76421a4f 100644 --- a/services/dns/src/stackit/dns/models/label.py +++ b/services/dns/src/stackit/dns/models/label.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class Label(BaseModel): """ Label - """ + """ # noqa: E501 key: Annotated[str, Field(min_length=1, strict=True, max_length=63)] value: Annotated[str, Field(min_length=1, strict=True, max_length=63)] diff --git a/services/dns/src/stackit/dns/models/list_labels_response.py b/services/dns/src/stackit/dns/models/list_labels_response.py index 0c3a3afc..6b803fad 100644 --- a/services/dns/src/stackit/dns/models/list_labels_response.py +++ b/services/dns/src/stackit/dns/models/list_labels_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListLabelsResponse(BaseModel): """ ResponseAllLabels. - """ + """ # noqa: E501 labels: Optional[List[Label]] = None message: Optional[StrictStr] = None diff --git a/services/dns/src/stackit/dns/models/list_record_sets_response.py b/services/dns/src/stackit/dns/models/list_record_sets_response.py index 4b963d61..536a1aab 100644 --- a/services/dns/src/stackit/dns/models/list_record_sets_response.py +++ b/services/dns/src/stackit/dns/models/list_record_sets_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListRecordSetsResponse(BaseModel): """ ResponseRRSetAll. - """ + """ # noqa: E501 items_per_page: StrictInt = Field(alias="itemsPerPage") message: Optional[StrictStr] = None diff --git a/services/dns/src/stackit/dns/models/list_zones_response.py b/services/dns/src/stackit/dns/models/list_zones_response.py index 0b642d2f..705e3e16 100644 --- a/services/dns/src/stackit/dns/models/list_zones_response.py +++ b/services/dns/src/stackit/dns/models/list_zones_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListZonesResponse(BaseModel): """ ResponseZoneAll for filtered zones. - """ + """ # noqa: E501 items_per_page: StrictInt = Field(alias="itemsPerPage") message: Optional[StrictStr] = None diff --git a/services/dns/src/stackit/dns/models/message.py b/services/dns/src/stackit/dns/models/message.py index 07d132b3..17aaacf0 100644 --- a/services/dns/src/stackit/dns/models/message.py +++ b/services/dns/src/stackit/dns/models/message.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class Message(BaseModel): """ Message - """ + """ # noqa: E501 message: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["message"] diff --git a/services/dns/src/stackit/dns/models/move_code_response.py b/services/dns/src/stackit/dns/models/move_code_response.py index be021e17..a6a6fdc2 100644 --- a/services/dns/src/stackit/dns/models/move_code_response.py +++ b/services/dns/src/stackit/dns/models/move_code_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class MoveCodeResponse(BaseModel): """ MoveCodeResponse - """ + """ # noqa: E501 code: StrictStr = Field(description="code to move the zone. It is one time shown so better keep it.") expires_at: StrictStr = Field(description="when the code expires", alias="expiresAt") diff --git a/services/dns/src/stackit/dns/models/move_zone_payload.py b/services/dns/src/stackit/dns/models/move_zone_payload.py index e98f5ab0..1937968b 100644 --- a/services/dns/src/stackit/dns/models/move_zone_payload.py +++ b/services/dns/src/stackit/dns/models/move_zone_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class MoveZonePayload(BaseModel): """ body to move zone from one project to another. - """ + """ # noqa: E501 code: Annotated[str, Field(min_length=1, strict=True, max_length=1024)] = Field( description="Code to move the zone. It must be valid, not expired and belong" diff --git a/services/dns/src/stackit/dns/models/partial_update_record_payload.py b/services/dns/src/stackit/dns/models/partial_update_record_payload.py index 12262d28..69411f97 100644 --- a/services/dns/src/stackit/dns/models/partial_update_record_payload.py +++ b/services/dns/src/stackit/dns/models/partial_update_record_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class PartialUpdateRecordPayload(BaseModel): """ RecordPatch for record patch in record set. - """ + """ # noqa: E501 action: StrictStr records: List[RecordPayload] = Field(description="records") diff --git a/services/dns/src/stackit/dns/models/partial_update_record_set_payload.py b/services/dns/src/stackit/dns/models/partial_update_record_set_payload.py index 9f8abae5..31126f6d 100644 --- a/services/dns/src/stackit/dns/models/partial_update_record_set_payload.py +++ b/services/dns/src/stackit/dns/models/partial_update_record_set_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class PartialUpdateRecordSetPayload(BaseModel): """ RRSetPatch for rr patch set info. - """ + """ # noqa: E501 comment: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( default=None, description="user comment" diff --git a/services/dns/src/stackit/dns/models/partial_update_zone_payload.py b/services/dns/src/stackit/dns/models/partial_update_zone_payload.py index fe91e5a8..413c7bfb 100644 --- a/services/dns/src/stackit/dns/models/partial_update_zone_payload.py +++ b/services/dns/src/stackit/dns/models/partial_update_zone_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class PartialUpdateZonePayload(BaseModel): """ PartialUpdateZonePayload - """ + """ # noqa: E501 acl: Optional[Annotated[str, Field(strict=True, max_length=2000)]] = Field( default="0.0.0.0/0,::/0", description="access control list" diff --git a/services/dns/src/stackit/dns/models/record.py b/services/dns/src/stackit/dns/models/record.py index faee5a26..da2192b9 100644 --- a/services/dns/src/stackit/dns/models/record.py +++ b/services/dns/src/stackit/dns/models/record.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class Record(BaseModel): """ Record. - """ + """ # noqa: E501 content: Annotated[str, Field(min_length=1, strict=True, max_length=64000)] = Field( description="content of the record" diff --git a/services/dns/src/stackit/dns/models/record_data_exchange.py b/services/dns/src/stackit/dns/models/record_data_exchange.py index 41c12f96..dd64f94f 100644 --- a/services/dns/src/stackit/dns/models/record_data_exchange.py +++ b/services/dns/src/stackit/dns/models/record_data_exchange.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class RecordDataExchange(BaseModel): """ RecordDataExchange - """ + """ # noqa: E501 comment: Optional[StrictStr] = None content: Optional[List[StrictStr]] = None diff --git a/services/dns/src/stackit/dns/models/record_payload.py b/services/dns/src/stackit/dns/models/record_payload.py index 3618b374..6949652c 100644 --- a/services/dns/src/stackit/dns/models/record_payload.py +++ b/services/dns/src/stackit/dns/models/record_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class RecordPayload(BaseModel): """ RecordPost for rr set info. - """ + """ # noqa: E501 content: Annotated[str, Field(min_length=1, strict=True, max_length=64000)] = Field( description="content of the record" diff --git a/services/dns/src/stackit/dns/models/record_set.py b/services/dns/src/stackit/dns/models/record_set.py index 4533fa12..b1f38125 100644 --- a/services/dns/src/stackit/dns/models/record_set.py +++ b/services/dns/src/stackit/dns/models/record_set.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -34,7 +34,7 @@ class RecordSet(BaseModel): """ RRSet. - """ + """ # noqa: E501 active: Optional[StrictBool] = Field(default=None, description="if the record set is active or not") comment: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="comment") diff --git a/services/dns/src/stackit/dns/models/record_set_response.py b/services/dns/src/stackit/dns/models/record_set_response.py index cb81c88f..81c47483 100644 --- a/services/dns/src/stackit/dns/models/record_set_response.py +++ b/services/dns/src/stackit/dns/models/record_set_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class RecordSetResponse(BaseModel): """ ResponseRRSet for rr set info. - """ + """ # noqa: E501 message: Optional[StrictStr] = None rrset: RecordSet diff --git a/services/dns/src/stackit/dns/models/validate_move_code_payload.py b/services/dns/src/stackit/dns/models/validate_move_code_payload.py index 4b67cdf8..c566deb1 100644 --- a/services/dns/src/stackit/dns/models/validate_move_code_payload.py +++ b/services/dns/src/stackit/dns/models/validate_move_code_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ValidateMoveCodePayload(BaseModel): """ PostValidateMoveCodeRequest body to validate move code request. - """ + """ # noqa: E501 code: Annotated[str, Field(min_length=1, strict=True, max_length=1024)] = Field( description="code that should be validated. It validates if it is valid, not expired and belongs to the zone." diff --git a/services/dns/src/stackit/dns/models/zone.py b/services/dns/src/stackit/dns/models/zone.py index 7df94b5d..f0e07b7c 100644 --- a/services/dns/src/stackit/dns/models/zone.py +++ b/services/dns/src/stackit/dns/models/zone.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -36,7 +36,7 @@ class Zone(BaseModel): """ Zone. - """ + """ # noqa: E501 acl: StrictStr = Field(description="access control list") active: Optional[StrictBool] = None diff --git a/services/dns/src/stackit/dns/models/zone_data_exchange.py b/services/dns/src/stackit/dns/models/zone_data_exchange.py index a8ab0f2a..a938d73f 100644 --- a/services/dns/src/stackit/dns/models/zone_data_exchange.py +++ b/services/dns/src/stackit/dns/models/zone_data_exchange.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ZoneDataExchange(BaseModel): """ ZoneDataExchange - """ + """ # noqa: E501 rr_sets: Optional[List[RecordDataExchange]] = Field(default=None, alias="rrSets") __properties: ClassVar[List[str]] = ["rrSets"] diff --git a/services/dns/src/stackit/dns/models/zone_extensions.py b/services/dns/src/stackit/dns/models/zone_extensions.py index 01514816..b635b75b 100644 --- a/services/dns/src/stackit/dns/models/zone_extensions.py +++ b/services/dns/src/stackit/dns/models/zone_extensions.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ZoneExtensions(BaseModel): """ ZoneExtensions - """ + """ # noqa: E501 observability_extension: Optional[ZoneObservabilityExtension] = Field(default=None, alias="observabilityExtension") __properties: ClassVar[List[str]] = ["observabilityExtension"] diff --git a/services/dns/src/stackit/dns/models/zone_models_import_record_model.py b/services/dns/src/stackit/dns/models/zone_models_import_record_model.py index a66c6847..441eae2f 100644 --- a/services/dns/src/stackit/dns/models/zone_models_import_record_model.py +++ b/services/dns/src/stackit/dns/models/zone_models_import_record_model.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ZoneModelsImportRecordModel(BaseModel): """ ZoneModelsImportRecordModel - """ + """ # noqa: E501 comment: Optional[StrictStr] = None content: Optional[List[StrictStr]] = None diff --git a/services/dns/src/stackit/dns/models/zone_models_import_zone_json.py b/services/dns/src/stackit/dns/models/zone_models_import_zone_json.py index 3685f1c4..7484b468 100644 --- a/services/dns/src/stackit/dns/models/zone_models_import_zone_json.py +++ b/services/dns/src/stackit/dns/models/zone_models_import_zone_json.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class ZoneModelsImportZoneJson(BaseModel): """ ZoneModelsImportZoneJson - """ + """ # noqa: E501 rr_sets: Optional[List[ZoneModelsImportRecordModel]] = Field(default=None, alias="rrSets") __properties: ClassVar[List[str]] = ["rrSets"] diff --git a/services/dns/src/stackit/dns/models/zone_observability_extension.py b/services/dns/src/stackit/dns/models/zone_observability_extension.py index 24975ae2..ccd1e69d 100644 --- a/services/dns/src/stackit/dns/models/zone_observability_extension.py +++ b/services/dns/src/stackit/dns/models/zone_observability_extension.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ZoneObservabilityExtension(BaseModel): """ ZoneObservabilityExtension - """ + """ # noqa: E501 observability_instance_id: StrictStr = Field(alias="observabilityInstanceId") state: Optional[StrictStr] = None diff --git a/services/dns/src/stackit/dns/models/zone_response.py b/services/dns/src/stackit/dns/models/zone_response.py index 0ba22503..c51b789d 100644 --- a/services/dns/src/stackit/dns/models/zone_response.py +++ b/services/dns/src/stackit/dns/models/zone_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ZoneResponse(BaseModel): """ ResponseZone for user info. - """ + """ # noqa: E501 message: Optional[StrictStr] = None zone: Zone diff --git a/services/dns/src/stackit/dns/rest.py b/services/dns/src/stackit/dns/rest.py index ec813953..dfda9f56 100644 --- a/services/dns/src/stackit/dns/rest.py +++ b/services/dns/src/stackit/dns/rest.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -125,7 +125,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/git/CHANGELOG.md b/services/git/CHANGELOG.md index 5b7dd0af..cf67bf89 100644 --- a/services/git/CHANGELOG.md +++ b/services/git/CHANGELOG.md @@ -1,3 +1,8 @@ +## v0.3.0 +- **Feature:** Add validation for field `flavor` in `CreateInstancePayload` model +- **Feature:** Add field `sku` in `Flavor` model +- **Internal:** Improve deserializing and error types + ## v0.2.0 - **Feature:** Add support for `Flavors` for STACKIT git instance - **Improvement:** Error handling and documentation improved diff --git a/services/git/pyproject.toml b/services/git/pyproject.toml index 7c3849dd..22709b7a 100644 --- a/services/git/pyproject.toml +++ b/services/git/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-git" [tool.poetry] name = "stackit-git" -version = "v0.2.0" +version = "v0.3.0" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/git/src/stackit/git/__init__.py b/services/git/src/stackit/git/__init__.py index 8f166806..6a47768c 100644 --- a/services/git/src/stackit/git/__init__.py +++ b/services/git/src/stackit/git/__init__.py @@ -12,35 +12,61 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "CreateInstancePayload", + "Flavor", + "GenericErrorResponse", + "Instance", + "InternalServerErrorResponse", + "ListFlavors", + "ListInstances", + "UnauthorizedResponse", +] + # import apis into sdk package -from stackit.git.api.default_api import DefaultApi -from stackit.git.api_client import ApiClient +from stackit.git.api.default_api import DefaultApi as DefaultApi +from stackit.git.api_client import ApiClient as ApiClient # import ApiClient -from stackit.git.api_response import ApiResponse -from stackit.git.configuration import HostConfiguration -from stackit.git.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.git.api_response import ApiResponse as ApiResponse +from stackit.git.configuration import HostConfiguration as HostConfiguration +from stackit.git.exceptions import ApiAttributeError as ApiAttributeError +from stackit.git.exceptions import ApiException as ApiException +from stackit.git.exceptions import ApiKeyError as ApiKeyError +from stackit.git.exceptions import ApiTypeError as ApiTypeError +from stackit.git.exceptions import ApiValueError as ApiValueError +from stackit.git.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.git.models.create_instance_payload import CreateInstancePayload -from stackit.git.models.flavor import Flavor -from stackit.git.models.generic_error_response import GenericErrorResponse -from stackit.git.models.instance import Instance +from stackit.git.models.create_instance_payload import ( + CreateInstancePayload as CreateInstancePayload, +) +from stackit.git.models.flavor import Flavor as Flavor +from stackit.git.models.generic_error_response import ( + GenericErrorResponse as GenericErrorResponse, +) +from stackit.git.models.instance import Instance as Instance from stackit.git.models.internal_server_error_response import ( - InternalServerErrorResponse, + InternalServerErrorResponse as InternalServerErrorResponse, +) +from stackit.git.models.list_flavors import ListFlavors as ListFlavors +from stackit.git.models.list_instances import ListInstances as ListInstances +from stackit.git.models.unauthorized_response import ( + UnauthorizedResponse as UnauthorizedResponse, ) -from stackit.git.models.list_flavors import ListFlavors -from stackit.git.models.list_instances import ListInstances -from stackit.git.models.unauthorized_response import UnauthorizedResponse diff --git a/services/git/src/stackit/git/api/default_api.py b/services/git/src/stackit/git/api/default_api.py index 80fdffec..ab0ea8bf 100644 --- a/services/git/src/stackit/git/api/default_api.py +++ b/services/git/src/stackit/git/api/default_api.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -89,7 +89,7 @@ def create_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -157,7 +157,7 @@ def create_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -225,7 +225,7 @@ def create_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -264,7 +264,7 @@ def _create_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -352,7 +352,7 @@ def delete_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -423,7 +423,7 @@ def delete_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -494,7 +494,7 @@ def delete_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -534,7 +534,7 @@ def _delete_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -614,7 +614,7 @@ def get_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -684,7 +684,7 @@ def get_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -754,7 +754,7 @@ def get_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -793,7 +793,7 @@ def _get_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -831,14 +831,7 @@ def _get_instance_serialize( @validate_call def list_flavors( self, - project_id: Annotated[ - str, - Field( - strict=True, - max_length=36, - description="The STACKIT portal project UUID the STACKIT Git instance is part of.", - ), - ], + project_id: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="Project identifier.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -853,7 +846,7 @@ def list_flavors( Provides detailed information about possible Git Flavors. - :param project_id: The STACKIT portal project UUID the STACKIT Git instance is part of. (required) + :param project_id: Project identifier. (required) :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -875,7 +868,7 @@ def list_flavors( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_flavors_serialize( project_id=project_id, @@ -887,10 +880,10 @@ def list_flavors( _response_types_map: Dict[str, Optional[str]] = { "200": "ListFlavors", - "400": None, + "400": "GenericErrorResponse", "401": "UnauthorizedResponse", "404": None, - "500": "InternalServerErrorResponse", + "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -902,14 +895,7 @@ def list_flavors( @validate_call def list_flavors_with_http_info( self, - project_id: Annotated[ - str, - Field( - strict=True, - max_length=36, - description="The STACKIT portal project UUID the STACKIT Git instance is part of.", - ), - ], + project_id: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="Project identifier.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -924,7 +910,7 @@ def list_flavors_with_http_info( Provides detailed information about possible Git Flavors. - :param project_id: The STACKIT portal project UUID the STACKIT Git instance is part of. (required) + :param project_id: Project identifier. (required) :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -946,7 +932,7 @@ def list_flavors_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_flavors_serialize( project_id=project_id, @@ -958,10 +944,10 @@ def list_flavors_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "ListFlavors", - "400": None, + "400": "GenericErrorResponse", "401": "UnauthorizedResponse", "404": None, - "500": "InternalServerErrorResponse", + "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -973,14 +959,7 @@ def list_flavors_with_http_info( @validate_call def list_flavors_without_preload_content( self, - project_id: Annotated[ - str, - Field( - strict=True, - max_length=36, - description="The STACKIT portal project UUID the STACKIT Git instance is part of.", - ), - ], + project_id: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="Project identifier.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -995,7 +974,7 @@ def list_flavors_without_preload_content( Provides detailed information about possible Git Flavors. - :param project_id: The STACKIT portal project UUID the STACKIT Git instance is part of. (required) + :param project_id: Project identifier. (required) :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1017,7 +996,7 @@ def list_flavors_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_flavors_serialize( project_id=project_id, @@ -1029,10 +1008,10 @@ def list_flavors_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "ListFlavors", - "400": None, + "400": "GenericErrorResponse", "401": "UnauthorizedResponse", "404": None, - "500": "InternalServerErrorResponse", + "500": "GenericErrorResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -1054,7 +1033,7 @@ def _list_flavors_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1127,7 +1106,7 @@ def list_instances( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -1190,7 +1169,7 @@ def list_instances_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -1253,7 +1232,7 @@ def list_instances_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -1289,7 +1268,7 @@ def _list_instances_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/git/src/stackit/git/api_client.py b/services/git/src/stackit/git/api_client.py index 59ef9b98..8ca96a1e 100644 --- a/services/git/src/stackit/git/api_client.py +++ b/services/git/src/stackit/git/api_client.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -332,6 +332,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -351,12 +355,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -458,7 +462,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -474,7 +478,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -489,6 +496,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/git/src/stackit/git/configuration.py b/services/git/src/stackit/git/configuration.py index a4b58c22..f46e9af9 100644 --- a/services/git/src/stackit/git/configuration.py +++ b/services/git/src/stackit/git/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT Git API @@ -15,7 +10,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -54,7 +71,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -72,7 +89,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -112,7 +134,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -131,12 +153,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/git/src/stackit/git/exceptions.py b/services/git/src/stackit/git/exceptions.py index 38d6acf3..6173d7dc 100644 --- a/services/git/src/stackit/git/exceptions.py +++ b/services/git/src/stackit/git/exceptions.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -152,6 +152,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -188,6 +195,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/git/src/stackit/git/models/__init__.py b/services/git/src/stackit/git/models/__init__.py index 66afcf29..36c3a8cb 100644 --- a/services/git/src/stackit/git/models/__init__.py +++ b/services/git/src/stackit/git/models/__init__.py @@ -11,7 +11,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/git/src/stackit/git/models/create_instance_payload.py b/services/git/src/stackit/git/models/create_instance_payload.py index ab930f32..0c266f78 100644 --- a/services/git/src/stackit/git/models/create_instance_payload.py +++ b/services/git/src/stackit/git/models/create_instance_payload.py @@ -10,13 +10,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,20 +25,30 @@ class CreateInstancePayload(BaseModel): """ - Instance creation configuration options. - """ + Request a STACKIT Git instance to be created with these properties. + """ # noqa: E501 acl: Optional[Annotated[List[StrictStr], Field(max_length=5)]] = Field( default=None, description="Restricted ACL for instance access." ) - flavor: Optional[StrictStr] = Field( - default="git-100", description="Instance flavor. Defaults to git-100 if not specified." + flavor: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field( + default=None, description="Desired instance flavor. Must be one of the defined enum values" ) name: Annotated[str, Field(min_length=5, strict=True, max_length=32)] = Field( description="A user chosen name to distinguish multiple STACKIT Git instances." ) __properties: ClassVar[List[str]] = ["acl", "flavor", "name"] + @field_validator("flavor") + def flavor_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(["git-10", "git-100"]): + raise ValueError("must be one of enum values ('git-10', 'git-100')") + return value + @field_validator("name") def name_validate_regular_expression(cls, value): """Validates the regular expression""" @@ -94,11 +104,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "acl": obj.get("acl"), - "flavor": obj.get("flavor") if obj.get("flavor") is not None else "git-100", - "name": obj.get("name"), - } - ) + _obj = cls.model_validate({"acl": obj.get("acl"), "flavor": obj.get("flavor"), "name": obj.get("name")}) return _obj diff --git a/services/git/src/stackit/git/models/flavor.py b/services/git/src/stackit/git/models/flavor.py index 5475660f..80fc07a6 100644 --- a/services/git/src/stackit/git/models/flavor.py +++ b/services/git/src/stackit/git/models/flavor.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,13 +25,14 @@ class Flavor(BaseModel): """ Describes a STACKIT Git Flavor. - """ + """ # noqa: E501 availability: StrictStr = Field(description="Defines the flavor availability.") description: StrictStr = Field(description="Flavor description.") display_name: StrictStr = Field(description="The display name that will be shown in the Portal.") id: Annotated[str, Field(strict=True, max_length=36)] = Field(description="Flavor id.") - __properties: ClassVar[List[str]] = ["availability", "description", "display_name", "id"] + sku: StrictStr = Field(description="SAP article number.") + __properties: ClassVar[List[str]] = ["availability", "description", "display_name", "id", "sku"] @field_validator("availability") def availability_validate_enum(cls, value): @@ -94,6 +95,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "description": obj.get("description"), "display_name": obj.get("display_name"), "id": obj.get("id"), + "sku": obj.get("sku"), } ) return _obj diff --git a/services/git/src/stackit/git/models/generic_error_response.py b/services/git/src/stackit/git/models/generic_error_response.py index 36ffb1b6..945532c5 100644 --- a/services/git/src/stackit/git/models/generic_error_response.py +++ b/services/git/src/stackit/git/models/generic_error_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class GenericErrorResponse(BaseModel): """ Generic Error Response. - """ + """ # noqa: E501 details: Optional[List[StrictStr]] = None message: StrictStr diff --git a/services/git/src/stackit/git/models/instance.py b/services/git/src/stackit/git/models/instance.py index aeabd26e..2d71925e 100644 --- a/services/git/src/stackit/git/models/instance.py +++ b/services/git/src/stackit/git/models/instance.py @@ -10,13 +10,12 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re from datetime import datetime from typing import Any, ClassVar, Dict, List, Optional, Set @@ -26,21 +25,29 @@ class Instance(BaseModel): """ - Information about an Instance. - """ + Describes a STACKIT Git instance. + """ # noqa: E501 acl: List[StrictStr] = Field(description="Restricted ACL for instance access.") consumed_disk: StrictStr = Field(description="How many bytes of disk space is consumed. Read Only.") consumed_object_storage: StrictStr = Field(description="How many bytes of Object Storage is consumed. Read Only.") - created: datetime = Field(description="Instance creation timestamp in RFC3339 format.") - flavor: StrictStr = Field(description="Instance flavor.") - id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field(description="Instance identifier.") - name: Annotated[str, Field(strict=True, max_length=32)] = Field(description="Instance name.") + created: datetime = Field(description="The date and time the creation of the STACKIT Git instance was triggered.") + flavor: StrictStr = Field(description="Desired instance flavor. Must be one of the defined enum values") + id: Annotated[str, Field(strict=True, max_length=36)] = Field( + description="A auto generated unique id which identifies the STACKIT Git instances." + ) + name: Annotated[str, Field(strict=True, max_length=32)] = Field( + description="A user chosen name to distinguish multiple STACKIT Git instances." + ) state: Annotated[str, Field(strict=True, max_length=32)] = Field( - description="Indicate the readiness state of the instance." + description="The current state of the STACKIT Git instance." + ) + url: Annotated[str, Field(strict=True, max_length=2048)] = Field( + description="The URL for reaching the STACKIT Git instance." + ) + version: Annotated[str, Field(strict=True, max_length=20)] = Field( + description="The current version of STACKIT Git deployed to the instance." ) - url: Annotated[str, Field(strict=True, max_length=512)] = Field(description="Instance url.") - version: Annotated[str, Field(strict=True, max_length=20)] = Field(description="STACKIT Git version indicator.") __properties: ClassVar[List[str]] = [ "acl", "consumed_disk", @@ -54,15 +61,6 @@ class Instance(BaseModel): "version", ] - @field_validator("id") - def id_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", value): - raise ValueError( - r"must validate the regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/" - ) - return value - @field_validator("state") def state_validate_enum(cls, value): """Validates the enum""" diff --git a/services/git/src/stackit/git/models/internal_server_error_response.py b/services/git/src/stackit/git/models/internal_server_error_response.py index 0789f80c..8e3784f7 100644 --- a/services/git/src/stackit/git/models/internal_server_error_response.py +++ b/services/git/src/stackit/git/models/internal_server_error_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class InternalServerErrorResponse(BaseModel): """ Internal server error. - """ + """ # noqa: E501 error: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["error"] diff --git a/services/git/src/stackit/git/models/list_flavors.py b/services/git/src/stackit/git/models/list_flavors.py index 1d2fb2d8..22ba5e1c 100644 --- a/services/git/src/stackit/git/models/list_flavors.py +++ b/services/git/src/stackit/git/models/list_flavors.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListFlavors(BaseModel): """ A list of STACKIT Git flavors. - """ + """ # noqa: E501 flavors: List[Flavor] __properties: ClassVar[List[str]] = ["flavors"] diff --git a/services/git/src/stackit/git/models/list_instances.py b/services/git/src/stackit/git/models/list_instances.py index f4afc5bf..2f48730b 100644 --- a/services/git/src/stackit/git/models/list_instances.py +++ b/services/git/src/stackit/git/models/list_instances.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,10 +26,10 @@ class ListInstances(BaseModel): """ - List of Instances. - """ + A list of STACKIT Git instances. + """ # noqa: E501 - instances: Annotated[List[Instance], Field(max_length=100)] + instances: Annotated[List[Instance], Field(max_length=50)] __properties: ClassVar[List[str]] = ["instances"] model_config = ConfigDict( diff --git a/services/git/src/stackit/git/models/unauthorized_response.py b/services/git/src/stackit/git/models/unauthorized_response.py index caeb666d..40b83963 100644 --- a/services/git/src/stackit/git/models/unauthorized_response.py +++ b/services/git/src/stackit/git/models/unauthorized_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class UnauthorizedResponse(BaseModel): """ The request could not be authorized. - """ + """ # noqa: E501 error: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["error"] diff --git a/services/git/src/stackit/git/rest.py b/services/git/src/stackit/git/rest.py index 6d2aaf59..bcf1f39f 100644 --- a/services/git/src/stackit/git/rest.py +++ b/services/git/src/stackit/git/rest.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -125,7 +125,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/kms/CHANGELOG.md b/services/kms/CHANGELOG.md index 77cf454e..e1d7a20d 100644 --- a/services/kms/CHANGELOG.md +++ b/services/kms/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.0.6 +- **Internal:** Improve deserializing and error types + ## v0.0.5 - **Improvement:** Updated validators diff --git a/services/kms/pyproject.toml b/services/kms/pyproject.toml index 1c1b6eb1..4d02c2f7 100644 --- a/services/kms/pyproject.toml +++ b/services/kms/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-kms" [tool.poetry] name = "stackit-kms" -version = "v0.0.5" +version = "v0.0.6" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/kms/src/stackit/kms/__init__.py b/services/kms/src/stackit/kms/__init__.py index 7ada5189..2bdbde05 100644 --- a/services/kms/src/stackit/kms/__init__.py +++ b/services/kms/src/stackit/kms/__init__.py @@ -11,51 +11,93 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "Algorithm", + "Backend", + "CreateKeyPayload", + "CreateKeyRingPayload", + "CreateWrappingKeyPayload", + "DecryptPayload", + "DecryptedData", + "EncryptPayload", + "EncryptedData", + "HttpError", + "ImportKeyPayload", + "Key", + "KeyList", + "KeyRing", + "KeyRingList", + "Purpose", + "SignPayload", + "SignedData", + "VerifiedData", + "VerifyPayload", + "Version", + "VersionList", + "WrappingAlgorithm", + "WrappingKey", + "WrappingKeyList", + "WrappingPurpose", +] + # import apis into sdk package -from stackit.kms.api.default_api import DefaultApi -from stackit.kms.api_client import ApiClient +from stackit.kms.api.default_api import DefaultApi as DefaultApi +from stackit.kms.api_client import ApiClient as ApiClient # import ApiClient -from stackit.kms.api_response import ApiResponse -from stackit.kms.configuration import HostConfiguration -from stackit.kms.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.kms.api_response import ApiResponse as ApiResponse +from stackit.kms.configuration import HostConfiguration as HostConfiguration +from stackit.kms.exceptions import ApiAttributeError as ApiAttributeError +from stackit.kms.exceptions import ApiException as ApiException +from stackit.kms.exceptions import ApiKeyError as ApiKeyError +from stackit.kms.exceptions import ApiTypeError as ApiTypeError +from stackit.kms.exceptions import ApiValueError as ApiValueError +from stackit.kms.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.kms.models.algorithm import Algorithm -from stackit.kms.models.backend import Backend -from stackit.kms.models.create_key_payload import CreateKeyPayload -from stackit.kms.models.create_key_ring_payload import CreateKeyRingPayload -from stackit.kms.models.create_wrapping_key_payload import CreateWrappingKeyPayload -from stackit.kms.models.decrypt_payload import DecryptPayload -from stackit.kms.models.decrypted_data import DecryptedData -from stackit.kms.models.encrypt_payload import EncryptPayload -from stackit.kms.models.encrypted_data import EncryptedData -from stackit.kms.models.http_error import HttpError -from stackit.kms.models.import_key_payload import ImportKeyPayload -from stackit.kms.models.key import Key -from stackit.kms.models.key_list import KeyList -from stackit.kms.models.key_ring import KeyRing -from stackit.kms.models.key_ring_list import KeyRingList -from stackit.kms.models.purpose import Purpose -from stackit.kms.models.sign_payload import SignPayload -from stackit.kms.models.signed_data import SignedData -from stackit.kms.models.verified_data import VerifiedData -from stackit.kms.models.verify_payload import VerifyPayload -from stackit.kms.models.version import Version -from stackit.kms.models.version_list import VersionList -from stackit.kms.models.wrapping_algorithm import WrappingAlgorithm -from stackit.kms.models.wrapping_key import WrappingKey -from stackit.kms.models.wrapping_key_list import WrappingKeyList -from stackit.kms.models.wrapping_purpose import WrappingPurpose +from stackit.kms.models.algorithm import Algorithm as Algorithm +from stackit.kms.models.backend import Backend as Backend +from stackit.kms.models.create_key_payload import CreateKeyPayload as CreateKeyPayload +from stackit.kms.models.create_key_ring_payload import ( + CreateKeyRingPayload as CreateKeyRingPayload, +) +from stackit.kms.models.create_wrapping_key_payload import ( + CreateWrappingKeyPayload as CreateWrappingKeyPayload, +) +from stackit.kms.models.decrypt_payload import DecryptPayload as DecryptPayload +from stackit.kms.models.decrypted_data import DecryptedData as DecryptedData +from stackit.kms.models.encrypt_payload import EncryptPayload as EncryptPayload +from stackit.kms.models.encrypted_data import EncryptedData as EncryptedData +from stackit.kms.models.http_error import HttpError as HttpError +from stackit.kms.models.import_key_payload import ImportKeyPayload as ImportKeyPayload +from stackit.kms.models.key import Key as Key +from stackit.kms.models.key_list import KeyList as KeyList +from stackit.kms.models.key_ring import KeyRing as KeyRing +from stackit.kms.models.key_ring_list import KeyRingList as KeyRingList +from stackit.kms.models.purpose import Purpose as Purpose +from stackit.kms.models.sign_payload import SignPayload as SignPayload +from stackit.kms.models.signed_data import SignedData as SignedData +from stackit.kms.models.verified_data import VerifiedData as VerifiedData +from stackit.kms.models.verify_payload import VerifyPayload as VerifyPayload +from stackit.kms.models.version import Version as Version +from stackit.kms.models.version_list import VersionList as VersionList +from stackit.kms.models.wrapping_algorithm import WrappingAlgorithm as WrappingAlgorithm +from stackit.kms.models.wrapping_key import WrappingKey as WrappingKey +from stackit.kms.models.wrapping_key_list import WrappingKeyList as WrappingKeyList +from stackit.kms.models.wrapping_purpose import WrappingPurpose as WrappingPurpose diff --git a/services/kms/src/stackit/kms/api/default_api.py b/services/kms/src/stackit/kms/api/default_api.py index 68e682df..99710145 100644 --- a/services/kms/src/stackit/kms/api/default_api.py +++ b/services/kms/src/stackit/kms/api/default_api.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -110,7 +110,7 @@ def create_key( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_key_serialize( project_id=project_id, @@ -186,7 +186,7 @@ def create_key_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_key_serialize( project_id=project_id, @@ -262,7 +262,7 @@ def create_key_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_key_serialize( project_id=project_id, @@ -305,7 +305,7 @@ def _create_key_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -398,7 +398,7 @@ def create_key_ring( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_key_ring_serialize( project_id=project_id, @@ -469,7 +469,7 @@ def create_key_ring_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_key_ring_serialize( project_id=project_id, @@ -540,7 +540,7 @@ def create_key_ring_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_key_ring_serialize( project_id=project_id, @@ -580,7 +580,7 @@ def _create_key_ring_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -674,7 +674,7 @@ def create_wrapping_key( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_wrapping_key_serialize( project_id=project_id, @@ -750,7 +750,7 @@ def create_wrapping_key_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_wrapping_key_serialize( project_id=project_id, @@ -826,7 +826,7 @@ def create_wrapping_key_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_wrapping_key_serialize( project_id=project_id, @@ -869,7 +869,7 @@ def _create_wrapping_key_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -971,7 +971,7 @@ def decrypt( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._decrypt_serialize( project_id=project_id, @@ -1056,7 +1056,7 @@ def decrypt_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._decrypt_serialize( project_id=project_id, @@ -1141,7 +1141,7 @@ def decrypt_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._decrypt_serialize( project_id=project_id, @@ -1189,7 +1189,7 @@ def _decrypt_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1289,7 +1289,7 @@ def delete_key( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_key_serialize( project_id=project_id, @@ -1365,7 +1365,7 @@ def delete_key_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_key_serialize( project_id=project_id, @@ -1441,7 +1441,7 @@ def delete_key_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_key_serialize( project_id=project_id, @@ -1484,7 +1484,7 @@ def _delete_key_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1569,7 +1569,7 @@ def delete_key_ring( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_key_ring_serialize( project_id=project_id, @@ -1641,7 +1641,7 @@ def delete_key_ring_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_key_ring_serialize( project_id=project_id, @@ -1713,7 +1713,7 @@ def delete_key_ring_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_key_ring_serialize( project_id=project_id, @@ -1754,7 +1754,7 @@ def _delete_key_ring_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1840,7 +1840,7 @@ def delete_wrapping_key( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_wrapping_key_serialize( project_id=project_id, @@ -1916,7 +1916,7 @@ def delete_wrapping_key_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_wrapping_key_serialize( project_id=project_id, @@ -1992,7 +1992,7 @@ def delete_wrapping_key_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_wrapping_key_serialize( project_id=project_id, @@ -2035,7 +2035,7 @@ def _delete_wrapping_key_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2126,7 +2126,7 @@ def destroy_version( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._destroy_version_serialize( project_id=project_id, @@ -2206,7 +2206,7 @@ def destroy_version_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._destroy_version_serialize( project_id=project_id, @@ -2286,7 +2286,7 @@ def destroy_version_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._destroy_version_serialize( project_id=project_id, @@ -2331,7 +2331,7 @@ def _destroy_version_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2424,7 +2424,7 @@ def disable_version( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._disable_version_serialize( project_id=project_id, @@ -2504,7 +2504,7 @@ def disable_version_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._disable_version_serialize( project_id=project_id, @@ -2584,7 +2584,7 @@ def disable_version_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._disable_version_serialize( project_id=project_id, @@ -2629,7 +2629,7 @@ def _disable_version_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2722,7 +2722,7 @@ def enable_version( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._enable_version_serialize( project_id=project_id, @@ -2802,7 +2802,7 @@ def enable_version_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._enable_version_serialize( project_id=project_id, @@ -2882,7 +2882,7 @@ def enable_version_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._enable_version_serialize( project_id=project_id, @@ -2927,7 +2927,7 @@ def _enable_version_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3023,7 +3023,7 @@ def encrypt( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._encrypt_serialize( project_id=project_id, @@ -3108,7 +3108,7 @@ def encrypt_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._encrypt_serialize( project_id=project_id, @@ -3193,7 +3193,7 @@ def encrypt_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._encrypt_serialize( project_id=project_id, @@ -3241,7 +3241,7 @@ def _encrypt_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3341,7 +3341,7 @@ def get_key( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_key_serialize( project_id=project_id, @@ -3417,7 +3417,7 @@ def get_key_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_key_serialize( project_id=project_id, @@ -3493,7 +3493,7 @@ def get_key_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_key_serialize( project_id=project_id, @@ -3536,7 +3536,7 @@ def _get_key_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3621,7 +3621,7 @@ def get_key_ring( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_key_ring_serialize( project_id=project_id, @@ -3693,7 +3693,7 @@ def get_key_ring_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_key_ring_serialize( project_id=project_id, @@ -3765,7 +3765,7 @@ def get_key_ring_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_key_ring_serialize( project_id=project_id, @@ -3806,7 +3806,7 @@ def _get_key_ring_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3895,7 +3895,7 @@ def get_version( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_version_serialize( project_id=project_id, @@ -3975,7 +3975,7 @@ def get_version_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_version_serialize( project_id=project_id, @@ -4055,7 +4055,7 @@ def get_version_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_version_serialize( project_id=project_id, @@ -4100,7 +4100,7 @@ def _get_version_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4190,7 +4190,7 @@ def get_wrapping_key( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_wrapping_key_serialize( project_id=project_id, @@ -4266,7 +4266,7 @@ def get_wrapping_key_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_wrapping_key_serialize( project_id=project_id, @@ -4342,7 +4342,7 @@ def get_wrapping_key_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_wrapping_key_serialize( project_id=project_id, @@ -4385,7 +4385,7 @@ def _get_wrapping_key_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4476,7 +4476,7 @@ def import_key( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._import_key_serialize( project_id=project_id, @@ -4557,7 +4557,7 @@ def import_key_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._import_key_serialize( project_id=project_id, @@ -4638,7 +4638,7 @@ def import_key_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._import_key_serialize( project_id=project_id, @@ -4684,7 +4684,7 @@ def _import_key_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4776,7 +4776,7 @@ def list_key_rings( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_key_rings_serialize( project_id=project_id, @@ -4843,7 +4843,7 @@ def list_key_rings_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_key_rings_serialize( project_id=project_id, @@ -4910,7 +4910,7 @@ def list_key_rings_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_key_rings_serialize( project_id=project_id, @@ -4948,7 +4948,7 @@ def _list_key_rings_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5029,7 +5029,7 @@ def list_keys( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_keys_serialize( project_id=project_id, @@ -5101,7 +5101,7 @@ def list_keys_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_keys_serialize( project_id=project_id, @@ -5173,7 +5173,7 @@ def list_keys_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_keys_serialize( project_id=project_id, @@ -5214,7 +5214,7 @@ def _list_keys_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5300,7 +5300,7 @@ def list_versions( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_versions_serialize( project_id=project_id, @@ -5376,7 +5376,7 @@ def list_versions_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_versions_serialize( project_id=project_id, @@ -5452,7 +5452,7 @@ def list_versions_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_versions_serialize( project_id=project_id, @@ -5495,7 +5495,7 @@ def _list_versions_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5580,7 +5580,7 @@ def list_wrapping_keys( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_wrapping_keys_serialize( project_id=project_id, @@ -5652,7 +5652,7 @@ def list_wrapping_keys_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_wrapping_keys_serialize( project_id=project_id, @@ -5724,7 +5724,7 @@ def list_wrapping_keys_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_wrapping_keys_serialize( project_id=project_id, @@ -5765,7 +5765,7 @@ def _list_wrapping_keys_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5851,7 +5851,7 @@ def restore_key( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._restore_key_serialize( project_id=project_id, @@ -5927,7 +5927,7 @@ def restore_key_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._restore_key_serialize( project_id=project_id, @@ -6003,7 +6003,7 @@ def restore_key_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._restore_key_serialize( project_id=project_id, @@ -6046,7 +6046,7 @@ def _restore_key_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -6137,7 +6137,7 @@ def restore_version( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._restore_version_serialize( project_id=project_id, @@ -6217,7 +6217,7 @@ def restore_version_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._restore_version_serialize( project_id=project_id, @@ -6297,7 +6297,7 @@ def restore_version_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._restore_version_serialize( project_id=project_id, @@ -6342,7 +6342,7 @@ def _restore_version_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -6432,7 +6432,7 @@ def rotate_key( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._rotate_key_serialize( project_id=project_id, @@ -6510,7 +6510,7 @@ def rotate_key_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._rotate_key_serialize( project_id=project_id, @@ -6588,7 +6588,7 @@ def rotate_key_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._rotate_key_serialize( project_id=project_id, @@ -6633,7 +6633,7 @@ def _rotate_key_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -6727,7 +6727,7 @@ def sign( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._sign_serialize( project_id=project_id, @@ -6812,7 +6812,7 @@ def sign_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._sign_serialize( project_id=project_id, @@ -6897,7 +6897,7 @@ def sign_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._sign_serialize( project_id=project_id, @@ -6945,7 +6945,7 @@ def _sign_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -7051,7 +7051,7 @@ def verify( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._verify_serialize( project_id=project_id, @@ -7136,7 +7136,7 @@ def verify_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._verify_serialize( project_id=project_id, @@ -7221,7 +7221,7 @@ def verify_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._verify_serialize( project_id=project_id, @@ -7269,7 +7269,7 @@ def _verify_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/kms/src/stackit/kms/api_client.py b/services/kms/src/stackit/kms/api_client.py index 21fe5b5a..594b8f7b 100644 --- a/services/kms/src/stackit/kms/api_client.py +++ b/services/kms/src/stackit/kms/api_client.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -331,6 +331,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -350,12 +354,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -457,7 +461,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -473,7 +477,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -488,6 +495,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/kms/src/stackit/kms/configuration.py b/services/kms/src/stackit/kms/configuration.py index 0c81b320..af52a98d 100644 --- a/services/kms/src/stackit/kms/configuration.py +++ b/services/kms/src/stackit/kms/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT Key Management Service API @@ -14,7 +9,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -53,7 +70,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -72,7 +89,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -112,7 +134,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -131,12 +153,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/kms/src/stackit/kms/exceptions.py b/services/kms/src/stackit/kms/exceptions.py index 7e9a4dd3..dba35426 100644 --- a/services/kms/src/stackit/kms/exceptions.py +++ b/services/kms/src/stackit/kms/exceptions.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -151,6 +151,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -187,6 +194,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/kms/src/stackit/kms/models/__init__.py b/services/kms/src/stackit/kms/models/__init__.py index 0174b5aa..51cb19d3 100644 --- a/services/kms/src/stackit/kms/models/__init__.py +++ b/services/kms/src/stackit/kms/models/__init__.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/kms/src/stackit/kms/models/algorithm.py b/services/kms/src/stackit/kms/models/algorithm.py index e4900daf..bddc6487 100644 --- a/services/kms/src/stackit/kms/models/algorithm.py +++ b/services/kms/src/stackit/kms/models/algorithm.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations diff --git a/services/kms/src/stackit/kms/models/backend.py b/services/kms/src/stackit/kms/models/backend.py index 9e2117e3..43d5759d 100644 --- a/services/kms/src/stackit/kms/models/backend.py +++ b/services/kms/src/stackit/kms/models/backend.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations diff --git a/services/kms/src/stackit/kms/models/create_key_payload.py b/services/kms/src/stackit/kms/models/create_key_payload.py index d43a89e4..cf9ddbe9 100644 --- a/services/kms/src/stackit/kms/models/create_key_payload.py +++ b/services/kms/src/stackit/kms/models/create_key_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -28,7 +28,7 @@ class CreateKeyPayload(BaseModel): """ CreateKeyPayload - """ + """ # noqa: E501 algorithm: Algorithm backend: Backend diff --git a/services/kms/src/stackit/kms/models/create_key_ring_payload.py b/services/kms/src/stackit/kms/models/create_key_ring_payload.py index 943dfc02..c6d21765 100644 --- a/services/kms/src/stackit/kms/models/create_key_ring_payload.py +++ b/services/kms/src/stackit/kms/models/create_key_ring_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateKeyRingPayload(BaseModel): """ CreateKeyRingPayload - """ + """ # noqa: E501 description: Optional[StrictStr] = Field( default=None, description="A user chosen description to distinguish multiple key rings." diff --git a/services/kms/src/stackit/kms/models/create_wrapping_key_payload.py b/services/kms/src/stackit/kms/models/create_wrapping_key_payload.py index b454775a..ef958d80 100644 --- a/services/kms/src/stackit/kms/models/create_wrapping_key_payload.py +++ b/services/kms/src/stackit/kms/models/create_wrapping_key_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -28,7 +28,7 @@ class CreateWrappingKeyPayload(BaseModel): """ CreateWrappingKeyPayload - """ + """ # noqa: E501 algorithm: WrappingAlgorithm backend: Backend diff --git a/services/kms/src/stackit/kms/models/decrypt_payload.py b/services/kms/src/stackit/kms/models/decrypt_payload.py index 456205a6..b384dbbb 100644 --- a/services/kms/src/stackit/kms/models/decrypt_payload.py +++ b/services/kms/src/stackit/kms/models/decrypt_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class DecryptPayload(BaseModel): """ DecryptPayload - """ + """ # noqa: E501 data: Union[StrictBytes, StrictStr] = Field(description="The data that has to be decrypted. Encoded in base64.") __properties: ClassVar[List[str]] = ["data"] diff --git a/services/kms/src/stackit/kms/models/decrypted_data.py b/services/kms/src/stackit/kms/models/decrypted_data.py index 3956ae77..6e7c52ab 100644 --- a/services/kms/src/stackit/kms/models/decrypted_data.py +++ b/services/kms/src/stackit/kms/models/decrypted_data.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class DecryptedData(BaseModel): """ DecryptedData - """ + """ # noqa: E501 data: Union[StrictBytes, StrictStr] = Field(description="The decrypted data. Encoded in base64.") __properties: ClassVar[List[str]] = ["data"] diff --git a/services/kms/src/stackit/kms/models/encrypt_payload.py b/services/kms/src/stackit/kms/models/encrypt_payload.py index 38aa91de..c1bdf32e 100644 --- a/services/kms/src/stackit/kms/models/encrypt_payload.py +++ b/services/kms/src/stackit/kms/models/encrypt_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class EncryptPayload(BaseModel): """ EncryptPayload - """ + """ # noqa: E501 data: Union[StrictBytes, StrictStr] = Field(description="The data that has to be encrypted. Encoded in base64.") __properties: ClassVar[List[str]] = ["data"] diff --git a/services/kms/src/stackit/kms/models/encrypted_data.py b/services/kms/src/stackit/kms/models/encrypted_data.py index 07ec43e2..df0bb457 100644 --- a/services/kms/src/stackit/kms/models/encrypted_data.py +++ b/services/kms/src/stackit/kms/models/encrypted_data.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class EncryptedData(BaseModel): """ EncryptedData - """ + """ # noqa: E501 data: Union[StrictBytes, StrictStr] = Field(description="The encrypted data. Encoded in base64.") __properties: ClassVar[List[str]] = ["data"] diff --git a/services/kms/src/stackit/kms/models/http_error.py b/services/kms/src/stackit/kms/models/http_error.py index 491c52dc..51793d12 100644 --- a/services/kms/src/stackit/kms/models/http_error.py +++ b/services/kms/src/stackit/kms/models/http_error.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class HttpError(BaseModel): """ HttpError - """ + """ # noqa: E501 message: StrictStr = Field(description="A string that gives a short information about what went wrong.") __properties: ClassVar[List[str]] = ["message"] diff --git a/services/kms/src/stackit/kms/models/import_key_payload.py b/services/kms/src/stackit/kms/models/import_key_payload.py index 81dbd60c..aa494167 100644 --- a/services/kms/src/stackit/kms/models/import_key_payload.py +++ b/services/kms/src/stackit/kms/models/import_key_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class ImportKeyPayload(BaseModel): """ ImportKeyPayload - """ + """ # noqa: E501 wrapped_key: StrictStr = Field( description="The wrapped key material that has to be imported. Encoded in base64.", alias="wrappedKey" diff --git a/services/kms/src/stackit/kms/models/key.py b/services/kms/src/stackit/kms/models/key.py index b28e5f13..70e6614d 100644 --- a/services/kms/src/stackit/kms/models/key.py +++ b/services/kms/src/stackit/kms/models/key.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -36,7 +36,7 @@ class Key(BaseModel): """ Key - """ + """ # noqa: E501 algorithm: Algorithm backend: Backend diff --git a/services/kms/src/stackit/kms/models/key_list.py b/services/kms/src/stackit/kms/models/key_list.py index 094ffd9e..28d0af58 100644 --- a/services/kms/src/stackit/kms/models/key_list.py +++ b/services/kms/src/stackit/kms/models/key_list.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class KeyList(BaseModel): """ KeyList - """ + """ # noqa: E501 keys: List[Key] __properties: ClassVar[List[str]] = ["keys"] diff --git a/services/kms/src/stackit/kms/models/key_ring.py b/services/kms/src/stackit/kms/models/key_ring.py index 3c2753c7..53aa446d 100644 --- a/services/kms/src/stackit/kms/models/key_ring.py +++ b/services/kms/src/stackit/kms/models/key_ring.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class KeyRing(BaseModel): """ KeyRing - """ + """ # noqa: E501 created_at: datetime = Field( description="The date and time the creation of the key ring was triggered.", alias="createdAt" diff --git a/services/kms/src/stackit/kms/models/key_ring_list.py b/services/kms/src/stackit/kms/models/key_ring_list.py index 854e24b0..3dc1bafc 100644 --- a/services/kms/src/stackit/kms/models/key_ring_list.py +++ b/services/kms/src/stackit/kms/models/key_ring_list.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class KeyRingList(BaseModel): """ KeyRingList - """ + """ # noqa: E501 key_rings: List[KeyRing] = Field(alias="keyRings") __properties: ClassVar[List[str]] = ["keyRings"] diff --git a/services/kms/src/stackit/kms/models/purpose.py b/services/kms/src/stackit/kms/models/purpose.py index c884ab13..5a36fcac 100644 --- a/services/kms/src/stackit/kms/models/purpose.py +++ b/services/kms/src/stackit/kms/models/purpose.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations diff --git a/services/kms/src/stackit/kms/models/sign_payload.py b/services/kms/src/stackit/kms/models/sign_payload.py index f1d49d0a..8f30b3e1 100644 --- a/services/kms/src/stackit/kms/models/sign_payload.py +++ b/services/kms/src/stackit/kms/models/sign_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class SignPayload(BaseModel): """ SignPayload - """ + """ # noqa: E501 data: Union[StrictBytes, StrictStr] = Field(description="The data that has to be signed. Encoded in base64.") __properties: ClassVar[List[str]] = ["data"] diff --git a/services/kms/src/stackit/kms/models/signed_data.py b/services/kms/src/stackit/kms/models/signed_data.py index 45f67aad..fb7ea875 100644 --- a/services/kms/src/stackit/kms/models/signed_data.py +++ b/services/kms/src/stackit/kms/models/signed_data.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class SignedData(BaseModel): """ SignedData - """ + """ # noqa: E501 data: Union[StrictBytes, StrictStr] = Field(description="The data that was signed. Encoded in base64.") signature: Union[StrictBytes, StrictStr] = Field(description="The signature of the data. Encoded in base64.") diff --git a/services/kms/src/stackit/kms/models/verified_data.py b/services/kms/src/stackit/kms/models/verified_data.py index a28daa78..23d86c4b 100644 --- a/services/kms/src/stackit/kms/models/verified_data.py +++ b/services/kms/src/stackit/kms/models/verified_data.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class VerifiedData(BaseModel): """ VerifiedData - """ + """ # noqa: E501 valid: StrictBool = Field(description="Whether or not the data has a valid signature.") __properties: ClassVar[List[str]] = ["valid"] diff --git a/services/kms/src/stackit/kms/models/verify_payload.py b/services/kms/src/stackit/kms/models/verify_payload.py index 08b63d62..46462bc7 100644 --- a/services/kms/src/stackit/kms/models/verify_payload.py +++ b/services/kms/src/stackit/kms/models/verify_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class VerifyPayload(BaseModel): """ VerifyPayload - """ + """ # noqa: E501 data: Union[StrictBytes, StrictStr] = Field(description="The data to be verified. Encoded in base64.") signature: Union[StrictBytes, StrictStr] = Field(description="The signature of the data. Encoded in base64.") diff --git a/services/kms/src/stackit/kms/models/version.py b/services/kms/src/stackit/kms/models/version.py index cfc63b0b..17fefb9d 100644 --- a/services/kms/src/stackit/kms/models/version.py +++ b/services/kms/src/stackit/kms/models/version.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -33,7 +33,7 @@ class Version(BaseModel): """ Version - """ + """ # noqa: E501 created_at: datetime = Field( description="The date and time the creation of the key was triggered.", alias="createdAt" diff --git a/services/kms/src/stackit/kms/models/version_list.py b/services/kms/src/stackit/kms/models/version_list.py index 2c38db76..07f41aad 100644 --- a/services/kms/src/stackit/kms/models/version_list.py +++ b/services/kms/src/stackit/kms/models/version_list.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class VersionList(BaseModel): """ VersionList - """ + """ # noqa: E501 versions: List[Version] __properties: ClassVar[List[str]] = ["versions"] diff --git a/services/kms/src/stackit/kms/models/wrapping_algorithm.py b/services/kms/src/stackit/kms/models/wrapping_algorithm.py index e2581909..e2c55e60 100644 --- a/services/kms/src/stackit/kms/models/wrapping_algorithm.py +++ b/services/kms/src/stackit/kms/models/wrapping_algorithm.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations diff --git a/services/kms/src/stackit/kms/models/wrapping_key.py b/services/kms/src/stackit/kms/models/wrapping_key.py index 10de3114..17e5bb36 100644 --- a/services/kms/src/stackit/kms/models/wrapping_key.py +++ b/services/kms/src/stackit/kms/models/wrapping_key.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class WrappingKey(BaseModel): """ WrappingKey - """ + """ # noqa: E501 algorithm: WrappingAlgorithm backend: Backend diff --git a/services/kms/src/stackit/kms/models/wrapping_key_list.py b/services/kms/src/stackit/kms/models/wrapping_key_list.py index 43c4068f..d0ef2e0f 100644 --- a/services/kms/src/stackit/kms/models/wrapping_key_list.py +++ b/services/kms/src/stackit/kms/models/wrapping_key_list.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class WrappingKeyList(BaseModel): """ WrappingKeyList - """ + """ # noqa: E501 wrapping_keys: List[WrappingKey] = Field(alias="wrappingKeys") __properties: ClassVar[List[str]] = ["wrappingKeys"] diff --git a/services/kms/src/stackit/kms/models/wrapping_purpose.py b/services/kms/src/stackit/kms/models/wrapping_purpose.py index 3165f82b..0d0a6e8d 100644 --- a/services/kms/src/stackit/kms/models/wrapping_purpose.py +++ b/services/kms/src/stackit/kms/models/wrapping_purpose.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations diff --git a/services/kms/src/stackit/kms/rest.py b/services/kms/src/stackit/kms/rest.py index c9b3a128..db6b5cff 100644 --- a/services/kms/src/stackit/kms/rest.py +++ b/services/kms/src/stackit/kms/rest.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -124,7 +124,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/lbapplication/CHANGELOG.md b/services/lbapplication/CHANGELOG.md index bb86676b..a6ab2658 100644 --- a/services/lbapplication/CHANGELOG.md +++ b/services/lbapplication/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.3.4 +- **Internal:** Improve deserializing and error types + ## v0.3.3 (2025-06-02) - **Deprecated:** Changed deprecation message of `GetQuotaResponse` and `RESTResponseType` diff --git a/services/lbapplication/pyproject.toml b/services/lbapplication/pyproject.toml index 8e0140b1..f8f47166 100644 --- a/services/lbapplication/pyproject.toml +++ b/services/lbapplication/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-lbapplication" [tool.poetry] name = "stackit-lbapplication" -version = "v0.3.3" +version = "v0.3.4" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/lbapplication/src/stackit/lbapplication/__init__.py b/services/lbapplication/src/stackit/lbapplication/__init__.py index 9a7963cd..521ba882 100644 --- a/services/lbapplication/src/stackit/lbapplication/__init__.py +++ b/services/lbapplication/src/stackit/lbapplication/__init__.py @@ -11,89 +11,167 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "ActiveHealthCheck", + "CertificateConfig", + "CookiePersistence", + "CreateCredentialsPayload", + "CreateCredentialsResponse", + "CreateLoadBalancerPayload", + "CredentialsResponse", + "GetCredentialsResponse", + "GetQuotaResponse", + "GetServiceStatusResponse", + "GoogleProtobufAny", + "HTTPConfig", + "Header", + "HttpHealthChecks", + "ListCredentialsResponse", + "ListLoadBalancersResponse", + "ListPlansResponse", + "Listener", + "LoadBalancer", + "LoadBalancerError", + "LoadBalancerOptions", + "LoadbalancerOptionAccessControl", + "LoadbalancerOptionLogs", + "LoadbalancerOptionMetrics", + "LoadbalancerOptionObservability", + "Matcher", + "Network", + "PlanDetails", + "ProtocolOptionsHTTPS", + "QueryParameters", + "Rule", + "Status", + "Target", + "TargetPool", + "UpdateCredentialsPayload", + "UpdateCredentialsResponse", + "UpdateLoadBalancerPayload", + "UpdateTargetPoolPayload", +] + # import apis into sdk package -from stackit.lbapplication.api.default_api import DefaultApi -from stackit.lbapplication.api_client import ApiClient +from stackit.lbapplication.api.default_api import DefaultApi as DefaultApi +from stackit.lbapplication.api_client import ApiClient as ApiClient # import ApiClient -from stackit.lbapplication.api_response import ApiResponse -from stackit.lbapplication.configuration import HostConfiguration -from stackit.lbapplication.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.lbapplication.api_response import ApiResponse as ApiResponse +from stackit.lbapplication.configuration import HostConfiguration as HostConfiguration +from stackit.lbapplication.exceptions import ApiAttributeError as ApiAttributeError +from stackit.lbapplication.exceptions import ApiException as ApiException +from stackit.lbapplication.exceptions import ApiKeyError as ApiKeyError +from stackit.lbapplication.exceptions import ApiTypeError as ApiTypeError +from stackit.lbapplication.exceptions import ApiValueError as ApiValueError +from stackit.lbapplication.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.lbapplication.models.active_health_check import ActiveHealthCheck -from stackit.lbapplication.models.certificate_config import CertificateConfig -from stackit.lbapplication.models.cookie_persistence import CookiePersistence +from stackit.lbapplication.models.active_health_check import ( + ActiveHealthCheck as ActiveHealthCheck, +) +from stackit.lbapplication.models.certificate_config import ( + CertificateConfig as CertificateConfig, +) +from stackit.lbapplication.models.cookie_persistence import ( + CookiePersistence as CookiePersistence, +) from stackit.lbapplication.models.create_credentials_payload import ( - CreateCredentialsPayload, + CreateCredentialsPayload as CreateCredentialsPayload, ) from stackit.lbapplication.models.create_credentials_response import ( - CreateCredentialsResponse, + CreateCredentialsResponse as CreateCredentialsResponse, ) from stackit.lbapplication.models.create_load_balancer_payload import ( - CreateLoadBalancerPayload, + CreateLoadBalancerPayload as CreateLoadBalancerPayload, +) +from stackit.lbapplication.models.credentials_response import ( + CredentialsResponse as CredentialsResponse, +) +from stackit.lbapplication.models.get_credentials_response import ( + GetCredentialsResponse as GetCredentialsResponse, +) +from stackit.lbapplication.models.get_quota_response import ( + GetQuotaResponse as GetQuotaResponse, ) -from stackit.lbapplication.models.credentials_response import CredentialsResponse -from stackit.lbapplication.models.get_credentials_response import GetCredentialsResponse -from stackit.lbapplication.models.get_quota_response import GetQuotaResponse from stackit.lbapplication.models.get_service_status_response import ( - GetServiceStatusResponse, + GetServiceStatusResponse as GetServiceStatusResponse, +) +from stackit.lbapplication.models.google_protobuf_any import ( + GoogleProtobufAny as GoogleProtobufAny, +) +from stackit.lbapplication.models.header import Header as Header +from stackit.lbapplication.models.http_config import HTTPConfig as HTTPConfig +from stackit.lbapplication.models.http_health_checks import ( + HttpHealthChecks as HttpHealthChecks, ) -from stackit.lbapplication.models.google_protobuf_any import GoogleProtobufAny -from stackit.lbapplication.models.header import Header -from stackit.lbapplication.models.http_config import HTTPConfig -from stackit.lbapplication.models.http_health_checks import HttpHealthChecks from stackit.lbapplication.models.list_credentials_response import ( - ListCredentialsResponse, + ListCredentialsResponse as ListCredentialsResponse, ) from stackit.lbapplication.models.list_load_balancers_response import ( - ListLoadBalancersResponse, + ListLoadBalancersResponse as ListLoadBalancersResponse, +) +from stackit.lbapplication.models.list_plans_response import ( + ListPlansResponse as ListPlansResponse, +) +from stackit.lbapplication.models.listener import Listener as Listener +from stackit.lbapplication.models.load_balancer import LoadBalancer as LoadBalancer +from stackit.lbapplication.models.load_balancer_error import ( + LoadBalancerError as LoadBalancerError, +) +from stackit.lbapplication.models.load_balancer_options import ( + LoadBalancerOptions as LoadBalancerOptions, ) -from stackit.lbapplication.models.list_plans_response import ListPlansResponse -from stackit.lbapplication.models.listener import Listener -from stackit.lbapplication.models.load_balancer import LoadBalancer -from stackit.lbapplication.models.load_balancer_error import LoadBalancerError -from stackit.lbapplication.models.load_balancer_options import LoadBalancerOptions from stackit.lbapplication.models.loadbalancer_option_access_control import ( - LoadbalancerOptionAccessControl, + LoadbalancerOptionAccessControl as LoadbalancerOptionAccessControl, +) +from stackit.lbapplication.models.loadbalancer_option_logs import ( + LoadbalancerOptionLogs as LoadbalancerOptionLogs, ) -from stackit.lbapplication.models.loadbalancer_option_logs import LoadbalancerOptionLogs from stackit.lbapplication.models.loadbalancer_option_metrics import ( - LoadbalancerOptionMetrics, + LoadbalancerOptionMetrics as LoadbalancerOptionMetrics, ) from stackit.lbapplication.models.loadbalancer_option_observability import ( - LoadbalancerOptionObservability, -) -from stackit.lbapplication.models.matcher import Matcher -from stackit.lbapplication.models.network import Network -from stackit.lbapplication.models.plan_details import PlanDetails -from stackit.lbapplication.models.protocol_options_https import ProtocolOptionsHTTPS -from stackit.lbapplication.models.query_parameters import QueryParameters -from stackit.lbapplication.models.rule import Rule -from stackit.lbapplication.models.status import Status -from stackit.lbapplication.models.target import Target -from stackit.lbapplication.models.target_pool import TargetPool + LoadbalancerOptionObservability as LoadbalancerOptionObservability, +) +from stackit.lbapplication.models.matcher import Matcher as Matcher +from stackit.lbapplication.models.network import Network as Network +from stackit.lbapplication.models.plan_details import PlanDetails as PlanDetails +from stackit.lbapplication.models.protocol_options_https import ( + ProtocolOptionsHTTPS as ProtocolOptionsHTTPS, +) +from stackit.lbapplication.models.query_parameters import ( + QueryParameters as QueryParameters, +) +from stackit.lbapplication.models.rule import Rule as Rule +from stackit.lbapplication.models.status import Status as Status +from stackit.lbapplication.models.target import Target as Target +from stackit.lbapplication.models.target_pool import TargetPool as TargetPool from stackit.lbapplication.models.update_credentials_payload import ( - UpdateCredentialsPayload, + UpdateCredentialsPayload as UpdateCredentialsPayload, ) from stackit.lbapplication.models.update_credentials_response import ( - UpdateCredentialsResponse, + UpdateCredentialsResponse as UpdateCredentialsResponse, ) from stackit.lbapplication.models.update_load_balancer_payload import ( - UpdateLoadBalancerPayload, + UpdateLoadBalancerPayload as UpdateLoadBalancerPayload, ) from stackit.lbapplication.models.update_target_pool_payload import ( - UpdateTargetPoolPayload, + UpdateTargetPoolPayload as UpdateTargetPoolPayload, ) diff --git a/services/lbapplication/src/stackit/lbapplication/api/default_api.py b/services/lbapplication/src/stackit/lbapplication/api/default_api.py index 657c4311..2fe9d4ef 100644 --- a/services/lbapplication/src/stackit/lbapplication/api/default_api.py +++ b/services/lbapplication/src/stackit/lbapplication/api/default_api.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import warnings from typing import Any, Dict, List, Optional, Tuple, Union @@ -117,7 +117,7 @@ def create_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("POST /v1beta/projects/{projectId}/credentials is deprecated.", DeprecationWarning) _param = self._create_credentials_serialize( @@ -190,7 +190,7 @@ def create_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("POST /v1beta/projects/{projectId}/credentials is deprecated.", DeprecationWarning) _param = self._create_credentials_serialize( @@ -263,7 +263,7 @@ def create_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("POST /v1beta/projects/{projectId}/credentials is deprecated.", DeprecationWarning) _param = self._create_credentials_serialize( @@ -305,7 +305,7 @@ def _create_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -396,7 +396,7 @@ def create_load_balancer( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("POST /v1beta/projects/{projectId}/load-balancers is deprecated.", DeprecationWarning) _param = self._create_load_balancer_serialize( @@ -470,7 +470,7 @@ def create_load_balancer_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("POST /v1beta/projects/{projectId}/load-balancers is deprecated.", DeprecationWarning) _param = self._create_load_balancer_serialize( @@ -544,7 +544,7 @@ def create_load_balancer_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("POST /v1beta/projects/{projectId}/load-balancers is deprecated.", DeprecationWarning) _param = self._create_load_balancer_serialize( @@ -587,7 +587,7 @@ def _create_load_balancer_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -675,7 +675,7 @@ def delete_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn( "DELETE /v1beta/projects/{projectId}/credentials/{credentialsRef} is deprecated.", DeprecationWarning ) @@ -746,7 +746,7 @@ def delete_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn( "DELETE /v1beta/projects/{projectId}/credentials/{credentialsRef} is deprecated.", DeprecationWarning ) @@ -817,7 +817,7 @@ def delete_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn( "DELETE /v1beta/projects/{projectId}/credentials/{credentialsRef} is deprecated.", DeprecationWarning ) @@ -859,7 +859,7 @@ def _delete_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -937,7 +937,7 @@ def delete_load_balancer( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("DELETE /v1beta/projects/{projectId}/load-balancers/{name} is deprecated.", DeprecationWarning) _param = self._delete_load_balancer_serialize( @@ -1006,7 +1006,7 @@ def delete_load_balancer_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("DELETE /v1beta/projects/{projectId}/load-balancers/{name} is deprecated.", DeprecationWarning) _param = self._delete_load_balancer_serialize( @@ -1075,7 +1075,7 @@ def delete_load_balancer_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("DELETE /v1beta/projects/{projectId}/load-balancers/{name} is deprecated.", DeprecationWarning) _param = self._delete_load_balancer_serialize( @@ -1115,7 +1115,7 @@ def _delete_load_balancer_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1190,7 +1190,7 @@ def disable_service( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("DELETE /v1beta/projects/{projectId} is deprecated.", DeprecationWarning) _param = self._disable_service_serialize( @@ -1255,7 +1255,7 @@ def disable_service_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("DELETE /v1beta/projects/{projectId} is deprecated.", DeprecationWarning) _param = self._disable_service_serialize( @@ -1320,7 +1320,7 @@ def disable_service_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("DELETE /v1beta/projects/{projectId} is deprecated.", DeprecationWarning) _param = self._disable_service_serialize( @@ -1358,7 +1358,7 @@ def _disable_service_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1434,7 +1434,7 @@ def enable_service( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("POST /v1beta/projects/{projectId} is deprecated.", DeprecationWarning) _param = self._enable_service_serialize( @@ -1503,7 +1503,7 @@ def enable_service_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("POST /v1beta/projects/{projectId} is deprecated.", DeprecationWarning) _param = self._enable_service_serialize( @@ -1572,7 +1572,7 @@ def enable_service_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("POST /v1beta/projects/{projectId} is deprecated.", DeprecationWarning) _param = self._enable_service_serialize( @@ -1612,7 +1612,7 @@ def _enable_service_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1690,7 +1690,7 @@ def get_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn( "GET /v1beta/projects/{projectId}/credentials/{credentialsRef} is deprecated.", DeprecationWarning ) @@ -1762,7 +1762,7 @@ def get_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn( "GET /v1beta/projects/{projectId}/credentials/{credentialsRef} is deprecated.", DeprecationWarning ) @@ -1834,7 +1834,7 @@ def get_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn( "GET /v1beta/projects/{projectId}/credentials/{credentialsRef} is deprecated.", DeprecationWarning ) @@ -1877,7 +1877,7 @@ def _get_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1955,7 +1955,7 @@ def get_load_balancer( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("GET /v1beta/projects/{projectId}/load-balancers/{name} is deprecated.", DeprecationWarning) _param = self._get_load_balancer_serialize( @@ -2025,7 +2025,7 @@ def get_load_balancer_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("GET /v1beta/projects/{projectId}/load-balancers/{name} is deprecated.", DeprecationWarning) _param = self._get_load_balancer_serialize( @@ -2095,7 +2095,7 @@ def get_load_balancer_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("GET /v1beta/projects/{projectId}/load-balancers/{name} is deprecated.", DeprecationWarning) _param = self._get_load_balancer_serialize( @@ -2136,7 +2136,7 @@ def _get_load_balancer_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2211,7 +2211,7 @@ def get_quota( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("GET /v1beta/projects/{projectId}/quota is deprecated.", DeprecationWarning) _param = self._get_quota_serialize( @@ -2276,7 +2276,7 @@ def get_quota_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("GET /v1beta/projects/{projectId}/quota is deprecated.", DeprecationWarning) _param = self._get_quota_serialize( @@ -2341,7 +2341,7 @@ def get_quota_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("GET /v1beta/projects/{projectId}/quota is deprecated.", DeprecationWarning) _param = self._get_quota_serialize( @@ -2379,7 +2379,7 @@ def _get_quota_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2452,7 +2452,7 @@ def get_service_status( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("GET /v1beta/projects/{projectId} is deprecated.", DeprecationWarning) _param = self._get_service_status_serialize( @@ -2517,7 +2517,7 @@ def get_service_status_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("GET /v1beta/projects/{projectId} is deprecated.", DeprecationWarning) _param = self._get_service_status_serialize( @@ -2582,7 +2582,7 @@ def get_service_status_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("GET /v1beta/projects/{projectId} is deprecated.", DeprecationWarning) _param = self._get_service_status_serialize( @@ -2620,7 +2620,7 @@ def _get_service_status_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2693,7 +2693,7 @@ def list_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("GET /v1beta/projects/{projectId}/credentials is deprecated.", DeprecationWarning) _param = self._list_credentials_serialize( @@ -2758,7 +2758,7 @@ def list_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("GET /v1beta/projects/{projectId}/credentials is deprecated.", DeprecationWarning) _param = self._list_credentials_serialize( @@ -2823,7 +2823,7 @@ def list_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("GET /v1beta/projects/{projectId}/credentials is deprecated.", DeprecationWarning) _param = self._list_credentials_serialize( @@ -2861,7 +2861,7 @@ def _list_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2950,7 +2950,7 @@ def list_load_balancers( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("GET /v1beta/projects/{projectId}/load-balancers is deprecated.", DeprecationWarning) _param = self._list_load_balancers_serialize( @@ -3033,7 +3033,7 @@ def list_load_balancers_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("GET /v1beta/projects/{projectId}/load-balancers is deprecated.", DeprecationWarning) _param = self._list_load_balancers_serialize( @@ -3116,7 +3116,7 @@ def list_load_balancers_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("GET /v1beta/projects/{projectId}/load-balancers is deprecated.", DeprecationWarning) _param = self._list_load_balancers_serialize( @@ -3158,7 +3158,7 @@ def _list_load_balancers_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3236,7 +3236,7 @@ def list_plans( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("GET /v1beta/plans is deprecated.", DeprecationWarning) _param = self._list_plans_serialize( @@ -3294,7 +3294,7 @@ def list_plans_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("GET /v1beta/plans is deprecated.", DeprecationWarning) _param = self._list_plans_serialize( @@ -3352,7 +3352,7 @@ def list_plans_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("GET /v1beta/plans is deprecated.", DeprecationWarning) _param = self._list_plans_serialize( @@ -3385,7 +3385,7 @@ def _list_plans_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3462,7 +3462,7 @@ def update_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn( "PUT /v1beta/projects/{projectId}/credentials/{credentialsRef} is deprecated.", DeprecationWarning ) @@ -3538,7 +3538,7 @@ def update_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn( "PUT /v1beta/projects/{projectId}/credentials/{credentialsRef} is deprecated.", DeprecationWarning ) @@ -3614,7 +3614,7 @@ def update_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn( "PUT /v1beta/projects/{projectId}/credentials/{credentialsRef} is deprecated.", DeprecationWarning ) @@ -3659,7 +3659,7 @@ def _update_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3750,7 +3750,7 @@ def update_load_balancer( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("PUT /v1beta/projects/{projectId}/load-balancers/{name} is deprecated.", DeprecationWarning) _param = self._update_load_balancer_serialize( @@ -3824,7 +3824,7 @@ def update_load_balancer_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("PUT /v1beta/projects/{projectId}/load-balancers/{name} is deprecated.", DeprecationWarning) _param = self._update_load_balancer_serialize( @@ -3898,7 +3898,7 @@ def update_load_balancer_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn("PUT /v1beta/projects/{projectId}/load-balancers/{name} is deprecated.", DeprecationWarning) _param = self._update_load_balancer_serialize( @@ -3941,7 +3941,7 @@ def _update_load_balancer_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4035,7 +4035,7 @@ def update_target_pool( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn( "PUT /v1beta/projects/{projectId}/load-balancers/{name}/target-pools/{targetPoolName} is deprecated.", DeprecationWarning, @@ -4115,7 +4115,7 @@ def update_target_pool_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn( "PUT /v1beta/projects/{projectId}/load-balancers/{name}/target-pools/{targetPoolName} is deprecated.", DeprecationWarning, @@ -4195,7 +4195,7 @@ def update_target_pool_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 warnings.warn( "PUT /v1beta/projects/{projectId}/load-balancers/{name}/target-pools/{targetPoolName} is deprecated.", DeprecationWarning, @@ -4242,7 +4242,7 @@ def _update_target_pool_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/lbapplication/src/stackit/lbapplication/api_client.py b/services/lbapplication/src/stackit/lbapplication/api_client.py index 29cb6b3c..0bd5b8fe 100644 --- a/services/lbapplication/src/stackit/lbapplication/api_client.py +++ b/services/lbapplication/src/stackit/lbapplication/api_client.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -331,6 +331,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -350,12 +354,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -457,7 +461,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -473,7 +477,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -488,6 +495,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/lbapplication/src/stackit/lbapplication/configuration.py b/services/lbapplication/src/stackit/lbapplication/configuration.py index f7604511..f6b30fba 100644 --- a/services/lbapplication/src/stackit/lbapplication/configuration.py +++ b/services/lbapplication/src/stackit/lbapplication/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ Application Load Balancer API @@ -14,7 +9,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -53,7 +70,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -72,7 +89,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -112,7 +134,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -131,12 +153,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/lbapplication/src/stackit/lbapplication/exceptions.py b/services/lbapplication/src/stackit/lbapplication/exceptions.py index d86df571..eb1b845b 100644 --- a/services/lbapplication/src/stackit/lbapplication/exceptions.py +++ b/services/lbapplication/src/stackit/lbapplication/exceptions.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -151,6 +151,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -187,6 +194,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/lbapplication/src/stackit/lbapplication/models/__init__.py b/services/lbapplication/src/stackit/lbapplication/models/__init__.py index 57a51ed8..22d7be5c 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/__init__.py +++ b/services/lbapplication/src/stackit/lbapplication/models/__init__.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/lbapplication/src/stackit/lbapplication/models/active_health_check.py b/services/lbapplication/src/stackit/lbapplication/models/active_health_check.py index e503a4bd..f56c6875 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/active_health_check.py +++ b/services/lbapplication/src/stackit/lbapplication/models/active_health_check.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt, field_validator @@ -27,7 +27,7 @@ class ActiveHealthCheck(BaseModel): """ ActiveHealthCheck - """ + """ # noqa: E501 healthy_threshold: Optional[StrictInt] = Field( default=None, description="Healthy threshold of the health checking", alias="healthyThreshold" diff --git a/services/lbapplication/src/stackit/lbapplication/models/certificate_config.py b/services/lbapplication/src/stackit/lbapplication/models/certificate_config.py index 09c9108e..a3445866 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/certificate_config.py +++ b/services/lbapplication/src/stackit/lbapplication/models/certificate_config.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CertificateConfig(BaseModel): """ CertificateConfig - """ + """ # noqa: E501 certificate_ids: Optional[List[StrictStr]] = Field( default=None, description="Certificate IDs for TLS termination", alias="certificateIds" diff --git a/services/lbapplication/src/stackit/lbapplication/models/cookie_persistence.py b/services/lbapplication/src/stackit/lbapplication/models/cookie_persistence.py index 486846d2..134e3bfc 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/cookie_persistence.py +++ b/services/lbapplication/src/stackit/lbapplication/models/cookie_persistence.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class CookiePersistence(BaseModel): """ CookiePersistence - """ + """ # noqa: E501 name: Optional[StrictStr] = Field(default=None, description="Cookie is the name of the cookie to use.") ttl: Optional[Annotated[str, Field(strict=True)]] = Field( diff --git a/services/lbapplication/src/stackit/lbapplication/models/create_credentials_payload.py b/services/lbapplication/src/stackit/lbapplication/models/create_credentials_payload.py index 2958f8dc..368762a7 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/create_credentials_payload.py +++ b/services/lbapplication/src/stackit/lbapplication/models/create_credentials_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class CreateCredentialsPayload(BaseModel): """ CreateCredentialsPayload - """ + """ # noqa: E501 display_name: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, description="Credential name", alias="displayName" diff --git a/services/lbapplication/src/stackit/lbapplication/models/create_credentials_response.py b/services/lbapplication/src/stackit/lbapplication/models/create_credentials_response.py index 112145c9..8d1bb16f 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/create_credentials_response.py +++ b/services/lbapplication/src/stackit/lbapplication/models/create_credentials_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class CreateCredentialsResponse(BaseModel): """ CreateCredentialsResponse - """ + """ # noqa: E501 credential: Optional[CredentialsResponse] = None __properties: ClassVar[List[str]] = ["credential"] diff --git a/services/lbapplication/src/stackit/lbapplication/models/create_load_balancer_payload.py b/services/lbapplication/src/stackit/lbapplication/models/create_load_balancer_payload.py index 796fb74d..7513c892 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/create_load_balancer_payload.py +++ b/services/lbapplication/src/stackit/lbapplication/models/create_load_balancer_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -31,7 +31,7 @@ class CreateLoadBalancerPayload(BaseModel): """ CreateLoadBalancerPayload - """ + """ # noqa: E501 errors: Optional[List[LoadBalancerError]] = Field( default=None, description="Reports all errors a application load balancer has." diff --git a/services/lbapplication/src/stackit/lbapplication/models/credentials_response.py b/services/lbapplication/src/stackit/lbapplication/models/credentials_response.py index f520edcb..38c8e29a 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/credentials_response.py +++ b/services/lbapplication/src/stackit/lbapplication/models/credentials_response.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class CredentialsResponse(BaseModel): """ CredentialsResponse - """ + """ # noqa: E501 credentials_ref: Optional[StrictStr] = Field( default=None, diff --git a/services/lbapplication/src/stackit/lbapplication/models/get_credentials_response.py b/services/lbapplication/src/stackit/lbapplication/models/get_credentials_response.py index 4a1e88ee..7a069863 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/get_credentials_response.py +++ b/services/lbapplication/src/stackit/lbapplication/models/get_credentials_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class GetCredentialsResponse(BaseModel): """ GetCredentialsResponse - """ + """ # noqa: E501 credential: Optional[CredentialsResponse] = None __properties: ClassVar[List[str]] = ["credential"] diff --git a/services/lbapplication/src/stackit/lbapplication/models/get_quota_response.py b/services/lbapplication/src/stackit/lbapplication/models/get_quota_response.py index b753ddac..81d2295b 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/get_quota_response.py +++ b/services/lbapplication/src/stackit/lbapplication/models/get_quota_response.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -25,7 +25,7 @@ class GetQuotaResponse(BaseModel): """ GetQuotaResponse - """ + """ # noqa: E501 max_load_balancers: Optional[Annotated[int, Field(le=999, strict=True, ge=-1)]] = Field( default=None, diff --git a/services/lbapplication/src/stackit/lbapplication/models/get_service_status_response.py b/services/lbapplication/src/stackit/lbapplication/models/get_service_status_response.py index b0f5b8df..72bd1ac7 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/get_service_status_response.py +++ b/services/lbapplication/src/stackit/lbapplication/models/get_service_status_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class GetServiceStatusResponse(BaseModel): """ Response with customer project status. - """ + """ # noqa: E501 status: Optional[StrictStr] = Field(default=None, description="status of the project") __properties: ClassVar[List[str]] = ["status"] diff --git a/services/lbapplication/src/stackit/lbapplication/models/google_protobuf_any.py b/services/lbapplication/src/stackit/lbapplication/models/google_protobuf_any.py index fa2b1873..46efd22c 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/google_protobuf_any.py +++ b/services/lbapplication/src/stackit/lbapplication/models/google_protobuf_any.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class GoogleProtobufAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. - """ + """ # noqa: E501 type: Optional[StrictStr] = Field(default=None, description="The type of the serialized message.", alias="@type") additional_properties: Dict[str, Any] = {} diff --git a/services/lbapplication/src/stackit/lbapplication/models/header.py b/services/lbapplication/src/stackit/lbapplication/models/header.py index 614c8dff..998db8ab 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/header.py +++ b/services/lbapplication/src/stackit/lbapplication/models/header.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Header(BaseModel): """ Header - """ + """ # noqa: E501 exact_match: Optional[StrictStr] = Field( default=None, description="Exact match for the header value.", alias="exactMatch" diff --git a/services/lbapplication/src/stackit/lbapplication/models/http_config.py b/services/lbapplication/src/stackit/lbapplication/models/http_config.py index e7603d99..c548147d 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/http_config.py +++ b/services/lbapplication/src/stackit/lbapplication/models/http_config.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class HTTPConfig(BaseModel): """ HTTPConfig - """ + """ # noqa: E501 matcher: Optional[List[Matcher]] = None __properties: ClassVar[List[str]] = ["matcher"] diff --git a/services/lbapplication/src/stackit/lbapplication/models/http_health_checks.py b/services/lbapplication/src/stackit/lbapplication/models/http_health_checks.py index 54ca15f4..a581e3e2 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/http_health_checks.py +++ b/services/lbapplication/src/stackit/lbapplication/models/http_health_checks.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class HttpHealthChecks(BaseModel): """ HttpHealthChecks - """ + """ # noqa: E501 ok_statuses: Optional[List[StrictStr]] = Field( default=None, description="List of HTTP status codes that indicate a healthy response", alias="okStatuses" diff --git a/services/lbapplication/src/stackit/lbapplication/models/list_credentials_response.py b/services/lbapplication/src/stackit/lbapplication/models/list_credentials_response.py index 4b0a5385..1a5c4a82 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/list_credentials_response.py +++ b/services/lbapplication/src/stackit/lbapplication/models/list_credentials_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListCredentialsResponse(BaseModel): """ ListCredentialsResponse - """ + """ # noqa: E501 credentials: Optional[List[CredentialsResponse]] = None __properties: ClassVar[List[str]] = ["credentials"] diff --git a/services/lbapplication/src/stackit/lbapplication/models/list_load_balancers_response.py b/services/lbapplication/src/stackit/lbapplication/models/list_load_balancers_response.py index 83de31b7..4d0ebe77 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/list_load_balancers_response.py +++ b/services/lbapplication/src/stackit/lbapplication/models/list_load_balancers_response.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -27,7 +27,7 @@ class ListLoadBalancersResponse(BaseModel): """ ListLoadBalancersResponse - """ + """ # noqa: E501 load_balancers: Optional[List[LoadBalancer]] = Field(default=None, alias="loadBalancers") next_page_id: Optional[Annotated[str, Field(strict=True)]] = Field( diff --git a/services/lbapplication/src/stackit/lbapplication/models/list_plans_response.py b/services/lbapplication/src/stackit/lbapplication/models/list_plans_response.py index 87e79119..fc4a88cc 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/list_plans_response.py +++ b/services/lbapplication/src/stackit/lbapplication/models/list_plans_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListPlansResponse(BaseModel): """ ListPlansResponse - """ + """ # noqa: E501 valid_plans: Optional[List[PlanDetails]] = Field(default=None, alias="validPlans") __properties: ClassVar[List[str]] = ["validPlans"] diff --git a/services/lbapplication/src/stackit/lbapplication/models/listener.py b/services/lbapplication/src/stackit/lbapplication/models/listener.py index 328cbf5f..7742713e 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/listener.py +++ b/services/lbapplication/src/stackit/lbapplication/models/listener.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class Listener(BaseModel): """ Listener - """ + """ # noqa: E501 display_name: Optional[StrictStr] = Field(default=None, alias="displayName") http: Optional[Dict[str, Any]] = None diff --git a/services/lbapplication/src/stackit/lbapplication/models/load_balancer.py b/services/lbapplication/src/stackit/lbapplication/models/load_balancer.py index 56e59800..b96c2a4d 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/load_balancer.py +++ b/services/lbapplication/src/stackit/lbapplication/models/load_balancer.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -31,7 +31,7 @@ class LoadBalancer(BaseModel): """ LoadBalancer - """ + """ # noqa: E501 errors: Optional[List[LoadBalancerError]] = Field( default=None, description="Reports all errors a application load balancer has." diff --git a/services/lbapplication/src/stackit/lbapplication/models/load_balancer_error.py b/services/lbapplication/src/stackit/lbapplication/models/load_balancer_error.py index c9909e0d..b676ff3e 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/load_balancer_error.py +++ b/services/lbapplication/src/stackit/lbapplication/models/load_balancer_error.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class LoadBalancerError(BaseModel): """ LoadBalancerError - """ + """ # noqa: E501 description: Optional[StrictStr] = Field( default=None, diff --git a/services/lbapplication/src/stackit/lbapplication/models/load_balancer_options.py b/services/lbapplication/src/stackit/lbapplication/models/load_balancer_options.py index 03a70caf..af7bb708 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/load_balancer_options.py +++ b/services/lbapplication/src/stackit/lbapplication/models/load_balancer_options.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -31,7 +31,7 @@ class LoadBalancerOptions(BaseModel): """ Defines any optional functionality you want to have enabled on your application load balancer. - """ + """ # noqa: E501 access_control: Optional[LoadbalancerOptionAccessControl] = Field(default=None, alias="accessControl") ephemeral_address: Optional[StrictBool] = Field(default=None, alias="ephemeralAddress") diff --git a/services/lbapplication/src/stackit/lbapplication/models/loadbalancer_option_access_control.py b/services/lbapplication/src/stackit/lbapplication/models/loadbalancer_option_access_control.py index 60249b8f..8d64bff4 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/loadbalancer_option_access_control.py +++ b/services/lbapplication/src/stackit/lbapplication/models/loadbalancer_option_access_control.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class LoadbalancerOptionAccessControl(BaseModel): """ Use this option to limit the IP ranges that can use the application load balancer. - """ + """ # noqa: E501 allowed_source_ranges: Optional[List[StrictStr]] = Field( default=None, diff --git a/services/lbapplication/src/stackit/lbapplication/models/loadbalancer_option_logs.py b/services/lbapplication/src/stackit/lbapplication/models/loadbalancer_option_logs.py index 730832bd..cd203763 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/loadbalancer_option_logs.py +++ b/services/lbapplication/src/stackit/lbapplication/models/loadbalancer_option_logs.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class LoadbalancerOptionLogs(BaseModel): """ LoadbalancerOptionLogs - """ + """ # noqa: E501 credentials_ref: Optional[StrictStr] = Field( default=None, diff --git a/services/lbapplication/src/stackit/lbapplication/models/loadbalancer_option_metrics.py b/services/lbapplication/src/stackit/lbapplication/models/loadbalancer_option_metrics.py index d83d012a..f138c3b9 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/loadbalancer_option_metrics.py +++ b/services/lbapplication/src/stackit/lbapplication/models/loadbalancer_option_metrics.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class LoadbalancerOptionMetrics(BaseModel): """ LoadbalancerOptionMetrics - """ + """ # noqa: E501 credentials_ref: Optional[StrictStr] = Field( default=None, diff --git a/services/lbapplication/src/stackit/lbapplication/models/loadbalancer_option_observability.py b/services/lbapplication/src/stackit/lbapplication/models/loadbalancer_option_observability.py index 48edf897..f40dc1e2 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/loadbalancer_option_observability.py +++ b/services/lbapplication/src/stackit/lbapplication/models/loadbalancer_option_observability.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class LoadbalancerOptionObservability(BaseModel): """ We offer Application Load Balancer metrics observability via ARGUS or external solutions. Not changeable after creation. - """ + """ # noqa: E501 logs: Optional[LoadbalancerOptionLogs] = None metrics: Optional[LoadbalancerOptionMetrics] = None diff --git a/services/lbapplication/src/stackit/lbapplication/models/matcher.py b/services/lbapplication/src/stackit/lbapplication/models/matcher.py index 2da6eea4..572bfae8 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/matcher.py +++ b/services/lbapplication/src/stackit/lbapplication/models/matcher.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -28,7 +28,7 @@ class Matcher(BaseModel): """ Matcher - """ + """ # noqa: E501 cookie_persistence: Optional[CookiePersistence] = Field(default=None, alias="cookiePersistence") headers: Optional[List[Header]] = Field(default=None, description="Headers for the matcher") diff --git a/services/lbapplication/src/stackit/lbapplication/models/network.py b/services/lbapplication/src/stackit/lbapplication/models/network.py index aebf464b..c83bc573 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/network.py +++ b/services/lbapplication/src/stackit/lbapplication/models/network.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class Network(BaseModel): """ Network - """ + """ # noqa: E501 network_id: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, description="Openstack network ID", alias="networkId" diff --git a/services/lbapplication/src/stackit/lbapplication/models/plan_details.py b/services/lbapplication/src/stackit/lbapplication/models/plan_details.py index c79c3974..71c36d68 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/plan_details.py +++ b/services/lbapplication/src/stackit/lbapplication/models/plan_details.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class PlanDetails(BaseModel): """ PlanDetails - """ + """ # noqa: E501 description: Optional[StrictStr] = Field(default=None, description="Description") flavor_name: Optional[StrictStr] = Field(default=None, description="Flavor Name", alias="flavorName") diff --git a/services/lbapplication/src/stackit/lbapplication/models/protocol_options_https.py b/services/lbapplication/src/stackit/lbapplication/models/protocol_options_https.py index baa17210..13b635e9 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/protocol_options_https.py +++ b/services/lbapplication/src/stackit/lbapplication/models/protocol_options_https.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ProtocolOptionsHTTPS(BaseModel): """ ProtocolOptionsHTTPS - """ + """ # noqa: E501 certificate_config: Optional[CertificateConfig] = Field(default=None, alias="certificateConfig") __properties: ClassVar[List[str]] = ["certificateConfig"] diff --git a/services/lbapplication/src/stackit/lbapplication/models/query_parameters.py b/services/lbapplication/src/stackit/lbapplication/models/query_parameters.py index 139bde2b..1fd6b9fa 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/query_parameters.py +++ b/services/lbapplication/src/stackit/lbapplication/models/query_parameters.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class QueryParameters(BaseModel): """ QueryParameters - """ + """ # noqa: E501 exact_match: Optional[StrictStr] = Field( default=None, description="Exact match for the parameter value", alias="exactMatch" diff --git a/services/lbapplication/src/stackit/lbapplication/models/rule.py b/services/lbapplication/src/stackit/lbapplication/models/rule.py index 62a0f96e..f26bb40f 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/rule.py +++ b/services/lbapplication/src/stackit/lbapplication/models/rule.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class Rule(BaseModel): """ Rule - """ + """ # noqa: E501 host: Optional[StrictStr] = Field(default=None, description="Host for the rule") http: Optional[HTTPConfig] = None diff --git a/services/lbapplication/src/stackit/lbapplication/models/status.py b/services/lbapplication/src/stackit/lbapplication/models/status.py index 6366899f..51fc9d90 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/status.py +++ b/services/lbapplication/src/stackit/lbapplication/models/status.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class Status(BaseModel): """ The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). - """ + """ # noqa: E501 code: Optional[StrictInt] = Field( default=None, diff --git a/services/lbapplication/src/stackit/lbapplication/models/target.py b/services/lbapplication/src/stackit/lbapplication/models/target.py index 5f93e331..0a8a12ae 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/target.py +++ b/services/lbapplication/src/stackit/lbapplication/models/target.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class Target(BaseModel): """ Target - """ + """ # noqa: E501 display_name: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, description="Target name", alias="displayName" diff --git a/services/lbapplication/src/stackit/lbapplication/models/target_pool.py b/services/lbapplication/src/stackit/lbapplication/models/target_pool.py index 4bd4484b..22560ba1 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/target_pool.py +++ b/services/lbapplication/src/stackit/lbapplication/models/target_pool.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -28,7 +28,7 @@ class TargetPool(BaseModel): """ TargetPool - """ + """ # noqa: E501 active_health_check: Optional[ActiveHealthCheck] = Field(default=None, alias="activeHealthCheck") name: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Target pool name") diff --git a/services/lbapplication/src/stackit/lbapplication/models/update_credentials_payload.py b/services/lbapplication/src/stackit/lbapplication/models/update_credentials_payload.py index 929eca73..dccdda85 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/update_credentials_payload.py +++ b/services/lbapplication/src/stackit/lbapplication/models/update_credentials_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class UpdateCredentialsPayload(BaseModel): """ UpdateCredentialsPayload - """ + """ # noqa: E501 display_name: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, description="Credential name", alias="displayName" diff --git a/services/lbapplication/src/stackit/lbapplication/models/update_credentials_response.py b/services/lbapplication/src/stackit/lbapplication/models/update_credentials_response.py index bc8cdf02..13289f8c 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/update_credentials_response.py +++ b/services/lbapplication/src/stackit/lbapplication/models/update_credentials_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class UpdateCredentialsResponse(BaseModel): """ UpdateCredentialsResponse - """ + """ # noqa: E501 credential: Optional[CredentialsResponse] = None __properties: ClassVar[List[str]] = ["credential"] diff --git a/services/lbapplication/src/stackit/lbapplication/models/update_load_balancer_payload.py b/services/lbapplication/src/stackit/lbapplication/models/update_load_balancer_payload.py index e86805d0..cc4c3c94 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/update_load_balancer_payload.py +++ b/services/lbapplication/src/stackit/lbapplication/models/update_load_balancer_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -31,7 +31,7 @@ class UpdateLoadBalancerPayload(BaseModel): """ UpdateLoadBalancerPayload - """ + """ # noqa: E501 errors: Optional[List[LoadBalancerError]] = Field( default=None, description="Reports all errors a application load balancer has." diff --git a/services/lbapplication/src/stackit/lbapplication/models/update_target_pool_payload.py b/services/lbapplication/src/stackit/lbapplication/models/update_target_pool_payload.py index 456baf11..74b16835 100644 --- a/services/lbapplication/src/stackit/lbapplication/models/update_target_pool_payload.py +++ b/services/lbapplication/src/stackit/lbapplication/models/update_target_pool_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -28,7 +28,7 @@ class UpdateTargetPoolPayload(BaseModel): """ UpdateTargetPoolPayload - """ + """ # noqa: E501 active_health_check: Optional[ActiveHealthCheck] = Field(default=None, alias="activeHealthCheck") name: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Target pool name") diff --git a/services/lbapplication/src/stackit/lbapplication/rest.py b/services/lbapplication/src/stackit/lbapplication/rest.py index 3bd1a7bb..34815dd4 100644 --- a/services/lbapplication/src/stackit/lbapplication/rest.py +++ b/services/lbapplication/src/stackit/lbapplication/rest.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -124,7 +124,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/loadbalancer/CHANGELOG.md b/services/loadbalancer/CHANGELOG.md index 99f41374..844369b5 100644 --- a/services/loadbalancer/CHANGELOG.md +++ b/services/loadbalancer/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.4.1 +- **Internal:** Improve deserializing and error types + ## v0.4.0 (2025-06-12) - **Feature:** Add new field `disable_target_security_group_assignment` in `LoadBalancer`, `CreateLoadBalancerPayload` and `UpdateLoadBalancerPayload` Models diff --git a/services/loadbalancer/pyproject.toml b/services/loadbalancer/pyproject.toml index 58cbc4ab..e5cbdcce 100644 --- a/services/loadbalancer/pyproject.toml +++ b/services/loadbalancer/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-loadbalancer" [tool.poetry] name = "stackit-loadbalancer" -version = "v0.4.0" +version = "v0.4.1" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/loadbalancer/src/stackit/loadbalancer/__init__.py b/services/loadbalancer/src/stackit/loadbalancer/__init__.py index 37ec2c5d..0b9598fe 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/__init__.py +++ b/services/loadbalancer/src/stackit/loadbalancer/__init__.py @@ -11,82 +11,149 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "ActiveHealthCheck", + "CreateCredentialsPayload", + "CreateCredentialsResponse", + "CreateLoadBalancerPayload", + "CredentialsResponse", + "GetCredentialsResponse", + "GetQuotaResponse", + "GoogleProtobufAny", + "ListCredentialsResponse", + "ListLoadBalancersResponse", + "ListPlansResponse", + "Listener", + "LoadBalancer", + "LoadBalancerError", + "LoadBalancerOptions", + "LoadbalancerOptionAccessControl", + "LoadbalancerOptionLogs", + "LoadbalancerOptionMetrics", + "LoadbalancerOptionObservability", + "Network", + "OptionsTCP", + "OptionsUDP", + "PlanDetails", + "SecurityGroup", + "ServerNameIndicator", + "SessionPersistence", + "Status", + "Target", + "TargetPool", + "UpdateCredentialsPayload", + "UpdateCredentialsResponse", + "UpdateLoadBalancerPayload", + "UpdateTargetPoolPayload", +] + # import apis into sdk package -from stackit.loadbalancer.api.default_api import DefaultApi -from stackit.loadbalancer.api_client import ApiClient +from stackit.loadbalancer.api.default_api import DefaultApi as DefaultApi +from stackit.loadbalancer.api_client import ApiClient as ApiClient # import ApiClient -from stackit.loadbalancer.api_response import ApiResponse -from stackit.loadbalancer.configuration import HostConfiguration -from stackit.loadbalancer.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.loadbalancer.api_response import ApiResponse as ApiResponse +from stackit.loadbalancer.configuration import HostConfiguration as HostConfiguration +from stackit.loadbalancer.exceptions import ApiAttributeError as ApiAttributeError +from stackit.loadbalancer.exceptions import ApiException as ApiException +from stackit.loadbalancer.exceptions import ApiKeyError as ApiKeyError +from stackit.loadbalancer.exceptions import ApiTypeError as ApiTypeError +from stackit.loadbalancer.exceptions import ApiValueError as ApiValueError +from stackit.loadbalancer.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.loadbalancer.models.active_health_check import ActiveHealthCheck +from stackit.loadbalancer.models.active_health_check import ( + ActiveHealthCheck as ActiveHealthCheck, +) from stackit.loadbalancer.models.create_credentials_payload import ( - CreateCredentialsPayload, + CreateCredentialsPayload as CreateCredentialsPayload, ) from stackit.loadbalancer.models.create_credentials_response import ( - CreateCredentialsResponse, + CreateCredentialsResponse as CreateCredentialsResponse, ) from stackit.loadbalancer.models.create_load_balancer_payload import ( - CreateLoadBalancerPayload, + CreateLoadBalancerPayload as CreateLoadBalancerPayload, +) +from stackit.loadbalancer.models.credentials_response import ( + CredentialsResponse as CredentialsResponse, +) +from stackit.loadbalancer.models.get_credentials_response import ( + GetCredentialsResponse as GetCredentialsResponse, +) +from stackit.loadbalancer.models.get_quota_response import ( + GetQuotaResponse as GetQuotaResponse, +) +from stackit.loadbalancer.models.google_protobuf_any import ( + GoogleProtobufAny as GoogleProtobufAny, ) -from stackit.loadbalancer.models.credentials_response import CredentialsResponse -from stackit.loadbalancer.models.get_credentials_response import GetCredentialsResponse -from stackit.loadbalancer.models.get_quota_response import GetQuotaResponse -from stackit.loadbalancer.models.google_protobuf_any import GoogleProtobufAny from stackit.loadbalancer.models.list_credentials_response import ( - ListCredentialsResponse, + ListCredentialsResponse as ListCredentialsResponse, ) from stackit.loadbalancer.models.list_load_balancers_response import ( - ListLoadBalancersResponse, + ListLoadBalancersResponse as ListLoadBalancersResponse, +) +from stackit.loadbalancer.models.list_plans_response import ( + ListPlansResponse as ListPlansResponse, +) +from stackit.loadbalancer.models.listener import Listener as Listener +from stackit.loadbalancer.models.load_balancer import LoadBalancer as LoadBalancer +from stackit.loadbalancer.models.load_balancer_error import ( + LoadBalancerError as LoadBalancerError, +) +from stackit.loadbalancer.models.load_balancer_options import ( + LoadBalancerOptions as LoadBalancerOptions, ) -from stackit.loadbalancer.models.list_plans_response import ListPlansResponse -from stackit.loadbalancer.models.listener import Listener -from stackit.loadbalancer.models.load_balancer import LoadBalancer -from stackit.loadbalancer.models.load_balancer_error import LoadBalancerError -from stackit.loadbalancer.models.load_balancer_options import LoadBalancerOptions from stackit.loadbalancer.models.loadbalancer_option_access_control import ( - LoadbalancerOptionAccessControl, + LoadbalancerOptionAccessControl as LoadbalancerOptionAccessControl, +) +from stackit.loadbalancer.models.loadbalancer_option_logs import ( + LoadbalancerOptionLogs as LoadbalancerOptionLogs, ) -from stackit.loadbalancer.models.loadbalancer_option_logs import LoadbalancerOptionLogs from stackit.loadbalancer.models.loadbalancer_option_metrics import ( - LoadbalancerOptionMetrics, + LoadbalancerOptionMetrics as LoadbalancerOptionMetrics, ) from stackit.loadbalancer.models.loadbalancer_option_observability import ( - LoadbalancerOptionObservability, -) -from stackit.loadbalancer.models.network import Network -from stackit.loadbalancer.models.options_tcp import OptionsTCP -from stackit.loadbalancer.models.options_udp import OptionsUDP -from stackit.loadbalancer.models.plan_details import PlanDetails -from stackit.loadbalancer.models.security_group import SecurityGroup -from stackit.loadbalancer.models.server_name_indicator import ServerNameIndicator -from stackit.loadbalancer.models.session_persistence import SessionPersistence -from stackit.loadbalancer.models.status import Status -from stackit.loadbalancer.models.target import Target -from stackit.loadbalancer.models.target_pool import TargetPool + LoadbalancerOptionObservability as LoadbalancerOptionObservability, +) +from stackit.loadbalancer.models.network import Network as Network +from stackit.loadbalancer.models.options_tcp import OptionsTCP as OptionsTCP +from stackit.loadbalancer.models.options_udp import OptionsUDP as OptionsUDP +from stackit.loadbalancer.models.plan_details import PlanDetails as PlanDetails +from stackit.loadbalancer.models.security_group import SecurityGroup as SecurityGroup +from stackit.loadbalancer.models.server_name_indicator import ( + ServerNameIndicator as ServerNameIndicator, +) +from stackit.loadbalancer.models.session_persistence import ( + SessionPersistence as SessionPersistence, +) +from stackit.loadbalancer.models.status import Status as Status +from stackit.loadbalancer.models.target import Target as Target +from stackit.loadbalancer.models.target_pool import TargetPool as TargetPool from stackit.loadbalancer.models.update_credentials_payload import ( - UpdateCredentialsPayload, + UpdateCredentialsPayload as UpdateCredentialsPayload, ) from stackit.loadbalancer.models.update_credentials_response import ( - UpdateCredentialsResponse, + UpdateCredentialsResponse as UpdateCredentialsResponse, ) from stackit.loadbalancer.models.update_load_balancer_payload import ( - UpdateLoadBalancerPayload, + UpdateLoadBalancerPayload as UpdateLoadBalancerPayload, ) from stackit.loadbalancer.models.update_target_pool_payload import ( - UpdateTargetPoolPayload, + UpdateTargetPoolPayload as UpdateTargetPoolPayload, ) diff --git a/services/loadbalancer/src/stackit/loadbalancer/api/default_api.py b/services/loadbalancer/src/stackit/loadbalancer/api/default_api.py index aa987f8e..022aad54 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/api/default_api.py +++ b/services/loadbalancer/src/stackit/loadbalancer/api/default_api.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -116,7 +116,7 @@ def create_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( project_id=project_id, @@ -192,7 +192,7 @@ def create_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( project_id=project_id, @@ -268,7 +268,7 @@ def create_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( project_id=project_id, @@ -311,7 +311,7 @@ def _create_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -407,7 +407,7 @@ def create_load_balancer( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_load_balancer_serialize( project_id=project_id, @@ -484,7 +484,7 @@ def create_load_balancer_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_load_balancer_serialize( project_id=project_id, @@ -561,7 +561,7 @@ def create_load_balancer_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_load_balancer_serialize( project_id=project_id, @@ -605,7 +605,7 @@ def _create_load_balancer_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -698,7 +698,7 @@ def delete_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( project_id=project_id, @@ -770,7 +770,7 @@ def delete_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( project_id=project_id, @@ -842,7 +842,7 @@ def delete_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( project_id=project_id, @@ -883,7 +883,7 @@ def _delete_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -966,7 +966,7 @@ def delete_load_balancer( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_load_balancer_serialize( project_id=project_id, @@ -1038,7 +1038,7 @@ def delete_load_balancer_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_load_balancer_serialize( project_id=project_id, @@ -1110,7 +1110,7 @@ def delete_load_balancer_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_load_balancer_serialize( project_id=project_id, @@ -1151,7 +1151,7 @@ def _delete_load_balancer_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1234,7 +1234,7 @@ def get_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( project_id=project_id, @@ -1307,7 +1307,7 @@ def get_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( project_id=project_id, @@ -1380,7 +1380,7 @@ def get_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( project_id=project_id, @@ -1422,7 +1422,7 @@ def _get_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1505,7 +1505,7 @@ def get_load_balancer( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_load_balancer_serialize( project_id=project_id, @@ -1578,7 +1578,7 @@ def get_load_balancer_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_load_balancer_serialize( project_id=project_id, @@ -1651,7 +1651,7 @@ def get_load_balancer_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_load_balancer_serialize( project_id=project_id, @@ -1693,7 +1693,7 @@ def _get_load_balancer_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1773,7 +1773,7 @@ def get_quota( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_quota_serialize( project_id=project_id, @@ -1841,7 +1841,7 @@ def get_quota_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_quota_serialize( project_id=project_id, @@ -1909,7 +1909,7 @@ def get_quota_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_quota_serialize( project_id=project_id, @@ -1948,7 +1948,7 @@ def _get_quota_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2026,7 +2026,7 @@ def list_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( project_id=project_id, @@ -2094,7 +2094,7 @@ def list_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( project_id=project_id, @@ -2162,7 +2162,7 @@ def list_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( project_id=project_id, @@ -2201,7 +2201,7 @@ def _list_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2295,7 +2295,7 @@ def list_load_balancers( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_load_balancers_serialize( project_id=project_id, @@ -2382,7 +2382,7 @@ def list_load_balancers_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_load_balancers_serialize( project_id=project_id, @@ -2469,7 +2469,7 @@ def list_load_balancers_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_load_balancers_serialize( project_id=project_id, @@ -2513,7 +2513,7 @@ def _list_load_balancers_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2596,7 +2596,7 @@ def list_plans( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_plans_serialize( region=region, @@ -2660,7 +2660,7 @@ def list_plans_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_plans_serialize( region=region, @@ -2724,7 +2724,7 @@ def list_plans_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_plans_serialize( region=region, @@ -2761,7 +2761,7 @@ def _list_plans_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2843,7 +2843,7 @@ def update_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_credentials_serialize( project_id=project_id, @@ -2920,7 +2920,7 @@ def update_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_credentials_serialize( project_id=project_id, @@ -2997,7 +2997,7 @@ def update_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_credentials_serialize( project_id=project_id, @@ -3041,7 +3041,7 @@ def _update_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3137,7 +3137,7 @@ def update_load_balancer( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_load_balancer_serialize( project_id=project_id, @@ -3214,7 +3214,7 @@ def update_load_balancer_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_load_balancer_serialize( project_id=project_id, @@ -3291,7 +3291,7 @@ def update_load_balancer_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_load_balancer_serialize( project_id=project_id, @@ -3335,7 +3335,7 @@ def _update_load_balancer_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3434,7 +3434,7 @@ def update_target_pool( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_target_pool_serialize( project_id=project_id, @@ -3514,7 +3514,7 @@ def update_target_pool_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_target_pool_serialize( project_id=project_id, @@ -3594,7 +3594,7 @@ def update_target_pool_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_target_pool_serialize( project_id=project_id, @@ -3639,7 +3639,7 @@ def _update_target_pool_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/loadbalancer/src/stackit/loadbalancer/api_client.py b/services/loadbalancer/src/stackit/loadbalancer/api_client.py index 3542b18f..5324e979 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/api_client.py +++ b/services/loadbalancer/src/stackit/loadbalancer/api_client.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -331,6 +331,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -350,12 +354,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -457,7 +461,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -473,7 +477,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -488,6 +495,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/loadbalancer/src/stackit/loadbalancer/configuration.py b/services/loadbalancer/src/stackit/loadbalancer/configuration.py index da49ec15..2a31b83c 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/configuration.py +++ b/services/loadbalancer/src/stackit/loadbalancer/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ Load Balancer API @@ -14,7 +9,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -53,7 +70,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -71,7 +88,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -111,7 +133,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -130,12 +152,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/loadbalancer/src/stackit/loadbalancer/exceptions.py b/services/loadbalancer/src/stackit/loadbalancer/exceptions.py index cc3b4f97..ecf1f323 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/exceptions.py +++ b/services/loadbalancer/src/stackit/loadbalancer/exceptions.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -151,6 +151,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -187,6 +194,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/__init__.py b/services/loadbalancer/src/stackit/loadbalancer/models/__init__.py index a04c158f..c400291e 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/__init__.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/__init__.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/active_health_check.py b/services/loadbalancer/src/stackit/loadbalancer/models/active_health_check.py index e6e45cc2..b89bfa78 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/active_health_check.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/active_health_check.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -25,7 +25,7 @@ class ActiveHealthCheck(BaseModel): """ ActiveHealthCheck - """ + """ # noqa: E501 healthy_threshold: Optional[Annotated[int, Field(le=1000000, strict=True, ge=1)]] = Field( default=None, description="Healthy threshold of the health checking", alias="healthyThreshold" diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/create_credentials_payload.py b/services/loadbalancer/src/stackit/loadbalancer/models/create_credentials_payload.py index 715ff3e1..ceccb6e4 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/create_credentials_payload.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/create_credentials_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class CreateCredentialsPayload(BaseModel): """ CreateCredentialsPayload - """ + """ # noqa: E501 display_name: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, description="Credential name", alias="displayName" diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/create_credentials_response.py b/services/loadbalancer/src/stackit/loadbalancer/models/create_credentials_response.py index 374d16e8..b07f5a5e 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/create_credentials_response.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/create_credentials_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class CreateCredentialsResponse(BaseModel): """ CreateCredentialsResponse - """ + """ # noqa: E501 credential: Optional[CredentialsResponse] = None __properties: ClassVar[List[str]] = ["credential"] diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/create_load_balancer_payload.py b/services/loadbalancer/src/stackit/loadbalancer/models/create_load_balancer_payload.py index 9102b893..be20966c 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/create_load_balancer_payload.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/create_load_balancer_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import ( @@ -39,7 +39,7 @@ class CreateLoadBalancerPayload(BaseModel): """ CreateLoadBalancerPayload - """ + """ # noqa: E501 disable_target_security_group_assignment: Optional[StrictBool] = Field( default=None, diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/credentials_response.py b/services/loadbalancer/src/stackit/loadbalancer/models/credentials_response.py index 6e67b41c..ab05893b 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/credentials_response.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/credentials_response.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class CredentialsResponse(BaseModel): """ CredentialsResponse - """ + """ # noqa: E501 credentials_ref: Optional[StrictStr] = Field( default=None, diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/get_credentials_response.py b/services/loadbalancer/src/stackit/loadbalancer/models/get_credentials_response.py index 66debb29..54f5575c 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/get_credentials_response.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/get_credentials_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class GetCredentialsResponse(BaseModel): """ GetCredentialsResponse - """ + """ # noqa: E501 credential: Optional[CredentialsResponse] = None __properties: ClassVar[List[str]] = ["credential"] diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/get_quota_response.py b/services/loadbalancer/src/stackit/loadbalancer/models/get_quota_response.py index 51038bd9..cd9e1452 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/get_quota_response.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/get_quota_response.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -25,7 +25,7 @@ class GetQuotaResponse(BaseModel): """ GetQuotaResponse - """ + """ # noqa: E501 max_load_balancers: Optional[Annotated[int, Field(le=1000000, strict=True, ge=-1)]] = Field( default=None, diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/google_protobuf_any.py b/services/loadbalancer/src/stackit/loadbalancer/models/google_protobuf_any.py index de07d88e..53c08a13 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/google_protobuf_any.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/google_protobuf_any.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class GoogleProtobufAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. - """ + """ # noqa: E501 type: Optional[StrictStr] = Field(default=None, description="The type of the serialized message.", alias="@type") additional_properties: Dict[str, Any] = {} diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/list_credentials_response.py b/services/loadbalancer/src/stackit/loadbalancer/models/list_credentials_response.py index ff1a14e9..631ea6ed 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/list_credentials_response.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/list_credentials_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListCredentialsResponse(BaseModel): """ ListCredentialsResponse - """ + """ # noqa: E501 credentials: Optional[List[CredentialsResponse]] = None __properties: ClassVar[List[str]] = ["credentials"] diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/list_load_balancers_response.py b/services/loadbalancer/src/stackit/loadbalancer/models/list_load_balancers_response.py index 644c96f3..3ffa3ad9 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/list_load_balancers_response.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/list_load_balancers_response.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -27,7 +27,7 @@ class ListLoadBalancersResponse(BaseModel): """ ListLoadBalancersResponse - """ + """ # noqa: E501 load_balancers: Optional[List[LoadBalancer]] = Field(default=None, alias="loadBalancers") next_page_id: Optional[Annotated[str, Field(strict=True)]] = Field( diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/list_plans_response.py b/services/loadbalancer/src/stackit/loadbalancer/models/list_plans_response.py index 41ecbbc7..fd2e7bd9 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/list_plans_response.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/list_plans_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListPlansResponse(BaseModel): """ ListPlansResponse - """ + """ # noqa: E501 valid_plans: Optional[List[PlanDetails]] = Field(default=None, alias="validPlans") __properties: ClassVar[List[str]] = ["validPlans"] diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/listener.py b/services/loadbalancer/src/stackit/loadbalancer/models/listener.py index e192d503..2ac92640 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/listener.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/listener.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -28,7 +28,7 @@ class Listener(BaseModel): """ Listener - """ + """ # noqa: E501 display_name: Optional[StrictStr] = Field(default=None, alias="displayName") name: Optional[StrictStr] = Field( diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/load_balancer.py b/services/loadbalancer/src/stackit/loadbalancer/models/load_balancer.py index bfc94782..7857cf14 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/load_balancer.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/load_balancer.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import ( @@ -39,7 +39,7 @@ class LoadBalancer(BaseModel): """ LoadBalancer - """ + """ # noqa: E501 disable_target_security_group_assignment: Optional[StrictBool] = Field( default=None, diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/load_balancer_error.py b/services/loadbalancer/src/stackit/loadbalancer/models/load_balancer_error.py index e89c93b2..9d9ae86e 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/load_balancer_error.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/load_balancer_error.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class LoadBalancerError(BaseModel): """ LoadBalancerError - """ + """ # noqa: E501 description: Optional[StrictStr] = Field( default=None, diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/load_balancer_options.py b/services/loadbalancer/src/stackit/loadbalancer/models/load_balancer_options.py index 9306f60f..e283e804 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/load_balancer_options.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/load_balancer_options.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -31,7 +31,7 @@ class LoadBalancerOptions(BaseModel): """ Defines any optional functionality you want to have enabled on your load balancer. - """ + """ # noqa: E501 access_control: Optional[LoadbalancerOptionAccessControl] = Field(default=None, alias="accessControl") ephemeral_address: Optional[StrictBool] = Field(default=None, alias="ephemeralAddress") diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/loadbalancer_option_access_control.py b/services/loadbalancer/src/stackit/loadbalancer/models/loadbalancer_option_access_control.py index 13345d4c..aabe7c72 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/loadbalancer_option_access_control.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/loadbalancer_option_access_control.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class LoadbalancerOptionAccessControl(BaseModel): """ Use this option to limit the IP ranges that can use the load balancer. - """ + """ # noqa: E501 allowed_source_ranges: Optional[List[StrictStr]] = Field( default=None, diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/loadbalancer_option_logs.py b/services/loadbalancer/src/stackit/loadbalancer/models/loadbalancer_option_logs.py index 2e8d6891..336c07f5 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/loadbalancer_option_logs.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/loadbalancer_option_logs.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class LoadbalancerOptionLogs(BaseModel): """ LoadbalancerOptionLogs - """ + """ # noqa: E501 credentials_ref: Optional[StrictStr] = Field( default=None, diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/loadbalancer_option_metrics.py b/services/loadbalancer/src/stackit/loadbalancer/models/loadbalancer_option_metrics.py index 21afed4c..b6f54551 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/loadbalancer_option_metrics.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/loadbalancer_option_metrics.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class LoadbalancerOptionMetrics(BaseModel): """ LoadbalancerOptionMetrics - """ + """ # noqa: E501 credentials_ref: Optional[StrictStr] = Field( default=None, diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/loadbalancer_option_observability.py b/services/loadbalancer/src/stackit/loadbalancer/models/loadbalancer_option_observability.py index a9980bf2..9752501c 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/loadbalancer_option_observability.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/loadbalancer_option_observability.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class LoadbalancerOptionObservability(BaseModel): """ We offer Load Balancer metrics observability via ARGUS or external solutions. Not changeable after creation. - """ + """ # noqa: E501 logs: Optional[LoadbalancerOptionLogs] = None metrics: Optional[LoadbalancerOptionMetrics] = None diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/network.py b/services/loadbalancer/src/stackit/loadbalancer/models/network.py index 5f022b5c..e53d96cf 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/network.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/network.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class Network(BaseModel): """ Network - """ + """ # noqa: E501 network_id: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, description="Openstack network ID", alias="networkId" diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/options_tcp.py b/services/loadbalancer/src/stackit/loadbalancer/models/options_tcp.py index 19ecef68..8bc4323d 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/options_tcp.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/options_tcp.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -25,7 +25,7 @@ class OptionsTCP(BaseModel): """ OptionsTCP - """ + """ # noqa: E501 idle_timeout: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/options_udp.py b/services/loadbalancer/src/stackit/loadbalancer/models/options_udp.py index d2756fcc..5887f58c 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/options_udp.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/options_udp.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -25,7 +25,7 @@ class OptionsUDP(BaseModel): """ OptionsUDP - """ + """ # noqa: E501 idle_timeout: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/plan_details.py b/services/loadbalancer/src/stackit/loadbalancer/models/plan_details.py index 172c54b9..0539aa82 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/plan_details.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/plan_details.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class PlanDetails(BaseModel): """ PlanDetails - """ + """ # noqa: E501 description: Optional[StrictStr] = Field(default=None, description="Description") flavor_name: Optional[StrictStr] = Field(default=None, description="Flavor Name", alias="flavorName") diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/security_group.py b/services/loadbalancer/src/stackit/loadbalancer/models/security_group.py index 205abe03..695f196f 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/security_group.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/security_group.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class SecurityGroup(BaseModel): """ SecurityGroup - """ + """ # noqa: E501 id: Optional[StrictStr] = Field(default=None, description="ID of the security Group") name: Optional[StrictStr] = Field(default=None, description="Name of the security Group") diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/server_name_indicator.py b/services/loadbalancer/src/stackit/loadbalancer/models/server_name_indicator.py index d90156a4..b70fb7de 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/server_name_indicator.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/server_name_indicator.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class ServerNameIndicator(BaseModel): """ ServerNameIndicator - """ + """ # noqa: E501 name: Optional[StrictStr] = Field(default=None, description="The domain name for this SNI config.") __properties: ClassVar[List[str]] = ["name"] diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/session_persistence.py b/services/loadbalancer/src/stackit/loadbalancer/models/session_persistence.py index 641f861c..2b9b53dd 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/session_persistence.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/session_persistence.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class SessionPersistence(BaseModel): """ SessionPersistence - """ + """ # noqa: E501 use_source_ip_address: Optional[StrictBool] = Field( default=None, diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/status.py b/services/loadbalancer/src/stackit/loadbalancer/models/status.py index 460d96ea..962454d4 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/status.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/status.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class Status(BaseModel): """ The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). - """ + """ # noqa: E501 code: Optional[StrictInt] = Field( default=None, diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/target.py b/services/loadbalancer/src/stackit/loadbalancer/models/target.py index 14e07fc4..1c2c6f0e 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/target.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/target.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class Target(BaseModel): """ Target - """ + """ # noqa: E501 display_name: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, description="Target name", alias="displayName" diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/target_pool.py b/services/loadbalancer/src/stackit/loadbalancer/models/target_pool.py index 5e2019d7..95a8ccce 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/target_pool.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/target_pool.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -29,7 +29,7 @@ class TargetPool(BaseModel): """ TargetPool - """ + """ # noqa: E501 active_health_check: Optional[ActiveHealthCheck] = Field(default=None, alias="activeHealthCheck") name: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Target pool name") diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/update_credentials_payload.py b/services/loadbalancer/src/stackit/loadbalancer/models/update_credentials_payload.py index c7192923..256922c7 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/update_credentials_payload.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/update_credentials_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class UpdateCredentialsPayload(BaseModel): """ UpdateCredentialsPayload - """ + """ # noqa: E501 display_name: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, description="Credential name", alias="displayName" diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/update_credentials_response.py b/services/loadbalancer/src/stackit/loadbalancer/models/update_credentials_response.py index ab34a5d3..13f03667 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/update_credentials_response.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/update_credentials_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class UpdateCredentialsResponse(BaseModel): """ UpdateCredentialsResponse - """ + """ # noqa: E501 credential: Optional[CredentialsResponse] = None __properties: ClassVar[List[str]] = ["credential"] diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/update_load_balancer_payload.py b/services/loadbalancer/src/stackit/loadbalancer/models/update_load_balancer_payload.py index 6bdd9430..fc6e50db 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/update_load_balancer_payload.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/update_load_balancer_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import ( @@ -39,7 +39,7 @@ class UpdateLoadBalancerPayload(BaseModel): """ UpdateLoadBalancerPayload - """ + """ # noqa: E501 disable_target_security_group_assignment: Optional[StrictBool] = Field( default=None, diff --git a/services/loadbalancer/src/stackit/loadbalancer/models/update_target_pool_payload.py b/services/loadbalancer/src/stackit/loadbalancer/models/update_target_pool_payload.py index 49545229..e7aa7ef4 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/models/update_target_pool_payload.py +++ b/services/loadbalancer/src/stackit/loadbalancer/models/update_target_pool_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -29,7 +29,7 @@ class UpdateTargetPoolPayload(BaseModel): """ UpdateTargetPoolPayload - """ + """ # noqa: E501 active_health_check: Optional[ActiveHealthCheck] = Field(default=None, alias="activeHealthCheck") name: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Target pool name") diff --git a/services/loadbalancer/src/stackit/loadbalancer/rest.py b/services/loadbalancer/src/stackit/loadbalancer/rest.py index d02425a3..6834ed28 100644 --- a/services/loadbalancer/src/stackit/loadbalancer/rest.py +++ b/services/loadbalancer/src/stackit/loadbalancer/rest.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -124,7 +124,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/logme/CHANGELOG.md b/services/logme/CHANGELOG.md index 6844d512..321b2576 100644 --- a/services/logme/CHANGELOG.md +++ b/services/logme/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.3.2 +- **Internal:** Improve deserializing and error types + ## v0.3.1 (2025-05-09) - **Feature:** Update user-agent header diff --git a/services/logme/pyproject.toml b/services/logme/pyproject.toml index 836a98c9..c1234aa3 100644 --- a/services/logme/pyproject.toml +++ b/services/logme/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-logme" [tool.poetry] name = "stackit-logme" -version = "v0.3.1" +version = "v0.3.2" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/logme/src/stackit/logme/__init__.py b/services/logme/src/stackit/logme/__init__.py index 9629a6e1..59e55f84 100644 --- a/services/logme/src/stackit/logme/__init__.py +++ b/services/logme/src/stackit/logme/__init__.py @@ -11,61 +11,129 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "Backup", + "CreateBackupResponseItem", + "CreateInstancePayload", + "CreateInstanceResponse", + "Credentials", + "CredentialsListItem", + "CredentialsResponse", + "Error", + "GetMetricsResponse", + "Instance", + "InstanceLastOperation", + "InstanceParameters", + "InstanceParametersGroksInner", + "InstanceSchema", + "ListBackupsResponse", + "ListCredentialsResponse", + "ListInstancesResponse", + "ListOfferingsResponse", + "ListRestoresResponse", + "ModelSchema", + "Offering", + "PartialUpdateInstancePayload", + "Plan", + "RawCredentials", + "Restore", + "TriggerRestoreResponse", + "UpdateBackupsConfigPayload", + "UpdateBackupsConfigResponse", +] + # import apis into sdk package -from stackit.logme.api.default_api import DefaultApi -from stackit.logme.api_client import ApiClient +from stackit.logme.api.default_api import DefaultApi as DefaultApi +from stackit.logme.api_client import ApiClient as ApiClient # import ApiClient -from stackit.logme.api_response import ApiResponse -from stackit.logme.configuration import HostConfiguration -from stackit.logme.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.logme.api_response import ApiResponse as ApiResponse +from stackit.logme.configuration import HostConfiguration as HostConfiguration +from stackit.logme.exceptions import ApiAttributeError as ApiAttributeError +from stackit.logme.exceptions import ApiException as ApiException +from stackit.logme.exceptions import ApiKeyError as ApiKeyError +from stackit.logme.exceptions import ApiTypeError as ApiTypeError +from stackit.logme.exceptions import ApiValueError as ApiValueError +from stackit.logme.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.logme.models.backup import Backup -from stackit.logme.models.create_backup_response_item import CreateBackupResponseItem -from stackit.logme.models.create_instance_payload import CreateInstancePayload -from stackit.logme.models.create_instance_response import CreateInstanceResponse -from stackit.logme.models.credentials import Credentials -from stackit.logme.models.credentials_list_item import CredentialsListItem -from stackit.logme.models.credentials_response import CredentialsResponse -from stackit.logme.models.error import Error -from stackit.logme.models.get_metrics_response import GetMetricsResponse -from stackit.logme.models.instance import Instance -from stackit.logme.models.instance_last_operation import InstanceLastOperation -from stackit.logme.models.instance_parameters import InstanceParameters +from stackit.logme.models.backup import Backup as Backup +from stackit.logme.models.create_backup_response_item import ( + CreateBackupResponseItem as CreateBackupResponseItem, +) +from stackit.logme.models.create_instance_payload import ( + CreateInstancePayload as CreateInstancePayload, +) +from stackit.logme.models.create_instance_response import ( + CreateInstanceResponse as CreateInstanceResponse, +) +from stackit.logme.models.credentials import Credentials as Credentials +from stackit.logme.models.credentials_list_item import ( + CredentialsListItem as CredentialsListItem, +) +from stackit.logme.models.credentials_response import ( + CredentialsResponse as CredentialsResponse, +) +from stackit.logme.models.error import Error as Error +from stackit.logme.models.get_metrics_response import ( + GetMetricsResponse as GetMetricsResponse, +) +from stackit.logme.models.instance import Instance as Instance +from stackit.logme.models.instance_last_operation import ( + InstanceLastOperation as InstanceLastOperation, +) +from stackit.logme.models.instance_parameters import ( + InstanceParameters as InstanceParameters, +) from stackit.logme.models.instance_parameters_groks_inner import ( - InstanceParametersGroksInner, -) -from stackit.logme.models.instance_schema import InstanceSchema -from stackit.logme.models.list_backups_response import ListBackupsResponse -from stackit.logme.models.list_credentials_response import ListCredentialsResponse -from stackit.logme.models.list_instances_response import ListInstancesResponse -from stackit.logme.models.list_offerings_response import ListOfferingsResponse -from stackit.logme.models.list_restores_response import ListRestoresResponse -from stackit.logme.models.model_schema import ModelSchema -from stackit.logme.models.offering import Offering + InstanceParametersGroksInner as InstanceParametersGroksInner, +) +from stackit.logme.models.instance_schema import InstanceSchema as InstanceSchema +from stackit.logme.models.list_backups_response import ( + ListBackupsResponse as ListBackupsResponse, +) +from stackit.logme.models.list_credentials_response import ( + ListCredentialsResponse as ListCredentialsResponse, +) +from stackit.logme.models.list_instances_response import ( + ListInstancesResponse as ListInstancesResponse, +) +from stackit.logme.models.list_offerings_response import ( + ListOfferingsResponse as ListOfferingsResponse, +) +from stackit.logme.models.list_restores_response import ( + ListRestoresResponse as ListRestoresResponse, +) +from stackit.logme.models.model_schema import ModelSchema as ModelSchema +from stackit.logme.models.offering import Offering as Offering from stackit.logme.models.partial_update_instance_payload import ( - PartialUpdateInstancePayload, + PartialUpdateInstancePayload as PartialUpdateInstancePayload, +) +from stackit.logme.models.plan import Plan as Plan +from stackit.logme.models.raw_credentials import RawCredentials as RawCredentials +from stackit.logme.models.restore import Restore as Restore +from stackit.logme.models.trigger_restore_response import ( + TriggerRestoreResponse as TriggerRestoreResponse, ) -from stackit.logme.models.plan import Plan -from stackit.logme.models.raw_credentials import RawCredentials -from stackit.logme.models.restore import Restore -from stackit.logme.models.trigger_restore_response import TriggerRestoreResponse from stackit.logme.models.update_backups_config_payload import ( - UpdateBackupsConfigPayload, + UpdateBackupsConfigPayload as UpdateBackupsConfigPayload, ) from stackit.logme.models.update_backups_config_response import ( - UpdateBackupsConfigResponse, + UpdateBackupsConfigResponse as UpdateBackupsConfigResponse, ) diff --git a/services/logme/src/stackit/logme/api/default_api.py b/services/logme/src/stackit/logme/api/default_api.py index 0394bd09..7fd1ba87 100644 --- a/services/logme/src/stackit/logme/api/default_api.py +++ b/services/logme/src/stackit/logme/api/default_api.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -104,7 +104,7 @@ def create_backup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_backup_serialize( instance_id=instance_id, @@ -169,7 +169,7 @@ def create_backup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_backup_serialize( instance_id=instance_id, @@ -234,7 +234,7 @@ def create_backup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_backup_serialize( instance_id=instance_id, @@ -271,7 +271,7 @@ def _create_backup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -349,7 +349,7 @@ def create_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( project_id=project_id, @@ -414,7 +414,7 @@ def create_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( project_id=project_id, @@ -479,7 +479,7 @@ def create_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( project_id=project_id, @@ -515,7 +515,7 @@ def _create_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -595,7 +595,7 @@ def create_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -663,7 +663,7 @@ def create_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -731,7 +731,7 @@ def create_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -768,7 +768,7 @@ def _create_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -857,7 +857,7 @@ def delete_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( project_id=project_id, @@ -926,7 +926,7 @@ def delete_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( project_id=project_id, @@ -995,7 +995,7 @@ def delete_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( project_id=project_id, @@ -1033,7 +1033,7 @@ def _delete_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1113,7 +1113,7 @@ def delete_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1179,7 +1179,7 @@ def delete_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1245,7 +1245,7 @@ def delete_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1282,7 +1282,7 @@ def _delete_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1362,7 +1362,7 @@ def download_backup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._download_backup_serialize( backup_id=backup_id, @@ -1430,7 +1430,7 @@ def download_backup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._download_backup_serialize( backup_id=backup_id, @@ -1498,7 +1498,7 @@ def download_backup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._download_backup_serialize( backup_id=backup_id, @@ -1536,7 +1536,7 @@ def _download_backup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1621,7 +1621,7 @@ def get_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( project_id=project_id, @@ -1690,7 +1690,7 @@ def get_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( project_id=project_id, @@ -1759,7 +1759,7 @@ def get_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( project_id=project_id, @@ -1797,7 +1797,7 @@ def _get_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1877,7 +1877,7 @@ def get_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -1943,7 +1943,7 @@ def get_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -2009,7 +2009,7 @@ def get_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -2046,7 +2046,7 @@ def _get_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2123,7 +2123,7 @@ def get_metrics( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_metrics_serialize( instance_id=instance_id, @@ -2187,7 +2187,7 @@ def get_metrics_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_metrics_serialize( instance_id=instance_id, @@ -2251,7 +2251,7 @@ def get_metrics_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_metrics_serialize( instance_id=instance_id, @@ -2287,7 +2287,7 @@ def _get_metrics_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2364,7 +2364,7 @@ def list_backups( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( instance_id=instance_id, @@ -2428,7 +2428,7 @@ def list_backups_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( instance_id=instance_id, @@ -2492,7 +2492,7 @@ def list_backups_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( instance_id=instance_id, @@ -2528,7 +2528,7 @@ def _list_backups_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2606,7 +2606,7 @@ def list_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( project_id=project_id, @@ -2671,7 +2671,7 @@ def list_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( project_id=project_id, @@ -2736,7 +2736,7 @@ def list_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( project_id=project_id, @@ -2772,7 +2772,7 @@ def _list_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2847,7 +2847,7 @@ def list_instances( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -2908,7 +2908,7 @@ def list_instances_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -2969,7 +2969,7 @@ def list_instances_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -3003,7 +3003,7 @@ def _list_instances_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3076,7 +3076,7 @@ def list_offerings( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_offerings_serialize( project_id=project_id, @@ -3136,7 +3136,7 @@ def list_offerings_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_offerings_serialize( project_id=project_id, @@ -3196,7 +3196,7 @@ def list_offerings_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_offerings_serialize( project_id=project_id, @@ -3229,7 +3229,7 @@ def _list_offerings_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3304,7 +3304,7 @@ def list_restores( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_restores_serialize( instance_id=instance_id, @@ -3368,7 +3368,7 @@ def list_restores_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_restores_serialize( instance_id=instance_id, @@ -3432,7 +3432,7 @@ def list_restores_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_restores_serialize( instance_id=instance_id, @@ -3468,7 +3468,7 @@ def _list_restores_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3554,7 +3554,7 @@ def partial_update_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_instance_serialize( project_id=project_id, @@ -3629,7 +3629,7 @@ def partial_update_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_instance_serialize( project_id=project_id, @@ -3704,7 +3704,7 @@ def partial_update_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_instance_serialize( project_id=project_id, @@ -3743,7 +3743,7 @@ def _partial_update_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3830,7 +3830,7 @@ def trigger_recreate( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_recreate_serialize( instance_id=instance_id, @@ -3895,7 +3895,7 @@ def trigger_recreate_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_recreate_serialize( instance_id=instance_id, @@ -3960,7 +3960,7 @@ def trigger_recreate_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_recreate_serialize( instance_id=instance_id, @@ -3997,7 +3997,7 @@ def _trigger_recreate_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4074,7 +4074,7 @@ def trigger_restart( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restart_serialize( instance_id=instance_id, @@ -4139,7 +4139,7 @@ def trigger_restart_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restart_serialize( instance_id=instance_id, @@ -4204,7 +4204,7 @@ def trigger_restart_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restart_serialize( instance_id=instance_id, @@ -4241,7 +4241,7 @@ def _trigger_restart_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4321,7 +4321,7 @@ def trigger_restore( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restore_serialize( instance_id=instance_id, @@ -4390,7 +4390,7 @@ def trigger_restore_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restore_serialize( instance_id=instance_id, @@ -4459,7 +4459,7 @@ def trigger_restore_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restore_serialize( instance_id=instance_id, @@ -4498,7 +4498,7 @@ def _trigger_restore_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4583,7 +4583,7 @@ def update_backups_config( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_backups_config_serialize( instance_id=instance_id, @@ -4655,7 +4655,7 @@ def update_backups_config_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_backups_config_serialize( instance_id=instance_id, @@ -4727,7 +4727,7 @@ def update_backups_config_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_backups_config_serialize( instance_id=instance_id, @@ -4766,7 +4766,7 @@ def _update_backups_config_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/logme/src/stackit/logme/api_client.py b/services/logme/src/stackit/logme/api_client.py index 0d26a24c..e5785162 100644 --- a/services/logme/src/stackit/logme/api_client.py +++ b/services/logme/src/stackit/logme/api_client.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -331,6 +331,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -350,12 +354,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -457,7 +461,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -473,7 +477,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -488,6 +495,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/logme/src/stackit/logme/configuration.py b/services/logme/src/stackit/logme/configuration.py index 6f03a143..a3a0e7d1 100644 --- a/services/logme/src/stackit/logme/configuration.py +++ b/services/logme/src/stackit/logme/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT LogMe API @@ -14,7 +9,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -53,7 +70,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -72,7 +89,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -112,7 +134,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -131,12 +153,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/logme/src/stackit/logme/exceptions.py b/services/logme/src/stackit/logme/exceptions.py index 0b366f1a..0fc8f39a 100644 --- a/services/logme/src/stackit/logme/exceptions.py +++ b/services/logme/src/stackit/logme/exceptions.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -151,6 +151,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -187,6 +194,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/logme/src/stackit/logme/models/__init__.py b/services/logme/src/stackit/logme/models/__init__.py index b3866284..41be98c8 100644 --- a/services/logme/src/stackit/logme/models/__init__.py +++ b/services/logme/src/stackit/logme/models/__init__.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/logme/src/stackit/logme/models/backup.py b/services/logme/src/stackit/logme/models/backup.py index 738fc27f..27b62efc 100644 --- a/services/logme/src/stackit/logme/models/backup.py +++ b/services/logme/src/stackit/logme/models/backup.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Backup(BaseModel): """ Backup - """ + """ # noqa: E501 downloadable: Optional[StrictBool] = None finished_at: StrictStr diff --git a/services/logme/src/stackit/logme/models/create_backup_response_item.py b/services/logme/src/stackit/logme/models/create_backup_response_item.py index 571dacfd..bd400596 100644 --- a/services/logme/src/stackit/logme/models/create_backup_response_item.py +++ b/services/logme/src/stackit/logme/models/create_backup_response_item.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateBackupResponseItem(BaseModel): """ CreateBackupResponseItem - """ + """ # noqa: E501 id: StrictInt message: StrictStr diff --git a/services/logme/src/stackit/logme/models/create_instance_payload.py b/services/logme/src/stackit/logme/models/create_instance_payload.py index 56fda1c5..0c3ae8be 100644 --- a/services/logme/src/stackit/logme/models/create_instance_payload.py +++ b/services/logme/src/stackit/logme/models/create_instance_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class CreateInstancePayload(BaseModel): """ CreateInstancePayload - """ + """ # noqa: E501 instance_name: StrictStr = Field(alias="instanceName") parameters: Optional[InstanceParameters] = None diff --git a/services/logme/src/stackit/logme/models/create_instance_response.py b/services/logme/src/stackit/logme/models/create_instance_response.py index f88e6527..039d82df 100644 --- a/services/logme/src/stackit/logme/models/create_instance_response.py +++ b/services/logme/src/stackit/logme/models/create_instance_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateInstanceResponse(BaseModel): """ CreateInstanceResponse - """ + """ # noqa: E501 instance_id: StrictStr = Field(alias="instanceId") __properties: ClassVar[List[str]] = ["instanceId"] diff --git a/services/logme/src/stackit/logme/models/credentials.py b/services/logme/src/stackit/logme/models/credentials.py index 9e70c2cb..ebc5bdf1 100644 --- a/services/logme/src/stackit/logme/models/credentials.py +++ b/services/logme/src/stackit/logme/models/credentials.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Credentials(BaseModel): """ Credentials - """ + """ # noqa: E501 host: StrictStr password: StrictStr diff --git a/services/logme/src/stackit/logme/models/credentials_list_item.py b/services/logme/src/stackit/logme/models/credentials_list_item.py index 9fcd5a67..0b4d196f 100644 --- a/services/logme/src/stackit/logme/models/credentials_list_item.py +++ b/services/logme/src/stackit/logme/models/credentials_list_item.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CredentialsListItem(BaseModel): """ CredentialsListItem - """ + """ # noqa: E501 id: StrictStr __properties: ClassVar[List[str]] = ["id"] diff --git a/services/logme/src/stackit/logme/models/credentials_response.py b/services/logme/src/stackit/logme/models/credentials_response.py index 2eff84df..d4e95c95 100644 --- a/services/logme/src/stackit/logme/models/credentials_response.py +++ b/services/logme/src/stackit/logme/models/credentials_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class CredentialsResponse(BaseModel): """ CredentialsResponse - """ + """ # noqa: E501 id: StrictStr raw: Optional[RawCredentials] = None diff --git a/services/logme/src/stackit/logme/models/error.py b/services/logme/src/stackit/logme/models/error.py index 8eb28da2..670059b3 100644 --- a/services/logme/src/stackit/logme/models/error.py +++ b/services/logme/src/stackit/logme/models/error.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Error(BaseModel): """ Error - """ + """ # noqa: E501 description: StrictStr error: StrictStr diff --git a/services/logme/src/stackit/logme/models/get_metrics_response.py b/services/logme/src/stackit/logme/models/get_metrics_response.py index 647179b3..f8fb1505 100644 --- a/services/logme/src/stackit/logme/models/get_metrics_response.py +++ b/services/logme/src/stackit/logme/models/get_metrics_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -32,7 +32,7 @@ class GetMetricsResponse(BaseModel): """ GetMetricsResponse - """ + """ # noqa: E501 cpu_idle_time: Optional[StrictInt] = Field(default=None, alias="cpuIdleTime") cpu_load_percent: Union[StrictFloat, StrictInt] = Field(alias="cpuLoadPercent") diff --git a/services/logme/src/stackit/logme/models/instance.py b/services/logme/src/stackit/logme/models/instance.py index ab9baef9..bf3be354 100644 --- a/services/logme/src/stackit/logme/models/instance.py +++ b/services/logme/src/stackit/logme/models/instance.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class Instance(BaseModel): """ Instance - """ + """ # noqa: E501 cf_guid: StrictStr = Field(alias="cfGuid") cf_organization_guid: StrictStr = Field(alias="cfOrganizationGuid") diff --git a/services/logme/src/stackit/logme/models/instance_last_operation.py b/services/logme/src/stackit/logme/models/instance_last_operation.py index ccbb305e..8eef57f3 100644 --- a/services/logme/src/stackit/logme/models/instance_last_operation.py +++ b/services/logme/src/stackit/logme/models/instance_last_operation.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class InstanceLastOperation(BaseModel): """ InstanceLastOperation - """ + """ # noqa: E501 description: StrictStr state: StrictStr diff --git a/services/logme/src/stackit/logme/models/instance_parameters.py b/services/logme/src/stackit/logme/models/instance_parameters.py index 1ce62495..f196bfb6 100644 --- a/services/logme/src/stackit/logme/models/instance_parameters.py +++ b/services/logme/src/stackit/logme/models/instance_parameters.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -37,7 +37,7 @@ class InstanceParameters(BaseModel): """ InstanceParameters - """ + """ # noqa: E501 enable_monitoring: Optional[StrictBool] = False fluentd_tcp: Optional[StrictInt] = Field(default=0, alias="fluentd-tcp") diff --git a/services/logme/src/stackit/logme/models/instance_parameters_groks_inner.py b/services/logme/src/stackit/logme/models/instance_parameters_groks_inner.py index ba348af1..646771da 100644 --- a/services/logme/src/stackit/logme/models/instance_parameters_groks_inner.py +++ b/services/logme/src/stackit/logme/models/instance_parameters_groks_inner.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class InstanceParametersGroksInner(BaseModel): """ InstanceParametersGroksInner - """ + """ # noqa: E501 pattern: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["pattern"] diff --git a/services/logme/src/stackit/logme/models/instance_schema.py b/services/logme/src/stackit/logme/models/instance_schema.py index 23de5a9f..03b54ddb 100644 --- a/services/logme/src/stackit/logme/models/instance_schema.py +++ b/services/logme/src/stackit/logme/models/instance_schema.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class InstanceSchema(BaseModel): """ InstanceSchema - """ + """ # noqa: E501 create: ModelSchema update: ModelSchema diff --git a/services/logme/src/stackit/logme/models/list_backups_response.py b/services/logme/src/stackit/logme/models/list_backups_response.py index ead80acb..bb93cd0d 100644 --- a/services/logme/src/stackit/logme/models/list_backups_response.py +++ b/services/logme/src/stackit/logme/models/list_backups_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListBackupsResponse(BaseModel): """ ListBackupsResponse - """ + """ # noqa: E501 instance_backups: List[Backup] = Field(alias="instanceBackups") __properties: ClassVar[List[str]] = ["instanceBackups"] diff --git a/services/logme/src/stackit/logme/models/list_credentials_response.py b/services/logme/src/stackit/logme/models/list_credentials_response.py index 5cfb2f45..749148f4 100644 --- a/services/logme/src/stackit/logme/models/list_credentials_response.py +++ b/services/logme/src/stackit/logme/models/list_credentials_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListCredentialsResponse(BaseModel): """ ListCredentialsResponse - """ + """ # noqa: E501 credentials_list: List[CredentialsListItem] = Field(alias="credentialsList") __properties: ClassVar[List[str]] = ["credentialsList"] diff --git a/services/logme/src/stackit/logme/models/list_instances_response.py b/services/logme/src/stackit/logme/models/list_instances_response.py index 5ebafb15..def4eacc 100644 --- a/services/logme/src/stackit/logme/models/list_instances_response.py +++ b/services/logme/src/stackit/logme/models/list_instances_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListInstancesResponse(BaseModel): """ ListInstancesResponse - """ + """ # noqa: E501 instances: List[Instance] __properties: ClassVar[List[str]] = ["instances"] diff --git a/services/logme/src/stackit/logme/models/list_offerings_response.py b/services/logme/src/stackit/logme/models/list_offerings_response.py index ee316634..14ab59be 100644 --- a/services/logme/src/stackit/logme/models/list_offerings_response.py +++ b/services/logme/src/stackit/logme/models/list_offerings_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListOfferingsResponse(BaseModel): """ ListOfferingsResponse - """ + """ # noqa: E501 offerings: List[Offering] __properties: ClassVar[List[str]] = ["offerings"] diff --git a/services/logme/src/stackit/logme/models/list_restores_response.py b/services/logme/src/stackit/logme/models/list_restores_response.py index 022372f9..1ff9f981 100644 --- a/services/logme/src/stackit/logme/models/list_restores_response.py +++ b/services/logme/src/stackit/logme/models/list_restores_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListRestoresResponse(BaseModel): """ ListRestoresResponse - """ + """ # noqa: E501 instance_restores: List[Restore] = Field(alias="instanceRestores") __properties: ClassVar[List[str]] = ["instanceRestores"] diff --git a/services/logme/src/stackit/logme/models/model_schema.py b/services/logme/src/stackit/logme/models/model_schema.py index 131e4b08..4279fdc9 100644 --- a/services/logme/src/stackit/logme/models/model_schema.py +++ b/services/logme/src/stackit/logme/models/model_schema.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class ModelSchema(BaseModel): """ ModelSchema - """ + """ # noqa: E501 parameters: Dict[str, Any] __properties: ClassVar[List[str]] = ["parameters"] diff --git a/services/logme/src/stackit/logme/models/offering.py b/services/logme/src/stackit/logme/models/offering.py index 9448d388..ba4d5ade 100644 --- a/services/logme/src/stackit/logme/models/offering.py +++ b/services/logme/src/stackit/logme/models/offering.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class Offering(BaseModel): """ Offering - """ + """ # noqa: E501 description: StrictStr documentation_url: StrictStr = Field(alias="documentationUrl") diff --git a/services/logme/src/stackit/logme/models/partial_update_instance_payload.py b/services/logme/src/stackit/logme/models/partial_update_instance_payload.py index 7e469f37..fec483b2 100644 --- a/services/logme/src/stackit/logme/models/partial_update_instance_payload.py +++ b/services/logme/src/stackit/logme/models/partial_update_instance_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class PartialUpdateInstancePayload(BaseModel): """ PartialUpdateInstancePayload - """ + """ # noqa: E501 instance_name: Optional[StrictStr] = Field(default=None, alias="instanceName") parameters: Optional[InstanceParameters] = None diff --git a/services/logme/src/stackit/logme/models/plan.py b/services/logme/src/stackit/logme/models/plan.py index 6ce0ac31..076f6c2e 100644 --- a/services/logme/src/stackit/logme/models/plan.py +++ b/services/logme/src/stackit/logme/models/plan.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Plan(BaseModel): """ Plan - """ + """ # noqa: E501 description: StrictStr free: StrictBool diff --git a/services/logme/src/stackit/logme/models/raw_credentials.py b/services/logme/src/stackit/logme/models/raw_credentials.py index 15db9a35..4c03016e 100644 --- a/services/logme/src/stackit/logme/models/raw_credentials.py +++ b/services/logme/src/stackit/logme/models/raw_credentials.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class RawCredentials(BaseModel): """ RawCredentials - """ + """ # noqa: E501 credentials: Credentials __properties: ClassVar[List[str]] = ["credentials"] diff --git a/services/logme/src/stackit/logme/models/restore.py b/services/logme/src/stackit/logme/models/restore.py index b4935500..fddf8b7b 100644 --- a/services/logme/src/stackit/logme/models/restore.py +++ b/services/logme/src/stackit/logme/models/restore.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Restore(BaseModel): """ Restore - """ + """ # noqa: E501 backup_id: StrictInt finished_at: StrictStr diff --git a/services/logme/src/stackit/logme/models/trigger_restore_response.py b/services/logme/src/stackit/logme/models/trigger_restore_response.py index 9cde1858..58d7e8c6 100644 --- a/services/logme/src/stackit/logme/models/trigger_restore_response.py +++ b/services/logme/src/stackit/logme/models/trigger_restore_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class TriggerRestoreResponse(BaseModel): """ TriggerRestoreResponse - """ + """ # noqa: E501 id: StrictInt __properties: ClassVar[List[str]] = ["id"] diff --git a/services/logme/src/stackit/logme/models/update_backups_config_payload.py b/services/logme/src/stackit/logme/models/update_backups_config_payload.py index a3a06aa3..4290dce1 100644 --- a/services/logme/src/stackit/logme/models/update_backups_config_payload.py +++ b/services/logme/src/stackit/logme/models/update_backups_config_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class UpdateBackupsConfigPayload(BaseModel): """ UpdateBackupsConfigPayload - """ + """ # noqa: E501 encryption_key: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["encryption_key"] diff --git a/services/logme/src/stackit/logme/models/update_backups_config_response.py b/services/logme/src/stackit/logme/models/update_backups_config_response.py index 101d9881..7175b5b6 100644 --- a/services/logme/src/stackit/logme/models/update_backups_config_response.py +++ b/services/logme/src/stackit/logme/models/update_backups_config_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class UpdateBackupsConfigResponse(BaseModel): """ UpdateBackupsConfigResponse - """ + """ # noqa: E501 message: StrictStr __properties: ClassVar[List[str]] = ["message"] diff --git a/services/logme/src/stackit/logme/rest.py b/services/logme/src/stackit/logme/rest.py index 2f2ad833..5c1b1d3b 100644 --- a/services/logme/src/stackit/logme/rest.py +++ b/services/logme/src/stackit/logme/rest.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -124,7 +124,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/mariadb/CHANGELOG.md b/services/mariadb/CHANGELOG.md index 53742bfd..dd64b684 100644 --- a/services/mariadb/CHANGELOG.md +++ b/services/mariadb/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.2.3 +- **Internal:** Improve deserializing and error types + ## v0.2.2 (2025-05-09) - **Feature:** Update user-agent header diff --git a/services/mariadb/pyproject.toml b/services/mariadb/pyproject.toml index e8cc4561..e111cf48 100644 --- a/services/mariadb/pyproject.toml +++ b/services/mariadb/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-mariadb" [tool.poetry] name = "stackit-mariadb" -version = "v0.2.2" +version = "v0.2.3" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/mariadb/src/stackit/mariadb/__init__.py b/services/mariadb/src/stackit/mariadb/__init__.py index b1f3f018..6e397a4a 100644 --- a/services/mariadb/src/stackit/mariadb/__init__.py +++ b/services/mariadb/src/stackit/mariadb/__init__.py @@ -11,58 +11,125 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "Backup", + "CreateBackupResponseItem", + "CreateInstancePayload", + "CreateInstanceResponse", + "Credentials", + "CredentialsListItem", + "CredentialsResponse", + "Error", + "GetMetricsResponse", + "Instance", + "InstanceLastOperation", + "InstanceParameters", + "InstanceSchema", + "ListBackupsResponse", + "ListCredentialsResponse", + "ListInstancesResponse", + "ListOfferingsResponse", + "ListRestoresResponse", + "ModelSchema", + "Offering", + "PartialUpdateInstancePayload", + "Plan", + "RawCredentials", + "Restore", + "TriggerRestoreResponse", + "UpdateBackupsConfigPayload", + "UpdateBackupsConfigResponse", +] + # import apis into sdk package -from stackit.mariadb.api.default_api import DefaultApi -from stackit.mariadb.api_client import ApiClient +from stackit.mariadb.api.default_api import DefaultApi as DefaultApi +from stackit.mariadb.api_client import ApiClient as ApiClient # import ApiClient -from stackit.mariadb.api_response import ApiResponse -from stackit.mariadb.configuration import HostConfiguration -from stackit.mariadb.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.mariadb.api_response import ApiResponse as ApiResponse +from stackit.mariadb.configuration import HostConfiguration as HostConfiguration +from stackit.mariadb.exceptions import ApiAttributeError as ApiAttributeError +from stackit.mariadb.exceptions import ApiException as ApiException +from stackit.mariadb.exceptions import ApiKeyError as ApiKeyError +from stackit.mariadb.exceptions import ApiTypeError as ApiTypeError +from stackit.mariadb.exceptions import ApiValueError as ApiValueError +from stackit.mariadb.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.mariadb.models.backup import Backup -from stackit.mariadb.models.create_backup_response_item import CreateBackupResponseItem -from stackit.mariadb.models.create_instance_payload import CreateInstancePayload -from stackit.mariadb.models.create_instance_response import CreateInstanceResponse -from stackit.mariadb.models.credentials import Credentials -from stackit.mariadb.models.credentials_list_item import CredentialsListItem -from stackit.mariadb.models.credentials_response import CredentialsResponse -from stackit.mariadb.models.error import Error -from stackit.mariadb.models.get_metrics_response import GetMetricsResponse -from stackit.mariadb.models.instance import Instance -from stackit.mariadb.models.instance_last_operation import InstanceLastOperation -from stackit.mariadb.models.instance_parameters import InstanceParameters -from stackit.mariadb.models.instance_schema import InstanceSchema -from stackit.mariadb.models.list_backups_response import ListBackupsResponse -from stackit.mariadb.models.list_credentials_response import ListCredentialsResponse -from stackit.mariadb.models.list_instances_response import ListInstancesResponse -from stackit.mariadb.models.list_offerings_response import ListOfferingsResponse -from stackit.mariadb.models.list_restores_response import ListRestoresResponse -from stackit.mariadb.models.model_schema import ModelSchema -from stackit.mariadb.models.offering import Offering +from stackit.mariadb.models.backup import Backup as Backup +from stackit.mariadb.models.create_backup_response_item import ( + CreateBackupResponseItem as CreateBackupResponseItem, +) +from stackit.mariadb.models.create_instance_payload import ( + CreateInstancePayload as CreateInstancePayload, +) +from stackit.mariadb.models.create_instance_response import ( + CreateInstanceResponse as CreateInstanceResponse, +) +from stackit.mariadb.models.credentials import Credentials as Credentials +from stackit.mariadb.models.credentials_list_item import ( + CredentialsListItem as CredentialsListItem, +) +from stackit.mariadb.models.credentials_response import ( + CredentialsResponse as CredentialsResponse, +) +from stackit.mariadb.models.error import Error as Error +from stackit.mariadb.models.get_metrics_response import ( + GetMetricsResponse as GetMetricsResponse, +) +from stackit.mariadb.models.instance import Instance as Instance +from stackit.mariadb.models.instance_last_operation import ( + InstanceLastOperation as InstanceLastOperation, +) +from stackit.mariadb.models.instance_parameters import ( + InstanceParameters as InstanceParameters, +) +from stackit.mariadb.models.instance_schema import InstanceSchema as InstanceSchema +from stackit.mariadb.models.list_backups_response import ( + ListBackupsResponse as ListBackupsResponse, +) +from stackit.mariadb.models.list_credentials_response import ( + ListCredentialsResponse as ListCredentialsResponse, +) +from stackit.mariadb.models.list_instances_response import ( + ListInstancesResponse as ListInstancesResponse, +) +from stackit.mariadb.models.list_offerings_response import ( + ListOfferingsResponse as ListOfferingsResponse, +) +from stackit.mariadb.models.list_restores_response import ( + ListRestoresResponse as ListRestoresResponse, +) +from stackit.mariadb.models.model_schema import ModelSchema as ModelSchema +from stackit.mariadb.models.offering import Offering as Offering from stackit.mariadb.models.partial_update_instance_payload import ( - PartialUpdateInstancePayload, + PartialUpdateInstancePayload as PartialUpdateInstancePayload, +) +from stackit.mariadb.models.plan import Plan as Plan +from stackit.mariadb.models.raw_credentials import RawCredentials as RawCredentials +from stackit.mariadb.models.restore import Restore as Restore +from stackit.mariadb.models.trigger_restore_response import ( + TriggerRestoreResponse as TriggerRestoreResponse, ) -from stackit.mariadb.models.plan import Plan -from stackit.mariadb.models.raw_credentials import RawCredentials -from stackit.mariadb.models.restore import Restore -from stackit.mariadb.models.trigger_restore_response import TriggerRestoreResponse from stackit.mariadb.models.update_backups_config_payload import ( - UpdateBackupsConfigPayload, + UpdateBackupsConfigPayload as UpdateBackupsConfigPayload, ) from stackit.mariadb.models.update_backups_config_response import ( - UpdateBackupsConfigResponse, + UpdateBackupsConfigResponse as UpdateBackupsConfigResponse, ) diff --git a/services/mariadb/src/stackit/mariadb/api/default_api.py b/services/mariadb/src/stackit/mariadb/api/default_api.py index 177f334a..b2274d1b 100644 --- a/services/mariadb/src/stackit/mariadb/api/default_api.py +++ b/services/mariadb/src/stackit/mariadb/api/default_api.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -104,7 +104,7 @@ def create_backup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_backup_serialize( instance_id=instance_id, @@ -169,7 +169,7 @@ def create_backup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_backup_serialize( instance_id=instance_id, @@ -234,7 +234,7 @@ def create_backup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_backup_serialize( instance_id=instance_id, @@ -271,7 +271,7 @@ def _create_backup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -349,7 +349,7 @@ def create_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( project_id=project_id, @@ -414,7 +414,7 @@ def create_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( project_id=project_id, @@ -479,7 +479,7 @@ def create_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( project_id=project_id, @@ -515,7 +515,7 @@ def _create_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -595,7 +595,7 @@ def create_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -663,7 +663,7 @@ def create_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -731,7 +731,7 @@ def create_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -768,7 +768,7 @@ def _create_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -857,7 +857,7 @@ def delete_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( project_id=project_id, @@ -926,7 +926,7 @@ def delete_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( project_id=project_id, @@ -995,7 +995,7 @@ def delete_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( project_id=project_id, @@ -1033,7 +1033,7 @@ def _delete_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1113,7 +1113,7 @@ def delete_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1179,7 +1179,7 @@ def delete_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1245,7 +1245,7 @@ def delete_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1282,7 +1282,7 @@ def _delete_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1362,7 +1362,7 @@ def download_backup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._download_backup_serialize( backup_id=backup_id, @@ -1430,7 +1430,7 @@ def download_backup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._download_backup_serialize( backup_id=backup_id, @@ -1498,7 +1498,7 @@ def download_backup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._download_backup_serialize( backup_id=backup_id, @@ -1536,7 +1536,7 @@ def _download_backup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1621,7 +1621,7 @@ def get_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( project_id=project_id, @@ -1690,7 +1690,7 @@ def get_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( project_id=project_id, @@ -1759,7 +1759,7 @@ def get_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( project_id=project_id, @@ -1797,7 +1797,7 @@ def _get_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1877,7 +1877,7 @@ def get_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -1943,7 +1943,7 @@ def get_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -2009,7 +2009,7 @@ def get_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -2046,7 +2046,7 @@ def _get_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2123,7 +2123,7 @@ def get_metrics( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_metrics_serialize( instance_id=instance_id, @@ -2187,7 +2187,7 @@ def get_metrics_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_metrics_serialize( instance_id=instance_id, @@ -2251,7 +2251,7 @@ def get_metrics_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_metrics_serialize( instance_id=instance_id, @@ -2287,7 +2287,7 @@ def _get_metrics_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2364,7 +2364,7 @@ def list_backups( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( instance_id=instance_id, @@ -2428,7 +2428,7 @@ def list_backups_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( instance_id=instance_id, @@ -2492,7 +2492,7 @@ def list_backups_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( instance_id=instance_id, @@ -2528,7 +2528,7 @@ def _list_backups_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2606,7 +2606,7 @@ def list_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( project_id=project_id, @@ -2671,7 +2671,7 @@ def list_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( project_id=project_id, @@ -2736,7 +2736,7 @@ def list_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( project_id=project_id, @@ -2772,7 +2772,7 @@ def _list_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2847,7 +2847,7 @@ def list_instances( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -2908,7 +2908,7 @@ def list_instances_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -2969,7 +2969,7 @@ def list_instances_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -3003,7 +3003,7 @@ def _list_instances_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3076,7 +3076,7 @@ def list_offerings( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_offerings_serialize( project_id=project_id, @@ -3136,7 +3136,7 @@ def list_offerings_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_offerings_serialize( project_id=project_id, @@ -3196,7 +3196,7 @@ def list_offerings_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_offerings_serialize( project_id=project_id, @@ -3229,7 +3229,7 @@ def _list_offerings_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3304,7 +3304,7 @@ def list_restores( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_restores_serialize( instance_id=instance_id, @@ -3368,7 +3368,7 @@ def list_restores_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_restores_serialize( instance_id=instance_id, @@ -3432,7 +3432,7 @@ def list_restores_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_restores_serialize( instance_id=instance_id, @@ -3468,7 +3468,7 @@ def _list_restores_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3554,7 +3554,7 @@ def partial_update_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_instance_serialize( project_id=project_id, @@ -3629,7 +3629,7 @@ def partial_update_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_instance_serialize( project_id=project_id, @@ -3704,7 +3704,7 @@ def partial_update_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_instance_serialize( project_id=project_id, @@ -3743,7 +3743,7 @@ def _partial_update_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3830,7 +3830,7 @@ def trigger_recreate( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_recreate_serialize( instance_id=instance_id, @@ -3895,7 +3895,7 @@ def trigger_recreate_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_recreate_serialize( instance_id=instance_id, @@ -3960,7 +3960,7 @@ def trigger_recreate_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_recreate_serialize( instance_id=instance_id, @@ -3997,7 +3997,7 @@ def _trigger_recreate_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4074,7 +4074,7 @@ def trigger_restart( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restart_serialize( instance_id=instance_id, @@ -4139,7 +4139,7 @@ def trigger_restart_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restart_serialize( instance_id=instance_id, @@ -4204,7 +4204,7 @@ def trigger_restart_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restart_serialize( instance_id=instance_id, @@ -4241,7 +4241,7 @@ def _trigger_restart_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4321,7 +4321,7 @@ def trigger_restore( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restore_serialize( instance_id=instance_id, @@ -4390,7 +4390,7 @@ def trigger_restore_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restore_serialize( instance_id=instance_id, @@ -4459,7 +4459,7 @@ def trigger_restore_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restore_serialize( instance_id=instance_id, @@ -4498,7 +4498,7 @@ def _trigger_restore_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4583,7 +4583,7 @@ def update_backups_config( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_backups_config_serialize( instance_id=instance_id, @@ -4655,7 +4655,7 @@ def update_backups_config_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_backups_config_serialize( instance_id=instance_id, @@ -4727,7 +4727,7 @@ def update_backups_config_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_backups_config_serialize( instance_id=instance_id, @@ -4766,7 +4766,7 @@ def _update_backups_config_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/mariadb/src/stackit/mariadb/api_client.py b/services/mariadb/src/stackit/mariadb/api_client.py index de934638..43752f02 100644 --- a/services/mariadb/src/stackit/mariadb/api_client.py +++ b/services/mariadb/src/stackit/mariadb/api_client.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -331,6 +331,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -350,12 +354,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -457,7 +461,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -473,7 +477,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -488,6 +495,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/mariadb/src/stackit/mariadb/configuration.py b/services/mariadb/src/stackit/mariadb/configuration.py index 6f926624..2131958e 100644 --- a/services/mariadb/src/stackit/mariadb/configuration.py +++ b/services/mariadb/src/stackit/mariadb/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT MariaDB API @@ -14,7 +9,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -53,7 +70,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -72,7 +89,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -112,7 +134,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -131,12 +153,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/mariadb/src/stackit/mariadb/exceptions.py b/services/mariadb/src/stackit/mariadb/exceptions.py index 1ee61c85..92b1f507 100644 --- a/services/mariadb/src/stackit/mariadb/exceptions.py +++ b/services/mariadb/src/stackit/mariadb/exceptions.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -151,6 +151,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -187,6 +194,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/mariadb/src/stackit/mariadb/models/__init__.py b/services/mariadb/src/stackit/mariadb/models/__init__.py index 7a4a8bbc..70c7fc61 100644 --- a/services/mariadb/src/stackit/mariadb/models/__init__.py +++ b/services/mariadb/src/stackit/mariadb/models/__init__.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/mariadb/src/stackit/mariadb/models/backup.py b/services/mariadb/src/stackit/mariadb/models/backup.py index 5923afec..dc226e7c 100644 --- a/services/mariadb/src/stackit/mariadb/models/backup.py +++ b/services/mariadb/src/stackit/mariadb/models/backup.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Backup(BaseModel): """ Backup - """ + """ # noqa: E501 downloadable: Optional[StrictBool] = None finished_at: StrictStr diff --git a/services/mariadb/src/stackit/mariadb/models/create_backup_response_item.py b/services/mariadb/src/stackit/mariadb/models/create_backup_response_item.py index 431b442a..78f74500 100644 --- a/services/mariadb/src/stackit/mariadb/models/create_backup_response_item.py +++ b/services/mariadb/src/stackit/mariadb/models/create_backup_response_item.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateBackupResponseItem(BaseModel): """ CreateBackupResponseItem - """ + """ # noqa: E501 id: StrictInt message: StrictStr diff --git a/services/mariadb/src/stackit/mariadb/models/create_instance_payload.py b/services/mariadb/src/stackit/mariadb/models/create_instance_payload.py index 13741559..9339f6b1 100644 --- a/services/mariadb/src/stackit/mariadb/models/create_instance_payload.py +++ b/services/mariadb/src/stackit/mariadb/models/create_instance_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class CreateInstancePayload(BaseModel): """ CreateInstancePayload - """ + """ # noqa: E501 instance_name: StrictStr = Field(alias="instanceName") parameters: Optional[InstanceParameters] = None diff --git a/services/mariadb/src/stackit/mariadb/models/create_instance_response.py b/services/mariadb/src/stackit/mariadb/models/create_instance_response.py index 7401ce60..c9ce1dc3 100644 --- a/services/mariadb/src/stackit/mariadb/models/create_instance_response.py +++ b/services/mariadb/src/stackit/mariadb/models/create_instance_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateInstanceResponse(BaseModel): """ CreateInstanceResponse - """ + """ # noqa: E501 instance_id: StrictStr = Field(alias="instanceId") __properties: ClassVar[List[str]] = ["instanceId"] diff --git a/services/mariadb/src/stackit/mariadb/models/credentials.py b/services/mariadb/src/stackit/mariadb/models/credentials.py index 0f819887..6e72de36 100644 --- a/services/mariadb/src/stackit/mariadb/models/credentials.py +++ b/services/mariadb/src/stackit/mariadb/models/credentials.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Credentials(BaseModel): """ Credentials - """ + """ # noqa: E501 host: StrictStr hosts: Optional[List[StrictStr]] = None diff --git a/services/mariadb/src/stackit/mariadb/models/credentials_list_item.py b/services/mariadb/src/stackit/mariadb/models/credentials_list_item.py index cc993a0e..436204b5 100644 --- a/services/mariadb/src/stackit/mariadb/models/credentials_list_item.py +++ b/services/mariadb/src/stackit/mariadb/models/credentials_list_item.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CredentialsListItem(BaseModel): """ CredentialsListItem - """ + """ # noqa: E501 id: StrictStr __properties: ClassVar[List[str]] = ["id"] diff --git a/services/mariadb/src/stackit/mariadb/models/credentials_response.py b/services/mariadb/src/stackit/mariadb/models/credentials_response.py index 299a94af..a98a6f3e 100644 --- a/services/mariadb/src/stackit/mariadb/models/credentials_response.py +++ b/services/mariadb/src/stackit/mariadb/models/credentials_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class CredentialsResponse(BaseModel): """ CredentialsResponse - """ + """ # noqa: E501 id: StrictStr raw: Optional[RawCredentials] = None diff --git a/services/mariadb/src/stackit/mariadb/models/error.py b/services/mariadb/src/stackit/mariadb/models/error.py index 77163e5c..660852b7 100644 --- a/services/mariadb/src/stackit/mariadb/models/error.py +++ b/services/mariadb/src/stackit/mariadb/models/error.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Error(BaseModel): """ Error - """ + """ # noqa: E501 description: StrictStr error: StrictStr diff --git a/services/mariadb/src/stackit/mariadb/models/get_metrics_response.py b/services/mariadb/src/stackit/mariadb/models/get_metrics_response.py index 26fe24be..5c94ea44 100644 --- a/services/mariadb/src/stackit/mariadb/models/get_metrics_response.py +++ b/services/mariadb/src/stackit/mariadb/models/get_metrics_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class GetMetricsResponse(BaseModel): """ GetMetricsResponse - """ + """ # noqa: E501 cpu_idle_time: Optional[StrictInt] = Field(default=None, alias="cpuIdleTime") cpu_load_percent: Union[StrictFloat, StrictInt] = Field(alias="cpuLoadPercent") diff --git a/services/mariadb/src/stackit/mariadb/models/instance.py b/services/mariadb/src/stackit/mariadb/models/instance.py index 75a0ae7b..4af4cb4a 100644 --- a/services/mariadb/src/stackit/mariadb/models/instance.py +++ b/services/mariadb/src/stackit/mariadb/models/instance.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class Instance(BaseModel): """ Instance - """ + """ # noqa: E501 cf_guid: StrictStr = Field(alias="cfGuid") cf_organization_guid: StrictStr = Field(alias="cfOrganizationGuid") diff --git a/services/mariadb/src/stackit/mariadb/models/instance_last_operation.py b/services/mariadb/src/stackit/mariadb/models/instance_last_operation.py index d49cd32b..b13b1bd3 100644 --- a/services/mariadb/src/stackit/mariadb/models/instance_last_operation.py +++ b/services/mariadb/src/stackit/mariadb/models/instance_last_operation.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class InstanceLastOperation(BaseModel): """ InstanceLastOperation - """ + """ # noqa: E501 description: StrictStr state: StrictStr diff --git a/services/mariadb/src/stackit/mariadb/models/instance_parameters.py b/services/mariadb/src/stackit/mariadb/models/instance_parameters.py index d19bb537..7f0ceae9 100644 --- a/services/mariadb/src/stackit/mariadb/models/instance_parameters.py +++ b/services/mariadb/src/stackit/mariadb/models/instance_parameters.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class InstanceParameters(BaseModel): """ InstanceParameters - """ + """ # noqa: E501 enable_monitoring: Optional[StrictBool] = False graphite: Optional[StrictStr] = Field( diff --git a/services/mariadb/src/stackit/mariadb/models/instance_schema.py b/services/mariadb/src/stackit/mariadb/models/instance_schema.py index ee3b7a81..9efb9623 100644 --- a/services/mariadb/src/stackit/mariadb/models/instance_schema.py +++ b/services/mariadb/src/stackit/mariadb/models/instance_schema.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class InstanceSchema(BaseModel): """ InstanceSchema - """ + """ # noqa: E501 create: ModelSchema update: ModelSchema diff --git a/services/mariadb/src/stackit/mariadb/models/list_backups_response.py b/services/mariadb/src/stackit/mariadb/models/list_backups_response.py index cc6bb684..afe362e0 100644 --- a/services/mariadb/src/stackit/mariadb/models/list_backups_response.py +++ b/services/mariadb/src/stackit/mariadb/models/list_backups_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListBackupsResponse(BaseModel): """ ListBackupsResponse - """ + """ # noqa: E501 instance_backups: List[Backup] = Field(alias="instanceBackups") __properties: ClassVar[List[str]] = ["instanceBackups"] diff --git a/services/mariadb/src/stackit/mariadb/models/list_credentials_response.py b/services/mariadb/src/stackit/mariadb/models/list_credentials_response.py index abbe1db0..7faf051d 100644 --- a/services/mariadb/src/stackit/mariadb/models/list_credentials_response.py +++ b/services/mariadb/src/stackit/mariadb/models/list_credentials_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListCredentialsResponse(BaseModel): """ ListCredentialsResponse - """ + """ # noqa: E501 credentials_list: List[CredentialsListItem] = Field(alias="credentialsList") __properties: ClassVar[List[str]] = ["credentialsList"] diff --git a/services/mariadb/src/stackit/mariadb/models/list_instances_response.py b/services/mariadb/src/stackit/mariadb/models/list_instances_response.py index f086b362..bd101c9b 100644 --- a/services/mariadb/src/stackit/mariadb/models/list_instances_response.py +++ b/services/mariadb/src/stackit/mariadb/models/list_instances_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListInstancesResponse(BaseModel): """ ListInstancesResponse - """ + """ # noqa: E501 instances: List[Instance] __properties: ClassVar[List[str]] = ["instances"] diff --git a/services/mariadb/src/stackit/mariadb/models/list_offerings_response.py b/services/mariadb/src/stackit/mariadb/models/list_offerings_response.py index 94c8d30d..fb688013 100644 --- a/services/mariadb/src/stackit/mariadb/models/list_offerings_response.py +++ b/services/mariadb/src/stackit/mariadb/models/list_offerings_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListOfferingsResponse(BaseModel): """ ListOfferingsResponse - """ + """ # noqa: E501 offerings: List[Offering] __properties: ClassVar[List[str]] = ["offerings"] diff --git a/services/mariadb/src/stackit/mariadb/models/list_restores_response.py b/services/mariadb/src/stackit/mariadb/models/list_restores_response.py index ff93a8d0..ef693261 100644 --- a/services/mariadb/src/stackit/mariadb/models/list_restores_response.py +++ b/services/mariadb/src/stackit/mariadb/models/list_restores_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListRestoresResponse(BaseModel): """ ListRestoresResponse - """ + """ # noqa: E501 instance_restores: List[Restore] = Field(alias="instanceRestores") __properties: ClassVar[List[str]] = ["instanceRestores"] diff --git a/services/mariadb/src/stackit/mariadb/models/model_schema.py b/services/mariadb/src/stackit/mariadb/models/model_schema.py index 6d81541b..221cd3bf 100644 --- a/services/mariadb/src/stackit/mariadb/models/model_schema.py +++ b/services/mariadb/src/stackit/mariadb/models/model_schema.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class ModelSchema(BaseModel): """ ModelSchema - """ + """ # noqa: E501 parameters: Dict[str, Any] __properties: ClassVar[List[str]] = ["parameters"] diff --git a/services/mariadb/src/stackit/mariadb/models/offering.py b/services/mariadb/src/stackit/mariadb/models/offering.py index ab54aa16..ace059d0 100644 --- a/services/mariadb/src/stackit/mariadb/models/offering.py +++ b/services/mariadb/src/stackit/mariadb/models/offering.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class Offering(BaseModel): """ Offering - """ + """ # noqa: E501 description: StrictStr documentation_url: StrictStr = Field(alias="documentationUrl") diff --git a/services/mariadb/src/stackit/mariadb/models/partial_update_instance_payload.py b/services/mariadb/src/stackit/mariadb/models/partial_update_instance_payload.py index 9098fe58..5aab8e1f 100644 --- a/services/mariadb/src/stackit/mariadb/models/partial_update_instance_payload.py +++ b/services/mariadb/src/stackit/mariadb/models/partial_update_instance_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class PartialUpdateInstancePayload(BaseModel): """ PartialUpdateInstancePayload - """ + """ # noqa: E501 instance_name: Optional[StrictStr] = Field(default=None, alias="instanceName") parameters: Optional[InstanceParameters] = None diff --git a/services/mariadb/src/stackit/mariadb/models/plan.py b/services/mariadb/src/stackit/mariadb/models/plan.py index 377a8de9..d2581410 100644 --- a/services/mariadb/src/stackit/mariadb/models/plan.py +++ b/services/mariadb/src/stackit/mariadb/models/plan.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Plan(BaseModel): """ Plan - """ + """ # noqa: E501 description: StrictStr free: StrictBool diff --git a/services/mariadb/src/stackit/mariadb/models/raw_credentials.py b/services/mariadb/src/stackit/mariadb/models/raw_credentials.py index 0e80fe31..d9b1f4a6 100644 --- a/services/mariadb/src/stackit/mariadb/models/raw_credentials.py +++ b/services/mariadb/src/stackit/mariadb/models/raw_credentials.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class RawCredentials(BaseModel): """ RawCredentials - """ + """ # noqa: E501 credentials: Credentials __properties: ClassVar[List[str]] = ["credentials"] diff --git a/services/mariadb/src/stackit/mariadb/models/restore.py b/services/mariadb/src/stackit/mariadb/models/restore.py index a12dc9e0..3b8bf638 100644 --- a/services/mariadb/src/stackit/mariadb/models/restore.py +++ b/services/mariadb/src/stackit/mariadb/models/restore.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Restore(BaseModel): """ Restore - """ + """ # noqa: E501 backup_id: StrictInt finished_at: StrictStr diff --git a/services/mariadb/src/stackit/mariadb/models/trigger_restore_response.py b/services/mariadb/src/stackit/mariadb/models/trigger_restore_response.py index 54b82735..f5cb70a0 100644 --- a/services/mariadb/src/stackit/mariadb/models/trigger_restore_response.py +++ b/services/mariadb/src/stackit/mariadb/models/trigger_restore_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class TriggerRestoreResponse(BaseModel): """ TriggerRestoreResponse - """ + """ # noqa: E501 id: StrictInt __properties: ClassVar[List[str]] = ["id"] diff --git a/services/mariadb/src/stackit/mariadb/models/update_backups_config_payload.py b/services/mariadb/src/stackit/mariadb/models/update_backups_config_payload.py index a678969f..5990aca7 100644 --- a/services/mariadb/src/stackit/mariadb/models/update_backups_config_payload.py +++ b/services/mariadb/src/stackit/mariadb/models/update_backups_config_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class UpdateBackupsConfigPayload(BaseModel): """ UpdateBackupsConfigPayload - """ + """ # noqa: E501 encryption_key: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["encryption_key"] diff --git a/services/mariadb/src/stackit/mariadb/models/update_backups_config_response.py b/services/mariadb/src/stackit/mariadb/models/update_backups_config_response.py index b752ba73..2a081e72 100644 --- a/services/mariadb/src/stackit/mariadb/models/update_backups_config_response.py +++ b/services/mariadb/src/stackit/mariadb/models/update_backups_config_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class UpdateBackupsConfigResponse(BaseModel): """ UpdateBackupsConfigResponse - """ + """ # noqa: E501 message: StrictStr __properties: ClassVar[List[str]] = ["message"] diff --git a/services/mariadb/src/stackit/mariadb/rest.py b/services/mariadb/src/stackit/mariadb/rest.py index bbd7383e..eb726257 100644 --- a/services/mariadb/src/stackit/mariadb/rest.py +++ b/services/mariadb/src/stackit/mariadb/rest.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -124,7 +124,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/modelserving/CHANGELOG.md b/services/modelserving/CHANGELOG.md index 8b8974bc..b9f55e6a 100644 --- a/services/modelserving/CHANGELOG.md +++ b/services/modelserving/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.1.2 +- **Internal:** Improve deserializing and error types + ## v0.1.1 (2025-05-09) - **Feature:** Update user-agent header diff --git a/services/modelserving/LICENSE.md b/services/modelserving/LICENSE.md new file mode 100644 index 00000000..7e2f0648 --- /dev/null +++ b/services/modelserving/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright 2025 Schwarz IT KG + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/services/modelserving/NOTICE.txt b/services/modelserving/NOTICE.txt new file mode 100644 index 00000000..32ddc7cd --- /dev/null +++ b/services/modelserving/NOTICE.txt @@ -0,0 +1,2 @@ +STACKIT ModelServing SDK for Python +Copyright 2025 Schwarz IT KG \ No newline at end of file diff --git a/services/modelserving/pyproject.toml b/services/modelserving/pyproject.toml index f8617917..faa8cfe2 100644 --- a/services/modelserving/pyproject.toml +++ b/services/modelserving/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-modelserving" [tool.poetry] name = "stackit-modelserving" -version = "v0.1.1" +version = "v0.1.2" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/modelserving/src/stackit/modelserving/__init__.py b/services/modelserving/src/stackit/modelserving/__init__.py index 7e1c6d70..c6876cb3 100644 --- a/services/modelserving/src/stackit/modelserving/__init__.py +++ b/services/modelserving/src/stackit/modelserving/__init__.py @@ -12,44 +12,95 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "ChatModelDetails", + "CreateTokenPayload", + "CreateTokenResponse", + "EmbeddingModelDetails", + "ErrorMessageResponse", + "GetChatModelResponse", + "GetEmbeddingsModelResp", + "GetTokenResponse", + "ListModelsResponse", + "ListTokenResp", + "MessageResponse", + "Model", + "PartialUpdateTokenPayload", + "SKU", + "Token", + "TokenCreated", + "UpdateTokenResponse", +] + # import apis into sdk package -from stackit.modelserving.api.default_api import DefaultApi -from stackit.modelserving.api_client import ApiClient +from stackit.modelserving.api.default_api import DefaultApi as DefaultApi +from stackit.modelserving.api_client import ApiClient as ApiClient # import ApiClient -from stackit.modelserving.api_response import ApiResponse -from stackit.modelserving.configuration import HostConfiguration -from stackit.modelserving.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.modelserving.api_response import ApiResponse as ApiResponse +from stackit.modelserving.configuration import HostConfiguration as HostConfiguration +from stackit.modelserving.exceptions import ApiAttributeError as ApiAttributeError +from stackit.modelserving.exceptions import ApiException as ApiException +from stackit.modelserving.exceptions import ApiKeyError as ApiKeyError +from stackit.modelserving.exceptions import ApiTypeError as ApiTypeError +from stackit.modelserving.exceptions import ApiValueError as ApiValueError +from stackit.modelserving.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.modelserving.models.chat_model_details import ChatModelDetails -from stackit.modelserving.models.create_token_payload import CreateTokenPayload -from stackit.modelserving.models.create_token_response import CreateTokenResponse -from stackit.modelserving.models.embedding_model_details import EmbeddingModelDetails -from stackit.modelserving.models.error_message_response import ErrorMessageResponse -from stackit.modelserving.models.get_chat_model_response import GetChatModelResponse -from stackit.modelserving.models.get_embeddings_model_resp import GetEmbeddingsModelResp -from stackit.modelserving.models.get_token_response import GetTokenResponse -from stackit.modelserving.models.list_models_response import ListModelsResponse -from stackit.modelserving.models.list_token_resp import ListTokenResp -from stackit.modelserving.models.message_response import MessageResponse -from stackit.modelserving.models.model import Model +from stackit.modelserving.models.chat_model_details import ( + ChatModelDetails as ChatModelDetails, +) +from stackit.modelserving.models.create_token_payload import ( + CreateTokenPayload as CreateTokenPayload, +) +from stackit.modelserving.models.create_token_response import ( + CreateTokenResponse as CreateTokenResponse, +) +from stackit.modelserving.models.embedding_model_details import ( + EmbeddingModelDetails as EmbeddingModelDetails, +) +from stackit.modelserving.models.error_message_response import ( + ErrorMessageResponse as ErrorMessageResponse, +) +from stackit.modelserving.models.get_chat_model_response import ( + GetChatModelResponse as GetChatModelResponse, +) +from stackit.modelserving.models.get_embeddings_model_resp import ( + GetEmbeddingsModelResp as GetEmbeddingsModelResp, +) +from stackit.modelserving.models.get_token_response import ( + GetTokenResponse as GetTokenResponse, +) +from stackit.modelserving.models.list_models_response import ( + ListModelsResponse as ListModelsResponse, +) +from stackit.modelserving.models.list_token_resp import ListTokenResp as ListTokenResp +from stackit.modelserving.models.message_response import ( + MessageResponse as MessageResponse, +) +from stackit.modelserving.models.model import Model as Model from stackit.modelserving.models.partial_update_token_payload import ( - PartialUpdateTokenPayload, + PartialUpdateTokenPayload as PartialUpdateTokenPayload, +) +from stackit.modelserving.models.sku import SKU as SKU +from stackit.modelserving.models.token import Token as Token +from stackit.modelserving.models.token_created import TokenCreated as TokenCreated +from stackit.modelserving.models.update_token_response import ( + UpdateTokenResponse as UpdateTokenResponse, ) -from stackit.modelserving.models.sku import SKU -from stackit.modelserving.models.token import Token -from stackit.modelserving.models.token_created import TokenCreated -from stackit.modelserving.models.update_token_response import UpdateTokenResponse diff --git a/services/modelserving/src/stackit/modelserving/api/default_api.py b/services/modelserving/src/stackit/modelserving/api/default_api.py index e4d05161..a40d5c65 100644 --- a/services/modelserving/src/stackit/modelserving/api/default_api.py +++ b/services/modelserving/src/stackit/modelserving/api/default_api.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -94,7 +94,7 @@ def create_token( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_token_serialize( region_id=region_id, @@ -166,7 +166,7 @@ def create_token_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_token_serialize( region_id=region_id, @@ -238,7 +238,7 @@ def create_token_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_token_serialize( region_id=region_id, @@ -279,7 +279,7 @@ def _create_token_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -370,7 +370,7 @@ def delete_token( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_token_serialize( region_id=region_id, @@ -442,7 +442,7 @@ def delete_token_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_token_serialize( region_id=region_id, @@ -514,7 +514,7 @@ def delete_token_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_token_serialize( region_id=region_id, @@ -555,7 +555,7 @@ def _delete_token_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -635,7 +635,7 @@ def get_chat_model( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_chat_model_serialize( region_id=region_id, @@ -702,7 +702,7 @@ def get_chat_model_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_chat_model_serialize( region_id=region_id, @@ -769,7 +769,7 @@ def get_chat_model_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_chat_model_serialize( region_id=region_id, @@ -807,7 +807,7 @@ def _get_chat_model_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -885,7 +885,7 @@ def get_embedding_model( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_embedding_model_serialize( region_id=region_id, @@ -952,7 +952,7 @@ def get_embedding_model_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_embedding_model_serialize( region_id=region_id, @@ -1019,7 +1019,7 @@ def get_embedding_model_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_embedding_model_serialize( region_id=region_id, @@ -1057,7 +1057,7 @@ def _get_embedding_model_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1138,7 +1138,7 @@ def get_token( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_token_serialize( region_id=region_id, @@ -1210,7 +1210,7 @@ def get_token_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_token_serialize( region_id=region_id, @@ -1282,7 +1282,7 @@ def get_token_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_token_serialize( region_id=region_id, @@ -1323,7 +1323,7 @@ def _get_token_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1400,7 +1400,7 @@ def list_models( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_models_serialize( region_id=region_id, @@ -1463,7 +1463,7 @@ def list_models_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_models_serialize( region_id=region_id, @@ -1526,7 +1526,7 @@ def list_models_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_models_serialize( region_id=region_id, @@ -1562,7 +1562,7 @@ def _list_models_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1638,7 +1638,7 @@ def list_tokens( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_tokens_serialize( region_id=region_id, @@ -1705,7 +1705,7 @@ def list_tokens_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_tokens_serialize( region_id=region_id, @@ -1772,7 +1772,7 @@ def list_tokens_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_tokens_serialize( region_id=region_id, @@ -1810,7 +1810,7 @@ def _list_tokens_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1894,7 +1894,7 @@ def partial_update_token( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_token_serialize( region_id=region_id, @@ -1970,7 +1970,7 @@ def partial_update_token_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_token_serialize( region_id=region_id, @@ -2046,7 +2046,7 @@ def partial_update_token_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_token_serialize( region_id=region_id, @@ -2089,7 +2089,7 @@ def _partial_update_token_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/modelserving/src/stackit/modelserving/api_client.py b/services/modelserving/src/stackit/modelserving/api_client.py index fd73eba0..cfc3ad66 100644 --- a/services/modelserving/src/stackit/modelserving/api_client.py +++ b/services/modelserving/src/stackit/modelserving/api_client.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -332,6 +332,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -351,12 +355,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -458,7 +462,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -474,7 +478,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -489,6 +496,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/modelserving/src/stackit/modelserving/configuration.py b/services/modelserving/src/stackit/modelserving/configuration.py index 5c09026e..ad3e84d3 100644 --- a/services/modelserving/src/stackit/modelserving/configuration.py +++ b/services/modelserving/src/stackit/modelserving/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT Model Serving API @@ -15,7 +10,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -54,7 +71,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -72,7 +89,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -112,7 +134,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -131,12 +153,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/modelserving/src/stackit/modelserving/exceptions.py b/services/modelserving/src/stackit/modelserving/exceptions.py index 82027eb2..f11ebd25 100644 --- a/services/modelserving/src/stackit/modelserving/exceptions.py +++ b/services/modelserving/src/stackit/modelserving/exceptions.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -152,6 +152,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -188,6 +195,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/modelserving/src/stackit/modelserving/models/__init__.py b/services/modelserving/src/stackit/modelserving/models/__init__.py index 6a337dde..16af77f2 100644 --- a/services/modelserving/src/stackit/modelserving/models/__init__.py +++ b/services/modelserving/src/stackit/modelserving/models/__init__.py @@ -11,7 +11,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/modelserving/src/stackit/modelserving/models/chat_model_details.py b/services/modelserving/src/stackit/modelserving/models/chat_model_details.py index b70bf76d..f61c56c9 100644 --- a/services/modelserving/src/stackit/modelserving/models/chat_model_details.py +++ b/services/modelserving/src/stackit/modelserving/models/chat_model_details.py @@ -10,13 +10,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator @@ -28,7 +28,7 @@ class ChatModelDetails(BaseModel): """ ChatModelDetails - """ + """ # noqa: E501 bits: Optional[StrictInt] = None category: StrictStr diff --git a/services/modelserving/src/stackit/modelserving/models/create_token_payload.py b/services/modelserving/src/stackit/modelserving/models/create_token_payload.py index 7e052c3b..45fa1425 100644 --- a/services/modelserving/src/stackit/modelserving/models/create_token_payload.py +++ b/services/modelserving/src/stackit/modelserving/models/create_token_payload.py @@ -10,13 +10,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -26,7 +26,7 @@ class CreateTokenPayload(BaseModel): """ CreateTokenPayload - """ + """ # noqa: E501 description: Optional[Annotated[str, Field(strict=True, max_length=2000)]] = None name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] diff --git a/services/modelserving/src/stackit/modelserving/models/create_token_response.py b/services/modelserving/src/stackit/modelserving/models/create_token_response.py index 24339d06..cbcda46b 100644 --- a/services/modelserving/src/stackit/modelserving/models/create_token_response.py +++ b/services/modelserving/src/stackit/modelserving/models/create_token_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class CreateTokenResponse(BaseModel): """ CreateTokenResponse - """ + """ # noqa: E501 message: Optional[StrictStr] = None token: TokenCreated diff --git a/services/modelserving/src/stackit/modelserving/models/embedding_model_details.py b/services/modelserving/src/stackit/modelserving/models/embedding_model_details.py index 6da2e190..5a83919e 100644 --- a/services/modelserving/src/stackit/modelserving/models/embedding_model_details.py +++ b/services/modelserving/src/stackit/modelserving/models/embedding_model_details.py @@ -10,13 +10,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator @@ -28,7 +28,7 @@ class EmbeddingModelDetails(BaseModel): """ EmbeddingModelDetails - """ + """ # noqa: E501 category: StrictStr description: Annotated[str, Field(strict=True, max_length=2000)] diff --git a/services/modelserving/src/stackit/modelserving/models/error_message_response.py b/services/modelserving/src/stackit/modelserving/models/error_message_response.py index 0a42f869..381da810 100644 --- a/services/modelserving/src/stackit/modelserving/models/error_message_response.py +++ b/services/modelserving/src/stackit/modelserving/models/error_message_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ErrorMessageResponse(BaseModel): """ ErrorMessageResponse - """ + """ # noqa: E501 error: Optional[StrictStr] = None message: Optional[StrictStr] = None diff --git a/services/modelserving/src/stackit/modelserving/models/get_chat_model_response.py b/services/modelserving/src/stackit/modelserving/models/get_chat_model_response.py index f164311a..100e2843 100644 --- a/services/modelserving/src/stackit/modelserving/models/get_chat_model_response.py +++ b/services/modelserving/src/stackit/modelserving/models/get_chat_model_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class GetChatModelResponse(BaseModel): """ GetChatModelResponse - """ + """ # noqa: E501 message: Optional[StrictStr] = None model: ChatModelDetails diff --git a/services/modelserving/src/stackit/modelserving/models/get_embeddings_model_resp.py b/services/modelserving/src/stackit/modelserving/models/get_embeddings_model_resp.py index 0888e53c..faf5ccc1 100644 --- a/services/modelserving/src/stackit/modelserving/models/get_embeddings_model_resp.py +++ b/services/modelserving/src/stackit/modelserving/models/get_embeddings_model_resp.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class GetEmbeddingsModelResp(BaseModel): """ GetEmbeddingsModelResp - """ + """ # noqa: E501 message: Optional[StrictStr] = None model: EmbeddingModelDetails diff --git a/services/modelserving/src/stackit/modelserving/models/get_token_response.py b/services/modelserving/src/stackit/modelserving/models/get_token_response.py index b5747615..e60afca9 100644 --- a/services/modelserving/src/stackit/modelserving/models/get_token_response.py +++ b/services/modelserving/src/stackit/modelserving/models/get_token_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class GetTokenResponse(BaseModel): """ GetTokenResponse - """ + """ # noqa: E501 message: Optional[StrictStr] = None token: Token diff --git a/services/modelserving/src/stackit/modelserving/models/list_models_response.py b/services/modelserving/src/stackit/modelserving/models/list_models_response.py index df8074d8..644526c4 100644 --- a/services/modelserving/src/stackit/modelserving/models/list_models_response.py +++ b/services/modelserving/src/stackit/modelserving/models/list_models_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListModelsResponse(BaseModel): """ ListModelsResponse - """ + """ # noqa: E501 message: Optional[StrictStr] = None models: List[Model] diff --git a/services/modelserving/src/stackit/modelserving/models/list_token_resp.py b/services/modelserving/src/stackit/modelserving/models/list_token_resp.py index 05140560..e427807a 100644 --- a/services/modelserving/src/stackit/modelserving/models/list_token_resp.py +++ b/services/modelserving/src/stackit/modelserving/models/list_token_resp.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListTokenResp(BaseModel): """ ListTokenResp - """ + """ # noqa: E501 message: Optional[StrictStr] = None tokens: List[Token] diff --git a/services/modelserving/src/stackit/modelserving/models/message_response.py b/services/modelserving/src/stackit/modelserving/models/message_response.py index 9fbe24e7..64e49b5e 100644 --- a/services/modelserving/src/stackit/modelserving/models/message_response.py +++ b/services/modelserving/src/stackit/modelserving/models/message_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class MessageResponse(BaseModel): """ MessageResponse - """ + """ # noqa: E501 message: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["message"] diff --git a/services/modelserving/src/stackit/modelserving/models/model.py b/services/modelserving/src/stackit/modelserving/models/model.py index 8f1c75dd..e67d9b65 100644 --- a/services/modelserving/src/stackit/modelserving/models/model.py +++ b/services/modelserving/src/stackit/modelserving/models/model.py @@ -10,13 +10,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -28,7 +28,7 @@ class Model(BaseModel): """ Model - """ + """ # noqa: E501 category: StrictStr description: Annotated[str, Field(strict=True, max_length=2000)] diff --git a/services/modelserving/src/stackit/modelserving/models/partial_update_token_payload.py b/services/modelserving/src/stackit/modelserving/models/partial_update_token_payload.py index 62f528a1..50315194 100644 --- a/services/modelserving/src/stackit/modelserving/models/partial_update_token_payload.py +++ b/services/modelserving/src/stackit/modelserving/models/partial_update_token_payload.py @@ -10,13 +10,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -26,7 +26,7 @@ class PartialUpdateTokenPayload(BaseModel): """ PartialUpdateTokenPayload - """ + """ # noqa: E501 description: Optional[Annotated[str, Field(strict=True, max_length=2000)]] = None name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = None diff --git a/services/modelserving/src/stackit/modelserving/models/sku.py b/services/modelserving/src/stackit/modelserving/models/sku.py index 81114d8f..ef5a56d5 100644 --- a/services/modelserving/src/stackit/modelserving/models/sku.py +++ b/services/modelserving/src/stackit/modelserving/models/sku.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class SKU(BaseModel): """ SKU - """ + """ # noqa: E501 description: Optional[StrictStr] = None id: StrictStr diff --git a/services/modelserving/src/stackit/modelserving/models/token.py b/services/modelserving/src/stackit/modelserving/models/token.py index 54abd3ca..1d74ce13 100644 --- a/services/modelserving/src/stackit/modelserving/models/token.py +++ b/services/modelserving/src/stackit/modelserving/models/token.py @@ -10,13 +10,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from datetime import datetime from typing import Any, ClassVar, Dict, List, Optional, Set @@ -27,7 +27,7 @@ class Token(BaseModel): """ Token - """ + """ # noqa: E501 description: Optional[Annotated[str, Field(strict=True, max_length=2000)]] = None id: StrictStr diff --git a/services/modelserving/src/stackit/modelserving/models/token_created.py b/services/modelserving/src/stackit/modelserving/models/token_created.py index 08210dde..b3b0d695 100644 --- a/services/modelserving/src/stackit/modelserving/models/token_created.py +++ b/services/modelserving/src/stackit/modelserving/models/token_created.py @@ -10,13 +10,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from datetime import datetime from typing import Any, ClassVar, Dict, List, Optional, Set @@ -27,7 +27,7 @@ class TokenCreated(BaseModel): """ TokenCreated - """ + """ # noqa: E501 content: Annotated[str, Field(min_length=1, strict=True, max_length=200)] description: Optional[Annotated[str, Field(strict=True, max_length=2000)]] = None diff --git a/services/modelserving/src/stackit/modelserving/models/update_token_response.py b/services/modelserving/src/stackit/modelserving/models/update_token_response.py index abba624d..7a649c5d 100644 --- a/services/modelserving/src/stackit/modelserving/models/update_token_response.py +++ b/services/modelserving/src/stackit/modelserving/models/update_token_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class UpdateTokenResponse(BaseModel): """ UpdateTokenResponse - """ + """ # noqa: E501 message: Optional[StrictStr] = None token: Token diff --git a/services/modelserving/src/stackit/modelserving/rest.py b/services/modelserving/src/stackit/modelserving/rest.py index f1f36821..2acbb8ff 100644 --- a/services/modelserving/src/stackit/modelserving/rest.py +++ b/services/modelserving/src/stackit/modelserving/rest.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -125,7 +125,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/objectstorage/CHANGELOG.md b/services/objectstorage/CHANGELOG.md index 33973fc2..f9219235 100644 --- a/services/objectstorage/CHANGELOG.md +++ b/services/objectstorage/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.0.4 +- **Internal:** Improve deserializing and error types + ## v1.0.3 (2025-05-09) - **Feature:** Update user-agent header diff --git a/services/objectstorage/pyproject.toml b/services/objectstorage/pyproject.toml index 8c06194c..4c86500d 100644 --- a/services/objectstorage/pyproject.toml +++ b/services/objectstorage/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-objectstorage" [tool.poetry] name = "stackit-objectstorage" -version = "v1.0.3" +version = "v1.0.4" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/objectstorage/src/stackit/objectstorage/__init__.py b/services/objectstorage/src/stackit/objectstorage/__init__.py index 08a41a77..461f5a4c 100644 --- a/services/objectstorage/src/stackit/objectstorage/__init__.py +++ b/services/objectstorage/src/stackit/objectstorage/__init__.py @@ -11,63 +11,111 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "AccessKey", + "Bucket", + "CreateAccessKeyPayload", + "CreateAccessKeyResponse", + "CreateBucketResponse", + "CreateCredentialsGroupPayload", + "CreateCredentialsGroupResponse", + "CredentialsGroup", + "DeleteAccessKeyResponse", + "DeleteBucketResponse", + "DeleteCredentialsGroupResponse", + "DetailedError", + "ErrorMessage", + "GetBucketResponse", + "HTTPValidationError", + "ListAccessKeysResponse", + "ListBucketsResponse", + "ListCredentialsGroupsResponse", + "LocationInner", + "ProjectScope", + "ProjectStatus", + "ValidationError", +] + # import apis into sdk package -from stackit.objectstorage.api.default_api import DefaultApi -from stackit.objectstorage.api_client import ApiClient +from stackit.objectstorage.api.default_api import DefaultApi as DefaultApi +from stackit.objectstorage.api_client import ApiClient as ApiClient # import ApiClient -from stackit.objectstorage.api_response import ApiResponse -from stackit.objectstorage.configuration import HostConfiguration -from stackit.objectstorage.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.objectstorage.api_response import ApiResponse as ApiResponse +from stackit.objectstorage.configuration import HostConfiguration as HostConfiguration +from stackit.objectstorage.exceptions import ApiAttributeError as ApiAttributeError +from stackit.objectstorage.exceptions import ApiException as ApiException +from stackit.objectstorage.exceptions import ApiKeyError as ApiKeyError +from stackit.objectstorage.exceptions import ApiTypeError as ApiTypeError +from stackit.objectstorage.exceptions import ApiValueError as ApiValueError +from stackit.objectstorage.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.objectstorage.models.access_key import AccessKey -from stackit.objectstorage.models.bucket import Bucket +from stackit.objectstorage.models.access_key import AccessKey as AccessKey +from stackit.objectstorage.models.bucket import Bucket as Bucket from stackit.objectstorage.models.create_access_key_payload import ( - CreateAccessKeyPayload, + CreateAccessKeyPayload as CreateAccessKeyPayload, ) from stackit.objectstorage.models.create_access_key_response import ( - CreateAccessKeyResponse, + CreateAccessKeyResponse as CreateAccessKeyResponse, +) +from stackit.objectstorage.models.create_bucket_response import ( + CreateBucketResponse as CreateBucketResponse, ) -from stackit.objectstorage.models.create_bucket_response import CreateBucketResponse from stackit.objectstorage.models.create_credentials_group_payload import ( - CreateCredentialsGroupPayload, + CreateCredentialsGroupPayload as CreateCredentialsGroupPayload, ) from stackit.objectstorage.models.create_credentials_group_response import ( - CreateCredentialsGroupResponse, + CreateCredentialsGroupResponse as CreateCredentialsGroupResponse, +) +from stackit.objectstorage.models.credentials_group import ( + CredentialsGroup as CredentialsGroup, ) -from stackit.objectstorage.models.credentials_group import CredentialsGroup from stackit.objectstorage.models.delete_access_key_response import ( - DeleteAccessKeyResponse, + DeleteAccessKeyResponse as DeleteAccessKeyResponse, +) +from stackit.objectstorage.models.delete_bucket_response import ( + DeleteBucketResponse as DeleteBucketResponse, ) -from stackit.objectstorage.models.delete_bucket_response import DeleteBucketResponse from stackit.objectstorage.models.delete_credentials_group_response import ( - DeleteCredentialsGroupResponse, + DeleteCredentialsGroupResponse as DeleteCredentialsGroupResponse, +) +from stackit.objectstorage.models.detailed_error import DetailedError as DetailedError +from stackit.objectstorage.models.error_message import ErrorMessage as ErrorMessage +from stackit.objectstorage.models.get_bucket_response import ( + GetBucketResponse as GetBucketResponse, +) +from stackit.objectstorage.models.http_validation_error import ( + HTTPValidationError as HTTPValidationError, ) -from stackit.objectstorage.models.detailed_error import DetailedError -from stackit.objectstorage.models.error_message import ErrorMessage -from stackit.objectstorage.models.get_bucket_response import GetBucketResponse -from stackit.objectstorage.models.http_validation_error import HTTPValidationError from stackit.objectstorage.models.list_access_keys_response import ( - ListAccessKeysResponse, + ListAccessKeysResponse as ListAccessKeysResponse, +) +from stackit.objectstorage.models.list_buckets_response import ( + ListBucketsResponse as ListBucketsResponse, ) -from stackit.objectstorage.models.list_buckets_response import ListBucketsResponse from stackit.objectstorage.models.list_credentials_groups_response import ( - ListCredentialsGroupsResponse, + ListCredentialsGroupsResponse as ListCredentialsGroupsResponse, +) +from stackit.objectstorage.models.location_inner import LocationInner as LocationInner +from stackit.objectstorage.models.project_scope import ProjectScope as ProjectScope +from stackit.objectstorage.models.project_status import ProjectStatus as ProjectStatus +from stackit.objectstorage.models.validation_error import ( + ValidationError as ValidationError, ) -from stackit.objectstorage.models.location_inner import LocationInner -from stackit.objectstorage.models.project_scope import ProjectScope -from stackit.objectstorage.models.project_status import ProjectStatus -from stackit.objectstorage.models.validation_error import ValidationError diff --git a/services/objectstorage/src/stackit/objectstorage/api/default_api.py b/services/objectstorage/src/stackit/objectstorage/api/default_api.py index 7fa7f0ff..5fa229b3 100644 --- a/services/objectstorage/src/stackit/objectstorage/api/default_api.py +++ b/services/objectstorage/src/stackit/objectstorage/api/default_api.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -113,7 +113,7 @@ def create_access_key( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_access_key_serialize( project_id=project_id, @@ -190,7 +190,7 @@ def create_access_key_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_access_key_serialize( project_id=project_id, @@ -267,7 +267,7 @@ def create_access_key_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_access_key_serialize( project_id=project_id, @@ -311,7 +311,7 @@ def _create_access_key_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -408,7 +408,7 @@ def create_bucket( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_bucket_serialize( project_id=project_id, @@ -483,7 +483,7 @@ def create_bucket_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_bucket_serialize( project_id=project_id, @@ -558,7 +558,7 @@ def create_bucket_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_bucket_serialize( project_id=project_id, @@ -600,7 +600,7 @@ def _create_bucket_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -682,7 +682,7 @@ def create_credentials_group( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_group_serialize( project_id=project_id, @@ -755,7 +755,7 @@ def create_credentials_group_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_group_serialize( project_id=project_id, @@ -828,7 +828,7 @@ def create_credentials_group_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_group_serialize( project_id=project_id, @@ -871,7 +871,7 @@ def _create_credentials_group_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -965,7 +965,7 @@ def delete_access_key( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_access_key_serialize( project_id=project_id, @@ -1043,7 +1043,7 @@ def delete_access_key_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_access_key_serialize( project_id=project_id, @@ -1121,7 +1121,7 @@ def delete_access_key_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_access_key_serialize( project_id=project_id, @@ -1166,7 +1166,7 @@ def _delete_access_key_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1255,7 +1255,7 @@ def delete_bucket( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_bucket_serialize( project_id=project_id, @@ -1329,7 +1329,7 @@ def delete_bucket_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_bucket_serialize( project_id=project_id, @@ -1403,7 +1403,7 @@ def delete_bucket_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_bucket_serialize( project_id=project_id, @@ -1444,7 +1444,7 @@ def _delete_bucket_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1527,7 +1527,7 @@ def delete_credentials_group( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_group_serialize( project_id=project_id, @@ -1599,7 +1599,7 @@ def delete_credentials_group_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_group_serialize( project_id=project_id, @@ -1671,7 +1671,7 @@ def delete_credentials_group_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_group_serialize( project_id=project_id, @@ -1712,7 +1712,7 @@ def _delete_credentials_group_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1792,7 +1792,7 @@ def disable_service( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._disable_service_serialize( project_id=project_id, @@ -1862,7 +1862,7 @@ def disable_service_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._disable_service_serialize( project_id=project_id, @@ -1932,7 +1932,7 @@ def disable_service_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._disable_service_serialize( project_id=project_id, @@ -1973,7 +1973,7 @@ def _disable_service_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2051,7 +2051,7 @@ def enable_service( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._enable_service_serialize( project_id=project_id, @@ -2121,7 +2121,7 @@ def enable_service_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._enable_service_serialize( project_id=project_id, @@ -2191,7 +2191,7 @@ def enable_service_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._enable_service_serialize( project_id=project_id, @@ -2232,7 +2232,7 @@ def _enable_service_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2315,7 +2315,7 @@ def get_bucket( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_bucket_serialize( project_id=project_id, @@ -2390,7 +2390,7 @@ def get_bucket_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_bucket_serialize( project_id=project_id, @@ -2465,7 +2465,7 @@ def get_bucket_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_bucket_serialize( project_id=project_id, @@ -2507,7 +2507,7 @@ def _get_bucket_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2587,7 +2587,7 @@ def get_service_status( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_service_status_serialize( project_id=project_id, @@ -2656,7 +2656,7 @@ def get_service_status_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_service_status_serialize( project_id=project_id, @@ -2725,7 +2725,7 @@ def get_service_status_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_service_status_serialize( project_id=project_id, @@ -2765,7 +2765,7 @@ def _get_service_status_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2846,7 +2846,7 @@ def list_access_keys( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_access_keys_serialize( project_id=project_id, @@ -2919,7 +2919,7 @@ def list_access_keys_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_access_keys_serialize( project_id=project_id, @@ -2992,7 +2992,7 @@ def list_access_keys_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_access_keys_serialize( project_id=project_id, @@ -3034,7 +3034,7 @@ def _list_access_keys_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3116,7 +3116,7 @@ def list_buckets( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_buckets_serialize( project_id=project_id, @@ -3185,7 +3185,7 @@ def list_buckets_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_buckets_serialize( project_id=project_id, @@ -3254,7 +3254,7 @@ def list_buckets_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_buckets_serialize( project_id=project_id, @@ -3294,7 +3294,7 @@ def _list_buckets_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3372,7 +3372,7 @@ def list_credentials_groups( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_groups_serialize( project_id=project_id, @@ -3440,7 +3440,7 @@ def list_credentials_groups_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_groups_serialize( project_id=project_id, @@ -3508,7 +3508,7 @@ def list_credentials_groups_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_groups_serialize( project_id=project_id, @@ -3547,7 +3547,7 @@ def _list_credentials_groups_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/objectstorage/src/stackit/objectstorage/api_client.py b/services/objectstorage/src/stackit/objectstorage/api_client.py index cc681180..38a001d8 100644 --- a/services/objectstorage/src/stackit/objectstorage/api_client.py +++ b/services/objectstorage/src/stackit/objectstorage/api_client.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -331,6 +331,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -350,12 +354,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -457,7 +461,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -473,7 +477,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -488,6 +495,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/objectstorage/src/stackit/objectstorage/configuration.py b/services/objectstorage/src/stackit/objectstorage/configuration.py index 9ea21c6c..2b47b61e 100644 --- a/services/objectstorage/src/stackit/objectstorage/configuration.py +++ b/services/objectstorage/src/stackit/objectstorage/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT Object Storage API @@ -14,7 +9,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -53,7 +70,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -71,7 +88,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -111,7 +133,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -130,12 +152,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/objectstorage/src/stackit/objectstorage/exceptions.py b/services/objectstorage/src/stackit/objectstorage/exceptions.py index 2c356c90..978cd510 100644 --- a/services/objectstorage/src/stackit/objectstorage/exceptions.py +++ b/services/objectstorage/src/stackit/objectstorage/exceptions.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -151,6 +151,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -187,6 +194,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/objectstorage/src/stackit/objectstorage/models/__init__.py b/services/objectstorage/src/stackit/objectstorage/models/__init__.py index 3892bdb7..1aa77634 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/__init__.py +++ b/services/objectstorage/src/stackit/objectstorage/models/__init__.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/objectstorage/src/stackit/objectstorage/models/access_key.py b/services/objectstorage/src/stackit/objectstorage/models/access_key.py index 1a722311..495316bd 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/access_key.py +++ b/services/objectstorage/src/stackit/objectstorage/models/access_key.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class AccessKey(BaseModel): """ AccessKey - """ + """ # noqa: E501 display_name: StrictStr = Field(alias="displayName") expires: StrictStr diff --git a/services/objectstorage/src/stackit/objectstorage/models/bucket.py b/services/objectstorage/src/stackit/objectstorage/models/bucket.py index ccf7893c..93fa50f2 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/bucket.py +++ b/services/objectstorage/src/stackit/objectstorage/models/bucket.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Bucket(BaseModel): """ Bucket - """ + """ # noqa: E501 name: StrictStr region: StrictStr diff --git a/services/objectstorage/src/stackit/objectstorage/models/create_access_key_payload.py b/services/objectstorage/src/stackit/objectstorage/models/create_access_key_payload.py index cde98c97..2bbddfa1 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/create_access_key_payload.py +++ b/services/objectstorage/src/stackit/objectstorage/models/create_access_key_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateAccessKeyPayload(BaseModel): """ CreateAccessKeyPayload - """ + """ # noqa: E501 expires: Optional[datetime] = Field(default=None, description="Expiration date. Null means never expires.") __properties: ClassVar[List[str]] = ["expires"] diff --git a/services/objectstorage/src/stackit/objectstorage/models/create_access_key_response.py b/services/objectstorage/src/stackit/objectstorage/models/create_access_key_response.py index 2954bbdb..97c9cb58 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/create_access_key_response.py +++ b/services/objectstorage/src/stackit/objectstorage/models/create_access_key_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateAccessKeyResponse(BaseModel): """ CreateAccessKeyResponse - """ + """ # noqa: E501 access_key: StrictStr = Field(description="Access key", alias="accessKey") display_name: StrictStr = Field(description="Obfuscated access key", alias="displayName") diff --git a/services/objectstorage/src/stackit/objectstorage/models/create_bucket_response.py b/services/objectstorage/src/stackit/objectstorage/models/create_bucket_response.py index 4eaefb2c..e2ffc02f 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/create_bucket_response.py +++ b/services/objectstorage/src/stackit/objectstorage/models/create_bucket_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateBucketResponse(BaseModel): """ CreateBucketResponse - """ + """ # noqa: E501 bucket: StrictStr = Field(description="Name of the bucket") project: StrictStr = Field(description="Project ID") diff --git a/services/objectstorage/src/stackit/objectstorage/models/create_credentials_group_payload.py b/services/objectstorage/src/stackit/objectstorage/models/create_credentials_group_payload.py index 9f3ce54c..0d106d56 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/create_credentials_group_payload.py +++ b/services/objectstorage/src/stackit/objectstorage/models/create_credentials_group_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateCredentialsGroupPayload(BaseModel): """ CreateCredentialsGroupPayload - """ + """ # noqa: E501 display_name: Annotated[str, Field(min_length=1, strict=True, max_length=32)] = Field( description="Name of the group holding credentials", alias="displayName" diff --git a/services/objectstorage/src/stackit/objectstorage/models/create_credentials_group_response.py b/services/objectstorage/src/stackit/objectstorage/models/create_credentials_group_response.py index 74104401..28357d6a 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/create_credentials_group_response.py +++ b/services/objectstorage/src/stackit/objectstorage/models/create_credentials_group_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class CreateCredentialsGroupResponse(BaseModel): """ CreateCredentialsGroupResponse - """ + """ # noqa: E501 credentials_group: CredentialsGroup = Field(alias="credentialsGroup") project: StrictStr = Field(description="Project ID") diff --git a/services/objectstorage/src/stackit/objectstorage/models/credentials_group.py b/services/objectstorage/src/stackit/objectstorage/models/credentials_group.py index d5ed3388..31e0c698 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/credentials_group.py +++ b/services/objectstorage/src/stackit/objectstorage/models/credentials_group.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CredentialsGroup(BaseModel): """ CredentialsGroup - """ + """ # noqa: E501 credentials_group_id: StrictStr = Field(description="The ID of the credentials group", alias="credentialsGroupId") display_name: StrictStr = Field(description="Name of the group holding credentials", alias="displayName") diff --git a/services/objectstorage/src/stackit/objectstorage/models/delete_access_key_response.py b/services/objectstorage/src/stackit/objectstorage/models/delete_access_key_response.py index 565a79b7..d99f2ee6 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/delete_access_key_response.py +++ b/services/objectstorage/src/stackit/objectstorage/models/delete_access_key_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class DeleteAccessKeyResponse(BaseModel): """ DeleteAccessKeyResponse - """ + """ # noqa: E501 key_id: StrictStr = Field( description="Identifies the pair of access key and secret access key for deletion", alias="keyId" diff --git a/services/objectstorage/src/stackit/objectstorage/models/delete_bucket_response.py b/services/objectstorage/src/stackit/objectstorage/models/delete_bucket_response.py index eb13e28d..f0021c50 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/delete_bucket_response.py +++ b/services/objectstorage/src/stackit/objectstorage/models/delete_bucket_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class DeleteBucketResponse(BaseModel): """ DeleteBucketResponse - """ + """ # noqa: E501 bucket: StrictStr = Field(description="Name of the bucket") project: StrictStr = Field(description="Project ID") diff --git a/services/objectstorage/src/stackit/objectstorage/models/delete_credentials_group_response.py b/services/objectstorage/src/stackit/objectstorage/models/delete_credentials_group_response.py index b42f67ad..9fe24e22 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/delete_credentials_group_response.py +++ b/services/objectstorage/src/stackit/objectstorage/models/delete_credentials_group_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class DeleteCredentialsGroupResponse(BaseModel): """ DeleteCredentialsGroupResponse - """ + """ # noqa: E501 credentials_group_id: StrictStr = Field(description="The ID of the credentials group", alias="credentialsGroupId") project: StrictStr = Field(description="Project ID") diff --git a/services/objectstorage/src/stackit/objectstorage/models/detailed_error.py b/services/objectstorage/src/stackit/objectstorage/models/detailed_error.py index 10f5db0b..41d71903 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/detailed_error.py +++ b/services/objectstorage/src/stackit/objectstorage/models/detailed_error.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class DetailedError(BaseModel): """ DetailedError - """ + """ # noqa: E501 key: StrictStr msg: StrictStr diff --git a/services/objectstorage/src/stackit/objectstorage/models/error_message.py b/services/objectstorage/src/stackit/objectstorage/models/error_message.py index f81c4244..5249c9fe 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/error_message.py +++ b/services/objectstorage/src/stackit/objectstorage/models/error_message.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ErrorMessage(BaseModel): """ ErrorMessage - """ + """ # noqa: E501 detail: List[DetailedError] __properties: ClassVar[List[str]] = ["detail"] diff --git a/services/objectstorage/src/stackit/objectstorage/models/get_bucket_response.py b/services/objectstorage/src/stackit/objectstorage/models/get_bucket_response.py index c4193f36..7a8a47df 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/get_bucket_response.py +++ b/services/objectstorage/src/stackit/objectstorage/models/get_bucket_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class GetBucketResponse(BaseModel): """ GetBucketResponse - """ + """ # noqa: E501 bucket: Bucket project: StrictStr = Field(description="Project ID") diff --git a/services/objectstorage/src/stackit/objectstorage/models/http_validation_error.py b/services/objectstorage/src/stackit/objectstorage/models/http_validation_error.py index 04e04e66..08cee2d8 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/http_validation_error.py +++ b/services/objectstorage/src/stackit/objectstorage/models/http_validation_error.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class HTTPValidationError(BaseModel): """ HTTPValidationError - """ + """ # noqa: E501 detail: Optional[List[ValidationError]] = None __properties: ClassVar[List[str]] = ["detail"] diff --git a/services/objectstorage/src/stackit/objectstorage/models/list_access_keys_response.py b/services/objectstorage/src/stackit/objectstorage/models/list_access_keys_response.py index 459b8e2f..53b76ff7 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/list_access_keys_response.py +++ b/services/objectstorage/src/stackit/objectstorage/models/list_access_keys_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListAccessKeysResponse(BaseModel): """ ListAccessKeysResponse - """ + """ # noqa: E501 access_keys: List[AccessKey] = Field(alias="accessKeys") project: StrictStr = Field(description="Project ID") diff --git a/services/objectstorage/src/stackit/objectstorage/models/list_buckets_response.py b/services/objectstorage/src/stackit/objectstorage/models/list_buckets_response.py index a43a7fbc..04edbeb3 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/list_buckets_response.py +++ b/services/objectstorage/src/stackit/objectstorage/models/list_buckets_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListBucketsResponse(BaseModel): """ ListBucketsResponse - """ + """ # noqa: E501 buckets: List[Bucket] project: StrictStr = Field(description="Project ID") diff --git a/services/objectstorage/src/stackit/objectstorage/models/list_credentials_groups_response.py b/services/objectstorage/src/stackit/objectstorage/models/list_credentials_groups_response.py index 005d9c13..d9dbdef0 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/list_credentials_groups_response.py +++ b/services/objectstorage/src/stackit/objectstorage/models/list_credentials_groups_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListCredentialsGroupsResponse(BaseModel): """ ListCredentialsGroupsResponse - """ + """ # noqa: E501 credentials_groups: List[CredentialsGroup] = Field(alias="credentialsGroups") project: StrictStr = Field(description="Project ID") diff --git a/services/objectstorage/src/stackit/objectstorage/models/location_inner.py b/services/objectstorage/src/stackit/objectstorage/models/location_inner.py index 9479fd9f..de9ffcd2 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/location_inner.py +++ b/services/objectstorage/src/stackit/objectstorage/models/location_inner.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations diff --git a/services/objectstorage/src/stackit/objectstorage/models/project_scope.py b/services/objectstorage/src/stackit/objectstorage/models/project_scope.py index 3dc27380..bd4d7e97 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/project_scope.py +++ b/services/objectstorage/src/stackit/objectstorage/models/project_scope.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations diff --git a/services/objectstorage/src/stackit/objectstorage/models/project_status.py b/services/objectstorage/src/stackit/objectstorage/models/project_status.py index bac9df89..9570ba9f 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/project_status.py +++ b/services/objectstorage/src/stackit/objectstorage/models/project_status.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ProjectStatus(BaseModel): """ ProjectStatus - """ + """ # noqa: E501 project: StrictStr = Field(description="Project ID") scope: ProjectScope = Field(description="Project Scope") diff --git a/services/objectstorage/src/stackit/objectstorage/models/validation_error.py b/services/objectstorage/src/stackit/objectstorage/models/validation_error.py index f38c2d59..57539695 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/validation_error.py +++ b/services/objectstorage/src/stackit/objectstorage/models/validation_error.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ValidationError(BaseModel): """ ValidationError - """ + """ # noqa: E501 loc: List[LocationInner] msg: StrictStr diff --git a/services/objectstorage/src/stackit/objectstorage/rest.py b/services/objectstorage/src/stackit/objectstorage/rest.py index 79c73f45..17775e9d 100644 --- a/services/objectstorage/src/stackit/objectstorage/rest.py +++ b/services/objectstorage/src/stackit/objectstorage/rest.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -124,7 +124,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/observability/CHANGELOG.md b/services/observability/CHANGELOG.md index 170f9458..a994235a 100644 --- a/services/observability/CHANGELOG.md +++ b/services/observability/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.5.1 +- **Internal:** Improve deserializing and error types + ## v0.5.0 (2025-05-27) - **Feature:** Add support for `matchers` to route - **Feature:** Add support for `priority levels`, `sendResolved`, `continue` to alert config models diff --git a/services/observability/pyproject.toml b/services/observability/pyproject.toml index 81dda919..e5829008 100644 --- a/services/observability/pyproject.toml +++ b/services/observability/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-observability" [tool.poetry] name = "stackit-observability" -version = "v0.5.0" +version = "v0.5.1" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/observability/src/stackit/observability/__init__.py b/services/observability/src/stackit/observability/__init__.py index 07c3569b..2c06e2ca 100644 --- a/services/observability/src/stackit/observability/__init__.py +++ b/services/observability/src/stackit/observability/__init__.py @@ -12,206 +12,353 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "Alert", + "AlertConfigReceiversResponse", + "AlertConfigRouteResponse", + "AlertGroup", + "AlertGroupResponse", + "AlertGroupsResponse", + "AlertRule", + "AlertRuleRecord", + "AlertRulesResponse", + "BasicAuth", + "CreateAlertConfigReceiverPayload", + "CreateAlertConfigReceiverPayloadEmailConfigsInner", + "CreateAlertConfigReceiverPayloadOpsgenieConfigsInner", + "CreateAlertConfigReceiverPayloadWebHookConfigsInner", + "CreateAlertConfigRoutePayload", + "CreateAlertConfigRoutePayloadRoutesInner", + "CreateAlertgroupsPayload", + "CreateAlertrulesPayload", + "CreateCredentialsResponse", + "CreateInstancePayload", + "CreateInstanceResponse", + "CreateLogsAlertgroupsPayload", + "CreateScrapeConfigPayload", + "CreateScrapeConfigPayloadBasicAuth", + "CreateScrapeConfigPayloadHttpSdConfigsInner", + "CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2", + "CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig", + "CreateScrapeConfigPayloadMetricsRelabelConfigsInner", + "CreateScrapeConfigPayloadStaticConfigsInner", + "Credentials", + "CredentialsRemoteWriteConfig", + "CredentialsRemoteWriteDeleteResponse", + "DeleteScrapeConfigResponse", + "EmailConfig", + "Error", + "GetAlertConfigsResponse", + "GetCredentialsResponse", + "GetInstanceResponse", + "GetMetricsStorageRetentionResponse", + "GetScrapeConfigResponse", + "GrafanaConfigs", + "GrafanaOauth", + "HTTPServiceSD", + "InhibitRules", + "Instance", + "InstanceResponse", + "InstanceSensitiveData", + "Job", + "ListACLResponse", + "ListCredentialsResponse", + "ListInstancesResponse", + "ListScrapeConfigsResponse", + "Message", + "MetricsRelabelConfig", + "ModelGlobal", + "OAuth2", + "OpsgenieConfig", + "PermissionDenied", + "Plan", + "PlanModel", + "PlansResponse", + "ProjectInstanceFull", + "Receiver", + "Receivers", + "Route", + "RouteSerializer", + "ScrapeConfigsResponse", + "ServiceKeysList", + "StaticConfigs", + "TLSConfig", + "UpdateACLPayload", + "UpdateAlertConfigReceiverPayload", + "UpdateAlertConfigRoutePayload", + "UpdateAlertConfigsPayload", + "UpdateAlertConfigsPayloadGlobal", + "UpdateAlertConfigsPayloadInhibitRules", + "UpdateAlertConfigsPayloadReceiversInner", + "UpdateAlertConfigsPayloadRoute", + "UpdateAlertConfigsResponse", + "UpdateAlertgroupPayload", + "UpdateAlertgroupsRequestInner", + "UpdateAlertgroupsRequestInnerRulesInner", + "UpdateCredentialsRemoteWriteConfigPayload", + "UpdateGrafanaConfigsPayload", + "UpdateGrafanaConfigsPayloadGenericOauth", + "UpdateInstancePayload", + "UpdateLogsAlertgroupPayload", + "UpdateMetricsStorageRetentionPayload", + "UpdateScrapeConfigPayload", + "UpdateScrapeConfigPayloadStaticConfigsInner", + "WebHook", +] + # import apis into sdk package -from stackit.observability.api.default_api import DefaultApi -from stackit.observability.api_client import ApiClient +from stackit.observability.api.default_api import DefaultApi as DefaultApi +from stackit.observability.api_client import ApiClient as ApiClient # import ApiClient -from stackit.observability.api_response import ApiResponse -from stackit.observability.configuration import HostConfiguration -from stackit.observability.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.observability.api_response import ApiResponse as ApiResponse +from stackit.observability.configuration import HostConfiguration as HostConfiguration +from stackit.observability.exceptions import ApiAttributeError as ApiAttributeError +from stackit.observability.exceptions import ApiException as ApiException +from stackit.observability.exceptions import ApiKeyError as ApiKeyError +from stackit.observability.exceptions import ApiTypeError as ApiTypeError +from stackit.observability.exceptions import ApiValueError as ApiValueError +from stackit.observability.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.observability.models.alert import Alert +from stackit.observability.models.alert import Alert as Alert from stackit.observability.models.alert_config_receivers_response import ( - AlertConfigReceiversResponse, + AlertConfigReceiversResponse as AlertConfigReceiversResponse, ) from stackit.observability.models.alert_config_route_response import ( - AlertConfigRouteResponse, -) -from stackit.observability.models.alert_group import AlertGroup -from stackit.observability.models.alert_group_response import AlertGroupResponse -from stackit.observability.models.alert_groups_response import AlertGroupsResponse -from stackit.observability.models.alert_rule import AlertRule -from stackit.observability.models.alert_rule_record import AlertRuleRecord -from stackit.observability.models.alert_rules_response import AlertRulesResponse -from stackit.observability.models.basic_auth import BasicAuth + AlertConfigRouteResponse as AlertConfigRouteResponse, +) +from stackit.observability.models.alert_group import AlertGroup as AlertGroup +from stackit.observability.models.alert_group_response import ( + AlertGroupResponse as AlertGroupResponse, +) +from stackit.observability.models.alert_groups_response import ( + AlertGroupsResponse as AlertGroupsResponse, +) +from stackit.observability.models.alert_rule import AlertRule as AlertRule +from stackit.observability.models.alert_rule_record import ( + AlertRuleRecord as AlertRuleRecord, +) +from stackit.observability.models.alert_rules_response import ( + AlertRulesResponse as AlertRulesResponse, +) +from stackit.observability.models.basic_auth import BasicAuth as BasicAuth from stackit.observability.models.create_alert_config_receiver_payload import ( - CreateAlertConfigReceiverPayload, + CreateAlertConfigReceiverPayload as CreateAlertConfigReceiverPayload, ) from stackit.observability.models.create_alert_config_receiver_payload_email_configs_inner import ( - CreateAlertConfigReceiverPayloadEmailConfigsInner, + CreateAlertConfigReceiverPayloadEmailConfigsInner as CreateAlertConfigReceiverPayloadEmailConfigsInner, ) from stackit.observability.models.create_alert_config_receiver_payload_opsgenie_configs_inner import ( - CreateAlertConfigReceiverPayloadOpsgenieConfigsInner, + CreateAlertConfigReceiverPayloadOpsgenieConfigsInner as CreateAlertConfigReceiverPayloadOpsgenieConfigsInner, ) from stackit.observability.models.create_alert_config_receiver_payload_web_hook_configs_inner import ( - CreateAlertConfigReceiverPayloadWebHookConfigsInner, + CreateAlertConfigReceiverPayloadWebHookConfigsInner as CreateAlertConfigReceiverPayloadWebHookConfigsInner, ) from stackit.observability.models.create_alert_config_route_payload import ( - CreateAlertConfigRoutePayload, + CreateAlertConfigRoutePayload as CreateAlertConfigRoutePayload, ) from stackit.observability.models.create_alert_config_route_payload_routes_inner import ( - CreateAlertConfigRoutePayloadRoutesInner, + CreateAlertConfigRoutePayloadRoutesInner as CreateAlertConfigRoutePayloadRoutesInner, ) from stackit.observability.models.create_alertgroups_payload import ( - CreateAlertgroupsPayload, + CreateAlertgroupsPayload as CreateAlertgroupsPayload, ) from stackit.observability.models.create_alertrules_payload import ( - CreateAlertrulesPayload, + CreateAlertrulesPayload as CreateAlertrulesPayload, ) from stackit.observability.models.create_credentials_response import ( - CreateCredentialsResponse, + CreateCredentialsResponse as CreateCredentialsResponse, +) +from stackit.observability.models.create_instance_payload import ( + CreateInstancePayload as CreateInstancePayload, +) +from stackit.observability.models.create_instance_response import ( + CreateInstanceResponse as CreateInstanceResponse, ) -from stackit.observability.models.create_instance_payload import CreateInstancePayload -from stackit.observability.models.create_instance_response import CreateInstanceResponse from stackit.observability.models.create_logs_alertgroups_payload import ( - CreateLogsAlertgroupsPayload, + CreateLogsAlertgroupsPayload as CreateLogsAlertgroupsPayload, ) from stackit.observability.models.create_scrape_config_payload import ( - CreateScrapeConfigPayload, + CreateScrapeConfigPayload as CreateScrapeConfigPayload, ) from stackit.observability.models.create_scrape_config_payload_basic_auth import ( - CreateScrapeConfigPayloadBasicAuth, + CreateScrapeConfigPayloadBasicAuth as CreateScrapeConfigPayloadBasicAuth, ) from stackit.observability.models.create_scrape_config_payload_http_sd_configs_inner import ( - CreateScrapeConfigPayloadHttpSdConfigsInner, + CreateScrapeConfigPayloadHttpSdConfigsInner as CreateScrapeConfigPayloadHttpSdConfigsInner, ) from stackit.observability.models.create_scrape_config_payload_http_sd_configs_inner_oauth2 import ( - CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2, + CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 as CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2, ) from stackit.observability.models.create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config import ( - CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig, + CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig as CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig, ) from stackit.observability.models.create_scrape_config_payload_metrics_relabel_configs_inner import ( - CreateScrapeConfigPayloadMetricsRelabelConfigsInner, + CreateScrapeConfigPayloadMetricsRelabelConfigsInner as CreateScrapeConfigPayloadMetricsRelabelConfigsInner, ) from stackit.observability.models.create_scrape_config_payload_static_configs_inner import ( - CreateScrapeConfigPayloadStaticConfigsInner, + CreateScrapeConfigPayloadStaticConfigsInner as CreateScrapeConfigPayloadStaticConfigsInner, ) -from stackit.observability.models.credentials import Credentials +from stackit.observability.models.credentials import Credentials as Credentials from stackit.observability.models.credentials_remote_write_config import ( - CredentialsRemoteWriteConfig, + CredentialsRemoteWriteConfig as CredentialsRemoteWriteConfig, ) from stackit.observability.models.credentials_remote_write_delete_response import ( - CredentialsRemoteWriteDeleteResponse, + CredentialsRemoteWriteDeleteResponse as CredentialsRemoteWriteDeleteResponse, ) from stackit.observability.models.delete_scrape_config_response import ( - DeleteScrapeConfigResponse, + DeleteScrapeConfigResponse as DeleteScrapeConfigResponse, ) -from stackit.observability.models.email_config import EmailConfig -from stackit.observability.models.error import Error +from stackit.observability.models.email_config import EmailConfig as EmailConfig +from stackit.observability.models.error import Error as Error from stackit.observability.models.get_alert_configs_response import ( - GetAlertConfigsResponse, + GetAlertConfigsResponse as GetAlertConfigsResponse, +) +from stackit.observability.models.get_credentials_response import ( + GetCredentialsResponse as GetCredentialsResponse, +) +from stackit.observability.models.get_instance_response import ( + GetInstanceResponse as GetInstanceResponse, ) -from stackit.observability.models.get_credentials_response import GetCredentialsResponse -from stackit.observability.models.get_instance_response import GetInstanceResponse from stackit.observability.models.get_metrics_storage_retention_response import ( - GetMetricsStorageRetentionResponse, + GetMetricsStorageRetentionResponse as GetMetricsStorageRetentionResponse, ) from stackit.observability.models.get_scrape_config_response import ( - GetScrapeConfigResponse, -) -from stackit.observability.models.grafana_configs import GrafanaConfigs -from stackit.observability.models.grafana_oauth import GrafanaOauth -from stackit.observability.models.http_service_sd import HTTPServiceSD -from stackit.observability.models.inhibit_rules import InhibitRules -from stackit.observability.models.instance import Instance -from stackit.observability.models.instance_response import InstanceResponse -from stackit.observability.models.instance_sensitive_data import InstanceSensitiveData -from stackit.observability.models.job import Job -from stackit.observability.models.list_acl_response import ListACLResponse + GetScrapeConfigResponse as GetScrapeConfigResponse, +) +from stackit.observability.models.grafana_configs import ( + GrafanaConfigs as GrafanaConfigs, +) +from stackit.observability.models.grafana_oauth import GrafanaOauth as GrafanaOauth +from stackit.observability.models.http_service_sd import HTTPServiceSD as HTTPServiceSD +from stackit.observability.models.inhibit_rules import InhibitRules as InhibitRules +from stackit.observability.models.instance import Instance as Instance +from stackit.observability.models.instance_response import ( + InstanceResponse as InstanceResponse, +) +from stackit.observability.models.instance_sensitive_data import ( + InstanceSensitiveData as InstanceSensitiveData, +) +from stackit.observability.models.job import Job as Job +from stackit.observability.models.list_acl_response import ( + ListACLResponse as ListACLResponse, +) from stackit.observability.models.list_credentials_response import ( - ListCredentialsResponse, + ListCredentialsResponse as ListCredentialsResponse, +) +from stackit.observability.models.list_instances_response import ( + ListInstancesResponse as ListInstancesResponse, ) -from stackit.observability.models.list_instances_response import ListInstancesResponse from stackit.observability.models.list_scrape_configs_response import ( - ListScrapeConfigsResponse, -) -from stackit.observability.models.message import Message -from stackit.observability.models.metrics_relabel_config import MetricsRelabelConfig -from stackit.observability.models.model_global import ModelGlobal -from stackit.observability.models.o_auth2 import OAuth2 -from stackit.observability.models.opsgenie_config import OpsgenieConfig -from stackit.observability.models.permission_denied import PermissionDenied -from stackit.observability.models.plan import Plan -from stackit.observability.models.plan_model import PlanModel -from stackit.observability.models.plans_response import PlansResponse -from stackit.observability.models.project_instance_full import ProjectInstanceFull -from stackit.observability.models.receiver import Receiver -from stackit.observability.models.receivers import Receivers -from stackit.observability.models.route import Route -from stackit.observability.models.route_serializer import RouteSerializer -from stackit.observability.models.scrape_configs_response import ScrapeConfigsResponse -from stackit.observability.models.service_keys_list import ServiceKeysList -from stackit.observability.models.static_configs import StaticConfigs -from stackit.observability.models.tls_config import TLSConfig -from stackit.observability.models.update_acl_payload import UpdateACLPayload + ListScrapeConfigsResponse as ListScrapeConfigsResponse, +) +from stackit.observability.models.message import Message as Message +from stackit.observability.models.metrics_relabel_config import ( + MetricsRelabelConfig as MetricsRelabelConfig, +) +from stackit.observability.models.model_global import ModelGlobal as ModelGlobal +from stackit.observability.models.o_auth2 import OAuth2 as OAuth2 +from stackit.observability.models.opsgenie_config import ( + OpsgenieConfig as OpsgenieConfig, +) +from stackit.observability.models.permission_denied import ( + PermissionDenied as PermissionDenied, +) +from stackit.observability.models.plan import Plan as Plan +from stackit.observability.models.plan_model import PlanModel as PlanModel +from stackit.observability.models.plans_response import PlansResponse as PlansResponse +from stackit.observability.models.project_instance_full import ( + ProjectInstanceFull as ProjectInstanceFull, +) +from stackit.observability.models.receiver import Receiver as Receiver +from stackit.observability.models.receivers import Receivers as Receivers +from stackit.observability.models.route import Route as Route +from stackit.observability.models.route_serializer import ( + RouteSerializer as RouteSerializer, +) +from stackit.observability.models.scrape_configs_response import ( + ScrapeConfigsResponse as ScrapeConfigsResponse, +) +from stackit.observability.models.service_keys_list import ( + ServiceKeysList as ServiceKeysList, +) +from stackit.observability.models.static_configs import StaticConfigs as StaticConfigs +from stackit.observability.models.tls_config import TLSConfig as TLSConfig +from stackit.observability.models.update_acl_payload import ( + UpdateACLPayload as UpdateACLPayload, +) from stackit.observability.models.update_alert_config_receiver_payload import ( - UpdateAlertConfigReceiverPayload, + UpdateAlertConfigReceiverPayload as UpdateAlertConfigReceiverPayload, ) from stackit.observability.models.update_alert_config_route_payload import ( - UpdateAlertConfigRoutePayload, + UpdateAlertConfigRoutePayload as UpdateAlertConfigRoutePayload, ) from stackit.observability.models.update_alert_configs_payload import ( - UpdateAlertConfigsPayload, + UpdateAlertConfigsPayload as UpdateAlertConfigsPayload, ) from stackit.observability.models.update_alert_configs_payload_global import ( - UpdateAlertConfigsPayloadGlobal, + UpdateAlertConfigsPayloadGlobal as UpdateAlertConfigsPayloadGlobal, ) from stackit.observability.models.update_alert_configs_payload_inhibit_rules import ( - UpdateAlertConfigsPayloadInhibitRules, + UpdateAlertConfigsPayloadInhibitRules as UpdateAlertConfigsPayloadInhibitRules, ) from stackit.observability.models.update_alert_configs_payload_receivers_inner import ( - UpdateAlertConfigsPayloadReceiversInner, + UpdateAlertConfigsPayloadReceiversInner as UpdateAlertConfigsPayloadReceiversInner, ) from stackit.observability.models.update_alert_configs_payload_route import ( - UpdateAlertConfigsPayloadRoute, + UpdateAlertConfigsPayloadRoute as UpdateAlertConfigsPayloadRoute, ) from stackit.observability.models.update_alert_configs_response import ( - UpdateAlertConfigsResponse, + UpdateAlertConfigsResponse as UpdateAlertConfigsResponse, ) from stackit.observability.models.update_alertgroup_payload import ( - UpdateAlertgroupPayload, + UpdateAlertgroupPayload as UpdateAlertgroupPayload, ) from stackit.observability.models.update_alertgroups_request_inner import ( - UpdateAlertgroupsRequestInner, + UpdateAlertgroupsRequestInner as UpdateAlertgroupsRequestInner, ) from stackit.observability.models.update_alertgroups_request_inner_rules_inner import ( - UpdateAlertgroupsRequestInnerRulesInner, + UpdateAlertgroupsRequestInnerRulesInner as UpdateAlertgroupsRequestInnerRulesInner, ) from stackit.observability.models.update_credentials_remote_write_config_payload import ( - UpdateCredentialsRemoteWriteConfigPayload, + UpdateCredentialsRemoteWriteConfigPayload as UpdateCredentialsRemoteWriteConfigPayload, ) from stackit.observability.models.update_grafana_configs_payload import ( - UpdateGrafanaConfigsPayload, + UpdateGrafanaConfigsPayload as UpdateGrafanaConfigsPayload, ) from stackit.observability.models.update_grafana_configs_payload_generic_oauth import ( - UpdateGrafanaConfigsPayloadGenericOauth, + UpdateGrafanaConfigsPayloadGenericOauth as UpdateGrafanaConfigsPayloadGenericOauth, +) +from stackit.observability.models.update_instance_payload import ( + UpdateInstancePayload as UpdateInstancePayload, ) -from stackit.observability.models.update_instance_payload import UpdateInstancePayload from stackit.observability.models.update_logs_alertgroup_payload import ( - UpdateLogsAlertgroupPayload, + UpdateLogsAlertgroupPayload as UpdateLogsAlertgroupPayload, ) from stackit.observability.models.update_metrics_storage_retention_payload import ( - UpdateMetricsStorageRetentionPayload, + UpdateMetricsStorageRetentionPayload as UpdateMetricsStorageRetentionPayload, ) from stackit.observability.models.update_scrape_config_payload import ( - UpdateScrapeConfigPayload, + UpdateScrapeConfigPayload as UpdateScrapeConfigPayload, ) from stackit.observability.models.update_scrape_config_payload_static_configs_inner import ( - UpdateScrapeConfigPayloadStaticConfigsInner, + UpdateScrapeConfigPayloadStaticConfigsInner as UpdateScrapeConfigPayloadStaticConfigsInner, ) -from stackit.observability.models.web_hook import WebHook +from stackit.observability.models.web_hook import WebHook as WebHook diff --git a/services/observability/src/stackit/observability/api/default_api.py b/services/observability/src/stackit/observability/api/default_api.py index bffeac75..8ca22fd8 100644 --- a/services/observability/src/stackit/observability/api/default_api.py +++ b/services/observability/src/stackit/observability/api/default_api.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -186,7 +186,7 @@ def create_alert_config_receiver( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_alert_config_receiver_serialize( instance_id=instance_id, @@ -256,7 +256,7 @@ def create_alert_config_receiver_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_alert_config_receiver_serialize( instance_id=instance_id, @@ -326,7 +326,7 @@ def create_alert_config_receiver_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_alert_config_receiver_serialize( instance_id=instance_id, @@ -365,7 +365,7 @@ def _create_alert_config_receiver_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -456,7 +456,7 @@ def create_alert_config_route( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_alert_config_route_serialize( instance_id=instance_id, @@ -526,7 +526,7 @@ def create_alert_config_route_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_alert_config_route_serialize( instance_id=instance_id, @@ -596,7 +596,7 @@ def create_alert_config_route_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_alert_config_route_serialize( instance_id=instance_id, @@ -635,7 +635,7 @@ def _create_alert_config_route_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -726,7 +726,7 @@ def create_alertgroups( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_alertgroups_serialize( instance_id=instance_id, @@ -796,7 +796,7 @@ def create_alertgroups_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_alertgroups_serialize( instance_id=instance_id, @@ -866,7 +866,7 @@ def create_alertgroups_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_alertgroups_serialize( instance_id=instance_id, @@ -905,7 +905,7 @@ def _create_alertgroups_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -999,7 +999,7 @@ def create_alertrules( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_alertrules_serialize( group_name=group_name, @@ -1073,7 +1073,7 @@ def create_alertrules_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_alertrules_serialize( group_name=group_name, @@ -1147,7 +1147,7 @@ def create_alertrules_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_alertrules_serialize( group_name=group_name, @@ -1188,7 +1188,7 @@ def _create_alertrules_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1278,7 +1278,7 @@ def create_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( instance_id=instance_id, @@ -1343,7 +1343,7 @@ def create_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( instance_id=instance_id, @@ -1408,7 +1408,7 @@ def create_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( instance_id=instance_id, @@ -1444,7 +1444,7 @@ def _create_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1522,7 +1522,7 @@ def create_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -1588,7 +1588,7 @@ def create_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -1654,7 +1654,7 @@ def create_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -1691,7 +1691,7 @@ def _create_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1780,7 +1780,7 @@ def create_logs_alertgroups( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_logs_alertgroups_serialize( instance_id=instance_id, @@ -1850,7 +1850,7 @@ def create_logs_alertgroups_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_logs_alertgroups_serialize( instance_id=instance_id, @@ -1920,7 +1920,7 @@ def create_logs_alertgroups_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_logs_alertgroups_serialize( instance_id=instance_id, @@ -1959,7 +1959,7 @@ def _create_logs_alertgroups_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2050,7 +2050,7 @@ def create_scrape_config( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_scrape_config_serialize( instance_id=instance_id, @@ -2120,7 +2120,7 @@ def create_scrape_config_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_scrape_config_serialize( instance_id=instance_id, @@ -2190,7 +2190,7 @@ def create_scrape_config_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_scrape_config_serialize( instance_id=instance_id, @@ -2229,7 +2229,7 @@ def _create_scrape_config_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2320,7 +2320,7 @@ def delete_alert_config_receiver( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_alert_config_receiver_serialize( instance_id=instance_id, @@ -2390,7 +2390,7 @@ def delete_alert_config_receiver_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_alert_config_receiver_serialize( instance_id=instance_id, @@ -2460,7 +2460,7 @@ def delete_alert_config_receiver_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_alert_config_receiver_serialize( instance_id=instance_id, @@ -2499,7 +2499,7 @@ def _delete_alert_config_receiver_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2582,7 +2582,7 @@ def delete_alert_config_route( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_alert_config_route_serialize( instance_id=instance_id, @@ -2652,7 +2652,7 @@ def delete_alert_config_route_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_alert_config_route_serialize( instance_id=instance_id, @@ -2722,7 +2722,7 @@ def delete_alert_config_route_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_alert_config_route_serialize( instance_id=instance_id, @@ -2761,7 +2761,7 @@ def _delete_alert_config_route_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2844,7 +2844,7 @@ def delete_alertgroup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_alertgroup_serialize( group_name=group_name, @@ -2915,7 +2915,7 @@ def delete_alertgroup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_alertgroup_serialize( group_name=group_name, @@ -2986,7 +2986,7 @@ def delete_alertgroup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_alertgroup_serialize( group_name=group_name, @@ -3026,7 +3026,7 @@ def _delete_alertgroup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3109,7 +3109,7 @@ def delete_alertgroups( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_alertgroups_serialize( instance_id=instance_id, @@ -3178,7 +3178,7 @@ def delete_alertgroups_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_alertgroups_serialize( instance_id=instance_id, @@ -3247,7 +3247,7 @@ def delete_alertgroups_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_alertgroups_serialize( instance_id=instance_id, @@ -3287,7 +3287,7 @@ def _delete_alertgroups_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3375,7 +3375,7 @@ def delete_alertrules( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_alertrules_serialize( group_name=group_name, @@ -3448,7 +3448,7 @@ def delete_alertrules_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_alertrules_serialize( group_name=group_name, @@ -3521,7 +3521,7 @@ def delete_alertrules_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_alertrules_serialize( group_name=group_name, @@ -3563,7 +3563,7 @@ def _delete_alertrules_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3650,7 +3650,7 @@ def delete_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( instance_id=instance_id, @@ -3721,7 +3721,7 @@ def delete_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( instance_id=instance_id, @@ -3792,7 +3792,7 @@ def delete_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( instance_id=instance_id, @@ -3832,7 +3832,7 @@ def _delete_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3915,7 +3915,7 @@ def delete_credentials_remote_write_config( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_remote_write_config_serialize( instance_id=instance_id, @@ -3987,7 +3987,7 @@ def delete_credentials_remote_write_config_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_remote_write_config_serialize( instance_id=instance_id, @@ -4059,7 +4059,7 @@ def delete_credentials_remote_write_config_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_remote_write_config_serialize( instance_id=instance_id, @@ -4100,7 +4100,7 @@ def _delete_credentials_remote_write_config_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4180,7 +4180,7 @@ def delete_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( instance_id=instance_id, @@ -4245,7 +4245,7 @@ def delete_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( instance_id=instance_id, @@ -4310,7 +4310,7 @@ def delete_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( instance_id=instance_id, @@ -4346,7 +4346,7 @@ def _delete_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4427,7 +4427,7 @@ def delete_logs_alertgroup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_logs_alertgroup_serialize( group_name=group_name, @@ -4498,7 +4498,7 @@ def delete_logs_alertgroup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_logs_alertgroup_serialize( group_name=group_name, @@ -4569,7 +4569,7 @@ def delete_logs_alertgroup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_logs_alertgroup_serialize( group_name=group_name, @@ -4609,7 +4609,7 @@ def _delete_logs_alertgroup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4692,7 +4692,7 @@ def delete_scrape_config( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_scrape_config_serialize( instance_id=instance_id, @@ -4762,7 +4762,7 @@ def delete_scrape_config_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_scrape_config_serialize( instance_id=instance_id, @@ -4832,7 +4832,7 @@ def delete_scrape_config_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_scrape_config_serialize( instance_id=instance_id, @@ -4871,7 +4871,7 @@ def _delete_scrape_config_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4954,7 +4954,7 @@ def get_alert_config_receiver( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_alert_config_receiver_serialize( instance_id=instance_id, @@ -5024,7 +5024,7 @@ def get_alert_config_receiver_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_alert_config_receiver_serialize( instance_id=instance_id, @@ -5094,7 +5094,7 @@ def get_alert_config_receiver_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_alert_config_receiver_serialize( instance_id=instance_id, @@ -5133,7 +5133,7 @@ def _get_alert_config_receiver_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5216,7 +5216,7 @@ def get_alert_config_route( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_alert_config_route_serialize( instance_id=instance_id, @@ -5285,7 +5285,7 @@ def get_alert_config_route_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_alert_config_route_serialize( instance_id=instance_id, @@ -5354,7 +5354,7 @@ def get_alert_config_route_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_alert_config_route_serialize( instance_id=instance_id, @@ -5392,7 +5392,7 @@ def _get_alert_config_route_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5472,7 +5472,7 @@ def get_alert_configs( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_alert_configs_serialize( instance_id=instance_id, @@ -5537,7 +5537,7 @@ def get_alert_configs_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_alert_configs_serialize( instance_id=instance_id, @@ -5602,7 +5602,7 @@ def get_alert_configs_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_alert_configs_serialize( instance_id=instance_id, @@ -5638,7 +5638,7 @@ def _get_alert_configs_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5719,7 +5719,7 @@ def get_alertgroup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_alertgroup_serialize( group_name=group_name, @@ -5790,7 +5790,7 @@ def get_alertgroup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_alertgroup_serialize( group_name=group_name, @@ -5861,7 +5861,7 @@ def get_alertgroup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_alertgroup_serialize( group_name=group_name, @@ -5901,7 +5901,7 @@ def _get_alertgroup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5984,7 +5984,7 @@ def get_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( instance_id=instance_id, @@ -6054,7 +6054,7 @@ def get_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( instance_id=instance_id, @@ -6124,7 +6124,7 @@ def get_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( instance_id=instance_id, @@ -6163,7 +6163,7 @@ def _get_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -6246,7 +6246,7 @@ def get_credentials_remote_write_config( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_remote_write_config_serialize( instance_id=instance_id, @@ -6317,7 +6317,7 @@ def get_credentials_remote_write_config_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_remote_write_config_serialize( instance_id=instance_id, @@ -6388,7 +6388,7 @@ def get_credentials_remote_write_config_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_remote_write_config_serialize( instance_id=instance_id, @@ -6428,7 +6428,7 @@ def _get_credentials_remote_write_config_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -6508,7 +6508,7 @@ def get_grafana_configs( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_grafana_configs_serialize( instance_id=instance_id, @@ -6573,7 +6573,7 @@ def get_grafana_configs_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_grafana_configs_serialize( instance_id=instance_id, @@ -6638,7 +6638,7 @@ def get_grafana_configs_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_grafana_configs_serialize( instance_id=instance_id, @@ -6674,7 +6674,7 @@ def _get_grafana_configs_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -6752,7 +6752,7 @@ def get_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( instance_id=instance_id, @@ -6817,7 +6817,7 @@ def get_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( instance_id=instance_id, @@ -6882,7 +6882,7 @@ def get_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( instance_id=instance_id, @@ -6918,7 +6918,7 @@ def _get_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -6999,7 +6999,7 @@ def get_logs_alertgroup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_logs_alertgroup_serialize( group_name=group_name, @@ -7070,7 +7070,7 @@ def get_logs_alertgroup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_logs_alertgroup_serialize( group_name=group_name, @@ -7141,7 +7141,7 @@ def get_logs_alertgroup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_logs_alertgroup_serialize( group_name=group_name, @@ -7181,7 +7181,7 @@ def _get_logs_alertgroup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -7261,7 +7261,7 @@ def get_metrics_storage_retention( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_metrics_storage_retention_serialize( instance_id=instance_id, @@ -7326,7 +7326,7 @@ def get_metrics_storage_retention_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_metrics_storage_retention_serialize( instance_id=instance_id, @@ -7391,7 +7391,7 @@ def get_metrics_storage_retention_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_metrics_storage_retention_serialize( instance_id=instance_id, @@ -7427,7 +7427,7 @@ def _get_metrics_storage_retention_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -7508,7 +7508,7 @@ def get_scrape_config( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_scrape_config_serialize( instance_id=instance_id, @@ -7577,7 +7577,7 @@ def get_scrape_config_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_scrape_config_serialize( instance_id=instance_id, @@ -7646,7 +7646,7 @@ def get_scrape_config_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_scrape_config_serialize( instance_id=instance_id, @@ -7684,7 +7684,7 @@ def _get_scrape_config_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -7764,7 +7764,7 @@ def list_acl( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_acl_serialize( instance_id=instance_id, @@ -7829,7 +7829,7 @@ def list_acl_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_acl_serialize( instance_id=instance_id, @@ -7894,7 +7894,7 @@ def list_acl_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_acl_serialize( instance_id=instance_id, @@ -7930,7 +7930,7 @@ def _list_acl_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -8008,7 +8008,7 @@ def list_alert_config_receivers( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_alert_config_receivers_serialize( instance_id=instance_id, @@ -8073,7 +8073,7 @@ def list_alert_config_receivers_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_alert_config_receivers_serialize( instance_id=instance_id, @@ -8138,7 +8138,7 @@ def list_alert_config_receivers_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_alert_config_receivers_serialize( instance_id=instance_id, @@ -8174,7 +8174,7 @@ def _list_alert_config_receivers_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -8252,7 +8252,7 @@ def list_alert_config_routes( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_alert_config_routes_serialize( instance_id=instance_id, @@ -8317,7 +8317,7 @@ def list_alert_config_routes_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_alert_config_routes_serialize( instance_id=instance_id, @@ -8382,7 +8382,7 @@ def list_alert_config_routes_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_alert_config_routes_serialize( instance_id=instance_id, @@ -8418,7 +8418,7 @@ def _list_alert_config_routes_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -8496,7 +8496,7 @@ def list_alertgroups( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_alertgroups_serialize( instance_id=instance_id, @@ -8562,7 +8562,7 @@ def list_alertgroups_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_alertgroups_serialize( instance_id=instance_id, @@ -8628,7 +8628,7 @@ def list_alertgroups_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_alertgroups_serialize( instance_id=instance_id, @@ -8665,7 +8665,7 @@ def _list_alertgroups_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -8746,7 +8746,7 @@ def list_alertrules( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_alertrules_serialize( group_name=group_name, @@ -8815,7 +8815,7 @@ def list_alertrules_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_alertrules_serialize( group_name=group_name, @@ -8884,7 +8884,7 @@ def list_alertrules_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_alertrules_serialize( group_name=group_name, @@ -8922,7 +8922,7 @@ def _list_alertrules_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -9002,7 +9002,7 @@ def list_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( instance_id=instance_id, @@ -9067,7 +9067,7 @@ def list_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( instance_id=instance_id, @@ -9132,7 +9132,7 @@ def list_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( instance_id=instance_id, @@ -9168,7 +9168,7 @@ def _list_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -9243,7 +9243,7 @@ def list_instances( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -9304,7 +9304,7 @@ def list_instances_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -9365,7 +9365,7 @@ def list_instances_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -9399,7 +9399,7 @@ def _list_instances_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -9475,7 +9475,7 @@ def list_logs_alertgroups( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_logs_alertgroups_serialize( instance_id=instance_id, @@ -9541,7 +9541,7 @@ def list_logs_alertgroups_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_logs_alertgroups_serialize( instance_id=instance_id, @@ -9607,7 +9607,7 @@ def list_logs_alertgroups_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_logs_alertgroups_serialize( instance_id=instance_id, @@ -9644,7 +9644,7 @@ def _list_logs_alertgroups_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -9719,7 +9719,7 @@ def list_plans( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_plans_serialize( project_id=project_id, @@ -9780,7 +9780,7 @@ def list_plans_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_plans_serialize( project_id=project_id, @@ -9841,7 +9841,7 @@ def list_plans_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_plans_serialize( project_id=project_id, @@ -9875,7 +9875,7 @@ def _list_plans_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -9951,7 +9951,7 @@ def list_scrape_configs( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_scrape_configs_serialize( instance_id=instance_id, @@ -10016,7 +10016,7 @@ def list_scrape_configs_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_scrape_configs_serialize( instance_id=instance_id, @@ -10081,7 +10081,7 @@ def list_scrape_configs_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_scrape_configs_serialize( instance_id=instance_id, @@ -10117,7 +10117,7 @@ def _list_scrape_configs_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -10198,7 +10198,7 @@ def partial_update_alertgroups( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_alertgroups_serialize( instance_id=instance_id, @@ -10268,7 +10268,7 @@ def partial_update_alertgroups_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_alertgroups_serialize( instance_id=instance_id, @@ -10338,7 +10338,7 @@ def partial_update_alertgroups_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_alertgroups_serialize( instance_id=instance_id, @@ -10379,7 +10379,7 @@ def _partial_update_alertgroups_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -10473,7 +10473,7 @@ def partial_update_alertrules( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_alertrules_serialize( group_name=group_name, @@ -10547,7 +10547,7 @@ def partial_update_alertrules_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_alertrules_serialize( group_name=group_name, @@ -10621,7 +10621,7 @@ def partial_update_alertrules_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_alertrules_serialize( group_name=group_name, @@ -10664,7 +10664,7 @@ def _partial_update_alertrules_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -10757,7 +10757,7 @@ def update_acl( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_acl_serialize( instance_id=instance_id, @@ -10827,7 +10827,7 @@ def update_acl_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_acl_serialize( instance_id=instance_id, @@ -10897,7 +10897,7 @@ def update_acl_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_acl_serialize( instance_id=instance_id, @@ -10936,7 +10936,7 @@ def _update_acl_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -11030,7 +11030,7 @@ def update_alert_config_receiver( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_alert_config_receiver_serialize( instance_id=instance_id, @@ -11105,7 +11105,7 @@ def update_alert_config_receiver_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_alert_config_receiver_serialize( instance_id=instance_id, @@ -11180,7 +11180,7 @@ def update_alert_config_receiver_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_alert_config_receiver_serialize( instance_id=instance_id, @@ -11222,7 +11222,7 @@ def _update_alert_config_receiver_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -11318,7 +11318,7 @@ def update_alert_config_route( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_alert_config_route_serialize( instance_id=instance_id, @@ -11393,7 +11393,7 @@ def update_alert_config_route_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_alert_config_route_serialize( instance_id=instance_id, @@ -11468,7 +11468,7 @@ def update_alert_config_route_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_alert_config_route_serialize( instance_id=instance_id, @@ -11510,7 +11510,7 @@ def _update_alert_config_route_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -11603,7 +11603,7 @@ def update_alert_configs( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_alert_configs_serialize( instance_id=instance_id, @@ -11673,7 +11673,7 @@ def update_alert_configs_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_alert_configs_serialize( instance_id=instance_id, @@ -11743,7 +11743,7 @@ def update_alert_configs_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_alert_configs_serialize( instance_id=instance_id, @@ -11782,7 +11782,7 @@ def _update_alert_configs_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -11876,7 +11876,7 @@ def update_alertgroup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_alertgroup_serialize( group_name=group_name, @@ -11951,7 +11951,7 @@ def update_alertgroup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_alertgroup_serialize( group_name=group_name, @@ -12026,7 +12026,7 @@ def update_alertgroup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_alertgroup_serialize( group_name=group_name, @@ -12068,7 +12068,7 @@ def _update_alertgroup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -12161,7 +12161,7 @@ def update_alertgroups( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_alertgroups_serialize( instance_id=instance_id, @@ -12231,7 +12231,7 @@ def update_alertgroups_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_alertgroups_serialize( instance_id=instance_id, @@ -12301,7 +12301,7 @@ def update_alertgroups_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_alertgroups_serialize( instance_id=instance_id, @@ -12342,7 +12342,7 @@ def _update_alertgroups_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -12436,7 +12436,7 @@ def update_credentials_remote_write_config( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_credentials_remote_write_config_serialize( instance_id=instance_id, @@ -12512,7 +12512,7 @@ def update_credentials_remote_write_config_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_credentials_remote_write_config_serialize( instance_id=instance_id, @@ -12588,7 +12588,7 @@ def update_credentials_remote_write_config_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_credentials_remote_write_config_serialize( instance_id=instance_id, @@ -12631,7 +12631,7 @@ def _update_credentials_remote_write_config_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -12724,7 +12724,7 @@ def update_grafana_configs( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_grafana_configs_serialize( instance_id=instance_id, @@ -12794,7 +12794,7 @@ def update_grafana_configs_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_grafana_configs_serialize( instance_id=instance_id, @@ -12864,7 +12864,7 @@ def update_grafana_configs_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_grafana_configs_serialize( instance_id=instance_id, @@ -12903,7 +12903,7 @@ def _update_grafana_configs_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -12994,7 +12994,7 @@ def update_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_instance_serialize( instance_id=instance_id, @@ -13064,7 +13064,7 @@ def update_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_instance_serialize( instance_id=instance_id, @@ -13134,7 +13134,7 @@ def update_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_instance_serialize( instance_id=instance_id, @@ -13173,7 +13173,7 @@ def _update_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -13267,7 +13267,7 @@ def update_logs_alertgroup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_logs_alertgroup_serialize( group_name=group_name, @@ -13342,7 +13342,7 @@ def update_logs_alertgroup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_logs_alertgroup_serialize( group_name=group_name, @@ -13417,7 +13417,7 @@ def update_logs_alertgroup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_logs_alertgroup_serialize( group_name=group_name, @@ -13459,7 +13459,7 @@ def _update_logs_alertgroup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -13552,7 +13552,7 @@ def update_metrics_storage_retention( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_metrics_storage_retention_serialize( instance_id=instance_id, @@ -13622,7 +13622,7 @@ def update_metrics_storage_retention_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_metrics_storage_retention_serialize( instance_id=instance_id, @@ -13692,7 +13692,7 @@ def update_metrics_storage_retention_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_metrics_storage_retention_serialize( instance_id=instance_id, @@ -13731,7 +13731,7 @@ def _update_metrics_storage_retention_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -13825,7 +13825,7 @@ def update_scrape_config( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_scrape_config_serialize( instance_id=instance_id, @@ -13900,7 +13900,7 @@ def update_scrape_config_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_scrape_config_serialize( instance_id=instance_id, @@ -13975,7 +13975,7 @@ def update_scrape_config_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_scrape_config_serialize( instance_id=instance_id, @@ -14017,7 +14017,7 @@ def _update_scrape_config_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/observability/src/stackit/observability/api_client.py b/services/observability/src/stackit/observability/api_client.py index ac39e080..45da200e 100644 --- a/services/observability/src/stackit/observability/api_client.py +++ b/services/observability/src/stackit/observability/api_client.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -332,6 +332,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -351,12 +355,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -458,7 +462,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -474,7 +478,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -489,6 +496,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/observability/src/stackit/observability/configuration.py b/services/observability/src/stackit/observability/configuration.py index 56e9755a..28e0f2f5 100644 --- a/services/observability/src/stackit/observability/configuration.py +++ b/services/observability/src/stackit/observability/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT Observability API @@ -15,7 +10,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -54,7 +71,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -73,7 +90,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -113,7 +135,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -132,12 +154,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/observability/src/stackit/observability/exceptions.py b/services/observability/src/stackit/observability/exceptions.py index 447a22d6..4e69a156 100644 --- a/services/observability/src/stackit/observability/exceptions.py +++ b/services/observability/src/stackit/observability/exceptions.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -152,6 +152,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -188,6 +195,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/observability/src/stackit/observability/models/__init__.py b/services/observability/src/stackit/observability/models/__init__.py index 2b1497a5..88dc8726 100644 --- a/services/observability/src/stackit/observability/models/__init__.py +++ b/services/observability/src/stackit/observability/models/__init__.py @@ -11,7 +11,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/observability/src/stackit/observability/models/alert.py b/services/observability/src/stackit/observability/models/alert.py index 815d73ec..a4f3c72b 100644 --- a/services/observability/src/stackit/observability/models/alert.py +++ b/services/observability/src/stackit/observability/models/alert.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -30,7 +30,7 @@ class Alert(BaseModel): """ Alert - """ + """ # noqa: E501 var_global: Optional[ModelGlobal] = Field(default=None, alias="global") inhibit_rules: Optional[List[InhibitRules]] = Field(default=None, alias="inhibitRules") diff --git a/services/observability/src/stackit/observability/models/alert_config_receivers_response.py b/services/observability/src/stackit/observability/models/alert_config_receivers_response.py index 8d8b2b86..995e7632 100644 --- a/services/observability/src/stackit/observability/models/alert_config_receivers_response.py +++ b/services/observability/src/stackit/observability/models/alert_config_receivers_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class AlertConfigReceiversResponse(BaseModel): """ AlertConfigReceiversResponse - """ + """ # noqa: E501 data: List[Receivers] message: Annotated[str, Field(min_length=1, strict=True)] diff --git a/services/observability/src/stackit/observability/models/alert_config_route_response.py b/services/observability/src/stackit/observability/models/alert_config_route_response.py index 2798ab77..2e5eceec 100644 --- a/services/observability/src/stackit/observability/models/alert_config_route_response.py +++ b/services/observability/src/stackit/observability/models/alert_config_route_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class AlertConfigRouteResponse(BaseModel): """ AlertConfigRouteResponse - """ + """ # noqa: E501 data: Route message: Annotated[str, Field(min_length=1, strict=True)] diff --git a/services/observability/src/stackit/observability/models/alert_group.py b/services/observability/src/stackit/observability/models/alert_group.py index 78f21fbd..9405e4c3 100644 --- a/services/observability/src/stackit/observability/models/alert_group.py +++ b/services/observability/src/stackit/observability/models/alert_group.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class AlertGroup(BaseModel): """ AlertGroup - """ + """ # noqa: E501 interval: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = "60s" name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] diff --git a/services/observability/src/stackit/observability/models/alert_group_response.py b/services/observability/src/stackit/observability/models/alert_group_response.py index 39af35bd..f2069074 100644 --- a/services/observability/src/stackit/observability/models/alert_group_response.py +++ b/services/observability/src/stackit/observability/models/alert_group_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class AlertGroupResponse(BaseModel): """ AlertGroupResponse - """ + """ # noqa: E501 data: AlertGroup message: Annotated[str, Field(min_length=1, strict=True)] diff --git a/services/observability/src/stackit/observability/models/alert_groups_response.py b/services/observability/src/stackit/observability/models/alert_groups_response.py index 0dcd4210..5d94921c 100644 --- a/services/observability/src/stackit/observability/models/alert_groups_response.py +++ b/services/observability/src/stackit/observability/models/alert_groups_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class AlertGroupsResponse(BaseModel): """ AlertGroupsResponse - """ + """ # noqa: E501 data: List[AlertGroup] message: Annotated[str, Field(min_length=1, strict=True)] diff --git a/services/observability/src/stackit/observability/models/alert_rule.py b/services/observability/src/stackit/observability/models/alert_rule.py index fbd889d4..0a1d6549 100644 --- a/services/observability/src/stackit/observability/models/alert_rule.py +++ b/services/observability/src/stackit/observability/models/alert_rule.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class AlertRule(BaseModel): """ AlertRule - """ + """ # noqa: E501 alert: Annotated[str, Field(min_length=1, strict=True, max_length=200)] annotations: Optional[Dict[str, Annotated[str, Field(min_length=1, strict=True)]]] = None diff --git a/services/observability/src/stackit/observability/models/alert_rule_record.py b/services/observability/src/stackit/observability/models/alert_rule_record.py index b250147b..ac186ee0 100644 --- a/services/observability/src/stackit/observability/models/alert_rule_record.py +++ b/services/observability/src/stackit/observability/models/alert_rule_record.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class AlertRuleRecord(BaseModel): """ AlertRuleRecord - """ + """ # noqa: E501 alert: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = None annotations: Optional[Dict[str, Annotated[str, Field(min_length=1, strict=True)]]] = None diff --git a/services/observability/src/stackit/observability/models/alert_rules_response.py b/services/observability/src/stackit/observability/models/alert_rules_response.py index 35af04a3..ab300a81 100644 --- a/services/observability/src/stackit/observability/models/alert_rules_response.py +++ b/services/observability/src/stackit/observability/models/alert_rules_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class AlertRulesResponse(BaseModel): """ AlertRulesResponse - """ + """ # noqa: E501 data: List[AlertRule] message: Annotated[str, Field(min_length=1, strict=True)] diff --git a/services/observability/src/stackit/observability/models/basic_auth.py b/services/observability/src/stackit/observability/models/basic_auth.py index bfd03e1f..1462ce81 100644 --- a/services/observability/src/stackit/observability/models/basic_auth.py +++ b/services/observability/src/stackit/observability/models/basic_auth.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class BasicAuth(BaseModel): """ BasicAuth - """ + """ # noqa: E501 password: Annotated[str, Field(min_length=1, strict=True, max_length=200)] username: Annotated[str, Field(min_length=1, strict=True, max_length=200)] diff --git a/services/observability/src/stackit/observability/models/create_alert_config_receiver_payload.py b/services/observability/src/stackit/observability/models/create_alert_config_receiver_payload.py index 3a4b9755..e7a18bd0 100644 --- a/services/observability/src/stackit/observability/models/create_alert_config_receiver_payload.py +++ b/services/observability/src/stackit/observability/models/create_alert_config_receiver_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -35,7 +35,7 @@ class CreateAlertConfigReceiverPayload(BaseModel): """ Receivers - """ + """ # noqa: E501 email_configs: Optional[List[CreateAlertConfigReceiverPayloadEmailConfigsInner]] = Field( default=None, description="Email configurations", alias="emailConfigs" diff --git a/services/observability/src/stackit/observability/models/create_alert_config_receiver_payload_email_configs_inner.py b/services/observability/src/stackit/observability/models/create_alert_config_receiver_payload_email_configs_inner.py index 02278ed1..42d527e9 100644 --- a/services/observability/src/stackit/observability/models/create_alert_config_receiver_payload_email_configs_inner.py +++ b/services/observability/src/stackit/observability/models/create_alert_config_receiver_payload_email_configs_inner.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateAlertConfigReceiverPayloadEmailConfigsInner(BaseModel): """ CreateAlertConfigReceiverPayloadEmailConfigsInner - """ + """ # noqa: E501 auth_identity: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field( default=None, diff --git a/services/observability/src/stackit/observability/models/create_alert_config_receiver_payload_opsgenie_configs_inner.py b/services/observability/src/stackit/observability/models/create_alert_config_receiver_payload_opsgenie_configs_inner.py index d97c9c29..704cdf28 100644 --- a/services/observability/src/stackit/observability/models/create_alert_config_receiver_payload_opsgenie_configs_inner.py +++ b/services/observability/src/stackit/observability/models/create_alert_config_receiver_payload_opsgenie_configs_inner.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateAlertConfigReceiverPayloadOpsgenieConfigsInner(BaseModel): """ CreateAlertConfigReceiverPayloadOpsgenieConfigsInner - """ + """ # noqa: E501 api_key: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field( default=None, diff --git a/services/observability/src/stackit/observability/models/create_alert_config_receiver_payload_web_hook_configs_inner.py b/services/observability/src/stackit/observability/models/create_alert_config_receiver_payload_web_hook_configs_inner.py index 9409f802..79a0f412 100644 --- a/services/observability/src/stackit/observability/models/create_alert_config_receiver_payload_web_hook_configs_inner.py +++ b/services/observability/src/stackit/observability/models/create_alert_config_receiver_payload_web_hook_configs_inner.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateAlertConfigReceiverPayloadWebHookConfigsInner(BaseModel): """ CreateAlertConfigReceiverPayloadWebHookConfigsInner - """ + """ # noqa: E501 ms_teams: Optional[StrictBool] = Field( default=False, diff --git a/services/observability/src/stackit/observability/models/create_alert_config_route_payload.py b/services/observability/src/stackit/observability/models/create_alert_config_route_payload.py index c3c63d00..477e05b8 100644 --- a/services/observability/src/stackit/observability/models/create_alert_config_route_payload.py +++ b/services/observability/src/stackit/observability/models/create_alert_config_route_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class CreateAlertConfigRoutePayload(BaseModel): """ The root node of the routing tree. - """ + """ # noqa: E501 var_continue: Optional[StrictBool] = Field( default=False, diff --git a/services/observability/src/stackit/observability/models/create_alert_config_route_payload_routes_inner.py b/services/observability/src/stackit/observability/models/create_alert_config_route_payload_routes_inner.py index 502e8aab..d3b97c16 100644 --- a/services/observability/src/stackit/observability/models/create_alert_config_route_payload_routes_inner.py +++ b/services/observability/src/stackit/observability/models/create_alert_config_route_payload_routes_inner.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateAlertConfigRoutePayloadRoutesInner(BaseModel): """ As in one level above - """ + """ # noqa: E501 var_continue: Optional[StrictBool] = Field(default=False, description="As in one level above", alias="continue") group_by: Optional[List[Annotated[str, Field(min_length=1, strict=True, max_length=200)]]] = Field( diff --git a/services/observability/src/stackit/observability/models/create_alertgroups_payload.py b/services/observability/src/stackit/observability/models/create_alertgroups_payload.py index 5e6d5c34..a6ffa1a4 100644 --- a/services/observability/src/stackit/observability/models/create_alertgroups_payload.py +++ b/services/observability/src/stackit/observability/models/create_alertgroups_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class CreateAlertgroupsPayload(BaseModel): """ Alert group that should be created or updated `Additional Validators:` * total config should not be bigger than 500000 characters as string since this the limitation of prometheus. - """ + """ # noqa: E501 interval: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = Field( default="60s", diff --git a/services/observability/src/stackit/observability/models/create_alertrules_payload.py b/services/observability/src/stackit/observability/models/create_alertrules_payload.py index 94cd5cba..aa659be1 100644 --- a/services/observability/src/stackit/observability/models/create_alertrules_payload.py +++ b/services/observability/src/stackit/observability/models/create_alertrules_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateAlertrulesPayload(BaseModel): """ Alert rule. `Additional Validators:` * total config (all alert groups/rules) should not be bigger than 500000 characters as string since this the limitation of prometheus. - """ + """ # noqa: E501 alert: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field( description="The name of the alert. `Additional Validators:` * is the identifier and so unique in the group * should only include the characters: a-zA-Z0-9-" diff --git a/services/observability/src/stackit/observability/models/create_credentials_response.py b/services/observability/src/stackit/observability/models/create_credentials_response.py index 40ffabd5..f13ac87d 100644 --- a/services/observability/src/stackit/observability/models/create_credentials_response.py +++ b/services/observability/src/stackit/observability/models/create_credentials_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class CreateCredentialsResponse(BaseModel): """ CreateCredentialsResponse - """ + """ # noqa: E501 credentials: Credentials message: Annotated[str, Field(min_length=1, strict=True)] diff --git a/services/observability/src/stackit/observability/models/create_instance_payload.py b/services/observability/src/stackit/observability/models/create_instance_payload.py index 27ad320b..bdd0df64 100644 --- a/services/observability/src/stackit/observability/models/create_instance_payload.py +++ b/services/observability/src/stackit/observability/models/create_instance_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateInstancePayload(BaseModel): """ Create update instance body. - """ + """ # noqa: E501 name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field( default=None, description="Name of the service" diff --git a/services/observability/src/stackit/observability/models/create_instance_response.py b/services/observability/src/stackit/observability/models/create_instance_response.py index f1da7c3d..1b42eda4 100644 --- a/services/observability/src/stackit/observability/models/create_instance_response.py +++ b/services/observability/src/stackit/observability/models/create_instance_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateInstanceResponse(BaseModel): """ CreateInstanceResponse - """ + """ # noqa: E501 dashboard_url: Annotated[str, Field(min_length=1, strict=True)] = Field(alias="dashboardUrl") instance_id: Annotated[str, Field(min_length=1, strict=True)] = Field(alias="instanceId") diff --git a/services/observability/src/stackit/observability/models/create_logs_alertgroups_payload.py b/services/observability/src/stackit/observability/models/create_logs_alertgroups_payload.py index 3ab22d6c..d620dc33 100644 --- a/services/observability/src/stackit/observability/models/create_logs_alertgroups_payload.py +++ b/services/observability/src/stackit/observability/models/create_logs_alertgroups_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class CreateLogsAlertgroupsPayload(BaseModel): """ Alert group that should be created or updated `Additional Validators:` * total config should not be bigger than 500000 characters as string since this the limitation of prometheus. - """ + """ # noqa: E501 interval: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = Field( default="60s", diff --git a/services/observability/src/stackit/observability/models/create_scrape_config_payload.py b/services/observability/src/stackit/observability/models/create_scrape_config_payload.py index 03bce281..1c652980 100644 --- a/services/observability/src/stackit/observability/models/create_scrape_config_payload.py +++ b/services/observability/src/stackit/observability/models/create_scrape_config_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -53,7 +53,7 @@ class CreateScrapeConfigPayload(BaseModel): """ CreateScrapeConfigPayload - """ + """ # noqa: E501 basic_auth: Optional[CreateScrapeConfigPayloadBasicAuth] = Field(default=None, alias="basicAuth") bearer_token: Optional[StrictStr] = Field( diff --git a/services/observability/src/stackit/observability/models/create_scrape_config_payload_basic_auth.py b/services/observability/src/stackit/observability/models/create_scrape_config_payload_basic_auth.py index 1c1aec98..0bbeb8b4 100644 --- a/services/observability/src/stackit/observability/models/create_scrape_config_payload_basic_auth.py +++ b/services/observability/src/stackit/observability/models/create_scrape_config_payload_basic_auth.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateScrapeConfigPayloadBasicAuth(BaseModel): """ Sets the 'Authorization' header on every scrape request with the configured username and password. `Additional Validators:` * if basicAuth is in the body no other authentication method should be in the body - """ + """ # noqa: E501 password: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field( default=None, description="password" diff --git a/services/observability/src/stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner.py b/services/observability/src/stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner.py index 0f8e84b4..191d7491 100644 --- a/services/observability/src/stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner.py +++ b/services/observability/src/stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -35,7 +35,7 @@ class CreateScrapeConfigPayloadHttpSdConfigsInner(BaseModel): """ CreateScrapeConfigPayloadHttpSdConfigsInner - """ + """ # noqa: E501 basic_auth: Optional[CreateScrapeConfigPayloadBasicAuth] = Field(default=None, alias="basicAuth") oauth2: Optional[CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2] = None diff --git a/services/observability/src/stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner_oauth2.py b/services/observability/src/stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner_oauth2.py index 6f421889..c1270e5c 100644 --- a/services/observability/src/stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner_oauth2.py +++ b/services/observability/src/stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner_oauth2.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2(BaseModel): """ OAuth 2.0 authentication using the client credentials grant type. Prometheus fetches an access token from the specified endpoint with the given client access and secret keys. `Additional Validators:` * if oauth2 is in the body no other authentication method should be in the body - """ + """ # noqa: E501 client_id: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field( description="clientId", alias="clientId" diff --git a/services/observability/src/stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config.py b/services/observability/src/stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config.py index e36ffd5b..9b62fd40 100644 --- a/services/observability/src/stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config.py +++ b/services/observability/src/stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig(BaseModel): """ Configures the scrape request's TLS settings. - """ + """ # noqa: E501 insecure_skip_verify: Optional[StrictBool] = Field( default=False, description="Disable validation of the server certificate.", alias="insecureSkipVerify" diff --git a/services/observability/src/stackit/observability/models/create_scrape_config_payload_metrics_relabel_configs_inner.py b/services/observability/src/stackit/observability/models/create_scrape_config_payload_metrics_relabel_configs_inner.py index f74de164..fda5b94f 100644 --- a/services/observability/src/stackit/observability/models/create_scrape_config_payload_metrics_relabel_configs_inner.py +++ b/services/observability/src/stackit/observability/models/create_scrape_config_payload_metrics_relabel_configs_inner.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -33,7 +33,7 @@ class CreateScrapeConfigPayloadMetricsRelabelConfigsInner(BaseModel): """ CreateScrapeConfigPayloadMetricsRelabelConfigsInner - """ + """ # noqa: E501 action: Optional[StrictStr] = Field( default="replace", diff --git a/services/observability/src/stackit/observability/models/create_scrape_config_payload_static_configs_inner.py b/services/observability/src/stackit/observability/models/create_scrape_config_payload_static_configs_inner.py index ca376f39..d99dbddb 100644 --- a/services/observability/src/stackit/observability/models/create_scrape_config_payload_static_configs_inner.py +++ b/services/observability/src/stackit/observability/models/create_scrape_config_payload_static_configs_inner.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateScrapeConfigPayloadStaticConfigsInner(BaseModel): """ CreateScrapeConfigPayloadStaticConfigsInner - """ + """ # noqa: E501 labels: Optional[Dict[str, Any]] = Field( default=None, diff --git a/services/observability/src/stackit/observability/models/credentials.py b/services/observability/src/stackit/observability/models/credentials.py index f5781b10..5836e646 100644 --- a/services/observability/src/stackit/observability/models/credentials.py +++ b/services/observability/src/stackit/observability/models/credentials.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class Credentials(BaseModel): """ Credentials - """ + """ # noqa: E501 password: Annotated[str, Field(min_length=1, strict=True)] username: Annotated[str, Field(min_length=1, strict=True)] diff --git a/services/observability/src/stackit/observability/models/credentials_remote_write_config.py b/services/observability/src/stackit/observability/models/credentials_remote_write_config.py index 325b22ec..ac47031f 100644 --- a/services/observability/src/stackit/observability/models/credentials_remote_write_config.py +++ b/services/observability/src/stackit/observability/models/credentials_remote_write_config.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CredentialsRemoteWriteConfig(BaseModel): """ CredentialsRemoteWriteConfig - """ + """ # noqa: E501 credentials_max_limit: Annotated[int, Field(le=6000000, strict=True, ge=0)] = Field(alias="credentialsMaxLimit") max_limit: Annotated[int, Field(le=6000000, strict=True, ge=0)] = Field(alias="maxLimit") diff --git a/services/observability/src/stackit/observability/models/credentials_remote_write_delete_response.py b/services/observability/src/stackit/observability/models/credentials_remote_write_delete_response.py index 41946631..5f314dfa 100644 --- a/services/observability/src/stackit/observability/models/credentials_remote_write_delete_response.py +++ b/services/observability/src/stackit/observability/models/credentials_remote_write_delete_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CredentialsRemoteWriteDeleteResponse(BaseModel): """ CredentialsRemoteWriteDeleteResponse - """ + """ # noqa: E501 max_limit: Annotated[int, Field(le=6000000, strict=True, ge=0)] = Field(alias="maxLimit") message: Annotated[str, Field(min_length=1, strict=True)] diff --git a/services/observability/src/stackit/observability/models/delete_scrape_config_response.py b/services/observability/src/stackit/observability/models/delete_scrape_config_response.py index bb58f8fe..dd800abb 100644 --- a/services/observability/src/stackit/observability/models/delete_scrape_config_response.py +++ b/services/observability/src/stackit/observability/models/delete_scrape_config_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class DeleteScrapeConfigResponse(BaseModel): """ DeleteScrapeConfigResponse - """ + """ # noqa: E501 data: List[Job] message: Annotated[str, Field(min_length=1, strict=True)] diff --git a/services/observability/src/stackit/observability/models/email_config.py b/services/observability/src/stackit/observability/models/email_config.py index 55abd07c..dca92e68 100644 --- a/services/observability/src/stackit/observability/models/email_config.py +++ b/services/observability/src/stackit/observability/models/email_config.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class EmailConfig(BaseModel): """ EmailConfig - """ + """ # noqa: E501 auth_identity: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field( default=None, alias="authIdentity" diff --git a/services/observability/src/stackit/observability/models/error.py b/services/observability/src/stackit/observability/models/error.py index 3c5bb9d7..8f04197f 100644 --- a/services/observability/src/stackit/observability/models/error.py +++ b/services/observability/src/stackit/observability/models/error.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class Error(BaseModel): """ Error - """ + """ # noqa: E501 errors: Optional[List[Dict[str, Optional[StrictStr]]]] = None message: Annotated[str, Field(min_length=1, strict=True)] diff --git a/services/observability/src/stackit/observability/models/get_alert_configs_response.py b/services/observability/src/stackit/observability/models/get_alert_configs_response.py index 6900d868..8534b2f0 100644 --- a/services/observability/src/stackit/observability/models/get_alert_configs_response.py +++ b/services/observability/src/stackit/observability/models/get_alert_configs_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class GetAlertConfigsResponse(BaseModel): """ GetAlertConfigsResponse - """ + """ # noqa: E501 data: Alert message: Annotated[str, Field(min_length=1, strict=True)] diff --git a/services/observability/src/stackit/observability/models/get_credentials_response.py b/services/observability/src/stackit/observability/models/get_credentials_response.py index b9af79e8..a53cb023 100644 --- a/services/observability/src/stackit/observability/models/get_credentials_response.py +++ b/services/observability/src/stackit/observability/models/get_credentials_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class GetCredentialsResponse(BaseModel): """ GetCredentialsResponse - """ + """ # noqa: E501 credentials_info: Optional[Dict[str, Optional[StrictStr]]] = Field(default=None, alias="credentialsInfo") id: Annotated[str, Field(min_length=1, strict=True, max_length=200)] diff --git a/services/observability/src/stackit/observability/models/get_instance_response.py b/services/observability/src/stackit/observability/models/get_instance_response.py index 02fad79d..86c55e67 100644 --- a/services/observability/src/stackit/observability/models/get_instance_response.py +++ b/services/observability/src/stackit/observability/models/get_instance_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -34,7 +34,7 @@ class GetInstanceResponse(BaseModel): """ GetInstanceResponse - """ + """ # noqa: E501 dashboard_url: Annotated[str, Field(min_length=1, strict=True, max_length=500)] = Field(alias="dashboardUrl") error: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = None diff --git a/services/observability/src/stackit/observability/models/get_metrics_storage_retention_response.py b/services/observability/src/stackit/observability/models/get_metrics_storage_retention_response.py index 1862e457..933549f9 100644 --- a/services/observability/src/stackit/observability/models/get_metrics_storage_retention_response.py +++ b/services/observability/src/stackit/observability/models/get_metrics_storage_retention_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class GetMetricsStorageRetentionResponse(BaseModel): """ GetMetricsStorageRetentionResponse - """ + """ # noqa: E501 message: Annotated[str, Field(min_length=1, strict=True)] metrics_retention_time1h: Annotated[str, Field(min_length=2, strict=True, max_length=8)] = Field( diff --git a/services/observability/src/stackit/observability/models/get_scrape_config_response.py b/services/observability/src/stackit/observability/models/get_scrape_config_response.py index 35b8a844..a79389e5 100644 --- a/services/observability/src/stackit/observability/models/get_scrape_config_response.py +++ b/services/observability/src/stackit/observability/models/get_scrape_config_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class GetScrapeConfigResponse(BaseModel): """ GetScrapeConfigResponse - """ + """ # noqa: E501 data: Job message: Annotated[str, Field(min_length=1, strict=True)] diff --git a/services/observability/src/stackit/observability/models/grafana_configs.py b/services/observability/src/stackit/observability/models/grafana_configs.py index 0852d08e..7dce48af 100644 --- a/services/observability/src/stackit/observability/models/grafana_configs.py +++ b/services/observability/src/stackit/observability/models/grafana_configs.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class GrafanaConfigs(BaseModel): """ GrafanaConfigs - """ + """ # noqa: E501 generic_oauth: Optional[GrafanaOauth] = Field(default=None, alias="genericOauth") message: Annotated[str, Field(min_length=1, strict=True)] diff --git a/services/observability/src/stackit/observability/models/grafana_oauth.py b/services/observability/src/stackit/observability/models/grafana_oauth.py index 2f647993..2513d97f 100644 --- a/services/observability/src/stackit/observability/models/grafana_oauth.py +++ b/services/observability/src/stackit/observability/models/grafana_oauth.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class GrafanaOauth(BaseModel): """ GrafanaOauth - """ + """ # noqa: E501 api_url: Annotated[str, Field(min_length=1, strict=True, max_length=300)] = Field(alias="apiUrl") auth_url: Annotated[str, Field(min_length=1, strict=True, max_length=300)] = Field(alias="authUrl") diff --git a/services/observability/src/stackit/observability/models/http_service_sd.py b/services/observability/src/stackit/observability/models/http_service_sd.py index 548938f1..6a6d4e27 100644 --- a/services/observability/src/stackit/observability/models/http_service_sd.py +++ b/services/observability/src/stackit/observability/models/http_service_sd.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class HTTPServiceSD(BaseModel): """ HTTPServiceSD - """ + """ # noqa: E501 basic_auth: Optional[BasicAuth] = Field(default=None, alias="basicAuth") oauth2: Optional[OAuth2] = None diff --git a/services/observability/src/stackit/observability/models/inhibit_rules.py b/services/observability/src/stackit/observability/models/inhibit_rules.py index 593b1218..3be92229 100644 --- a/services/observability/src/stackit/observability/models/inhibit_rules.py +++ b/services/observability/src/stackit/observability/models/inhibit_rules.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class InhibitRules(BaseModel): """ InhibitRules - """ + """ # noqa: E501 equal: Optional[ Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=200)]], Field(max_length=10)] diff --git a/services/observability/src/stackit/observability/models/instance.py b/services/observability/src/stackit/observability/models/instance.py index 85baa055..e5f08d90 100644 --- a/services/observability/src/stackit/observability/models/instance.py +++ b/services/observability/src/stackit/observability/models/instance.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -34,7 +34,7 @@ class Instance(BaseModel): """ Instance - """ + """ # noqa: E501 cluster: Annotated[str, Field(min_length=1, strict=True, max_length=63)] grafana_public_read_access: StrictBool = Field(alias="grafanaPublicReadAccess") diff --git a/services/observability/src/stackit/observability/models/instance_response.py b/services/observability/src/stackit/observability/models/instance_response.py index 276eb515..f7835c99 100644 --- a/services/observability/src/stackit/observability/models/instance_response.py +++ b/services/observability/src/stackit/observability/models/instance_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class InstanceResponse(BaseModel): """ InstanceResponse - """ + """ # noqa: E501 message: Annotated[str, Field(min_length=1, strict=True)] __properties: ClassVar[List[str]] = ["message"] diff --git a/services/observability/src/stackit/observability/models/instance_sensitive_data.py b/services/observability/src/stackit/observability/models/instance_sensitive_data.py index 1f4ff9d0..b56588ac 100644 --- a/services/observability/src/stackit/observability/models/instance_sensitive_data.py +++ b/services/observability/src/stackit/observability/models/instance_sensitive_data.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class InstanceSensitiveData(BaseModel): """ InstanceSensitiveData - """ + """ # noqa: E501 alerting_url: Annotated[str, Field(min_length=1, strict=True)] = Field(alias="alertingUrl") cluster: Annotated[str, Field(min_length=1, strict=True, max_length=63)] diff --git a/services/observability/src/stackit/observability/models/job.py b/services/observability/src/stackit/observability/models/job.py index fca091d1..0a8956ec 100644 --- a/services/observability/src/stackit/observability/models/job.py +++ b/services/observability/src/stackit/observability/models/job.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -39,7 +39,7 @@ class Job(BaseModel): """ Job - """ + """ # noqa: E501 basic_auth: Optional[BasicAuth] = Field(default=None, alias="basicAuth") bearer_token: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, alias="bearerToken") diff --git a/services/observability/src/stackit/observability/models/list_acl_response.py b/services/observability/src/stackit/observability/models/list_acl_response.py index e0994ef9..c977d3ce 100644 --- a/services/observability/src/stackit/observability/models/list_acl_response.py +++ b/services/observability/src/stackit/observability/models/list_acl_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ListACLResponse(BaseModel): """ ListACLResponse - """ + """ # noqa: E501 acl: List[Annotated[str, Field(min_length=1, strict=True, max_length=100)]] message: Annotated[str, Field(min_length=1, strict=True)] diff --git a/services/observability/src/stackit/observability/models/list_credentials_response.py b/services/observability/src/stackit/observability/models/list_credentials_response.py index 99a6e9d5..7f11beb9 100644 --- a/services/observability/src/stackit/observability/models/list_credentials_response.py +++ b/services/observability/src/stackit/observability/models/list_credentials_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListCredentialsResponse(BaseModel): """ ListCredentialsResponse - """ + """ # noqa: E501 credentials: List[ServiceKeysList] message: Annotated[str, Field(min_length=1, strict=True)] diff --git a/services/observability/src/stackit/observability/models/list_instances_response.py b/services/observability/src/stackit/observability/models/list_instances_response.py index 165824b5..8d1081a1 100644 --- a/services/observability/src/stackit/observability/models/list_instances_response.py +++ b/services/observability/src/stackit/observability/models/list_instances_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListInstancesResponse(BaseModel): """ ListInstancesResponse - """ + """ # noqa: E501 instances: List[ProjectInstanceFull] message: Annotated[str, Field(min_length=1, strict=True)] diff --git a/services/observability/src/stackit/observability/models/list_scrape_configs_response.py b/services/observability/src/stackit/observability/models/list_scrape_configs_response.py index 18dc422e..a39f1ccd 100644 --- a/services/observability/src/stackit/observability/models/list_scrape_configs_response.py +++ b/services/observability/src/stackit/observability/models/list_scrape_configs_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListScrapeConfigsResponse(BaseModel): """ ListScrapeConfigsResponse - """ + """ # noqa: E501 data: List[Job] message: Annotated[str, Field(min_length=1, strict=True)] diff --git a/services/observability/src/stackit/observability/models/message.py b/services/observability/src/stackit/observability/models/message.py index 809fa782..4bdc419d 100644 --- a/services/observability/src/stackit/observability/models/message.py +++ b/services/observability/src/stackit/observability/models/message.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class Message(BaseModel): """ Message - """ + """ # noqa: E501 message: Annotated[str, Field(min_length=1, strict=True)] __properties: ClassVar[List[str]] = ["message"] diff --git a/services/observability/src/stackit/observability/models/metrics_relabel_config.py b/services/observability/src/stackit/observability/models/metrics_relabel_config.py index 3a3360aa..3349fa34 100644 --- a/services/observability/src/stackit/observability/models/metrics_relabel_config.py +++ b/services/observability/src/stackit/observability/models/metrics_relabel_config.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class MetricsRelabelConfig(BaseModel): """ MetricsRelabelConfig - """ + """ # noqa: E501 action: Optional[StrictStr] = "replace" modulus: Optional[Annotated[int, Field(le=200, strict=True)]] = None diff --git a/services/observability/src/stackit/observability/models/model_global.py b/services/observability/src/stackit/observability/models/model_global.py index 2bda3b22..9ddb3746 100644 --- a/services/observability/src/stackit/observability/models/model_global.py +++ b/services/observability/src/stackit/observability/models/model_global.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ModelGlobal(BaseModel): """ ModelGlobal - """ + """ # noqa: E501 opsgenie_api_key: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field( default=None, alias="opsgenieApiKey" diff --git a/services/observability/src/stackit/observability/models/o_auth2.py b/services/observability/src/stackit/observability/models/o_auth2.py index 7c4241f9..4adec4cb 100644 --- a/services/observability/src/stackit/observability/models/o_auth2.py +++ b/services/observability/src/stackit/observability/models/o_auth2.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class OAuth2(BaseModel): """ OAuth2 - """ + """ # noqa: E501 client_id: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field(alias="clientId") client_secret: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field(alias="clientSecret") diff --git a/services/observability/src/stackit/observability/models/opsgenie_config.py b/services/observability/src/stackit/observability/models/opsgenie_config.py index 97c34b5f..0fcc786f 100644 --- a/services/observability/src/stackit/observability/models/opsgenie_config.py +++ b/services/observability/src/stackit/observability/models/opsgenie_config.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class OpsgenieConfig(BaseModel): """ OpsgenieConfig - """ + """ # noqa: E501 api_key: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field( default=None, alias="apiKey" diff --git a/services/observability/src/stackit/observability/models/permission_denied.py b/services/observability/src/stackit/observability/models/permission_denied.py index 642f3814..71dc55d6 100644 --- a/services/observability/src/stackit/observability/models/permission_denied.py +++ b/services/observability/src/stackit/observability/models/permission_denied.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class PermissionDenied(BaseModel): """ PermissionDenied - """ + """ # noqa: E501 detail: Annotated[str, Field(min_length=1, strict=True)] __properties: ClassVar[List[str]] = ["detail"] diff --git a/services/observability/src/stackit/observability/models/plan.py b/services/observability/src/stackit/observability/models/plan.py index 1571c62b..08b99c3a 100644 --- a/services/observability/src/stackit/observability/models/plan.py +++ b/services/observability/src/stackit/observability/models/plan.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class Plan(BaseModel): """ Plan - """ + """ # noqa: E501 alert_matchers: StrictInt = Field(alias="alertMatchers") alert_receivers: StrictInt = Field(alias="alertReceivers") diff --git a/services/observability/src/stackit/observability/models/plan_model.py b/services/observability/src/stackit/observability/models/plan_model.py index 96312320..80637429 100644 --- a/services/observability/src/stackit/observability/models/plan_model.py +++ b/services/observability/src/stackit/observability/models/plan_model.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class PlanModel(BaseModel): """ PlanModel - """ + """ # noqa: E501 alert_matchers: StrictInt = Field(alias="alertMatchers") alert_receivers: StrictInt = Field(alias="alertReceivers") diff --git a/services/observability/src/stackit/observability/models/plans_response.py b/services/observability/src/stackit/observability/models/plans_response.py index 2e968685..e65a6c08 100644 --- a/services/observability/src/stackit/observability/models/plans_response.py +++ b/services/observability/src/stackit/observability/models/plans_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class PlansResponse(BaseModel): """ PlansResponse - """ + """ # noqa: E501 message: Annotated[str, Field(min_length=1, strict=True)] plans: List[Plan] diff --git a/services/observability/src/stackit/observability/models/project_instance_full.py b/services/observability/src/stackit/observability/models/project_instance_full.py index 0c2713e5..28ec205f 100644 --- a/services/observability/src/stackit/observability/models/project_instance_full.py +++ b/services/observability/src/stackit/observability/models/project_instance_full.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ProjectInstanceFull(BaseModel): """ ProjectInstanceFull - """ + """ # noqa: E501 error: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = None id: Annotated[str, Field(min_length=1, strict=True)] diff --git a/services/observability/src/stackit/observability/models/receiver.py b/services/observability/src/stackit/observability/models/receiver.py index 060e6077..28ed13c2 100644 --- a/services/observability/src/stackit/observability/models/receiver.py +++ b/services/observability/src/stackit/observability/models/receiver.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class Receiver(BaseModel): """ Receiver - """ + """ # noqa: E501 data: Receivers message: Annotated[str, Field(min_length=1, strict=True)] diff --git a/services/observability/src/stackit/observability/models/receivers.py b/services/observability/src/stackit/observability/models/receivers.py index c75dc8ab..419d97fa 100644 --- a/services/observability/src/stackit/observability/models/receivers.py +++ b/services/observability/src/stackit/observability/models/receivers.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class Receivers(BaseModel): """ Receivers - """ + """ # noqa: E501 email_configs: Optional[List[EmailConfig]] = Field(default=None, alias="emailConfigs") name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] diff --git a/services/observability/src/stackit/observability/models/route.py b/services/observability/src/stackit/observability/models/route.py index 098b369e..765eacdd 100644 --- a/services/observability/src/stackit/observability/models/route.py +++ b/services/observability/src/stackit/observability/models/route.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class Route(BaseModel): """ Route - """ + """ # noqa: E501 var_continue: Optional[StrictBool] = Field(default=False, alias="continue") group_by: Optional[ diff --git a/services/observability/src/stackit/observability/models/route_serializer.py b/services/observability/src/stackit/observability/models/route_serializer.py index 93f25b22..e6abf232 100644 --- a/services/observability/src/stackit/observability/models/route_serializer.py +++ b/services/observability/src/stackit/observability/models/route_serializer.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class RouteSerializer(BaseModel): """ RouteSerializer - """ + """ # noqa: E501 var_continue: Optional[StrictBool] = Field(default=False, alias="continue") group_by: Optional[ diff --git a/services/observability/src/stackit/observability/models/scrape_configs_response.py b/services/observability/src/stackit/observability/models/scrape_configs_response.py index 5f12f852..b9fd95b9 100644 --- a/services/observability/src/stackit/observability/models/scrape_configs_response.py +++ b/services/observability/src/stackit/observability/models/scrape_configs_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ScrapeConfigsResponse(BaseModel): """ ScrapeConfigsResponse - """ + """ # noqa: E501 data: List[Job] message: Annotated[str, Field(min_length=1, strict=True)] diff --git a/services/observability/src/stackit/observability/models/service_keys_list.py b/services/observability/src/stackit/observability/models/service_keys_list.py index 3c5fe3b9..bad3ed68 100644 --- a/services/observability/src/stackit/observability/models/service_keys_list.py +++ b/services/observability/src/stackit/observability/models/service_keys_list.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ServiceKeysList(BaseModel): """ ServiceKeysList - """ + """ # noqa: E501 credentials_info: Optional[Dict[str, Optional[StrictStr]]] = Field(default=None, alias="credentialsInfo") id: Annotated[str, Field(min_length=1, strict=True, max_length=200)] diff --git a/services/observability/src/stackit/observability/models/static_configs.py b/services/observability/src/stackit/observability/models/static_configs.py index 97ddb520..1e7fe41d 100644 --- a/services/observability/src/stackit/observability/models/static_configs.py +++ b/services/observability/src/stackit/observability/models/static_configs.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class StaticConfigs(BaseModel): """ StaticConfigs - """ + """ # noqa: E501 labels: Optional[Dict[str, Annotated[str, Field(min_length=1, strict=True)]]] = None targets: List[Annotated[str, Field(min_length=1, strict=True, max_length=400)]] diff --git a/services/observability/src/stackit/observability/models/tls_config.py b/services/observability/src/stackit/observability/models/tls_config.py index de424ece..f65a9a07 100644 --- a/services/observability/src/stackit/observability/models/tls_config.py +++ b/services/observability/src/stackit/observability/models/tls_config.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class TLSConfig(BaseModel): """ TLSConfig - """ + """ # noqa: E501 insecure_skip_verify: Optional[StrictBool] = Field(default=False, alias="insecureSkipVerify") __properties: ClassVar[List[str]] = ["insecureSkipVerify"] diff --git a/services/observability/src/stackit/observability/models/update_acl_payload.py b/services/observability/src/stackit/observability/models/update_acl_payload.py index f1572474..aacccfc1 100644 --- a/services/observability/src/stackit/observability/models/update_acl_payload.py +++ b/services/observability/src/stackit/observability/models/update_acl_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class UpdateACLPayload(BaseModel): """ List of cidr. Send empty string to remove acl. - """ + """ # noqa: E501 acl: List[Annotated[str, Field(strict=True, max_length=100)]] = Field(description="list of cidr") __properties: ClassVar[List[str]] = ["acl"] diff --git a/services/observability/src/stackit/observability/models/update_alert_config_receiver_payload.py b/services/observability/src/stackit/observability/models/update_alert_config_receiver_payload.py index c1ecff13..a545fd2c 100644 --- a/services/observability/src/stackit/observability/models/update_alert_config_receiver_payload.py +++ b/services/observability/src/stackit/observability/models/update_alert_config_receiver_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -35,7 +35,7 @@ class UpdateAlertConfigReceiverPayload(BaseModel): """ Receivers - """ + """ # noqa: E501 email_configs: Optional[List[CreateAlertConfigReceiverPayloadEmailConfigsInner]] = Field( default=None, description="Email configurations", alias="emailConfigs" diff --git a/services/observability/src/stackit/observability/models/update_alert_config_route_payload.py b/services/observability/src/stackit/observability/models/update_alert_config_route_payload.py index f6785939..bc06d189 100644 --- a/services/observability/src/stackit/observability/models/update_alert_config_route_payload.py +++ b/services/observability/src/stackit/observability/models/update_alert_config_route_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class UpdateAlertConfigRoutePayload(BaseModel): """ The root node of the routing tree. - """ + """ # noqa: E501 var_continue: Optional[StrictBool] = Field( default=False, diff --git a/services/observability/src/stackit/observability/models/update_alert_configs_payload.py b/services/observability/src/stackit/observability/models/update_alert_configs_payload.py index 73861b46..e7047205 100644 --- a/services/observability/src/stackit/observability/models/update_alert_configs_payload.py +++ b/services/observability/src/stackit/observability/models/update_alert_configs_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -38,7 +38,7 @@ class UpdateAlertConfigsPayload(BaseModel): """ Alert config - """ + """ # noqa: E501 var_global: Optional[UpdateAlertConfigsPayloadGlobal] = Field(default=None, alias="global") inhibit_rules: Optional[UpdateAlertConfigsPayloadInhibitRules] = Field(default=None, alias="inhibitRules") diff --git a/services/observability/src/stackit/observability/models/update_alert_configs_payload_global.py b/services/observability/src/stackit/observability/models/update_alert_configs_payload_global.py index b001f804..fd2bff10 100644 --- a/services/observability/src/stackit/observability/models/update_alert_configs_payload_global.py +++ b/services/observability/src/stackit/observability/models/update_alert_configs_payload_global.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class UpdateAlertConfigsPayloadGlobal(BaseModel): """ Global config. If nothing passed the default argus config will be used. - """ + """ # noqa: E501 opsgenie_api_key: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field( default=None, diff --git a/services/observability/src/stackit/observability/models/update_alert_configs_payload_inhibit_rules.py b/services/observability/src/stackit/observability/models/update_alert_configs_payload_inhibit_rules.py index e94cea13..f8e22046 100644 --- a/services/observability/src/stackit/observability/models/update_alert_configs_payload_inhibit_rules.py +++ b/services/observability/src/stackit/observability/models/update_alert_configs_payload_inhibit_rules.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class UpdateAlertConfigsPayloadInhibitRules(BaseModel): """ A list of inhibition rules. - """ + """ # noqa: E501 equal: Optional[List[Annotated[str, Field(min_length=1, strict=True, max_length=200)]]] = Field( default=None, diff --git a/services/observability/src/stackit/observability/models/update_alert_configs_payload_receivers_inner.py b/services/observability/src/stackit/observability/models/update_alert_configs_payload_receivers_inner.py index 3c097250..bd5ab5a5 100644 --- a/services/observability/src/stackit/observability/models/update_alert_configs_payload_receivers_inner.py +++ b/services/observability/src/stackit/observability/models/update_alert_configs_payload_receivers_inner.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -35,7 +35,7 @@ class UpdateAlertConfigsPayloadReceiversInner(BaseModel): """ Receivers - """ + """ # noqa: E501 email_configs: Optional[List[CreateAlertConfigReceiverPayloadEmailConfigsInner]] = Field( default=None, description="Email configurations", alias="emailConfigs" diff --git a/services/observability/src/stackit/observability/models/update_alert_configs_payload_route.py b/services/observability/src/stackit/observability/models/update_alert_configs_payload_route.py index 132a4903..fa3616e2 100644 --- a/services/observability/src/stackit/observability/models/update_alert_configs_payload_route.py +++ b/services/observability/src/stackit/observability/models/update_alert_configs_payload_route.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class UpdateAlertConfigsPayloadRoute(BaseModel): """ The root node of the routing tree. - """ + """ # noqa: E501 var_continue: Optional[StrictBool] = Field( default=False, diff --git a/services/observability/src/stackit/observability/models/update_alert_configs_response.py b/services/observability/src/stackit/observability/models/update_alert_configs_response.py index de8f1610..9d955fca 100644 --- a/services/observability/src/stackit/observability/models/update_alert_configs_response.py +++ b/services/observability/src/stackit/observability/models/update_alert_configs_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class UpdateAlertConfigsResponse(BaseModel): """ UpdateAlertConfigsResponse - """ + """ # noqa: E501 data: Alert message: Annotated[str, Field(min_length=1, strict=True)] diff --git a/services/observability/src/stackit/observability/models/update_alertgroup_payload.py b/services/observability/src/stackit/observability/models/update_alertgroup_payload.py index b387f61f..8a74a297 100644 --- a/services/observability/src/stackit/observability/models/update_alertgroup_payload.py +++ b/services/observability/src/stackit/observability/models/update_alertgroup_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class UpdateAlertgroupPayload(BaseModel): """ Alert group that should be created or updated `Additional Validators:` * total config should not be bigger than 500000 characters as string since this the limitation of prometheus. - """ + """ # noqa: E501 interval: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = Field( default="60s", diff --git a/services/observability/src/stackit/observability/models/update_alertgroups_request_inner.py b/services/observability/src/stackit/observability/models/update_alertgroups_request_inner.py index 7ee1ed1e..0fd8000b 100644 --- a/services/observability/src/stackit/observability/models/update_alertgroups_request_inner.py +++ b/services/observability/src/stackit/observability/models/update_alertgroups_request_inner.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class UpdateAlertgroupsRequestInner(BaseModel): """ Alert group that should be created or updated `Additional Validators:` * total config should not be bigger than 500000 characters as string since this the limitation of prometheus. - """ + """ # noqa: E501 interval: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = Field( default="60s", diff --git a/services/observability/src/stackit/observability/models/update_alertgroups_request_inner_rules_inner.py b/services/observability/src/stackit/observability/models/update_alertgroups_request_inner_rules_inner.py index 0c0796cf..97c6ad3a 100644 --- a/services/observability/src/stackit/observability/models/update_alertgroups_request_inner_rules_inner.py +++ b/services/observability/src/stackit/observability/models/update_alertgroups_request_inner_rules_inner.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class UpdateAlertgroupsRequestInnerRulesInner(BaseModel): """ Alert rule. `Additional Validators:` * total config (all alert groups/rules) should not be bigger than 500000 characters as string since this the limitation of prometheus. - """ + """ # noqa: E501 alert: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field( description="The name of the alert. `Additional Validators:` * is the identifier and so unique in the group * should only include the characters: a-zA-Z0-9-" diff --git a/services/observability/src/stackit/observability/models/update_credentials_remote_write_config_payload.py b/services/observability/src/stackit/observability/models/update_credentials_remote_write_config_payload.py index bbd61177..c2827dec 100644 --- a/services/observability/src/stackit/observability/models/update_credentials_remote_write_config_payload.py +++ b/services/observability/src/stackit/observability/models/update_credentials_remote_write_config_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class UpdateCredentialsRemoteWriteConfigPayload(BaseModel): """ Remote write limit config. - """ + """ # noqa: E501 max_limit: Optional[Union[StrictFloat, StrictInt]] = Field( default=None, diff --git a/services/observability/src/stackit/observability/models/update_grafana_configs_payload.py b/services/observability/src/stackit/observability/models/update_grafana_configs_payload.py index d7fd370b..3dba7b3f 100644 --- a/services/observability/src/stackit/observability/models/update_grafana_configs_payload.py +++ b/services/observability/src/stackit/observability/models/update_grafana_configs_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class UpdateGrafanaConfigsPayload(BaseModel): """ Sending any of the attributes results in a set of the attribute and overwrites any previous configuration. - """ + """ # noqa: E501 generic_oauth: Optional[UpdateGrafanaConfigsPayloadGenericOauth] = Field(default=None, alias="genericOauth") public_read_access: Optional[StrictBool] = Field( diff --git a/services/observability/src/stackit/observability/models/update_grafana_configs_payload_generic_oauth.py b/services/observability/src/stackit/observability/models/update_grafana_configs_payload_generic_oauth.py index b0e8b9ae..fdb02e5f 100644 --- a/services/observability/src/stackit/observability/models/update_grafana_configs_payload_generic_oauth.py +++ b/services/observability/src/stackit/observability/models/update_grafana_configs_payload_generic_oauth.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class UpdateGrafanaConfigsPayloadGenericOauth(BaseModel): """ UpdateGrafanaConfigsPayloadGenericOauth - """ + """ # noqa: E501 api_url: StrictStr = Field( description="Set api_url to the resource that returns OpenID UserInfo compatible information.", alias="apiUrl" diff --git a/services/observability/src/stackit/observability/models/update_instance_payload.py b/services/observability/src/stackit/observability/models/update_instance_payload.py index ba6e26b2..eb13a810 100644 --- a/services/observability/src/stackit/observability/models/update_instance_payload.py +++ b/services/observability/src/stackit/observability/models/update_instance_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class UpdateInstancePayload(BaseModel): """ Create update instance body. - """ + """ # noqa: E501 name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field( default=None, description="Name of the service" diff --git a/services/observability/src/stackit/observability/models/update_logs_alertgroup_payload.py b/services/observability/src/stackit/observability/models/update_logs_alertgroup_payload.py index e7b9b823..5971c7e5 100644 --- a/services/observability/src/stackit/observability/models/update_logs_alertgroup_payload.py +++ b/services/observability/src/stackit/observability/models/update_logs_alertgroup_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class UpdateLogsAlertgroupPayload(BaseModel): """ Alert group that should be created or updated `Additional Validators:` * total config should not be bigger than 500000 characters as string since this the limitation of prometheus. - """ + """ # noqa: E501 interval: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = Field( default="60s", diff --git a/services/observability/src/stackit/observability/models/update_metrics_storage_retention_payload.py b/services/observability/src/stackit/observability/models/update_metrics_storage_retention_payload.py index 765b723d..589a4327 100644 --- a/services/observability/src/stackit/observability/models/update_metrics_storage_retention_payload.py +++ b/services/observability/src/stackit/observability/models/update_metrics_storage_retention_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class UpdateMetricsStorageRetentionPayload(BaseModel): """ UpdateMetricsStorageRetentionPayload - """ + """ # noqa: E501 metrics_retention_time1h: Annotated[str, Field(min_length=2, strict=True, max_length=8)] = Field( description="Retention time of longtime storage of 1h sampled data. After that time the data will be deleted permanently. `Additional Validators:` * Should be a valid time string * Should not be bigger than metricsRetentionTime5m", diff --git a/services/observability/src/stackit/observability/models/update_scrape_config_payload.py b/services/observability/src/stackit/observability/models/update_scrape_config_payload.py index 8879f2fa..7ef271f4 100644 --- a/services/observability/src/stackit/observability/models/update_scrape_config_payload.py +++ b/services/observability/src/stackit/observability/models/update_scrape_config_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -47,7 +47,7 @@ class UpdateScrapeConfigPayload(BaseModel): """ UpdateScrapeConfigPayload - """ + """ # noqa: E501 basic_auth: Optional[CreateScrapeConfigPayloadBasicAuth] = Field(default=None, alias="basicAuth") bearer_token: Optional[StrictStr] = Field( diff --git a/services/observability/src/stackit/observability/models/update_scrape_config_payload_static_configs_inner.py b/services/observability/src/stackit/observability/models/update_scrape_config_payload_static_configs_inner.py index 682cdf16..c33363a9 100644 --- a/services/observability/src/stackit/observability/models/update_scrape_config_payload_static_configs_inner.py +++ b/services/observability/src/stackit/observability/models/update_scrape_config_payload_static_configs_inner.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class UpdateScrapeConfigPayloadStaticConfigsInner(BaseModel): """ UpdateScrapeConfigPayloadStaticConfigsInner - """ + """ # noqa: E501 labels: Optional[Dict[str, Any]] = Field( default=None, diff --git a/services/observability/src/stackit/observability/models/web_hook.py b/services/observability/src/stackit/observability/models/web_hook.py index e40457b4..6c3705fd 100644 --- a/services/observability/src/stackit/observability/models/web_hook.py +++ b/services/observability/src/stackit/observability/models/web_hook.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class WebHook(BaseModel): """ WebHook - """ + """ # noqa: E501 ms_teams: Optional[StrictBool] = Field(default=False, alias="msTeams") send_resolved: Optional[StrictBool] = Field(default=True, alias="sendResolved") diff --git a/services/observability/src/stackit/observability/rest.py b/services/observability/src/stackit/observability/rest.py index ed5f0826..f504719e 100644 --- a/services/observability/src/stackit/observability/rest.py +++ b/services/observability/src/stackit/observability/rest.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -125,7 +125,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/opensearch/CHANGELOG.md b/services/opensearch/CHANGELOG.md index 84856efa..3d7c20e9 100644 --- a/services/opensearch/CHANGELOG.md +++ b/services/opensearch/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.3.1 +- **Internal:** Improve deserializing and error types + ## v0.3.0 - **Breaking change:** Attribute `tls_protocols` of `InstanceParameters` model is now of type `List[StrictStr]` (previously `StrictStr`) diff --git a/services/opensearch/pyproject.toml b/services/opensearch/pyproject.toml index a716e022..f308d29d 100644 --- a/services/opensearch/pyproject.toml +++ b/services/opensearch/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-opensearch" [tool.poetry] name = "stackit-opensearch" -version = "v0.3.0" +version = "v0.3.1" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/opensearch/src/stackit/opensearch/__init__.py b/services/opensearch/src/stackit/opensearch/__init__.py index 07142860..0004633d 100644 --- a/services/opensearch/src/stackit/opensearch/__init__.py +++ b/services/opensearch/src/stackit/opensearch/__init__.py @@ -11,60 +11,125 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "Backup", + "CreateBackupResponseItem", + "CreateInstancePayload", + "CreateInstanceResponse", + "Credentials", + "CredentialsListItem", + "CredentialsResponse", + "Error", + "GetMetricsResponse", + "Instance", + "InstanceLastOperation", + "InstanceParameters", + "InstanceSchema", + "ListBackupsResponse", + "ListCredentialsResponse", + "ListInstancesResponse", + "ListOfferingsResponse", + "ListRestoresResponse", + "ModelSchema", + "Offering", + "PartialUpdateInstancePayload", + "Plan", + "RawCredentials", + "Restore", + "TriggerRestoreResponse", + "UpdateBackupsConfigPayload", + "UpdateBackupsConfigResponse", +] + # import apis into sdk package -from stackit.opensearch.api.default_api import DefaultApi -from stackit.opensearch.api_client import ApiClient +from stackit.opensearch.api.default_api import DefaultApi as DefaultApi +from stackit.opensearch.api_client import ApiClient as ApiClient # import ApiClient -from stackit.opensearch.api_response import ApiResponse -from stackit.opensearch.configuration import HostConfiguration -from stackit.opensearch.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.opensearch.api_response import ApiResponse as ApiResponse +from stackit.opensearch.configuration import HostConfiguration as HostConfiguration +from stackit.opensearch.exceptions import ApiAttributeError as ApiAttributeError +from stackit.opensearch.exceptions import ApiException as ApiException +from stackit.opensearch.exceptions import ApiKeyError as ApiKeyError +from stackit.opensearch.exceptions import ApiTypeError as ApiTypeError +from stackit.opensearch.exceptions import ApiValueError as ApiValueError +from stackit.opensearch.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.opensearch.models.backup import Backup +from stackit.opensearch.models.backup import Backup as Backup from stackit.opensearch.models.create_backup_response_item import ( - CreateBackupResponseItem, -) -from stackit.opensearch.models.create_instance_payload import CreateInstancePayload -from stackit.opensearch.models.create_instance_response import CreateInstanceResponse -from stackit.opensearch.models.credentials import Credentials -from stackit.opensearch.models.credentials_list_item import CredentialsListItem -from stackit.opensearch.models.credentials_response import CredentialsResponse -from stackit.opensearch.models.error import Error -from stackit.opensearch.models.get_metrics_response import GetMetricsResponse -from stackit.opensearch.models.instance import Instance -from stackit.opensearch.models.instance_last_operation import InstanceLastOperation -from stackit.opensearch.models.instance_parameters import InstanceParameters -from stackit.opensearch.models.instance_schema import InstanceSchema -from stackit.opensearch.models.list_backups_response import ListBackupsResponse -from stackit.opensearch.models.list_credentials_response import ListCredentialsResponse -from stackit.opensearch.models.list_instances_response import ListInstancesResponse -from stackit.opensearch.models.list_offerings_response import ListOfferingsResponse -from stackit.opensearch.models.list_restores_response import ListRestoresResponse -from stackit.opensearch.models.model_schema import ModelSchema -from stackit.opensearch.models.offering import Offering + CreateBackupResponseItem as CreateBackupResponseItem, +) +from stackit.opensearch.models.create_instance_payload import ( + CreateInstancePayload as CreateInstancePayload, +) +from stackit.opensearch.models.create_instance_response import ( + CreateInstanceResponse as CreateInstanceResponse, +) +from stackit.opensearch.models.credentials import Credentials as Credentials +from stackit.opensearch.models.credentials_list_item import ( + CredentialsListItem as CredentialsListItem, +) +from stackit.opensearch.models.credentials_response import ( + CredentialsResponse as CredentialsResponse, +) +from stackit.opensearch.models.error import Error as Error +from stackit.opensearch.models.get_metrics_response import ( + GetMetricsResponse as GetMetricsResponse, +) +from stackit.opensearch.models.instance import Instance as Instance +from stackit.opensearch.models.instance_last_operation import ( + InstanceLastOperation as InstanceLastOperation, +) +from stackit.opensearch.models.instance_parameters import ( + InstanceParameters as InstanceParameters, +) +from stackit.opensearch.models.instance_schema import InstanceSchema as InstanceSchema +from stackit.opensearch.models.list_backups_response import ( + ListBackupsResponse as ListBackupsResponse, +) +from stackit.opensearch.models.list_credentials_response import ( + ListCredentialsResponse as ListCredentialsResponse, +) +from stackit.opensearch.models.list_instances_response import ( + ListInstancesResponse as ListInstancesResponse, +) +from stackit.opensearch.models.list_offerings_response import ( + ListOfferingsResponse as ListOfferingsResponse, +) +from stackit.opensearch.models.list_restores_response import ( + ListRestoresResponse as ListRestoresResponse, +) +from stackit.opensearch.models.model_schema import ModelSchema as ModelSchema +from stackit.opensearch.models.offering import Offering as Offering from stackit.opensearch.models.partial_update_instance_payload import ( - PartialUpdateInstancePayload, + PartialUpdateInstancePayload as PartialUpdateInstancePayload, +) +from stackit.opensearch.models.plan import Plan as Plan +from stackit.opensearch.models.raw_credentials import RawCredentials as RawCredentials +from stackit.opensearch.models.restore import Restore as Restore +from stackit.opensearch.models.trigger_restore_response import ( + TriggerRestoreResponse as TriggerRestoreResponse, ) -from stackit.opensearch.models.plan import Plan -from stackit.opensearch.models.raw_credentials import RawCredentials -from stackit.opensearch.models.restore import Restore -from stackit.opensearch.models.trigger_restore_response import TriggerRestoreResponse from stackit.opensearch.models.update_backups_config_payload import ( - UpdateBackupsConfigPayload, + UpdateBackupsConfigPayload as UpdateBackupsConfigPayload, ) from stackit.opensearch.models.update_backups_config_response import ( - UpdateBackupsConfigResponse, + UpdateBackupsConfigResponse as UpdateBackupsConfigResponse, ) diff --git a/services/opensearch/src/stackit/opensearch/api/default_api.py b/services/opensearch/src/stackit/opensearch/api/default_api.py index bfca9705..8dabfd95 100644 --- a/services/opensearch/src/stackit/opensearch/api/default_api.py +++ b/services/opensearch/src/stackit/opensearch/api/default_api.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -106,7 +106,7 @@ def create_backup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_backup_serialize( instance_id=instance_id, @@ -171,7 +171,7 @@ def create_backup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_backup_serialize( instance_id=instance_id, @@ -236,7 +236,7 @@ def create_backup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_backup_serialize( instance_id=instance_id, @@ -273,7 +273,7 @@ def _create_backup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -351,7 +351,7 @@ def create_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( project_id=project_id, @@ -416,7 +416,7 @@ def create_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( project_id=project_id, @@ -481,7 +481,7 @@ def create_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( project_id=project_id, @@ -517,7 +517,7 @@ def _create_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -597,7 +597,7 @@ def create_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -665,7 +665,7 @@ def create_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -733,7 +733,7 @@ def create_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -770,7 +770,7 @@ def _create_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -859,7 +859,7 @@ def delete_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( project_id=project_id, @@ -928,7 +928,7 @@ def delete_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( project_id=project_id, @@ -997,7 +997,7 @@ def delete_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( project_id=project_id, @@ -1035,7 +1035,7 @@ def _delete_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1115,7 +1115,7 @@ def delete_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1181,7 +1181,7 @@ def delete_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1247,7 +1247,7 @@ def delete_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1284,7 +1284,7 @@ def _delete_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1364,7 +1364,7 @@ def download_backup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._download_backup_serialize( backup_id=backup_id, @@ -1432,7 +1432,7 @@ def download_backup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._download_backup_serialize( backup_id=backup_id, @@ -1500,7 +1500,7 @@ def download_backup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._download_backup_serialize( backup_id=backup_id, @@ -1538,7 +1538,7 @@ def _download_backup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1623,7 +1623,7 @@ def get_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( project_id=project_id, @@ -1692,7 +1692,7 @@ def get_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( project_id=project_id, @@ -1761,7 +1761,7 @@ def get_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( project_id=project_id, @@ -1799,7 +1799,7 @@ def _get_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1879,7 +1879,7 @@ def get_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -1945,7 +1945,7 @@ def get_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -2011,7 +2011,7 @@ def get_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -2048,7 +2048,7 @@ def _get_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2125,7 +2125,7 @@ def get_metrics( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_metrics_serialize( instance_id=instance_id, @@ -2189,7 +2189,7 @@ def get_metrics_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_metrics_serialize( instance_id=instance_id, @@ -2253,7 +2253,7 @@ def get_metrics_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_metrics_serialize( instance_id=instance_id, @@ -2289,7 +2289,7 @@ def _get_metrics_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2366,7 +2366,7 @@ def list_backups( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( instance_id=instance_id, @@ -2430,7 +2430,7 @@ def list_backups_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( instance_id=instance_id, @@ -2494,7 +2494,7 @@ def list_backups_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( instance_id=instance_id, @@ -2530,7 +2530,7 @@ def _list_backups_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2608,7 +2608,7 @@ def list_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( project_id=project_id, @@ -2673,7 +2673,7 @@ def list_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( project_id=project_id, @@ -2738,7 +2738,7 @@ def list_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( project_id=project_id, @@ -2774,7 +2774,7 @@ def _list_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2849,7 +2849,7 @@ def list_instances( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -2910,7 +2910,7 @@ def list_instances_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -2971,7 +2971,7 @@ def list_instances_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -3005,7 +3005,7 @@ def _list_instances_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3078,7 +3078,7 @@ def list_offerings( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_offerings_serialize( project_id=project_id, @@ -3138,7 +3138,7 @@ def list_offerings_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_offerings_serialize( project_id=project_id, @@ -3198,7 +3198,7 @@ def list_offerings_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_offerings_serialize( project_id=project_id, @@ -3231,7 +3231,7 @@ def _list_offerings_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3306,7 +3306,7 @@ def list_restores( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_restores_serialize( instance_id=instance_id, @@ -3370,7 +3370,7 @@ def list_restores_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_restores_serialize( instance_id=instance_id, @@ -3434,7 +3434,7 @@ def list_restores_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_restores_serialize( instance_id=instance_id, @@ -3470,7 +3470,7 @@ def _list_restores_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3556,7 +3556,7 @@ def partial_update_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_instance_serialize( project_id=project_id, @@ -3631,7 +3631,7 @@ def partial_update_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_instance_serialize( project_id=project_id, @@ -3706,7 +3706,7 @@ def partial_update_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_instance_serialize( project_id=project_id, @@ -3745,7 +3745,7 @@ def _partial_update_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3832,7 +3832,7 @@ def trigger_recreate( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_recreate_serialize( instance_id=instance_id, @@ -3897,7 +3897,7 @@ def trigger_recreate_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_recreate_serialize( instance_id=instance_id, @@ -3962,7 +3962,7 @@ def trigger_recreate_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_recreate_serialize( instance_id=instance_id, @@ -3999,7 +3999,7 @@ def _trigger_recreate_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4076,7 +4076,7 @@ def trigger_restart( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restart_serialize( instance_id=instance_id, @@ -4141,7 +4141,7 @@ def trigger_restart_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restart_serialize( instance_id=instance_id, @@ -4206,7 +4206,7 @@ def trigger_restart_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restart_serialize( instance_id=instance_id, @@ -4243,7 +4243,7 @@ def _trigger_restart_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4323,7 +4323,7 @@ def trigger_restore( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restore_serialize( instance_id=instance_id, @@ -4392,7 +4392,7 @@ def trigger_restore_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restore_serialize( instance_id=instance_id, @@ -4461,7 +4461,7 @@ def trigger_restore_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restore_serialize( instance_id=instance_id, @@ -4500,7 +4500,7 @@ def _trigger_restore_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4585,7 +4585,7 @@ def update_backups_config( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_backups_config_serialize( instance_id=instance_id, @@ -4657,7 +4657,7 @@ def update_backups_config_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_backups_config_serialize( instance_id=instance_id, @@ -4729,7 +4729,7 @@ def update_backups_config_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_backups_config_serialize( instance_id=instance_id, @@ -4768,7 +4768,7 @@ def _update_backups_config_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/opensearch/src/stackit/opensearch/api_client.py b/services/opensearch/src/stackit/opensearch/api_client.py index fc0ed04c..8035a1e7 100644 --- a/services/opensearch/src/stackit/opensearch/api_client.py +++ b/services/opensearch/src/stackit/opensearch/api_client.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -331,6 +331,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -350,12 +354,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -457,7 +461,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -473,7 +477,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -488,6 +495,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/opensearch/src/stackit/opensearch/configuration.py b/services/opensearch/src/stackit/opensearch/configuration.py index ee5560ab..f8e5ce4b 100644 --- a/services/opensearch/src/stackit/opensearch/configuration.py +++ b/services/opensearch/src/stackit/opensearch/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT Opensearch API @@ -14,7 +9,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -53,7 +70,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -72,7 +89,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -112,7 +134,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -131,12 +153,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/opensearch/src/stackit/opensearch/exceptions.py b/services/opensearch/src/stackit/opensearch/exceptions.py index 62edb6ce..fe8cfebe 100644 --- a/services/opensearch/src/stackit/opensearch/exceptions.py +++ b/services/opensearch/src/stackit/opensearch/exceptions.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -151,6 +151,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -187,6 +194,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/opensearch/src/stackit/opensearch/models/__init__.py b/services/opensearch/src/stackit/opensearch/models/__init__.py index 384cc705..666888eb 100644 --- a/services/opensearch/src/stackit/opensearch/models/__init__.py +++ b/services/opensearch/src/stackit/opensearch/models/__init__.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/opensearch/src/stackit/opensearch/models/backup.py b/services/opensearch/src/stackit/opensearch/models/backup.py index 3a0aeb87..9e4d177e 100644 --- a/services/opensearch/src/stackit/opensearch/models/backup.py +++ b/services/opensearch/src/stackit/opensearch/models/backup.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Backup(BaseModel): """ Backup - """ + """ # noqa: E501 downloadable: Optional[StrictBool] = None finished_at: StrictStr diff --git a/services/opensearch/src/stackit/opensearch/models/create_backup_response_item.py b/services/opensearch/src/stackit/opensearch/models/create_backup_response_item.py index 982b429d..1f60ae48 100644 --- a/services/opensearch/src/stackit/opensearch/models/create_backup_response_item.py +++ b/services/opensearch/src/stackit/opensearch/models/create_backup_response_item.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateBackupResponseItem(BaseModel): """ CreateBackupResponseItem - """ + """ # noqa: E501 id: StrictInt message: StrictStr diff --git a/services/opensearch/src/stackit/opensearch/models/create_instance_payload.py b/services/opensearch/src/stackit/opensearch/models/create_instance_payload.py index 4b7943d5..6c235dcb 100644 --- a/services/opensearch/src/stackit/opensearch/models/create_instance_payload.py +++ b/services/opensearch/src/stackit/opensearch/models/create_instance_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class CreateInstancePayload(BaseModel): """ CreateInstancePayload - """ + """ # noqa: E501 instance_name: StrictStr = Field(alias="instanceName") parameters: Optional[InstanceParameters] = None diff --git a/services/opensearch/src/stackit/opensearch/models/create_instance_response.py b/services/opensearch/src/stackit/opensearch/models/create_instance_response.py index 987850b8..75abed57 100644 --- a/services/opensearch/src/stackit/opensearch/models/create_instance_response.py +++ b/services/opensearch/src/stackit/opensearch/models/create_instance_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateInstanceResponse(BaseModel): """ CreateInstanceResponse - """ + """ # noqa: E501 instance_id: StrictStr = Field(alias="instanceId") __properties: ClassVar[List[str]] = ["instanceId"] diff --git a/services/opensearch/src/stackit/opensearch/models/credentials.py b/services/opensearch/src/stackit/opensearch/models/credentials.py index dd3f7f0f..6222f090 100644 --- a/services/opensearch/src/stackit/opensearch/models/credentials.py +++ b/services/opensearch/src/stackit/opensearch/models/credentials.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Credentials(BaseModel): """ Credentials - """ + """ # noqa: E501 host: StrictStr hosts: Optional[List[StrictStr]] = None diff --git a/services/opensearch/src/stackit/opensearch/models/credentials_list_item.py b/services/opensearch/src/stackit/opensearch/models/credentials_list_item.py index eb10a0a2..debc34f6 100644 --- a/services/opensearch/src/stackit/opensearch/models/credentials_list_item.py +++ b/services/opensearch/src/stackit/opensearch/models/credentials_list_item.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CredentialsListItem(BaseModel): """ CredentialsListItem - """ + """ # noqa: E501 id: StrictStr __properties: ClassVar[List[str]] = ["id"] diff --git a/services/opensearch/src/stackit/opensearch/models/credentials_response.py b/services/opensearch/src/stackit/opensearch/models/credentials_response.py index 81167d03..33033491 100644 --- a/services/opensearch/src/stackit/opensearch/models/credentials_response.py +++ b/services/opensearch/src/stackit/opensearch/models/credentials_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class CredentialsResponse(BaseModel): """ CredentialsResponse - """ + """ # noqa: E501 id: StrictStr raw: Optional[RawCredentials] = None diff --git a/services/opensearch/src/stackit/opensearch/models/error.py b/services/opensearch/src/stackit/opensearch/models/error.py index e950e669..d8c463de 100644 --- a/services/opensearch/src/stackit/opensearch/models/error.py +++ b/services/opensearch/src/stackit/opensearch/models/error.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Error(BaseModel): """ Error - """ + """ # noqa: E501 description: StrictStr error: StrictStr diff --git a/services/opensearch/src/stackit/opensearch/models/get_metrics_response.py b/services/opensearch/src/stackit/opensearch/models/get_metrics_response.py index fac3b5ac..c174f907 100644 --- a/services/opensearch/src/stackit/opensearch/models/get_metrics_response.py +++ b/services/opensearch/src/stackit/opensearch/models/get_metrics_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class GetMetricsResponse(BaseModel): """ GetMetricsResponse - """ + """ # noqa: E501 cpu_idle_time: Optional[StrictInt] = Field(default=None, alias="cpuIdleTime") cpu_load_percent: Union[StrictFloat, StrictInt] = Field(alias="cpuLoadPercent") diff --git a/services/opensearch/src/stackit/opensearch/models/instance.py b/services/opensearch/src/stackit/opensearch/models/instance.py index 251f3469..1a349a5d 100644 --- a/services/opensearch/src/stackit/opensearch/models/instance.py +++ b/services/opensearch/src/stackit/opensearch/models/instance.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class Instance(BaseModel): """ Instance - """ + """ # noqa: E501 cf_guid: StrictStr = Field(alias="cfGuid") cf_organization_guid: StrictStr = Field(alias="cfOrganizationGuid") diff --git a/services/opensearch/src/stackit/opensearch/models/instance_last_operation.py b/services/opensearch/src/stackit/opensearch/models/instance_last_operation.py index 302d977d..d0b6a0d9 100644 --- a/services/opensearch/src/stackit/opensearch/models/instance_last_operation.py +++ b/services/opensearch/src/stackit/opensearch/models/instance_last_operation.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class InstanceLastOperation(BaseModel): """ InstanceLastOperation - """ + """ # noqa: E501 description: StrictStr state: StrictStr diff --git a/services/opensearch/src/stackit/opensearch/models/instance_parameters.py b/services/opensearch/src/stackit/opensearch/models/instance_parameters.py index 7081e297..5a145f50 100644 --- a/services/opensearch/src/stackit/opensearch/models/instance_parameters.py +++ b/services/opensearch/src/stackit/opensearch/models/instance_parameters.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -32,7 +32,7 @@ class InstanceParameters(BaseModel): """ InstanceParameters - """ + """ # noqa: E501 enable_monitoring: Optional[StrictBool] = False graphite: Optional[StrictStr] = Field( diff --git a/services/opensearch/src/stackit/opensearch/models/instance_schema.py b/services/opensearch/src/stackit/opensearch/models/instance_schema.py index 2b1dbde0..9f59459f 100644 --- a/services/opensearch/src/stackit/opensearch/models/instance_schema.py +++ b/services/opensearch/src/stackit/opensearch/models/instance_schema.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class InstanceSchema(BaseModel): """ InstanceSchema - """ + """ # noqa: E501 create: ModelSchema update: ModelSchema diff --git a/services/opensearch/src/stackit/opensearch/models/list_backups_response.py b/services/opensearch/src/stackit/opensearch/models/list_backups_response.py index 21c80f4b..88701149 100644 --- a/services/opensearch/src/stackit/opensearch/models/list_backups_response.py +++ b/services/opensearch/src/stackit/opensearch/models/list_backups_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListBackupsResponse(BaseModel): """ ListBackupsResponse - """ + """ # noqa: E501 instance_backups: List[Backup] = Field(alias="instanceBackups") __properties: ClassVar[List[str]] = ["instanceBackups"] diff --git a/services/opensearch/src/stackit/opensearch/models/list_credentials_response.py b/services/opensearch/src/stackit/opensearch/models/list_credentials_response.py index de177b8d..e975d346 100644 --- a/services/opensearch/src/stackit/opensearch/models/list_credentials_response.py +++ b/services/opensearch/src/stackit/opensearch/models/list_credentials_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListCredentialsResponse(BaseModel): """ ListCredentialsResponse - """ + """ # noqa: E501 credentials_list: List[CredentialsListItem] = Field(alias="credentialsList") __properties: ClassVar[List[str]] = ["credentialsList"] diff --git a/services/opensearch/src/stackit/opensearch/models/list_instances_response.py b/services/opensearch/src/stackit/opensearch/models/list_instances_response.py index 06dfe173..c13deac1 100644 --- a/services/opensearch/src/stackit/opensearch/models/list_instances_response.py +++ b/services/opensearch/src/stackit/opensearch/models/list_instances_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListInstancesResponse(BaseModel): """ ListInstancesResponse - """ + """ # noqa: E501 instances: List[Instance] __properties: ClassVar[List[str]] = ["instances"] diff --git a/services/opensearch/src/stackit/opensearch/models/list_offerings_response.py b/services/opensearch/src/stackit/opensearch/models/list_offerings_response.py index 6f7a65c7..ef2992b7 100644 --- a/services/opensearch/src/stackit/opensearch/models/list_offerings_response.py +++ b/services/opensearch/src/stackit/opensearch/models/list_offerings_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListOfferingsResponse(BaseModel): """ ListOfferingsResponse - """ + """ # noqa: E501 offerings: List[Offering] __properties: ClassVar[List[str]] = ["offerings"] diff --git a/services/opensearch/src/stackit/opensearch/models/list_restores_response.py b/services/opensearch/src/stackit/opensearch/models/list_restores_response.py index 12abf0d5..9722ca83 100644 --- a/services/opensearch/src/stackit/opensearch/models/list_restores_response.py +++ b/services/opensearch/src/stackit/opensearch/models/list_restores_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListRestoresResponse(BaseModel): """ ListRestoresResponse - """ + """ # noqa: E501 instance_restores: List[Restore] = Field(alias="instanceRestores") __properties: ClassVar[List[str]] = ["instanceRestores"] diff --git a/services/opensearch/src/stackit/opensearch/models/model_schema.py b/services/opensearch/src/stackit/opensearch/models/model_schema.py index 72550288..787ba950 100644 --- a/services/opensearch/src/stackit/opensearch/models/model_schema.py +++ b/services/opensearch/src/stackit/opensearch/models/model_schema.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class ModelSchema(BaseModel): """ ModelSchema - """ + """ # noqa: E501 parameters: Dict[str, Any] __properties: ClassVar[List[str]] = ["parameters"] diff --git a/services/opensearch/src/stackit/opensearch/models/offering.py b/services/opensearch/src/stackit/opensearch/models/offering.py index f2f49ba4..6d5cfcf5 100644 --- a/services/opensearch/src/stackit/opensearch/models/offering.py +++ b/services/opensearch/src/stackit/opensearch/models/offering.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class Offering(BaseModel): """ Offering - """ + """ # noqa: E501 description: StrictStr documentation_url: StrictStr = Field(alias="documentationUrl") diff --git a/services/opensearch/src/stackit/opensearch/models/partial_update_instance_payload.py b/services/opensearch/src/stackit/opensearch/models/partial_update_instance_payload.py index 90deee04..25c2a704 100644 --- a/services/opensearch/src/stackit/opensearch/models/partial_update_instance_payload.py +++ b/services/opensearch/src/stackit/opensearch/models/partial_update_instance_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class PartialUpdateInstancePayload(BaseModel): """ PartialUpdateInstancePayload - """ + """ # noqa: E501 instance_name: Optional[StrictStr] = Field(default=None, alias="instanceName") parameters: Optional[InstanceParameters] = None diff --git a/services/opensearch/src/stackit/opensearch/models/plan.py b/services/opensearch/src/stackit/opensearch/models/plan.py index 5b95f08e..6e3aa3eb 100644 --- a/services/opensearch/src/stackit/opensearch/models/plan.py +++ b/services/opensearch/src/stackit/opensearch/models/plan.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Plan(BaseModel): """ Plan - """ + """ # noqa: E501 description: StrictStr free: StrictBool diff --git a/services/opensearch/src/stackit/opensearch/models/raw_credentials.py b/services/opensearch/src/stackit/opensearch/models/raw_credentials.py index a87c0e70..ed82169c 100644 --- a/services/opensearch/src/stackit/opensearch/models/raw_credentials.py +++ b/services/opensearch/src/stackit/opensearch/models/raw_credentials.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class RawCredentials(BaseModel): """ RawCredentials - """ + """ # noqa: E501 credentials: Credentials __properties: ClassVar[List[str]] = ["credentials"] diff --git a/services/opensearch/src/stackit/opensearch/models/restore.py b/services/opensearch/src/stackit/opensearch/models/restore.py index ee68742b..37537ac4 100644 --- a/services/opensearch/src/stackit/opensearch/models/restore.py +++ b/services/opensearch/src/stackit/opensearch/models/restore.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Restore(BaseModel): """ Restore - """ + """ # noqa: E501 backup_id: StrictInt finished_at: StrictStr diff --git a/services/opensearch/src/stackit/opensearch/models/trigger_restore_response.py b/services/opensearch/src/stackit/opensearch/models/trigger_restore_response.py index aad997d0..93cb5fd2 100644 --- a/services/opensearch/src/stackit/opensearch/models/trigger_restore_response.py +++ b/services/opensearch/src/stackit/opensearch/models/trigger_restore_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class TriggerRestoreResponse(BaseModel): """ TriggerRestoreResponse - """ + """ # noqa: E501 id: StrictInt __properties: ClassVar[List[str]] = ["id"] diff --git a/services/opensearch/src/stackit/opensearch/models/update_backups_config_payload.py b/services/opensearch/src/stackit/opensearch/models/update_backups_config_payload.py index 7ca3af1e..7d5782d9 100644 --- a/services/opensearch/src/stackit/opensearch/models/update_backups_config_payload.py +++ b/services/opensearch/src/stackit/opensearch/models/update_backups_config_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class UpdateBackupsConfigPayload(BaseModel): """ UpdateBackupsConfigPayload - """ + """ # noqa: E501 encryption_key: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["encryption_key"] diff --git a/services/opensearch/src/stackit/opensearch/models/update_backups_config_response.py b/services/opensearch/src/stackit/opensearch/models/update_backups_config_response.py index 62c8ec8e..57b3f7ef 100644 --- a/services/opensearch/src/stackit/opensearch/models/update_backups_config_response.py +++ b/services/opensearch/src/stackit/opensearch/models/update_backups_config_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class UpdateBackupsConfigResponse(BaseModel): """ UpdateBackupsConfigResponse - """ + """ # noqa: E501 message: StrictStr __properties: ClassVar[List[str]] = ["message"] diff --git a/services/opensearch/src/stackit/opensearch/rest.py b/services/opensearch/src/stackit/opensearch/rest.py index fdf2de40..9b9428b4 100644 --- a/services/opensearch/src/stackit/opensearch/rest.py +++ b/services/opensearch/src/stackit/opensearch/rest.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -124,7 +124,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/postgresflex/CHANGELOG.md b/services/postgresflex/CHANGELOG.md index 0ede413d..a05262c5 100644 --- a/services/postgresflex/CHANGELOG.md +++ b/services/postgresflex/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.0.2 +- **Internal:** Improve deserializing and error types + ## v1.0.1 (2025-05-09) - **Feature:** Update user-agent header diff --git a/services/postgresflex/pyproject.toml b/services/postgresflex/pyproject.toml index db476478..1615235f 100644 --- a/services/postgresflex/pyproject.toml +++ b/services/postgresflex/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-postgresflex" [tool.poetry] name = "stackit-postgresflex" -version = "v1.0.1" +version = "v1.0.2" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/postgresflex/src/stackit/postgresflex/__init__.py b/services/postgresflex/src/stackit/postgresflex/__init__.py index e2c503d9..dc98383f 100644 --- a/services/postgresflex/src/stackit/postgresflex/__init__.py +++ b/services/postgresflex/src/stackit/postgresflex/__init__.py @@ -12,109 +12,233 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "ACL", + "ApiConfiguration", + "ApiExtensionConfigLoadResponse", + "ApiExtensionConfigureResponse", + "ApiExtensionDeleteResponse", + "ApiExtensionList", + "ApiExtensionLoadResponse", + "ApiInstallResponse", + "ApiInstalledListResponse", + "Backup", + "CloneInstancePayload", + "CloneInstanceResponse", + "CreateDatabasePayload", + "CreateInstancePayload", + "CreateInstanceResponse", + "CreateUserPayload", + "CreateUserResponse", + "Error", + "ExtensionsConfiguration", + "ExtensionsExtensionListResponse", + "ExtensionsNewConfig", + "Flavor", + "GetBackupResponse", + "GetUserResponse", + "Instance", + "InstanceCreateDatabaseResponse", + "InstanceDataPoint", + "InstanceDatabase", + "InstanceHost", + "InstanceHostMetric", + "InstanceListDatabasesResponse", + "InstanceListInstance", + "InstanceMetricsResponse", + "InstanceResponse", + "ListBackupsResponse", + "ListFlavorsResponse", + "ListInstancesResponse", + "ListStoragesResponse", + "ListUsersResponse", + "ListUsersResponseItem", + "ListVersionsResponse", + "PartialUpdateInstancePayload", + "PartialUpdateInstanceResponse", + "PartialUpdateUserPayload", + "PostgresDatabaseParameter", + "PostgresDatabaseParameterResponse", + "ResetUserResponse", + "Storage", + "StorageRange", + "UpdateBackupSchedulePayload", + "UpdateInstancePayload", + "UpdateUserPayload", + "User", + "UserResponse", +] + # import apis into sdk package -from stackit.postgresflex.api.default_api import DefaultApi -from stackit.postgresflex.api_client import ApiClient +from stackit.postgresflex.api.default_api import DefaultApi as DefaultApi +from stackit.postgresflex.api_client import ApiClient as ApiClient # import ApiClient -from stackit.postgresflex.api_response import ApiResponse -from stackit.postgresflex.configuration import HostConfiguration -from stackit.postgresflex.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.postgresflex.api_response import ApiResponse as ApiResponse +from stackit.postgresflex.configuration import HostConfiguration as HostConfiguration +from stackit.postgresflex.exceptions import ApiAttributeError as ApiAttributeError +from stackit.postgresflex.exceptions import ApiException as ApiException +from stackit.postgresflex.exceptions import ApiKeyError as ApiKeyError +from stackit.postgresflex.exceptions import ApiTypeError as ApiTypeError +from stackit.postgresflex.exceptions import ApiValueError as ApiValueError +from stackit.postgresflex.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.postgresflex.models.acl import ACL -from stackit.postgresflex.models.api_configuration import ApiConfiguration +from stackit.postgresflex.models.acl import ACL as ACL +from stackit.postgresflex.models.api_configuration import ( + ApiConfiguration as ApiConfiguration, +) from stackit.postgresflex.models.api_extension_config_load_response import ( - ApiExtensionConfigLoadResponse, + ApiExtensionConfigLoadResponse as ApiExtensionConfigLoadResponse, ) from stackit.postgresflex.models.api_extension_configure_response import ( - ApiExtensionConfigureResponse, + ApiExtensionConfigureResponse as ApiExtensionConfigureResponse, ) from stackit.postgresflex.models.api_extension_delete_response import ( - ApiExtensionDeleteResponse, + ApiExtensionDeleteResponse as ApiExtensionDeleteResponse, +) +from stackit.postgresflex.models.api_extension_list import ( + ApiExtensionList as ApiExtensionList, ) -from stackit.postgresflex.models.api_extension_list import ApiExtensionList from stackit.postgresflex.models.api_extension_load_response import ( - ApiExtensionLoadResponse, + ApiExtensionLoadResponse as ApiExtensionLoadResponse, +) +from stackit.postgresflex.models.api_install_response import ( + ApiInstallResponse as ApiInstallResponse, ) -from stackit.postgresflex.models.api_install_response import ApiInstallResponse from stackit.postgresflex.models.api_installed_list_response import ( - ApiInstalledListResponse, -) -from stackit.postgresflex.models.backup import Backup -from stackit.postgresflex.models.clone_instance_payload import CloneInstancePayload -from stackit.postgresflex.models.clone_instance_response import CloneInstanceResponse -from stackit.postgresflex.models.create_database_payload import CreateDatabasePayload -from stackit.postgresflex.models.create_instance_payload import CreateInstancePayload -from stackit.postgresflex.models.create_instance_response import CreateInstanceResponse -from stackit.postgresflex.models.create_user_payload import CreateUserPayload -from stackit.postgresflex.models.create_user_response import CreateUserResponse -from stackit.postgresflex.models.error import Error -from stackit.postgresflex.models.extensions_configuration import ExtensionsConfiguration + ApiInstalledListResponse as ApiInstalledListResponse, +) +from stackit.postgresflex.models.backup import Backup as Backup +from stackit.postgresflex.models.clone_instance_payload import ( + CloneInstancePayload as CloneInstancePayload, +) +from stackit.postgresflex.models.clone_instance_response import ( + CloneInstanceResponse as CloneInstanceResponse, +) +from stackit.postgresflex.models.create_database_payload import ( + CreateDatabasePayload as CreateDatabasePayload, +) +from stackit.postgresflex.models.create_instance_payload import ( + CreateInstancePayload as CreateInstancePayload, +) +from stackit.postgresflex.models.create_instance_response import ( + CreateInstanceResponse as CreateInstanceResponse, +) +from stackit.postgresflex.models.create_user_payload import ( + CreateUserPayload as CreateUserPayload, +) +from stackit.postgresflex.models.create_user_response import ( + CreateUserResponse as CreateUserResponse, +) +from stackit.postgresflex.models.error import Error as Error +from stackit.postgresflex.models.extensions_configuration import ( + ExtensionsConfiguration as ExtensionsConfiguration, +) from stackit.postgresflex.models.extensions_extension_list_response import ( - ExtensionsExtensionListResponse, + ExtensionsExtensionListResponse as ExtensionsExtensionListResponse, +) +from stackit.postgresflex.models.extensions_new_config import ( + ExtensionsNewConfig as ExtensionsNewConfig, +) +from stackit.postgresflex.models.flavor import Flavor as Flavor +from stackit.postgresflex.models.get_backup_response import ( + GetBackupResponse as GetBackupResponse, +) +from stackit.postgresflex.models.get_user_response import ( + GetUserResponse as GetUserResponse, ) -from stackit.postgresflex.models.extensions_new_config import ExtensionsNewConfig -from stackit.postgresflex.models.flavor import Flavor -from stackit.postgresflex.models.get_backup_response import GetBackupResponse -from stackit.postgresflex.models.get_user_response import GetUserResponse -from stackit.postgresflex.models.instance import Instance +from stackit.postgresflex.models.instance import Instance as Instance from stackit.postgresflex.models.instance_create_database_response import ( - InstanceCreateDatabaseResponse, + InstanceCreateDatabaseResponse as InstanceCreateDatabaseResponse, +) +from stackit.postgresflex.models.instance_data_point import ( + InstanceDataPoint as InstanceDataPoint, +) +from stackit.postgresflex.models.instance_database import ( + InstanceDatabase as InstanceDatabase, +) +from stackit.postgresflex.models.instance_host import InstanceHost as InstanceHost +from stackit.postgresflex.models.instance_host_metric import ( + InstanceHostMetric as InstanceHostMetric, ) -from stackit.postgresflex.models.instance_data_point import InstanceDataPoint -from stackit.postgresflex.models.instance_database import InstanceDatabase -from stackit.postgresflex.models.instance_host import InstanceHost -from stackit.postgresflex.models.instance_host_metric import InstanceHostMetric from stackit.postgresflex.models.instance_list_databases_response import ( - InstanceListDatabasesResponse, + InstanceListDatabasesResponse as InstanceListDatabasesResponse, +) +from stackit.postgresflex.models.instance_list_instance import ( + InstanceListInstance as InstanceListInstance, ) -from stackit.postgresflex.models.instance_list_instance import InstanceListInstance from stackit.postgresflex.models.instance_metrics_response import ( - InstanceMetricsResponse, -) -from stackit.postgresflex.models.instance_response import InstanceResponse -from stackit.postgresflex.models.list_backups_response import ListBackupsResponse -from stackit.postgresflex.models.list_flavors_response import ListFlavorsResponse -from stackit.postgresflex.models.list_instances_response import ListInstancesResponse -from stackit.postgresflex.models.list_storages_response import ListStoragesResponse -from stackit.postgresflex.models.list_users_response import ListUsersResponse -from stackit.postgresflex.models.list_users_response_item import ListUsersResponseItem -from stackit.postgresflex.models.list_versions_response import ListVersionsResponse + InstanceMetricsResponse as InstanceMetricsResponse, +) +from stackit.postgresflex.models.instance_response import ( + InstanceResponse as InstanceResponse, +) +from stackit.postgresflex.models.list_backups_response import ( + ListBackupsResponse as ListBackupsResponse, +) +from stackit.postgresflex.models.list_flavors_response import ( + ListFlavorsResponse as ListFlavorsResponse, +) +from stackit.postgresflex.models.list_instances_response import ( + ListInstancesResponse as ListInstancesResponse, +) +from stackit.postgresflex.models.list_storages_response import ( + ListStoragesResponse as ListStoragesResponse, +) +from stackit.postgresflex.models.list_users_response import ( + ListUsersResponse as ListUsersResponse, +) +from stackit.postgresflex.models.list_users_response_item import ( + ListUsersResponseItem as ListUsersResponseItem, +) +from stackit.postgresflex.models.list_versions_response import ( + ListVersionsResponse as ListVersionsResponse, +) from stackit.postgresflex.models.partial_update_instance_payload import ( - PartialUpdateInstancePayload, + PartialUpdateInstancePayload as PartialUpdateInstancePayload, ) from stackit.postgresflex.models.partial_update_instance_response import ( - PartialUpdateInstanceResponse, + PartialUpdateInstanceResponse as PartialUpdateInstanceResponse, ) from stackit.postgresflex.models.partial_update_user_payload import ( - PartialUpdateUserPayload, + PartialUpdateUserPayload as PartialUpdateUserPayload, ) from stackit.postgresflex.models.postgres_database_parameter import ( - PostgresDatabaseParameter, + PostgresDatabaseParameter as PostgresDatabaseParameter, ) from stackit.postgresflex.models.postgres_database_parameter_response import ( - PostgresDatabaseParameterResponse, + PostgresDatabaseParameterResponse as PostgresDatabaseParameterResponse, +) +from stackit.postgresflex.models.reset_user_response import ( + ResetUserResponse as ResetUserResponse, ) -from stackit.postgresflex.models.reset_user_response import ResetUserResponse -from stackit.postgresflex.models.storage import Storage -from stackit.postgresflex.models.storage_range import StorageRange +from stackit.postgresflex.models.storage import Storage as Storage +from stackit.postgresflex.models.storage_range import StorageRange as StorageRange from stackit.postgresflex.models.update_backup_schedule_payload import ( - UpdateBackupSchedulePayload, + UpdateBackupSchedulePayload as UpdateBackupSchedulePayload, +) +from stackit.postgresflex.models.update_instance_payload import ( + UpdateInstancePayload as UpdateInstancePayload, +) +from stackit.postgresflex.models.update_user_payload import ( + UpdateUserPayload as UpdateUserPayload, ) -from stackit.postgresflex.models.update_instance_payload import UpdateInstancePayload -from stackit.postgresflex.models.update_user_payload import UpdateUserPayload -from stackit.postgresflex.models.user import User -from stackit.postgresflex.models.user_response import UserResponse +from stackit.postgresflex.models.user import User as User +from stackit.postgresflex.models.user_response import UserResponse as UserResponse diff --git a/services/postgresflex/src/stackit/postgresflex/api/default_api.py b/services/postgresflex/src/stackit/postgresflex/api/default_api.py index e2de1f6a..f1f329cd 100644 --- a/services/postgresflex/src/stackit/postgresflex/api/default_api.py +++ b/services/postgresflex/src/stackit/postgresflex/api/default_api.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -134,7 +134,7 @@ def clone_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._clone_instance_serialize( project_id=project_id, @@ -210,7 +210,7 @@ def clone_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._clone_instance_serialize( project_id=project_id, @@ -286,7 +286,7 @@ def clone_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._clone_instance_serialize( project_id=project_id, @@ -329,7 +329,7 @@ def _clone_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -425,7 +425,7 @@ def create_database( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_database_serialize( project_id=project_id, @@ -501,7 +501,7 @@ def create_database_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_database_serialize( project_id=project_id, @@ -577,7 +577,7 @@ def create_database_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_database_serialize( project_id=project_id, @@ -620,7 +620,7 @@ def _create_database_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -713,7 +713,7 @@ def create_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -785,7 +785,7 @@ def create_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -857,7 +857,7 @@ def create_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -898,7 +898,7 @@ def _create_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -992,7 +992,7 @@ def create_user( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_user_serialize( project_id=project_id, @@ -1068,7 +1068,7 @@ def create_user_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_user_serialize( project_id=project_id, @@ -1144,7 +1144,7 @@ def create_user_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_user_serialize( project_id=project_id, @@ -1187,7 +1187,7 @@ def _create_user_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1283,7 +1283,7 @@ def delete_database( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_database_serialize( project_id=project_id, @@ -1359,7 +1359,7 @@ def delete_database_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_database_serialize( project_id=project_id, @@ -1435,7 +1435,7 @@ def delete_database_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_database_serialize( project_id=project_id, @@ -1478,7 +1478,7 @@ def _delete_database_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1563,7 +1563,7 @@ def delete_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1636,7 +1636,7 @@ def delete_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1709,7 +1709,7 @@ def delete_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1751,7 +1751,7 @@ def _delete_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1837,7 +1837,7 @@ def delete_user( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_user_serialize( project_id=project_id, @@ -1913,7 +1913,7 @@ def delete_user_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_user_serialize( project_id=project_id, @@ -1989,7 +1989,7 @@ def delete_user_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_user_serialize( project_id=project_id, @@ -2032,7 +2032,7 @@ def _delete_user_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2117,7 +2117,7 @@ def force_delete_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._force_delete_instance_serialize( project_id=project_id, @@ -2190,7 +2190,7 @@ def force_delete_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._force_delete_instance_serialize( project_id=project_id, @@ -2263,7 +2263,7 @@ def force_delete_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._force_delete_instance_serialize( project_id=project_id, @@ -2305,7 +2305,7 @@ def _force_delete_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2391,7 +2391,7 @@ def get_backup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_backup_serialize( project_id=project_id, @@ -2468,7 +2468,7 @@ def get_backup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_backup_serialize( project_id=project_id, @@ -2545,7 +2545,7 @@ def get_backup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_backup_serialize( project_id=project_id, @@ -2589,7 +2589,7 @@ def _get_backup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2674,7 +2674,7 @@ def get_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -2746,7 +2746,7 @@ def get_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -2818,7 +2818,7 @@ def get_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -2859,7 +2859,7 @@ def _get_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2945,7 +2945,7 @@ def get_user( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_user_serialize( project_id=project_id, @@ -3021,7 +3021,7 @@ def get_user_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_user_serialize( project_id=project_id, @@ -3097,7 +3097,7 @@ def get_user_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_user_serialize( project_id=project_id, @@ -3140,7 +3140,7 @@ def _get_user_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3225,7 +3225,7 @@ def list_backups( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( project_id=project_id, @@ -3298,7 +3298,7 @@ def list_backups_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( project_id=project_id, @@ -3371,7 +3371,7 @@ def list_backups_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( project_id=project_id, @@ -3413,7 +3413,7 @@ def _list_backups_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3496,7 +3496,7 @@ def list_database_parameters( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_database_parameters_serialize( project_id=project_id, @@ -3568,7 +3568,7 @@ def list_database_parameters_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_database_parameters_serialize( project_id=project_id, @@ -3640,7 +3640,7 @@ def list_database_parameters_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_database_parameters_serialize( project_id=project_id, @@ -3681,7 +3681,7 @@ def _list_database_parameters_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3764,7 +3764,7 @@ def list_databases( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_databases_serialize( project_id=project_id, @@ -3836,7 +3836,7 @@ def list_databases_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_databases_serialize( project_id=project_id, @@ -3908,7 +3908,7 @@ def list_databases_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_databases_serialize( project_id=project_id, @@ -3949,7 +3949,7 @@ def _list_databases_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4029,7 +4029,7 @@ def list_flavors( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_flavors_serialize( project_id=project_id, @@ -4097,7 +4097,7 @@ def list_flavors_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_flavors_serialize( project_id=project_id, @@ -4165,7 +4165,7 @@ def list_flavors_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_flavors_serialize( project_id=project_id, @@ -4204,7 +4204,7 @@ def _list_flavors_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4282,7 +4282,7 @@ def list_instances( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -4350,7 +4350,7 @@ def list_instances_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -4418,7 +4418,7 @@ def list_instances_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -4457,7 +4457,7 @@ def _list_instances_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4573,7 +4573,7 @@ def list_metrics( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_metrics_serialize( project_id=project_id, @@ -4685,7 +4685,7 @@ def list_metrics_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_metrics_serialize( project_id=project_id, @@ -4797,7 +4797,7 @@ def list_metrics_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_metrics_serialize( project_id=project_id, @@ -4848,7 +4848,7 @@ def _list_metrics_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4949,7 +4949,7 @@ def list_storages( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_storages_serialize( project_id=project_id, @@ -5021,7 +5021,7 @@ def list_storages_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_storages_serialize( project_id=project_id, @@ -5093,7 +5093,7 @@ def list_storages_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_storages_serialize( project_id=project_id, @@ -5134,7 +5134,7 @@ def _list_storages_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5217,7 +5217,7 @@ def list_users( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_users_serialize( project_id=project_id, @@ -5289,7 +5289,7 @@ def list_users_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_users_serialize( project_id=project_id, @@ -5361,7 +5361,7 @@ def list_users_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_users_serialize( project_id=project_id, @@ -5402,7 +5402,7 @@ def _list_users_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5485,7 +5485,7 @@ def list_versions( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_versions_serialize( project_id=project_id, @@ -5557,7 +5557,7 @@ def list_versions_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_versions_serialize( project_id=project_id, @@ -5629,7 +5629,7 @@ def list_versions_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_versions_serialize( project_id=project_id, @@ -5670,7 +5670,7 @@ def _list_versions_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5758,7 +5758,7 @@ def partial_update_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_instance_serialize( project_id=project_id, @@ -5834,7 +5834,7 @@ def partial_update_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_instance_serialize( project_id=project_id, @@ -5910,7 +5910,7 @@ def partial_update_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_instance_serialize( project_id=project_id, @@ -5953,7 +5953,7 @@ def _partial_update_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -6057,7 +6057,7 @@ def partial_update_user( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_user_serialize( project_id=project_id, @@ -6142,7 +6142,7 @@ def partial_update_user_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_user_serialize( project_id=project_id, @@ -6227,7 +6227,7 @@ def partial_update_user_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_user_serialize( project_id=project_id, @@ -6272,7 +6272,7 @@ def _partial_update_user_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -6370,7 +6370,7 @@ def reset_user( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._reset_user_serialize( project_id=project_id, @@ -6447,7 +6447,7 @@ def reset_user_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._reset_user_serialize( project_id=project_id, @@ -6524,7 +6524,7 @@ def reset_user_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._reset_user_serialize( project_id=project_id, @@ -6568,7 +6568,7 @@ def _reset_user_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -6656,7 +6656,7 @@ def update_backup_schedule( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_backup_schedule_serialize( project_id=project_id, @@ -6734,7 +6734,7 @@ def update_backup_schedule_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_backup_schedule_serialize( project_id=project_id, @@ -6812,7 +6812,7 @@ def update_backup_schedule_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_backup_schedule_serialize( project_id=project_id, @@ -6857,7 +6857,7 @@ def _update_backup_schedule_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -6953,7 +6953,7 @@ def update_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_instance_serialize( project_id=project_id, @@ -7029,7 +7029,7 @@ def update_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_instance_serialize( project_id=project_id, @@ -7105,7 +7105,7 @@ def update_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_instance_serialize( project_id=project_id, @@ -7148,7 +7148,7 @@ def _update_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -7252,7 +7252,7 @@ def update_user( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_user_serialize( project_id=project_id, @@ -7337,7 +7337,7 @@ def update_user_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_user_serialize( project_id=project_id, @@ -7422,7 +7422,7 @@ def update_user_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_user_serialize( project_id=project_id, @@ -7467,7 +7467,7 @@ def _update_user_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/postgresflex/src/stackit/postgresflex/api_client.py b/services/postgresflex/src/stackit/postgresflex/api_client.py index c38e0bfd..74ec9ea9 100644 --- a/services/postgresflex/src/stackit/postgresflex/api_client.py +++ b/services/postgresflex/src/stackit/postgresflex/api_client.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -332,6 +332,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -351,12 +355,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -458,7 +462,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -474,7 +478,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -489,6 +496,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/postgresflex/src/stackit/postgresflex/configuration.py b/services/postgresflex/src/stackit/postgresflex/configuration.py index 05166bab..de61061d 100644 --- a/services/postgresflex/src/stackit/postgresflex/configuration.py +++ b/services/postgresflex/src/stackit/postgresflex/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT PostgreSQL Flex API @@ -15,7 +10,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -54,7 +71,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -72,7 +89,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -112,7 +134,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -131,12 +153,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/postgresflex/src/stackit/postgresflex/exceptions.py b/services/postgresflex/src/stackit/postgresflex/exceptions.py index d529833d..0bcb662e 100644 --- a/services/postgresflex/src/stackit/postgresflex/exceptions.py +++ b/services/postgresflex/src/stackit/postgresflex/exceptions.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -152,6 +152,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -188,6 +195,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/postgresflex/src/stackit/postgresflex/models/__init__.py b/services/postgresflex/src/stackit/postgresflex/models/__init__.py index 2f1a9c30..f7a8fbaf 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/__init__.py +++ b/services/postgresflex/src/stackit/postgresflex/models/__init__.py @@ -11,7 +11,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/postgresflex/src/stackit/postgresflex/models/acl.py b/services/postgresflex/src/stackit/postgresflex/models/acl.py index e6c010eb..2820eccd 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/acl.py +++ b/services/postgresflex/src/stackit/postgresflex/models/acl.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ACL(BaseModel): """ ACL - """ + """ # noqa: E501 items: Optional[List[StrictStr]] = None __properties: ClassVar[List[str]] = ["items"] diff --git a/services/postgresflex/src/stackit/postgresflex/models/api_configuration.py b/services/postgresflex/src/stackit/postgresflex/models/api_configuration.py index 7c6b9261..ce288d1f 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/api_configuration.py +++ b/services/postgresflex/src/stackit/postgresflex/models/api_configuration.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ApiConfiguration(BaseModel): """ ApiConfiguration - """ + """ # noqa: E501 name: Optional[StrictStr] = None setting: Optional[StrictStr] = None diff --git a/services/postgresflex/src/stackit/postgresflex/models/api_extension_config_load_response.py b/services/postgresflex/src/stackit/postgresflex/models/api_extension_config_load_response.py index 5d34de2b..cc4bfcf8 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/api_extension_config_load_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/api_extension_config_load_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ApiExtensionConfigLoadResponse(BaseModel): """ ApiExtensionConfigLoadResponse - """ + """ # noqa: E501 configuration: Optional[List[ApiConfiguration]] = Field( default=None, description="Returns marshalled JSON of the new configuration of whatever extension is called" diff --git a/services/postgresflex/src/stackit/postgresflex/models/api_extension_configure_response.py b/services/postgresflex/src/stackit/postgresflex/models/api_extension_configure_response.py index e24b1199..7debe822 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/api_extension_configure_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/api_extension_configure_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ApiExtensionConfigureResponse(BaseModel): """ ApiExtensionConfigureResponse - """ + """ # noqa: E501 configuration: Optional[List[ApiConfiguration]] = Field( default=None, description="Returns marshalled JSON of the new configuration of whatever extension is called" diff --git a/services/postgresflex/src/stackit/postgresflex/models/api_extension_delete_response.py b/services/postgresflex/src/stackit/postgresflex/models/api_extension_delete_response.py index 00226ffb..6cb9750e 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/api_extension_delete_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/api_extension_delete_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ApiExtensionDeleteResponse(BaseModel): """ ApiExtensionDeleteResponse - """ + """ # noqa: E501 is_succeded: Optional[StrictBool] = Field(default=None, alias="isSucceded") __properties: ClassVar[List[str]] = ["isSucceded"] diff --git a/services/postgresflex/src/stackit/postgresflex/models/api_extension_list.py b/services/postgresflex/src/stackit/postgresflex/models/api_extension_list.py index a3ec2cba..c4314a20 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/api_extension_list.py +++ b/services/postgresflex/src/stackit/postgresflex/models/api_extension_list.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ApiExtensionList(BaseModel): """ ApiExtensionList - """ + """ # noqa: E501 id: Optional[StrictInt] = Field(default=None, alias="ID") description: Optional[StrictStr] = None diff --git a/services/postgresflex/src/stackit/postgresflex/models/api_extension_load_response.py b/services/postgresflex/src/stackit/postgresflex/models/api_extension_load_response.py index 481a5e22..b62c5fc2 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/api_extension_load_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/api_extension_load_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ApiExtensionLoadResponse(BaseModel): """ ApiExtensionLoadResponse - """ + """ # noqa: E501 extension: Optional[ApiExtensionList] = None __properties: ClassVar[List[str]] = ["extension"] diff --git a/services/postgresflex/src/stackit/postgresflex/models/api_install_response.py b/services/postgresflex/src/stackit/postgresflex/models/api_install_response.py index d1a8d6d6..225e2732 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/api_install_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/api_install_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ApiInstallResponse(BaseModel): """ ApiInstallResponse - """ + """ # noqa: E501 extension: Optional[ApiExtensionList] = None __properties: ClassVar[List[str]] = ["extension"] diff --git a/services/postgresflex/src/stackit/postgresflex/models/api_installed_list_response.py b/services/postgresflex/src/stackit/postgresflex/models/api_installed_list_response.py index c01cd7d0..b5a787ba 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/api_installed_list_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/api_installed_list_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ApiInstalledListResponse(BaseModel): """ ApiInstalledListResponse - """ + """ # noqa: E501 installed: Optional[List[ApiExtensionList]] = None __properties: ClassVar[List[str]] = ["installed"] diff --git a/services/postgresflex/src/stackit/postgresflex/models/backup.py b/services/postgresflex/src/stackit/postgresflex/models/backup.py index 6a7c32da..8cb8cdf0 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/backup.py +++ b/services/postgresflex/src/stackit/postgresflex/models/backup.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class Backup(BaseModel): """ Backup - """ + """ # noqa: E501 end_time: Optional[StrictStr] = Field(default=None, alias="endTime") error: Optional[StrictStr] = None diff --git a/services/postgresflex/src/stackit/postgresflex/models/clone_instance_payload.py b/services/postgresflex/src/stackit/postgresflex/models/clone_instance_payload.py index 05bee56d..03511bd3 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/clone_instance_payload.py +++ b/services/postgresflex/src/stackit/postgresflex/models/clone_instance_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CloneInstancePayload(BaseModel): """ CloneInstancePayload - """ + """ # noqa: E501 var_class: Optional[StrictStr] = Field(default=None, alias="class") size: Optional[StrictInt] = None diff --git a/services/postgresflex/src/stackit/postgresflex/models/clone_instance_response.py b/services/postgresflex/src/stackit/postgresflex/models/clone_instance_response.py index 594dca71..5a9d5343 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/clone_instance_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/clone_instance_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CloneInstanceResponse(BaseModel): """ CloneInstanceResponse - """ + """ # noqa: E501 instance_id: Optional[StrictStr] = Field(default=None, alias="instanceId") __properties: ClassVar[List[str]] = ["instanceId"] diff --git a/services/postgresflex/src/stackit/postgresflex/models/create_database_payload.py b/services/postgresflex/src/stackit/postgresflex/models/create_database_payload.py index 591e8b55..08e5e097 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/create_database_payload.py +++ b/services/postgresflex/src/stackit/postgresflex/models/create_database_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateDatabasePayload(BaseModel): """ CreateDatabasePayload - """ + """ # noqa: E501 name: Optional[StrictStr] = None options: Optional[Dict[str, StrictStr]] = Field(default=None, description="Database specific options") diff --git a/services/postgresflex/src/stackit/postgresflex/models/create_instance_payload.py b/services/postgresflex/src/stackit/postgresflex/models/create_instance_payload.py index 90efe8dc..7745c9a8 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/create_instance_payload.py +++ b/services/postgresflex/src/stackit/postgresflex/models/create_instance_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -28,7 +28,7 @@ class CreateInstancePayload(BaseModel): """ CreateInstancePayload - """ + """ # noqa: E501 acl: ACL backup_schedule: StrictStr = Field(alias="backupSchedule") diff --git a/services/postgresflex/src/stackit/postgresflex/models/create_instance_response.py b/services/postgresflex/src/stackit/postgresflex/models/create_instance_response.py index 209b1107..2dcaf537 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/create_instance_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/create_instance_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateInstanceResponse(BaseModel): """ CreateInstanceResponse - """ + """ # noqa: E501 id: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["id"] diff --git a/services/postgresflex/src/stackit/postgresflex/models/create_user_payload.py b/services/postgresflex/src/stackit/postgresflex/models/create_user_payload.py index ddd38793..3318ee39 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/create_user_payload.py +++ b/services/postgresflex/src/stackit/postgresflex/models/create_user_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateUserPayload(BaseModel): """ CreateUserPayload - """ + """ # noqa: E501 roles: Optional[List[StrictStr]] = None username: Optional[StrictStr] = None diff --git a/services/postgresflex/src/stackit/postgresflex/models/create_user_response.py b/services/postgresflex/src/stackit/postgresflex/models/create_user_response.py index 01e49384..5bd1a015 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/create_user_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/create_user_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class CreateUserResponse(BaseModel): """ CreateUserResponse - """ + """ # noqa: E501 item: Optional[User] = None __properties: ClassVar[List[str]] = ["item"] diff --git a/services/postgresflex/src/stackit/postgresflex/models/error.py b/services/postgresflex/src/stackit/postgresflex/models/error.py index 64ba99b2..f32c1e86 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/error.py +++ b/services/postgresflex/src/stackit/postgresflex/models/error.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class Error(BaseModel): """ Error - """ + """ # noqa: E501 code: Optional[StrictInt] = None fields: Optional[Dict[str, List[StrictStr]]] = None diff --git a/services/postgresflex/src/stackit/postgresflex/models/extensions_configuration.py b/services/postgresflex/src/stackit/postgresflex/models/extensions_configuration.py index ed8c7a03..5631666c 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/extensions_configuration.py +++ b/services/postgresflex/src/stackit/postgresflex/models/extensions_configuration.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ExtensionsConfiguration(BaseModel): """ ExtensionsConfiguration - """ + """ # noqa: E501 name: Optional[StrictStr] = None setting: Optional[StrictStr] = None diff --git a/services/postgresflex/src/stackit/postgresflex/models/extensions_extension_list_response.py b/services/postgresflex/src/stackit/postgresflex/models/extensions_extension_list_response.py index b0319112..1898f0b5 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/extensions_extension_list_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/extensions_extension_list_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ExtensionsExtensionListResponse(BaseModel): """ ExtensionsExtensionListResponse - """ + """ # noqa: E501 list: Optional[List[ApiExtensionList]] = None __properties: ClassVar[List[str]] = ["list"] diff --git a/services/postgresflex/src/stackit/postgresflex/models/extensions_new_config.py b/services/postgresflex/src/stackit/postgresflex/models/extensions_new_config.py index 97a29770..579b181f 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/extensions_new_config.py +++ b/services/postgresflex/src/stackit/postgresflex/models/extensions_new_config.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ExtensionsNewConfig(BaseModel): """ ExtensionsNewConfig - """ + """ # noqa: E501 configuration: Optional[List[ExtensionsConfiguration]] = None __properties: ClassVar[List[str]] = ["configuration"] diff --git a/services/postgresflex/src/stackit/postgresflex/models/flavor.py b/services/postgresflex/src/stackit/postgresflex/models/flavor.py index 59fde513..77efd2ac 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/flavor.py +++ b/services/postgresflex/src/stackit/postgresflex/models/flavor.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class Flavor(BaseModel): """ Flavor - """ + """ # noqa: E501 cpu: Optional[StrictInt] = None description: Optional[StrictStr] = None diff --git a/services/postgresflex/src/stackit/postgresflex/models/get_backup_response.py b/services/postgresflex/src/stackit/postgresflex/models/get_backup_response.py index ae6d25e7..5e6b619e 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/get_backup_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/get_backup_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class GetBackupResponse(BaseModel): """ GetBackupResponse - """ + """ # noqa: E501 item: Optional[Backup] = None __properties: ClassVar[List[str]] = ["item"] diff --git a/services/postgresflex/src/stackit/postgresflex/models/get_user_response.py b/services/postgresflex/src/stackit/postgresflex/models/get_user_response.py index b83050be..85f78249 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/get_user_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/get_user_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class GetUserResponse(BaseModel): """ GetUserResponse - """ + """ # noqa: E501 item: Optional[UserResponse] = None __properties: ClassVar[List[str]] = ["item"] diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance.py b/services/postgresflex/src/stackit/postgresflex/models/instance.py index c2766b88..2c565642 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/instance.py +++ b/services/postgresflex/src/stackit/postgresflex/models/instance.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class Instance(BaseModel): """ Instance - """ + """ # noqa: E501 acl: Optional[ACL] = None backup_schedule: Optional[StrictStr] = Field(default=None, alias="backupSchedule") diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_create_database_response.py b/services/postgresflex/src/stackit/postgresflex/models/instance_create_database_response.py index ffc68edc..ce9af702 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/instance_create_database_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/instance_create_database_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class InstanceCreateDatabaseResponse(BaseModel): """ InstanceCreateDatabaseResponse - """ + """ # noqa: E501 id: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["id"] diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_data_point.py b/services/postgresflex/src/stackit/postgresflex/models/instance_data_point.py index 4925ee15..1ad97805 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/instance_data_point.py +++ b/services/postgresflex/src/stackit/postgresflex/models/instance_data_point.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class InstanceDataPoint(BaseModel): """ InstanceDataPoint - """ + """ # noqa: E501 timestamp: Optional[StrictStr] = None value: Optional[Union[StrictFloat, StrictInt]] = None diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_database.py b/services/postgresflex/src/stackit/postgresflex/models/instance_database.py index 9661a957..bccc7cf4 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/instance_database.py +++ b/services/postgresflex/src/stackit/postgresflex/models/instance_database.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class InstanceDatabase(BaseModel): """ InstanceDatabase - """ + """ # noqa: E501 id: Optional[StrictStr] = None name: Optional[StrictStr] = None diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_host.py b/services/postgresflex/src/stackit/postgresflex/models/instance_host.py index 36be9596..d2f01805 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/instance_host.py +++ b/services/postgresflex/src/stackit/postgresflex/models/instance_host.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class InstanceHost(BaseModel): """ InstanceHost - """ + """ # noqa: E501 host_metrics: Optional[List[InstanceHostMetric]] = Field(default=None, alias="hostMetrics") id: Optional[StrictStr] = None diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_host_metric.py b/services/postgresflex/src/stackit/postgresflex/models/instance_host_metric.py index 8360e117..09cde5f7 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/instance_host_metric.py +++ b/services/postgresflex/src/stackit/postgresflex/models/instance_host_metric.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class InstanceHostMetric(BaseModel): """ InstanceHostMetric - """ + """ # noqa: E501 datapoints: Optional[List[InstanceDataPoint]] = None name: Optional[StrictStr] = None diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_list_databases_response.py b/services/postgresflex/src/stackit/postgresflex/models/instance_list_databases_response.py index 69f36841..9b08c0ea 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/instance_list_databases_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/instance_list_databases_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class InstanceListDatabasesResponse(BaseModel): """ InstanceListDatabasesResponse - """ + """ # noqa: E501 databases: Optional[List[InstanceDatabase]] = None __properties: ClassVar[List[str]] = ["databases"] diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_list_instance.py b/services/postgresflex/src/stackit/postgresflex/models/instance_list_instance.py index 94002b81..304e665f 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/instance_list_instance.py +++ b/services/postgresflex/src/stackit/postgresflex/models/instance_list_instance.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class InstanceListInstance(BaseModel): """ InstanceListInstance - """ + """ # noqa: E501 id: Optional[StrictStr] = None name: Optional[StrictStr] = None diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_metrics_response.py b/services/postgresflex/src/stackit/postgresflex/models/instance_metrics_response.py index fbf5a91d..e0a9463a 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/instance_metrics_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/instance_metrics_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class InstanceMetricsResponse(BaseModel): """ InstanceMetricsResponse - """ + """ # noqa: E501 hosts: Optional[List[InstanceHost]] = None __properties: ClassVar[List[str]] = ["hosts"] diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_response.py b/services/postgresflex/src/stackit/postgresflex/models/instance_response.py index f1808147..4577bd6b 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/instance_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/instance_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class InstanceResponse(BaseModel): """ InstanceResponse - """ + """ # noqa: E501 item: Optional[Instance] = None __properties: ClassVar[List[str]] = ["item"] diff --git a/services/postgresflex/src/stackit/postgresflex/models/list_backups_response.py b/services/postgresflex/src/stackit/postgresflex/models/list_backups_response.py index 3631af5b..d92771fa 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/list_backups_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/list_backups_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListBackupsResponse(BaseModel): """ ListBackupsResponse - """ + """ # noqa: E501 count: Optional[StrictInt] = None items: Optional[List[Backup]] = None diff --git a/services/postgresflex/src/stackit/postgresflex/models/list_flavors_response.py b/services/postgresflex/src/stackit/postgresflex/models/list_flavors_response.py index 66f64766..d72dae97 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/list_flavors_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/list_flavors_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListFlavorsResponse(BaseModel): """ ListFlavorsResponse - """ + """ # noqa: E501 flavors: Optional[List[Flavor]] = None __properties: ClassVar[List[str]] = ["flavors"] diff --git a/services/postgresflex/src/stackit/postgresflex/models/list_instances_response.py b/services/postgresflex/src/stackit/postgresflex/models/list_instances_response.py index bb0dfe7d..7a49d9b0 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/list_instances_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/list_instances_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListInstancesResponse(BaseModel): """ ListInstancesResponse - """ + """ # noqa: E501 count: Optional[StrictInt] = None items: Optional[List[InstanceListInstance]] = None diff --git a/services/postgresflex/src/stackit/postgresflex/models/list_storages_response.py b/services/postgresflex/src/stackit/postgresflex/models/list_storages_response.py index 57e1c207..625ceb2c 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/list_storages_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/list_storages_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListStoragesResponse(BaseModel): """ ListStoragesResponse - """ + """ # noqa: E501 storage_classes: Optional[List[StrictStr]] = Field(default=None, alias="storageClasses") storage_range: Optional[StorageRange] = Field(default=None, alias="storageRange") diff --git a/services/postgresflex/src/stackit/postgresflex/models/list_users_response.py b/services/postgresflex/src/stackit/postgresflex/models/list_users_response.py index d218f223..15f36003 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/list_users_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/list_users_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListUsersResponse(BaseModel): """ ListUsersResponse - """ + """ # noqa: E501 count: Optional[StrictInt] = None items: Optional[List[ListUsersResponseItem]] = None diff --git a/services/postgresflex/src/stackit/postgresflex/models/list_users_response_item.py b/services/postgresflex/src/stackit/postgresflex/models/list_users_response_item.py index 17a18f06..7640d4b9 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/list_users_response_item.py +++ b/services/postgresflex/src/stackit/postgresflex/models/list_users_response_item.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ListUsersResponseItem(BaseModel): """ ListUsersResponseItem - """ + """ # noqa: E501 id: Optional[StrictStr] = None username: Optional[StrictStr] = None diff --git a/services/postgresflex/src/stackit/postgresflex/models/list_versions_response.py b/services/postgresflex/src/stackit/postgresflex/models/list_versions_response.py index 87ff68c3..68de74b7 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/list_versions_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/list_versions_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ListVersionsResponse(BaseModel): """ ListVersionsResponse - """ + """ # noqa: E501 versions: Optional[List[StrictStr]] = None __properties: ClassVar[List[str]] = ["versions"] diff --git a/services/postgresflex/src/stackit/postgresflex/models/partial_update_instance_payload.py b/services/postgresflex/src/stackit/postgresflex/models/partial_update_instance_payload.py index 8e76d273..e8a6ef7a 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/partial_update_instance_payload.py +++ b/services/postgresflex/src/stackit/postgresflex/models/partial_update_instance_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -28,7 +28,7 @@ class PartialUpdateInstancePayload(BaseModel): """ PartialUpdateInstancePayload - """ + """ # noqa: E501 acl: Optional[ACL] = None backup_schedule: Optional[StrictStr] = Field(default=None, alias="backupSchedule") diff --git a/services/postgresflex/src/stackit/postgresflex/models/partial_update_instance_response.py b/services/postgresflex/src/stackit/postgresflex/models/partial_update_instance_response.py index 7e312714..64c65816 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/partial_update_instance_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/partial_update_instance_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class PartialUpdateInstanceResponse(BaseModel): """ PartialUpdateInstanceResponse - """ + """ # noqa: E501 item: Optional[Instance] = None __properties: ClassVar[List[str]] = ["item"] diff --git a/services/postgresflex/src/stackit/postgresflex/models/partial_update_user_payload.py b/services/postgresflex/src/stackit/postgresflex/models/partial_update_user_payload.py index 762f701b..65dfef9d 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/partial_update_user_payload.py +++ b/services/postgresflex/src/stackit/postgresflex/models/partial_update_user_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class PartialUpdateUserPayload(BaseModel): """ PartialUpdateUserPayload - """ + """ # noqa: E501 database: Optional[StrictStr] = None roles: Optional[List[StrictStr]] = None diff --git a/services/postgresflex/src/stackit/postgresflex/models/postgres_database_parameter.py b/services/postgresflex/src/stackit/postgresflex/models/postgres_database_parameter.py index 4dbfe818..b5bd1a1c 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/postgres_database_parameter.py +++ b/services/postgresflex/src/stackit/postgresflex/models/postgres_database_parameter.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class PostgresDatabaseParameter(BaseModel): """ PostgresDatabaseParameter - """ + """ # noqa: E501 context: Optional[StrictStr] = Field(default=None, description="Context of the parameter.") data_type: Optional[StrictStr] = Field( diff --git a/services/postgresflex/src/stackit/postgresflex/models/postgres_database_parameter_response.py b/services/postgresflex/src/stackit/postgresflex/models/postgres_database_parameter_response.py index bc06cc56..bd49db7d 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/postgres_database_parameter_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/postgres_database_parameter_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class PostgresDatabaseParameterResponse(BaseModel): """ PostgresDatabaseParameterResponse - """ + """ # noqa: E501 parameter: Optional[List[PostgresDatabaseParameter]] = Field(default=None, description="List of the parameter") __properties: ClassVar[List[str]] = ["parameter"] diff --git a/services/postgresflex/src/stackit/postgresflex/models/reset_user_response.py b/services/postgresflex/src/stackit/postgresflex/models/reset_user_response.py index 4773c55e..96cd9f36 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/reset_user_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/reset_user_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ResetUserResponse(BaseModel): """ ResetUserResponse - """ + """ # noqa: E501 item: Optional[User] = None __properties: ClassVar[List[str]] = ["item"] diff --git a/services/postgresflex/src/stackit/postgresflex/models/storage.py b/services/postgresflex/src/stackit/postgresflex/models/storage.py index 80902fa1..e904ce69 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/storage.py +++ b/services/postgresflex/src/stackit/postgresflex/models/storage.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class Storage(BaseModel): """ Storage - """ + """ # noqa: E501 var_class: Optional[StrictStr] = Field(default=None, alias="class") size: Optional[StrictInt] = None diff --git a/services/postgresflex/src/stackit/postgresflex/models/storage_range.py b/services/postgresflex/src/stackit/postgresflex/models/storage_range.py index 86834bbf..d044eeb5 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/storage_range.py +++ b/services/postgresflex/src/stackit/postgresflex/models/storage_range.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class StorageRange(BaseModel): """ StorageRange - """ + """ # noqa: E501 max: Optional[StrictInt] = None min: Optional[StrictInt] = None diff --git a/services/postgresflex/src/stackit/postgresflex/models/update_backup_schedule_payload.py b/services/postgresflex/src/stackit/postgresflex/models/update_backup_schedule_payload.py index 70df84fe..b1a172e0 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/update_backup_schedule_payload.py +++ b/services/postgresflex/src/stackit/postgresflex/models/update_backup_schedule_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class UpdateBackupSchedulePayload(BaseModel): """ UpdateBackupSchedulePayload - """ + """ # noqa: E501 backup_schedule: StrictStr = Field(alias="backupSchedule") __properties: ClassVar[List[str]] = ["backupSchedule"] diff --git a/services/postgresflex/src/stackit/postgresflex/models/update_instance_payload.py b/services/postgresflex/src/stackit/postgresflex/models/update_instance_payload.py index 9ea03cb1..52c40f61 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/update_instance_payload.py +++ b/services/postgresflex/src/stackit/postgresflex/models/update_instance_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -28,7 +28,7 @@ class UpdateInstancePayload(BaseModel): """ UpdateInstancePayload - """ + """ # noqa: E501 acl: Optional[ACL] = None backup_schedule: Optional[StrictStr] = Field(default=None, alias="backupSchedule") diff --git a/services/postgresflex/src/stackit/postgresflex/models/update_user_payload.py b/services/postgresflex/src/stackit/postgresflex/models/update_user_payload.py index 80326945..57722fba 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/update_user_payload.py +++ b/services/postgresflex/src/stackit/postgresflex/models/update_user_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class UpdateUserPayload(BaseModel): """ UpdateUserPayload - """ + """ # noqa: E501 database: Optional[StrictStr] = None roles: Optional[List[StrictStr]] = None diff --git a/services/postgresflex/src/stackit/postgresflex/models/user.py b/services/postgresflex/src/stackit/postgresflex/models/user.py index b31eb818..5aeede49 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/user.py +++ b/services/postgresflex/src/stackit/postgresflex/models/user.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class User(BaseModel): """ User - """ + """ # noqa: E501 database: Optional[StrictStr] = None host: Optional[StrictStr] = None diff --git a/services/postgresflex/src/stackit/postgresflex/models/user_response.py b/services/postgresflex/src/stackit/postgresflex/models/user_response.py index e1a6ac34..abd85fdd 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/user_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/user_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class UserResponse(BaseModel): """ UserResponse - """ + """ # noqa: E501 host: Optional[StrictStr] = None id: Optional[StrictStr] = None diff --git a/services/postgresflex/src/stackit/postgresflex/rest.py b/services/postgresflex/src/stackit/postgresflex/rest.py index f1a6ec27..141c22ef 100644 --- a/services/postgresflex/src/stackit/postgresflex/rest.py +++ b/services/postgresflex/src/stackit/postgresflex/rest.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -125,7 +125,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/rabbitmq/CHANGELOG.md b/services/rabbitmq/CHANGELOG.md index 528cf9e2..9a7352a1 100644 --- a/services/rabbitmq/CHANGELOG.md +++ b/services/rabbitmq/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.2.2 +- **Internal:** Improve deserializing and error types + ## v0.2.1 (2025-05-09) - **Feature:** Update user-agent header diff --git a/services/rabbitmq/pyproject.toml b/services/rabbitmq/pyproject.toml index 6b7f8fc5..2be59349 100644 --- a/services/rabbitmq/pyproject.toml +++ b/services/rabbitmq/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-rabbitmq" [tool.poetry] name = "stackit-rabbitmq" -version = "v0.2.1" +version = "v0.2.2" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/rabbitmq/src/stackit/rabbitmq/__init__.py b/services/rabbitmq/src/stackit/rabbitmq/__init__.py index bbdd6495..f0ac828f 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/__init__.py +++ b/services/rabbitmq/src/stackit/rabbitmq/__init__.py @@ -11,58 +11,125 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "Backup", + "CreateBackupResponseItem", + "CreateInstancePayload", + "CreateInstanceResponse", + "Credentials", + "CredentialsListItem", + "CredentialsResponse", + "Error", + "GetMetricsResponse", + "Instance", + "InstanceLastOperation", + "InstanceParameters", + "InstanceSchema", + "ListBackupsResponse", + "ListCredentialsResponse", + "ListInstancesResponse", + "ListOfferingsResponse", + "ListRestoresResponse", + "ModelSchema", + "Offering", + "PartialUpdateInstancePayload", + "Plan", + "RawCredentials", + "Restore", + "TriggerRestoreResponse", + "UpdateBackupsConfigPayload", + "UpdateBackupsConfigResponse", +] + # import apis into sdk package -from stackit.rabbitmq.api.default_api import DefaultApi -from stackit.rabbitmq.api_client import ApiClient +from stackit.rabbitmq.api.default_api import DefaultApi as DefaultApi +from stackit.rabbitmq.api_client import ApiClient as ApiClient # import ApiClient -from stackit.rabbitmq.api_response import ApiResponse -from stackit.rabbitmq.configuration import HostConfiguration -from stackit.rabbitmq.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.rabbitmq.api_response import ApiResponse as ApiResponse +from stackit.rabbitmq.configuration import HostConfiguration as HostConfiguration +from stackit.rabbitmq.exceptions import ApiAttributeError as ApiAttributeError +from stackit.rabbitmq.exceptions import ApiException as ApiException +from stackit.rabbitmq.exceptions import ApiKeyError as ApiKeyError +from stackit.rabbitmq.exceptions import ApiTypeError as ApiTypeError +from stackit.rabbitmq.exceptions import ApiValueError as ApiValueError +from stackit.rabbitmq.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.rabbitmq.models.backup import Backup -from stackit.rabbitmq.models.create_backup_response_item import CreateBackupResponseItem -from stackit.rabbitmq.models.create_instance_payload import CreateInstancePayload -from stackit.rabbitmq.models.create_instance_response import CreateInstanceResponse -from stackit.rabbitmq.models.credentials import Credentials -from stackit.rabbitmq.models.credentials_list_item import CredentialsListItem -from stackit.rabbitmq.models.credentials_response import CredentialsResponse -from stackit.rabbitmq.models.error import Error -from stackit.rabbitmq.models.get_metrics_response import GetMetricsResponse -from stackit.rabbitmq.models.instance import Instance -from stackit.rabbitmq.models.instance_last_operation import InstanceLastOperation -from stackit.rabbitmq.models.instance_parameters import InstanceParameters -from stackit.rabbitmq.models.instance_schema import InstanceSchema -from stackit.rabbitmq.models.list_backups_response import ListBackupsResponse -from stackit.rabbitmq.models.list_credentials_response import ListCredentialsResponse -from stackit.rabbitmq.models.list_instances_response import ListInstancesResponse -from stackit.rabbitmq.models.list_offerings_response import ListOfferingsResponse -from stackit.rabbitmq.models.list_restores_response import ListRestoresResponse -from stackit.rabbitmq.models.model_schema import ModelSchema -from stackit.rabbitmq.models.offering import Offering +from stackit.rabbitmq.models.backup import Backup as Backup +from stackit.rabbitmq.models.create_backup_response_item import ( + CreateBackupResponseItem as CreateBackupResponseItem, +) +from stackit.rabbitmq.models.create_instance_payload import ( + CreateInstancePayload as CreateInstancePayload, +) +from stackit.rabbitmq.models.create_instance_response import ( + CreateInstanceResponse as CreateInstanceResponse, +) +from stackit.rabbitmq.models.credentials import Credentials as Credentials +from stackit.rabbitmq.models.credentials_list_item import ( + CredentialsListItem as CredentialsListItem, +) +from stackit.rabbitmq.models.credentials_response import ( + CredentialsResponse as CredentialsResponse, +) +from stackit.rabbitmq.models.error import Error as Error +from stackit.rabbitmq.models.get_metrics_response import ( + GetMetricsResponse as GetMetricsResponse, +) +from stackit.rabbitmq.models.instance import Instance as Instance +from stackit.rabbitmq.models.instance_last_operation import ( + InstanceLastOperation as InstanceLastOperation, +) +from stackit.rabbitmq.models.instance_parameters import ( + InstanceParameters as InstanceParameters, +) +from stackit.rabbitmq.models.instance_schema import InstanceSchema as InstanceSchema +from stackit.rabbitmq.models.list_backups_response import ( + ListBackupsResponse as ListBackupsResponse, +) +from stackit.rabbitmq.models.list_credentials_response import ( + ListCredentialsResponse as ListCredentialsResponse, +) +from stackit.rabbitmq.models.list_instances_response import ( + ListInstancesResponse as ListInstancesResponse, +) +from stackit.rabbitmq.models.list_offerings_response import ( + ListOfferingsResponse as ListOfferingsResponse, +) +from stackit.rabbitmq.models.list_restores_response import ( + ListRestoresResponse as ListRestoresResponse, +) +from stackit.rabbitmq.models.model_schema import ModelSchema as ModelSchema +from stackit.rabbitmq.models.offering import Offering as Offering from stackit.rabbitmq.models.partial_update_instance_payload import ( - PartialUpdateInstancePayload, + PartialUpdateInstancePayload as PartialUpdateInstancePayload, +) +from stackit.rabbitmq.models.plan import Plan as Plan +from stackit.rabbitmq.models.raw_credentials import RawCredentials as RawCredentials +from stackit.rabbitmq.models.restore import Restore as Restore +from stackit.rabbitmq.models.trigger_restore_response import ( + TriggerRestoreResponse as TriggerRestoreResponse, ) -from stackit.rabbitmq.models.plan import Plan -from stackit.rabbitmq.models.raw_credentials import RawCredentials -from stackit.rabbitmq.models.restore import Restore -from stackit.rabbitmq.models.trigger_restore_response import TriggerRestoreResponse from stackit.rabbitmq.models.update_backups_config_payload import ( - UpdateBackupsConfigPayload, + UpdateBackupsConfigPayload as UpdateBackupsConfigPayload, ) from stackit.rabbitmq.models.update_backups_config_response import ( - UpdateBackupsConfigResponse, + UpdateBackupsConfigResponse as UpdateBackupsConfigResponse, ) diff --git a/services/rabbitmq/src/stackit/rabbitmq/api/default_api.py b/services/rabbitmq/src/stackit/rabbitmq/api/default_api.py index f89f9f99..80697994 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/api/default_api.py +++ b/services/rabbitmq/src/stackit/rabbitmq/api/default_api.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -104,7 +104,7 @@ def create_backup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_backup_serialize( instance_id=instance_id, @@ -169,7 +169,7 @@ def create_backup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_backup_serialize( instance_id=instance_id, @@ -234,7 +234,7 @@ def create_backup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_backup_serialize( instance_id=instance_id, @@ -271,7 +271,7 @@ def _create_backup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -349,7 +349,7 @@ def create_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( project_id=project_id, @@ -414,7 +414,7 @@ def create_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( project_id=project_id, @@ -479,7 +479,7 @@ def create_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( project_id=project_id, @@ -515,7 +515,7 @@ def _create_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -595,7 +595,7 @@ def create_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -663,7 +663,7 @@ def create_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -731,7 +731,7 @@ def create_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -768,7 +768,7 @@ def _create_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -857,7 +857,7 @@ def delete_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( project_id=project_id, @@ -926,7 +926,7 @@ def delete_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( project_id=project_id, @@ -995,7 +995,7 @@ def delete_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( project_id=project_id, @@ -1033,7 +1033,7 @@ def _delete_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1113,7 +1113,7 @@ def delete_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1179,7 +1179,7 @@ def delete_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1245,7 +1245,7 @@ def delete_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1282,7 +1282,7 @@ def _delete_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1362,7 +1362,7 @@ def download_backup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._download_backup_serialize( backup_id=backup_id, @@ -1430,7 +1430,7 @@ def download_backup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._download_backup_serialize( backup_id=backup_id, @@ -1498,7 +1498,7 @@ def download_backup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._download_backup_serialize( backup_id=backup_id, @@ -1536,7 +1536,7 @@ def _download_backup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1621,7 +1621,7 @@ def get_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( project_id=project_id, @@ -1690,7 +1690,7 @@ def get_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( project_id=project_id, @@ -1759,7 +1759,7 @@ def get_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( project_id=project_id, @@ -1797,7 +1797,7 @@ def _get_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1877,7 +1877,7 @@ def get_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -1943,7 +1943,7 @@ def get_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -2009,7 +2009,7 @@ def get_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -2046,7 +2046,7 @@ def _get_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2123,7 +2123,7 @@ def get_metrics( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_metrics_serialize( instance_id=instance_id, @@ -2187,7 +2187,7 @@ def get_metrics_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_metrics_serialize( instance_id=instance_id, @@ -2251,7 +2251,7 @@ def get_metrics_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_metrics_serialize( instance_id=instance_id, @@ -2287,7 +2287,7 @@ def _get_metrics_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2364,7 +2364,7 @@ def list_backups( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( instance_id=instance_id, @@ -2428,7 +2428,7 @@ def list_backups_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( instance_id=instance_id, @@ -2492,7 +2492,7 @@ def list_backups_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( instance_id=instance_id, @@ -2528,7 +2528,7 @@ def _list_backups_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2606,7 +2606,7 @@ def list_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( project_id=project_id, @@ -2671,7 +2671,7 @@ def list_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( project_id=project_id, @@ -2736,7 +2736,7 @@ def list_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( project_id=project_id, @@ -2772,7 +2772,7 @@ def _list_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2847,7 +2847,7 @@ def list_instances( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -2908,7 +2908,7 @@ def list_instances_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -2969,7 +2969,7 @@ def list_instances_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -3003,7 +3003,7 @@ def _list_instances_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3076,7 +3076,7 @@ def list_offerings( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_offerings_serialize( project_id=project_id, @@ -3136,7 +3136,7 @@ def list_offerings_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_offerings_serialize( project_id=project_id, @@ -3196,7 +3196,7 @@ def list_offerings_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_offerings_serialize( project_id=project_id, @@ -3229,7 +3229,7 @@ def _list_offerings_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3304,7 +3304,7 @@ def list_restores( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_restores_serialize( instance_id=instance_id, @@ -3368,7 +3368,7 @@ def list_restores_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_restores_serialize( instance_id=instance_id, @@ -3432,7 +3432,7 @@ def list_restores_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_restores_serialize( instance_id=instance_id, @@ -3468,7 +3468,7 @@ def _list_restores_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3554,7 +3554,7 @@ def partial_update_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_instance_serialize( project_id=project_id, @@ -3629,7 +3629,7 @@ def partial_update_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_instance_serialize( project_id=project_id, @@ -3704,7 +3704,7 @@ def partial_update_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_instance_serialize( project_id=project_id, @@ -3743,7 +3743,7 @@ def _partial_update_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3830,7 +3830,7 @@ def trigger_recreate( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_recreate_serialize( instance_id=instance_id, @@ -3895,7 +3895,7 @@ def trigger_recreate_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_recreate_serialize( instance_id=instance_id, @@ -3960,7 +3960,7 @@ def trigger_recreate_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_recreate_serialize( instance_id=instance_id, @@ -3997,7 +3997,7 @@ def _trigger_recreate_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4074,7 +4074,7 @@ def trigger_restart( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restart_serialize( instance_id=instance_id, @@ -4139,7 +4139,7 @@ def trigger_restart_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restart_serialize( instance_id=instance_id, @@ -4204,7 +4204,7 @@ def trigger_restart_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restart_serialize( instance_id=instance_id, @@ -4241,7 +4241,7 @@ def _trigger_restart_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4321,7 +4321,7 @@ def trigger_restore( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restore_serialize( instance_id=instance_id, @@ -4390,7 +4390,7 @@ def trigger_restore_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restore_serialize( instance_id=instance_id, @@ -4459,7 +4459,7 @@ def trigger_restore_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restore_serialize( instance_id=instance_id, @@ -4498,7 +4498,7 @@ def _trigger_restore_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4583,7 +4583,7 @@ def update_backups_config( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_backups_config_serialize( instance_id=instance_id, @@ -4655,7 +4655,7 @@ def update_backups_config_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_backups_config_serialize( instance_id=instance_id, @@ -4727,7 +4727,7 @@ def update_backups_config_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_backups_config_serialize( instance_id=instance_id, @@ -4766,7 +4766,7 @@ def _update_backups_config_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/rabbitmq/src/stackit/rabbitmq/api_client.py b/services/rabbitmq/src/stackit/rabbitmq/api_client.py index 8e237363..61ee6f3c 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/api_client.py +++ b/services/rabbitmq/src/stackit/rabbitmq/api_client.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -331,6 +331,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -350,12 +354,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -457,7 +461,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -473,7 +477,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -488,6 +495,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/rabbitmq/src/stackit/rabbitmq/configuration.py b/services/rabbitmq/src/stackit/rabbitmq/configuration.py index 94421f10..0d46d1d7 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/configuration.py +++ b/services/rabbitmq/src/stackit/rabbitmq/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT RabbitMQ API @@ -14,7 +9,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -53,7 +70,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -72,7 +89,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -112,7 +134,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -131,12 +153,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/rabbitmq/src/stackit/rabbitmq/exceptions.py b/services/rabbitmq/src/stackit/rabbitmq/exceptions.py index 466ef977..0206e5ad 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/exceptions.py +++ b/services/rabbitmq/src/stackit/rabbitmq/exceptions.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -151,6 +151,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -187,6 +194,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/__init__.py b/services/rabbitmq/src/stackit/rabbitmq/models/__init__.py index f283d903..a6129fdc 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/__init__.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/__init__.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/backup.py b/services/rabbitmq/src/stackit/rabbitmq/models/backup.py index c4f37079..fc62b796 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/backup.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/backup.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Backup(BaseModel): """ Backup - """ + """ # noqa: E501 downloadable: Optional[StrictBool] = None finished_at: StrictStr diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/create_backup_response_item.py b/services/rabbitmq/src/stackit/rabbitmq/models/create_backup_response_item.py index 4ba62567..c0c4eed2 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/create_backup_response_item.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/create_backup_response_item.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateBackupResponseItem(BaseModel): """ CreateBackupResponseItem - """ + """ # noqa: E501 id: StrictInt message: StrictStr diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/create_instance_payload.py b/services/rabbitmq/src/stackit/rabbitmq/models/create_instance_payload.py index 2187a117..3971b02d 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/create_instance_payload.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/create_instance_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class CreateInstancePayload(BaseModel): """ CreateInstancePayload - """ + """ # noqa: E501 instance_name: StrictStr = Field(alias="instanceName") parameters: Optional[InstanceParameters] = None diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/create_instance_response.py b/services/rabbitmq/src/stackit/rabbitmq/models/create_instance_response.py index b00cecf6..25d84e8e 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/create_instance_response.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/create_instance_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateInstanceResponse(BaseModel): """ CreateInstanceResponse - """ + """ # noqa: E501 instance_id: StrictStr = Field(alias="instanceId") __properties: ClassVar[List[str]] = ["instanceId"] diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/credentials.py b/services/rabbitmq/src/stackit/rabbitmq/models/credentials.py index 48e630df..ca57899d 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/credentials.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/credentials.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Credentials(BaseModel): """ Credentials - """ + """ # noqa: E501 host: StrictStr hosts: Optional[List[StrictStr]] = None diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/credentials_list_item.py b/services/rabbitmq/src/stackit/rabbitmq/models/credentials_list_item.py index ba9fcbf4..999d264f 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/credentials_list_item.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/credentials_list_item.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CredentialsListItem(BaseModel): """ CredentialsListItem - """ + """ # noqa: E501 id: StrictStr __properties: ClassVar[List[str]] = ["id"] diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/credentials_response.py b/services/rabbitmq/src/stackit/rabbitmq/models/credentials_response.py index 16bbf3c5..0351a8c3 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/credentials_response.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/credentials_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class CredentialsResponse(BaseModel): """ CredentialsResponse - """ + """ # noqa: E501 id: StrictStr raw: Optional[RawCredentials] = None diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/error.py b/services/rabbitmq/src/stackit/rabbitmq/models/error.py index ce770b74..8a737ddb 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/error.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/error.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Error(BaseModel): """ Error - """ + """ # noqa: E501 description: StrictStr error: StrictStr diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/get_metrics_response.py b/services/rabbitmq/src/stackit/rabbitmq/models/get_metrics_response.py index cf5dae7f..f0b521b3 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/get_metrics_response.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/get_metrics_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class GetMetricsResponse(BaseModel): """ GetMetricsResponse - """ + """ # noqa: E501 cpu_idle_time: Optional[StrictInt] = Field(default=None, alias="cpuIdleTime") cpu_load_percent: Union[StrictFloat, StrictInt] = Field(alias="cpuLoadPercent") diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/instance.py b/services/rabbitmq/src/stackit/rabbitmq/models/instance.py index 4cc8bfc6..439e0d01 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/instance.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/instance.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class Instance(BaseModel): """ Instance - """ + """ # noqa: E501 cf_guid: StrictStr = Field(alias="cfGuid") cf_organization_guid: StrictStr = Field(alias="cfOrganizationGuid") diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/instance_last_operation.py b/services/rabbitmq/src/stackit/rabbitmq/models/instance_last_operation.py index b9aad852..8c5ed27c 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/instance_last_operation.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/instance_last_operation.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class InstanceLastOperation(BaseModel): """ InstanceLastOperation - """ + """ # noqa: E501 description: StrictStr state: StrictStr diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/instance_parameters.py b/services/rabbitmq/src/stackit/rabbitmq/models/instance_parameters.py index 5633e090..d45bc4f2 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/instance_parameters.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/instance_parameters.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -32,7 +32,7 @@ class InstanceParameters(BaseModel): """ InstanceParameters - """ + """ # noqa: E501 consumer_timeout: Optional[Annotated[int, Field(strict=True, ge=1800000)]] = Field( default=1800000, description="The unit is milliseconds." diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/instance_schema.py b/services/rabbitmq/src/stackit/rabbitmq/models/instance_schema.py index 6868ab21..28f195b2 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/instance_schema.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/instance_schema.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class InstanceSchema(BaseModel): """ InstanceSchema - """ + """ # noqa: E501 create: ModelSchema update: ModelSchema diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/list_backups_response.py b/services/rabbitmq/src/stackit/rabbitmq/models/list_backups_response.py index 536263ad..18e24ac6 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/list_backups_response.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/list_backups_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListBackupsResponse(BaseModel): """ ListBackupsResponse - """ + """ # noqa: E501 instance_backups: List[Backup] = Field(alias="instanceBackups") __properties: ClassVar[List[str]] = ["instanceBackups"] diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/list_credentials_response.py b/services/rabbitmq/src/stackit/rabbitmq/models/list_credentials_response.py index ac10698b..e4402218 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/list_credentials_response.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/list_credentials_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListCredentialsResponse(BaseModel): """ ListCredentialsResponse - """ + """ # noqa: E501 credentials_list: List[CredentialsListItem] = Field(alias="credentialsList") __properties: ClassVar[List[str]] = ["credentialsList"] diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/list_instances_response.py b/services/rabbitmq/src/stackit/rabbitmq/models/list_instances_response.py index 47caa8ff..088ca46a 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/list_instances_response.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/list_instances_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListInstancesResponse(BaseModel): """ ListInstancesResponse - """ + """ # noqa: E501 instances: List[Instance] __properties: ClassVar[List[str]] = ["instances"] diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/list_offerings_response.py b/services/rabbitmq/src/stackit/rabbitmq/models/list_offerings_response.py index 9640f5ac..4cc8aab9 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/list_offerings_response.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/list_offerings_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListOfferingsResponse(BaseModel): """ ListOfferingsResponse - """ + """ # noqa: E501 offerings: List[Offering] __properties: ClassVar[List[str]] = ["offerings"] diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/list_restores_response.py b/services/rabbitmq/src/stackit/rabbitmq/models/list_restores_response.py index 4ab68148..08ec6718 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/list_restores_response.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/list_restores_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListRestoresResponse(BaseModel): """ ListRestoresResponse - """ + """ # noqa: E501 instance_restores: List[Restore] = Field(alias="instanceRestores") __properties: ClassVar[List[str]] = ["instanceRestores"] diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/model_schema.py b/services/rabbitmq/src/stackit/rabbitmq/models/model_schema.py index 610a53ef..36cf9591 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/model_schema.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/model_schema.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class ModelSchema(BaseModel): """ ModelSchema - """ + """ # noqa: E501 parameters: Dict[str, Any] __properties: ClassVar[List[str]] = ["parameters"] diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/offering.py b/services/rabbitmq/src/stackit/rabbitmq/models/offering.py index 29d68592..bd50d691 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/offering.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/offering.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class Offering(BaseModel): """ Offering - """ + """ # noqa: E501 description: StrictStr documentation_url: StrictStr = Field(alias="documentationUrl") diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/partial_update_instance_payload.py b/services/rabbitmq/src/stackit/rabbitmq/models/partial_update_instance_payload.py index 9afd6d47..7b848cd6 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/partial_update_instance_payload.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/partial_update_instance_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class PartialUpdateInstancePayload(BaseModel): """ PartialUpdateInstancePayload - """ + """ # noqa: E501 instance_name: Optional[StrictStr] = Field(default=None, alias="instanceName") parameters: Optional[InstanceParameters] = None diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/plan.py b/services/rabbitmq/src/stackit/rabbitmq/models/plan.py index 4a8acf82..22430c76 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/plan.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/plan.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Plan(BaseModel): """ Plan - """ + """ # noqa: E501 description: StrictStr free: StrictBool diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/raw_credentials.py b/services/rabbitmq/src/stackit/rabbitmq/models/raw_credentials.py index aebcf3c5..7a308a82 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/raw_credentials.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/raw_credentials.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class RawCredentials(BaseModel): """ RawCredentials - """ + """ # noqa: E501 credentials: Credentials __properties: ClassVar[List[str]] = ["credentials"] diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/restore.py b/services/rabbitmq/src/stackit/rabbitmq/models/restore.py index a28376d2..716bba55 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/restore.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/restore.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Restore(BaseModel): """ Restore - """ + """ # noqa: E501 backup_id: StrictInt finished_at: StrictStr diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/trigger_restore_response.py b/services/rabbitmq/src/stackit/rabbitmq/models/trigger_restore_response.py index 5244e860..0074db90 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/trigger_restore_response.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/trigger_restore_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class TriggerRestoreResponse(BaseModel): """ TriggerRestoreResponse - """ + """ # noqa: E501 id: StrictInt __properties: ClassVar[List[str]] = ["id"] diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/update_backups_config_payload.py b/services/rabbitmq/src/stackit/rabbitmq/models/update_backups_config_payload.py index dbc76bc8..ac6a6121 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/update_backups_config_payload.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/update_backups_config_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class UpdateBackupsConfigPayload(BaseModel): """ UpdateBackupsConfigPayload - """ + """ # noqa: E501 encryption_key: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["encryption_key"] diff --git a/services/rabbitmq/src/stackit/rabbitmq/models/update_backups_config_response.py b/services/rabbitmq/src/stackit/rabbitmq/models/update_backups_config_response.py index b8de968a..71a34f06 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/models/update_backups_config_response.py +++ b/services/rabbitmq/src/stackit/rabbitmq/models/update_backups_config_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class UpdateBackupsConfigResponse(BaseModel): """ UpdateBackupsConfigResponse - """ + """ # noqa: E501 message: StrictStr __properties: ClassVar[List[str]] = ["message"] diff --git a/services/rabbitmq/src/stackit/rabbitmq/rest.py b/services/rabbitmq/src/stackit/rabbitmq/rest.py index 95d5d89f..bcefa6ab 100644 --- a/services/rabbitmq/src/stackit/rabbitmq/rest.py +++ b/services/rabbitmq/src/stackit/rabbitmq/rest.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -124,7 +124,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/redis/CHANGELOG.md b/services/redis/CHANGELOG.md index c90b2ad0..bd76ecd0 100644 --- a/services/redis/CHANGELOG.md +++ b/services/redis/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.2.2 +- **Internal:** Improve deserializing and error types + ## v0.2.1 (2025-05-09) - **Feature:** Update user-agent header diff --git a/services/redis/pyproject.toml b/services/redis/pyproject.toml index b8ee6008..bdb3189e 100644 --- a/services/redis/pyproject.toml +++ b/services/redis/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-redis" [tool.poetry] name = "stackit-redis" -version = "v0.2.1" +version = "v0.2.2" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/redis/src/stackit/redis/__init__.py b/services/redis/src/stackit/redis/__init__.py index dd3e30fb..43d01019 100644 --- a/services/redis/src/stackit/redis/__init__.py +++ b/services/redis/src/stackit/redis/__init__.py @@ -11,58 +11,125 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "Backup", + "CreateBackupResponseItem", + "CreateInstancePayload", + "CreateInstanceResponse", + "Credentials", + "CredentialsListItem", + "CredentialsResponse", + "Error", + "GetMetricsResponse", + "Instance", + "InstanceLastOperation", + "InstanceParameters", + "InstanceSchema", + "ListBackupsResponse", + "ListCredentialsResponse", + "ListInstancesResponse", + "ListOfferingsResponse", + "ListRestoresResponse", + "ModelSchema", + "Offering", + "PartialUpdateInstancePayload", + "Plan", + "RawCredentials", + "Restore", + "TriggerRestoreResponse", + "UpdateBackupsConfigPayload", + "UpdateBackupsConfigResponse", +] + # import apis into sdk package -from stackit.redis.api.default_api import DefaultApi -from stackit.redis.api_client import ApiClient +from stackit.redis.api.default_api import DefaultApi as DefaultApi +from stackit.redis.api_client import ApiClient as ApiClient # import ApiClient -from stackit.redis.api_response import ApiResponse -from stackit.redis.configuration import HostConfiguration -from stackit.redis.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.redis.api_response import ApiResponse as ApiResponse +from stackit.redis.configuration import HostConfiguration as HostConfiguration +from stackit.redis.exceptions import ApiAttributeError as ApiAttributeError +from stackit.redis.exceptions import ApiException as ApiException +from stackit.redis.exceptions import ApiKeyError as ApiKeyError +from stackit.redis.exceptions import ApiTypeError as ApiTypeError +from stackit.redis.exceptions import ApiValueError as ApiValueError +from stackit.redis.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.redis.models.backup import Backup -from stackit.redis.models.create_backup_response_item import CreateBackupResponseItem -from stackit.redis.models.create_instance_payload import CreateInstancePayload -from stackit.redis.models.create_instance_response import CreateInstanceResponse -from stackit.redis.models.credentials import Credentials -from stackit.redis.models.credentials_list_item import CredentialsListItem -from stackit.redis.models.credentials_response import CredentialsResponse -from stackit.redis.models.error import Error -from stackit.redis.models.get_metrics_response import GetMetricsResponse -from stackit.redis.models.instance import Instance -from stackit.redis.models.instance_last_operation import InstanceLastOperation -from stackit.redis.models.instance_parameters import InstanceParameters -from stackit.redis.models.instance_schema import InstanceSchema -from stackit.redis.models.list_backups_response import ListBackupsResponse -from stackit.redis.models.list_credentials_response import ListCredentialsResponse -from stackit.redis.models.list_instances_response import ListInstancesResponse -from stackit.redis.models.list_offerings_response import ListOfferingsResponse -from stackit.redis.models.list_restores_response import ListRestoresResponse -from stackit.redis.models.model_schema import ModelSchema -from stackit.redis.models.offering import Offering +from stackit.redis.models.backup import Backup as Backup +from stackit.redis.models.create_backup_response_item import ( + CreateBackupResponseItem as CreateBackupResponseItem, +) +from stackit.redis.models.create_instance_payload import ( + CreateInstancePayload as CreateInstancePayload, +) +from stackit.redis.models.create_instance_response import ( + CreateInstanceResponse as CreateInstanceResponse, +) +from stackit.redis.models.credentials import Credentials as Credentials +from stackit.redis.models.credentials_list_item import ( + CredentialsListItem as CredentialsListItem, +) +from stackit.redis.models.credentials_response import ( + CredentialsResponse as CredentialsResponse, +) +from stackit.redis.models.error import Error as Error +from stackit.redis.models.get_metrics_response import ( + GetMetricsResponse as GetMetricsResponse, +) +from stackit.redis.models.instance import Instance as Instance +from stackit.redis.models.instance_last_operation import ( + InstanceLastOperation as InstanceLastOperation, +) +from stackit.redis.models.instance_parameters import ( + InstanceParameters as InstanceParameters, +) +from stackit.redis.models.instance_schema import InstanceSchema as InstanceSchema +from stackit.redis.models.list_backups_response import ( + ListBackupsResponse as ListBackupsResponse, +) +from stackit.redis.models.list_credentials_response import ( + ListCredentialsResponse as ListCredentialsResponse, +) +from stackit.redis.models.list_instances_response import ( + ListInstancesResponse as ListInstancesResponse, +) +from stackit.redis.models.list_offerings_response import ( + ListOfferingsResponse as ListOfferingsResponse, +) +from stackit.redis.models.list_restores_response import ( + ListRestoresResponse as ListRestoresResponse, +) +from stackit.redis.models.model_schema import ModelSchema as ModelSchema +from stackit.redis.models.offering import Offering as Offering from stackit.redis.models.partial_update_instance_payload import ( - PartialUpdateInstancePayload, + PartialUpdateInstancePayload as PartialUpdateInstancePayload, +) +from stackit.redis.models.plan import Plan as Plan +from stackit.redis.models.raw_credentials import RawCredentials as RawCredentials +from stackit.redis.models.restore import Restore as Restore +from stackit.redis.models.trigger_restore_response import ( + TriggerRestoreResponse as TriggerRestoreResponse, ) -from stackit.redis.models.plan import Plan -from stackit.redis.models.raw_credentials import RawCredentials -from stackit.redis.models.restore import Restore -from stackit.redis.models.trigger_restore_response import TriggerRestoreResponse from stackit.redis.models.update_backups_config_payload import ( - UpdateBackupsConfigPayload, + UpdateBackupsConfigPayload as UpdateBackupsConfigPayload, ) from stackit.redis.models.update_backups_config_response import ( - UpdateBackupsConfigResponse, + UpdateBackupsConfigResponse as UpdateBackupsConfigResponse, ) diff --git a/services/redis/src/stackit/redis/api/default_api.py b/services/redis/src/stackit/redis/api/default_api.py index b9f7776f..4eb2e338 100644 --- a/services/redis/src/stackit/redis/api/default_api.py +++ b/services/redis/src/stackit/redis/api/default_api.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -104,7 +104,7 @@ def create_backup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_backup_serialize( instance_id=instance_id, @@ -169,7 +169,7 @@ def create_backup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_backup_serialize( instance_id=instance_id, @@ -234,7 +234,7 @@ def create_backup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_backup_serialize( instance_id=instance_id, @@ -271,7 +271,7 @@ def _create_backup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -349,7 +349,7 @@ def create_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( project_id=project_id, @@ -414,7 +414,7 @@ def create_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( project_id=project_id, @@ -479,7 +479,7 @@ def create_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_credentials_serialize( project_id=project_id, @@ -515,7 +515,7 @@ def _create_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -595,7 +595,7 @@ def create_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -663,7 +663,7 @@ def create_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -731,7 +731,7 @@ def create_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -768,7 +768,7 @@ def _create_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -857,7 +857,7 @@ def delete_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( project_id=project_id, @@ -926,7 +926,7 @@ def delete_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( project_id=project_id, @@ -995,7 +995,7 @@ def delete_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_credentials_serialize( project_id=project_id, @@ -1033,7 +1033,7 @@ def _delete_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1113,7 +1113,7 @@ def delete_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1179,7 +1179,7 @@ def delete_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1245,7 +1245,7 @@ def delete_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1282,7 +1282,7 @@ def _delete_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1362,7 +1362,7 @@ def download_backup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._download_backup_serialize( backup_id=backup_id, @@ -1430,7 +1430,7 @@ def download_backup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._download_backup_serialize( backup_id=backup_id, @@ -1498,7 +1498,7 @@ def download_backup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._download_backup_serialize( backup_id=backup_id, @@ -1536,7 +1536,7 @@ def _download_backup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1621,7 +1621,7 @@ def get_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( project_id=project_id, @@ -1690,7 +1690,7 @@ def get_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( project_id=project_id, @@ -1759,7 +1759,7 @@ def get_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_credentials_serialize( project_id=project_id, @@ -1797,7 +1797,7 @@ def _get_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1877,7 +1877,7 @@ def get_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -1943,7 +1943,7 @@ def get_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -2009,7 +2009,7 @@ def get_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -2046,7 +2046,7 @@ def _get_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2123,7 +2123,7 @@ def get_metrics( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_metrics_serialize( instance_id=instance_id, @@ -2187,7 +2187,7 @@ def get_metrics_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_metrics_serialize( instance_id=instance_id, @@ -2251,7 +2251,7 @@ def get_metrics_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_metrics_serialize( instance_id=instance_id, @@ -2287,7 +2287,7 @@ def _get_metrics_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2364,7 +2364,7 @@ def list_backups( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( instance_id=instance_id, @@ -2428,7 +2428,7 @@ def list_backups_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( instance_id=instance_id, @@ -2492,7 +2492,7 @@ def list_backups_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( instance_id=instance_id, @@ -2528,7 +2528,7 @@ def _list_backups_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2606,7 +2606,7 @@ def list_credentials( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( project_id=project_id, @@ -2671,7 +2671,7 @@ def list_credentials_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( project_id=project_id, @@ -2736,7 +2736,7 @@ def list_credentials_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_credentials_serialize( project_id=project_id, @@ -2772,7 +2772,7 @@ def _list_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2847,7 +2847,7 @@ def list_instances( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -2908,7 +2908,7 @@ def list_instances_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -2969,7 +2969,7 @@ def list_instances_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -3003,7 +3003,7 @@ def _list_instances_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3076,7 +3076,7 @@ def list_offerings( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_offerings_serialize( project_id=project_id, @@ -3136,7 +3136,7 @@ def list_offerings_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_offerings_serialize( project_id=project_id, @@ -3196,7 +3196,7 @@ def list_offerings_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_offerings_serialize( project_id=project_id, @@ -3229,7 +3229,7 @@ def _list_offerings_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3304,7 +3304,7 @@ def list_restores( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_restores_serialize( instance_id=instance_id, @@ -3368,7 +3368,7 @@ def list_restores_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_restores_serialize( instance_id=instance_id, @@ -3432,7 +3432,7 @@ def list_restores_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_restores_serialize( instance_id=instance_id, @@ -3468,7 +3468,7 @@ def _list_restores_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3554,7 +3554,7 @@ def partial_update_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_instance_serialize( project_id=project_id, @@ -3629,7 +3629,7 @@ def partial_update_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_instance_serialize( project_id=project_id, @@ -3704,7 +3704,7 @@ def partial_update_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_instance_serialize( project_id=project_id, @@ -3743,7 +3743,7 @@ def _partial_update_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3830,7 +3830,7 @@ def trigger_recreate( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_recreate_serialize( instance_id=instance_id, @@ -3895,7 +3895,7 @@ def trigger_recreate_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_recreate_serialize( instance_id=instance_id, @@ -3960,7 +3960,7 @@ def trigger_recreate_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_recreate_serialize( instance_id=instance_id, @@ -3997,7 +3997,7 @@ def _trigger_recreate_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4074,7 +4074,7 @@ def trigger_restart( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restart_serialize( instance_id=instance_id, @@ -4139,7 +4139,7 @@ def trigger_restart_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restart_serialize( instance_id=instance_id, @@ -4204,7 +4204,7 @@ def trigger_restart_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restart_serialize( instance_id=instance_id, @@ -4241,7 +4241,7 @@ def _trigger_restart_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4321,7 +4321,7 @@ def trigger_restore( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restore_serialize( instance_id=instance_id, @@ -4390,7 +4390,7 @@ def trigger_restore_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restore_serialize( instance_id=instance_id, @@ -4459,7 +4459,7 @@ def trigger_restore_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_restore_serialize( instance_id=instance_id, @@ -4498,7 +4498,7 @@ def _trigger_restore_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4583,7 +4583,7 @@ def update_backups_config( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_backups_config_serialize( instance_id=instance_id, @@ -4655,7 +4655,7 @@ def update_backups_config_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_backups_config_serialize( instance_id=instance_id, @@ -4727,7 +4727,7 @@ def update_backups_config_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_backups_config_serialize( instance_id=instance_id, @@ -4766,7 +4766,7 @@ def _update_backups_config_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/redis/src/stackit/redis/api_client.py b/services/redis/src/stackit/redis/api_client.py index 4fc21a48..da1fb760 100644 --- a/services/redis/src/stackit/redis/api_client.py +++ b/services/redis/src/stackit/redis/api_client.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -331,6 +331,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -350,12 +354,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -457,7 +461,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -473,7 +477,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -488,6 +495,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/redis/src/stackit/redis/configuration.py b/services/redis/src/stackit/redis/configuration.py index a67750b5..8f0fad39 100644 --- a/services/redis/src/stackit/redis/configuration.py +++ b/services/redis/src/stackit/redis/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT Redis API @@ -14,7 +9,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -53,7 +70,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -72,7 +89,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -112,7 +134,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -131,12 +153,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/redis/src/stackit/redis/exceptions.py b/services/redis/src/stackit/redis/exceptions.py index cfcc3c10..d74d391a 100644 --- a/services/redis/src/stackit/redis/exceptions.py +++ b/services/redis/src/stackit/redis/exceptions.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -151,6 +151,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -187,6 +194,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/redis/src/stackit/redis/models/__init__.py b/services/redis/src/stackit/redis/models/__init__.py index 9a40fdc3..2ec30946 100644 --- a/services/redis/src/stackit/redis/models/__init__.py +++ b/services/redis/src/stackit/redis/models/__init__.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/redis/src/stackit/redis/models/backup.py b/services/redis/src/stackit/redis/models/backup.py index 50f9586a..b9a7ca15 100644 --- a/services/redis/src/stackit/redis/models/backup.py +++ b/services/redis/src/stackit/redis/models/backup.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Backup(BaseModel): """ Backup - """ + """ # noqa: E501 downloadable: Optional[StrictBool] = None finished_at: StrictStr diff --git a/services/redis/src/stackit/redis/models/create_backup_response_item.py b/services/redis/src/stackit/redis/models/create_backup_response_item.py index 298bb268..8445a5ff 100644 --- a/services/redis/src/stackit/redis/models/create_backup_response_item.py +++ b/services/redis/src/stackit/redis/models/create_backup_response_item.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateBackupResponseItem(BaseModel): """ CreateBackupResponseItem - """ + """ # noqa: E501 id: StrictInt message: StrictStr diff --git a/services/redis/src/stackit/redis/models/create_instance_payload.py b/services/redis/src/stackit/redis/models/create_instance_payload.py index 98c9e809..86bd7d31 100644 --- a/services/redis/src/stackit/redis/models/create_instance_payload.py +++ b/services/redis/src/stackit/redis/models/create_instance_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class CreateInstancePayload(BaseModel): """ CreateInstancePayload - """ + """ # noqa: E501 instance_name: StrictStr = Field(alias="instanceName") parameters: Optional[InstanceParameters] = None diff --git a/services/redis/src/stackit/redis/models/create_instance_response.py b/services/redis/src/stackit/redis/models/create_instance_response.py index 5ce55411..ce53731d 100644 --- a/services/redis/src/stackit/redis/models/create_instance_response.py +++ b/services/redis/src/stackit/redis/models/create_instance_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateInstanceResponse(BaseModel): """ CreateInstanceResponse - """ + """ # noqa: E501 instance_id: StrictStr = Field(alias="instanceId") __properties: ClassVar[List[str]] = ["instanceId"] diff --git a/services/redis/src/stackit/redis/models/credentials.py b/services/redis/src/stackit/redis/models/credentials.py index e87c6df2..1bf1d8e6 100644 --- a/services/redis/src/stackit/redis/models/credentials.py +++ b/services/redis/src/stackit/redis/models/credentials.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Credentials(BaseModel): """ Credentials - """ + """ # noqa: E501 host: StrictStr hosts: Optional[List[StrictStr]] = None diff --git a/services/redis/src/stackit/redis/models/credentials_list_item.py b/services/redis/src/stackit/redis/models/credentials_list_item.py index f3cdae3e..2fb40133 100644 --- a/services/redis/src/stackit/redis/models/credentials_list_item.py +++ b/services/redis/src/stackit/redis/models/credentials_list_item.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CredentialsListItem(BaseModel): """ CredentialsListItem - """ + """ # noqa: E501 id: StrictStr __properties: ClassVar[List[str]] = ["id"] diff --git a/services/redis/src/stackit/redis/models/credentials_response.py b/services/redis/src/stackit/redis/models/credentials_response.py index d7c38753..9ba21767 100644 --- a/services/redis/src/stackit/redis/models/credentials_response.py +++ b/services/redis/src/stackit/redis/models/credentials_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class CredentialsResponse(BaseModel): """ CredentialsResponse - """ + """ # noqa: E501 id: StrictStr raw: Optional[RawCredentials] = None diff --git a/services/redis/src/stackit/redis/models/error.py b/services/redis/src/stackit/redis/models/error.py index 455817c8..be31830a 100644 --- a/services/redis/src/stackit/redis/models/error.py +++ b/services/redis/src/stackit/redis/models/error.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Error(BaseModel): """ Error - """ + """ # noqa: E501 description: StrictStr error: StrictStr diff --git a/services/redis/src/stackit/redis/models/get_metrics_response.py b/services/redis/src/stackit/redis/models/get_metrics_response.py index f6201add..01ec300f 100644 --- a/services/redis/src/stackit/redis/models/get_metrics_response.py +++ b/services/redis/src/stackit/redis/models/get_metrics_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class GetMetricsResponse(BaseModel): """ GetMetricsResponse - """ + """ # noqa: E501 cpu_idle_time: Optional[StrictInt] = Field(default=None, alias="cpuIdleTime") cpu_load_percent: Union[StrictFloat, StrictInt] = Field(alias="cpuLoadPercent") diff --git a/services/redis/src/stackit/redis/models/instance.py b/services/redis/src/stackit/redis/models/instance.py index 58066c59..8fb05296 100644 --- a/services/redis/src/stackit/redis/models/instance.py +++ b/services/redis/src/stackit/redis/models/instance.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class Instance(BaseModel): """ Instance - """ + """ # noqa: E501 cf_guid: StrictStr = Field(alias="cfGuid") cf_organization_guid: StrictStr = Field(alias="cfOrganizationGuid") diff --git a/services/redis/src/stackit/redis/models/instance_last_operation.py b/services/redis/src/stackit/redis/models/instance_last_operation.py index 85fb8cde..d07f71ec 100644 --- a/services/redis/src/stackit/redis/models/instance_last_operation.py +++ b/services/redis/src/stackit/redis/models/instance_last_operation.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class InstanceLastOperation(BaseModel): """ InstanceLastOperation - """ + """ # noqa: E501 description: StrictStr state: StrictStr diff --git a/services/redis/src/stackit/redis/models/instance_parameters.py b/services/redis/src/stackit/redis/models/instance_parameters.py index 373fb1a4..f1c778c3 100644 --- a/services/redis/src/stackit/redis/models/instance_parameters.py +++ b/services/redis/src/stackit/redis/models/instance_parameters.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -32,7 +32,7 @@ class InstanceParameters(BaseModel): """ InstanceParameters - """ + """ # noqa: E501 down_after_milliseconds: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field( default=10000, description="The unit is milliseconds.", alias="down-after-milliseconds" diff --git a/services/redis/src/stackit/redis/models/instance_schema.py b/services/redis/src/stackit/redis/models/instance_schema.py index 06bdb58b..bdb20428 100644 --- a/services/redis/src/stackit/redis/models/instance_schema.py +++ b/services/redis/src/stackit/redis/models/instance_schema.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class InstanceSchema(BaseModel): """ InstanceSchema - """ + """ # noqa: E501 create: ModelSchema update: ModelSchema diff --git a/services/redis/src/stackit/redis/models/list_backups_response.py b/services/redis/src/stackit/redis/models/list_backups_response.py index 9a0f474e..76fbf62a 100644 --- a/services/redis/src/stackit/redis/models/list_backups_response.py +++ b/services/redis/src/stackit/redis/models/list_backups_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListBackupsResponse(BaseModel): """ ListBackupsResponse - """ + """ # noqa: E501 instance_backups: List[Backup] = Field(alias="instanceBackups") __properties: ClassVar[List[str]] = ["instanceBackups"] diff --git a/services/redis/src/stackit/redis/models/list_credentials_response.py b/services/redis/src/stackit/redis/models/list_credentials_response.py index 15d69e38..cbf9b4ea 100644 --- a/services/redis/src/stackit/redis/models/list_credentials_response.py +++ b/services/redis/src/stackit/redis/models/list_credentials_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListCredentialsResponse(BaseModel): """ ListCredentialsResponse - """ + """ # noqa: E501 credentials_list: List[CredentialsListItem] = Field(alias="credentialsList") __properties: ClassVar[List[str]] = ["credentialsList"] diff --git a/services/redis/src/stackit/redis/models/list_instances_response.py b/services/redis/src/stackit/redis/models/list_instances_response.py index 86566873..dc295824 100644 --- a/services/redis/src/stackit/redis/models/list_instances_response.py +++ b/services/redis/src/stackit/redis/models/list_instances_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListInstancesResponse(BaseModel): """ ListInstancesResponse - """ + """ # noqa: E501 instances: List[Instance] __properties: ClassVar[List[str]] = ["instances"] diff --git a/services/redis/src/stackit/redis/models/list_offerings_response.py b/services/redis/src/stackit/redis/models/list_offerings_response.py index 343f4789..74da9ac1 100644 --- a/services/redis/src/stackit/redis/models/list_offerings_response.py +++ b/services/redis/src/stackit/redis/models/list_offerings_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListOfferingsResponse(BaseModel): """ ListOfferingsResponse - """ + """ # noqa: E501 offerings: List[Offering] __properties: ClassVar[List[str]] = ["offerings"] diff --git a/services/redis/src/stackit/redis/models/list_restores_response.py b/services/redis/src/stackit/redis/models/list_restores_response.py index 9ef9d733..c65adcab 100644 --- a/services/redis/src/stackit/redis/models/list_restores_response.py +++ b/services/redis/src/stackit/redis/models/list_restores_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListRestoresResponse(BaseModel): """ ListRestoresResponse - """ + """ # noqa: E501 instance_restores: List[Restore] = Field(alias="instanceRestores") __properties: ClassVar[List[str]] = ["instanceRestores"] diff --git a/services/redis/src/stackit/redis/models/model_schema.py b/services/redis/src/stackit/redis/models/model_schema.py index 79e94bf7..da461c08 100644 --- a/services/redis/src/stackit/redis/models/model_schema.py +++ b/services/redis/src/stackit/redis/models/model_schema.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class ModelSchema(BaseModel): """ ModelSchema - """ + """ # noqa: E501 parameters: Dict[str, Any] __properties: ClassVar[List[str]] = ["parameters"] diff --git a/services/redis/src/stackit/redis/models/offering.py b/services/redis/src/stackit/redis/models/offering.py index a1d0f667..6a23bd53 100644 --- a/services/redis/src/stackit/redis/models/offering.py +++ b/services/redis/src/stackit/redis/models/offering.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class Offering(BaseModel): """ Offering - """ + """ # noqa: E501 description: StrictStr documentation_url: StrictStr = Field(alias="documentationUrl") diff --git a/services/redis/src/stackit/redis/models/partial_update_instance_payload.py b/services/redis/src/stackit/redis/models/partial_update_instance_payload.py index 8bf7a752..9b72e74b 100644 --- a/services/redis/src/stackit/redis/models/partial_update_instance_payload.py +++ b/services/redis/src/stackit/redis/models/partial_update_instance_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class PartialUpdateInstancePayload(BaseModel): """ PartialUpdateInstancePayload - """ + """ # noqa: E501 instance_name: Optional[StrictStr] = Field(default=None, alias="instanceName") parameters: Optional[InstanceParameters] = None diff --git a/services/redis/src/stackit/redis/models/plan.py b/services/redis/src/stackit/redis/models/plan.py index 624a4017..8d8b3432 100644 --- a/services/redis/src/stackit/redis/models/plan.py +++ b/services/redis/src/stackit/redis/models/plan.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Plan(BaseModel): """ Plan - """ + """ # noqa: E501 description: StrictStr free: StrictBool diff --git a/services/redis/src/stackit/redis/models/raw_credentials.py b/services/redis/src/stackit/redis/models/raw_credentials.py index 8482313b..81fa6095 100644 --- a/services/redis/src/stackit/redis/models/raw_credentials.py +++ b/services/redis/src/stackit/redis/models/raw_credentials.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class RawCredentials(BaseModel): """ RawCredentials - """ + """ # noqa: E501 credentials: Credentials __properties: ClassVar[List[str]] = ["credentials"] diff --git a/services/redis/src/stackit/redis/models/restore.py b/services/redis/src/stackit/redis/models/restore.py index f9ce8dd9..02fa431e 100644 --- a/services/redis/src/stackit/redis/models/restore.py +++ b/services/redis/src/stackit/redis/models/restore.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Restore(BaseModel): """ Restore - """ + """ # noqa: E501 backup_id: StrictInt finished_at: StrictStr diff --git a/services/redis/src/stackit/redis/models/trigger_restore_response.py b/services/redis/src/stackit/redis/models/trigger_restore_response.py index eeebee6c..7da520d0 100644 --- a/services/redis/src/stackit/redis/models/trigger_restore_response.py +++ b/services/redis/src/stackit/redis/models/trigger_restore_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class TriggerRestoreResponse(BaseModel): """ TriggerRestoreResponse - """ + """ # noqa: E501 id: StrictInt __properties: ClassVar[List[str]] = ["id"] diff --git a/services/redis/src/stackit/redis/models/update_backups_config_payload.py b/services/redis/src/stackit/redis/models/update_backups_config_payload.py index 3cb50930..5dcc6689 100644 --- a/services/redis/src/stackit/redis/models/update_backups_config_payload.py +++ b/services/redis/src/stackit/redis/models/update_backups_config_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class UpdateBackupsConfigPayload(BaseModel): """ UpdateBackupsConfigPayload - """ + """ # noqa: E501 encryption_key: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["encryption_key"] diff --git a/services/redis/src/stackit/redis/models/update_backups_config_response.py b/services/redis/src/stackit/redis/models/update_backups_config_response.py index 35fdbfeb..643eef0f 100644 --- a/services/redis/src/stackit/redis/models/update_backups_config_response.py +++ b/services/redis/src/stackit/redis/models/update_backups_config_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class UpdateBackupsConfigResponse(BaseModel): """ UpdateBackupsConfigResponse - """ + """ # noqa: E501 message: StrictStr __properties: ClassVar[List[str]] = ["message"] diff --git a/services/redis/src/stackit/redis/rest.py b/services/redis/src/stackit/redis/rest.py index 80750737..8d31b882 100644 --- a/services/redis/src/stackit/redis/rest.py +++ b/services/redis/src/stackit/redis/rest.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -124,7 +124,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/resourcemanager/CHANGELOG.md b/services/resourcemanager/CHANGELOG.md index e8427a2d..1375f13d 100644 --- a/services/resourcemanager/CHANGELOG.md +++ b/services/resourcemanager/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.5.1 +- **Internal:** Improve deserializing and error types + ## v0.5.0 (2025-06-04) - **Feature:** Delete Organization labels using the new method `DeleteOrganizationLabels` - **Feature:** Delete Project labels using the new method `DeleteProjectLabels` diff --git a/services/resourcemanager/pyproject.toml b/services/resourcemanager/pyproject.toml index a8f7246d..719235b9 100644 --- a/services/resourcemanager/pyproject.toml +++ b/services/resourcemanager/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-resourcemanager" [tool.poetry] name = "stackit-resourcemanager" -version = "v0.5.0" +version = "v0.5.1" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/resourcemanager/src/stackit/resourcemanager/__init__.py b/services/resourcemanager/src/stackit/resourcemanager/__init__.py index 3542fb2c..93907345 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/__init__.py +++ b/services/resourcemanager/src/stackit/resourcemanager/__init__.py @@ -11,59 +11,109 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "CreateFolderPayload", + "CreateProjectPayload", + "ErrorResponse", + "FolderResponse", + "GetFolderDetailsResponse", + "GetProjectResponse", + "LifecycleState", + "ListFoldersResponse", + "ListFoldersResponseItemsInner", + "ListOrganizationsResponse", + "ListOrganizationsResponseItemsInner", + "ListProjectsResponse", + "Member", + "OrganizationResponse", + "Parent", + "ParentListInner", + "PartialUpdateFolderPayload", + "PartialUpdateOrganizationPayload", + "PartialUpdateProjectPayload", + "Project", +] + # import apis into sdk package -from stackit.resourcemanager.api.default_api import DefaultApi -from stackit.resourcemanager.api_client import ApiClient +from stackit.resourcemanager.api.default_api import DefaultApi as DefaultApi +from stackit.resourcemanager.api_client import ApiClient as ApiClient # import ApiClient -from stackit.resourcemanager.api_response import ApiResponse -from stackit.resourcemanager.configuration import HostConfiguration -from stackit.resourcemanager.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.resourcemanager.api_response import ApiResponse as ApiResponse +from stackit.resourcemanager.configuration import HostConfiguration as HostConfiguration +from stackit.resourcemanager.exceptions import ApiAttributeError as ApiAttributeError +from stackit.resourcemanager.exceptions import ApiException as ApiException +from stackit.resourcemanager.exceptions import ApiKeyError as ApiKeyError +from stackit.resourcemanager.exceptions import ApiTypeError as ApiTypeError +from stackit.resourcemanager.exceptions import ApiValueError as ApiValueError +from stackit.resourcemanager.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.resourcemanager.models.create_folder_payload import CreateFolderPayload -from stackit.resourcemanager.models.create_project_payload import CreateProjectPayload -from stackit.resourcemanager.models.error_response import ErrorResponse -from stackit.resourcemanager.models.folder_response import FolderResponse +from stackit.resourcemanager.models.create_folder_payload import ( + CreateFolderPayload as CreateFolderPayload, +) +from stackit.resourcemanager.models.create_project_payload import ( + CreateProjectPayload as CreateProjectPayload, +) +from stackit.resourcemanager.models.error_response import ErrorResponse as ErrorResponse +from stackit.resourcemanager.models.folder_response import ( + FolderResponse as FolderResponse, +) from stackit.resourcemanager.models.get_folder_details_response import ( - GetFolderDetailsResponse, + GetFolderDetailsResponse as GetFolderDetailsResponse, +) +from stackit.resourcemanager.models.get_project_response import ( + GetProjectResponse as GetProjectResponse, +) +from stackit.resourcemanager.models.lifecycle_state import ( + LifecycleState as LifecycleState, +) +from stackit.resourcemanager.models.list_folders_response import ( + ListFoldersResponse as ListFoldersResponse, ) -from stackit.resourcemanager.models.get_project_response import GetProjectResponse -from stackit.resourcemanager.models.lifecycle_state import LifecycleState -from stackit.resourcemanager.models.list_folders_response import ListFoldersResponse from stackit.resourcemanager.models.list_folders_response_items_inner import ( - ListFoldersResponseItemsInner, + ListFoldersResponseItemsInner as ListFoldersResponseItemsInner, ) from stackit.resourcemanager.models.list_organizations_response import ( - ListOrganizationsResponse, + ListOrganizationsResponse as ListOrganizationsResponse, ) from stackit.resourcemanager.models.list_organizations_response_items_inner import ( - ListOrganizationsResponseItemsInner, + ListOrganizationsResponseItemsInner as ListOrganizationsResponseItemsInner, +) +from stackit.resourcemanager.models.list_projects_response import ( + ListProjectsResponse as ListProjectsResponse, +) +from stackit.resourcemanager.models.member import Member as Member +from stackit.resourcemanager.models.organization_response import ( + OrganizationResponse as OrganizationResponse, +) +from stackit.resourcemanager.models.parent import Parent as Parent +from stackit.resourcemanager.models.parent_list_inner import ( + ParentListInner as ParentListInner, ) -from stackit.resourcemanager.models.list_projects_response import ListProjectsResponse -from stackit.resourcemanager.models.member import Member -from stackit.resourcemanager.models.organization_response import OrganizationResponse -from stackit.resourcemanager.models.parent import Parent -from stackit.resourcemanager.models.parent_list_inner import ParentListInner from stackit.resourcemanager.models.partial_update_folder_payload import ( - PartialUpdateFolderPayload, + PartialUpdateFolderPayload as PartialUpdateFolderPayload, ) from stackit.resourcemanager.models.partial_update_organization_payload import ( - PartialUpdateOrganizationPayload, + PartialUpdateOrganizationPayload as PartialUpdateOrganizationPayload, ) from stackit.resourcemanager.models.partial_update_project_payload import ( - PartialUpdateProjectPayload, + PartialUpdateProjectPayload as PartialUpdateProjectPayload, ) -from stackit.resourcemanager.models.project import Project +from stackit.resourcemanager.models.project import Project as Project diff --git a/services/resourcemanager/src/stackit/resourcemanager/api/default_api.py b/services/resourcemanager/src/stackit/resourcemanager/api/default_api.py index 69764841..d8ecf9f4 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/api/default_api.py +++ b/services/resourcemanager/src/stackit/resourcemanager/api/default_api.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from datetime import datetime from typing import Any, Dict, List, Optional, Tuple, Union @@ -99,7 +99,7 @@ def create_folder( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_folder_serialize( create_folder_payload=create_folder_payload, @@ -162,7 +162,7 @@ def create_folder_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_folder_serialize( create_folder_payload=create_folder_payload, @@ -225,7 +225,7 @@ def create_folder_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_folder_serialize( create_folder_payload=create_folder_payload, @@ -261,7 +261,7 @@ def _create_folder_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -342,7 +342,7 @@ def create_project( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_project_serialize( create_project_payload=create_project_payload, @@ -405,7 +405,7 @@ def create_project_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_project_serialize( create_project_payload=create_project_payload, @@ -468,7 +468,7 @@ def create_project_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_project_serialize( create_project_payload=create_project_payload, @@ -504,7 +504,7 @@ def _create_project_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -595,7 +595,7 @@ def delete_folder( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_folder_serialize( container_id=container_id, @@ -668,7 +668,7 @@ def delete_folder_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_folder_serialize( container_id=container_id, @@ -741,7 +741,7 @@ def delete_folder_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_folder_serialize( container_id=container_id, @@ -778,7 +778,7 @@ def _delete_folder_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -860,7 +860,7 @@ def delete_folder_labels( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_folder_labels_serialize( container_id=container_id, @@ -927,7 +927,7 @@ def delete_folder_labels_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_folder_labels_serialize( container_id=container_id, @@ -994,7 +994,7 @@ def delete_folder_labels_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_folder_labels_serialize( container_id=container_id, @@ -1032,7 +1032,7 @@ def _delete_folder_labels_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1115,7 +1115,7 @@ def delete_organization_labels( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_organization_labels_serialize( container_id=container_id, @@ -1183,7 +1183,7 @@ def delete_organization_labels_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_organization_labels_serialize( container_id=container_id, @@ -1251,7 +1251,7 @@ def delete_organization_labels_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_organization_labels_serialize( container_id=container_id, @@ -1289,7 +1289,7 @@ def _delete_organization_labels_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1368,7 +1368,7 @@ def delete_project( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_project_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index @@ -1427,7 +1427,7 @@ def delete_project_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_project_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index @@ -1486,7 +1486,7 @@ def delete_project_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_project_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index @@ -1516,7 +1516,7 @@ def _delete_project_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1594,7 +1594,7 @@ def delete_project_labels( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_project_labels_serialize( container_id=container_id, @@ -1661,7 +1661,7 @@ def delete_project_labels_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_project_labels_serialize( container_id=container_id, @@ -1728,7 +1728,7 @@ def delete_project_labels_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_project_labels_serialize( container_id=container_id, @@ -1766,7 +1766,7 @@ def _delete_project_labels_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1848,7 +1848,7 @@ def get_folder_details( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_folder_details_serialize( container_id=container_id, @@ -1916,7 +1916,7 @@ def get_folder_details_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_folder_details_serialize( container_id=container_id, @@ -1984,7 +1984,7 @@ def get_folder_details_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_folder_details_serialize( container_id=container_id, @@ -2021,7 +2021,7 @@ def _get_folder_details_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2101,7 +2101,7 @@ def get_organization( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_organization_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index @@ -2161,7 +2161,7 @@ def get_organization_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_organization_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index @@ -2221,7 +2221,7 @@ def get_organization_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_organization_serialize( id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index @@ -2251,7 +2251,7 @@ def _get_organization_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2329,7 +2329,7 @@ def get_project( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_project_serialize( id=id, @@ -2397,7 +2397,7 @@ def get_project_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_project_serialize( id=id, @@ -2465,7 +2465,7 @@ def get_project_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_project_serialize( id=id, @@ -2502,7 +2502,7 @@ def _get_project_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2624,7 +2624,7 @@ def list_folders( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_folders_serialize( container_parent_id=container_parent_id, @@ -2737,7 +2737,7 @@ def list_folders_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_folders_serialize( container_parent_id=container_parent_id, @@ -2850,7 +2850,7 @@ def list_folders_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_folders_serialize( container_parent_id=container_parent_id, @@ -2898,7 +2898,7 @@ def _list_folders_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3036,7 +3036,7 @@ def list_organizations( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_organizations_serialize( container_ids=container_ids, @@ -3141,7 +3141,7 @@ def list_organizations_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_organizations_serialize( container_ids=container_ids, @@ -3246,7 +3246,7 @@ def list_organizations_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_organizations_serialize( container_ids=container_ids, @@ -3291,7 +3291,7 @@ def _list_organizations_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3431,7 +3431,7 @@ def list_projects( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_projects_serialize( container_parent_id=container_parent_id, @@ -3543,7 +3543,7 @@ def list_projects_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_projects_serialize( container_parent_id=container_parent_id, @@ -3655,7 +3655,7 @@ def list_projects_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_projects_serialize( container_parent_id=container_parent_id, @@ -3702,7 +3702,7 @@ def _list_projects_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3806,7 +3806,7 @@ def partial_update_folder( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_folder_serialize( container_id=container_id, @@ -3875,7 +3875,7 @@ def partial_update_folder_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_folder_serialize( container_id=container_id, @@ -3944,7 +3944,7 @@ def partial_update_folder_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_folder_serialize( container_id=container_id, @@ -3982,7 +3982,7 @@ def _partial_update_folder_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4071,7 +4071,7 @@ def partial_update_organization( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_organization_serialize( id=id, @@ -4140,7 +4140,7 @@ def partial_update_organization_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_organization_serialize( id=id, @@ -4209,7 +4209,7 @@ def partial_update_organization_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_organization_serialize( id=id, @@ -4246,7 +4246,7 @@ def _partial_update_organization_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4334,7 +4334,7 @@ def partial_update_project( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_project_serialize( id=id, @@ -4403,7 +4403,7 @@ def partial_update_project_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_project_serialize( id=id, @@ -4472,7 +4472,7 @@ def partial_update_project_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_project_serialize( id=id, @@ -4510,7 +4510,7 @@ def _partial_update_project_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/resourcemanager/src/stackit/resourcemanager/api_client.py b/services/resourcemanager/src/stackit/resourcemanager/api_client.py index 04793ba2..1cc38eac 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/api_client.py +++ b/services/resourcemanager/src/stackit/resourcemanager/api_client.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -331,6 +331,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -350,12 +354,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -457,7 +461,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -473,7 +477,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -488,6 +495,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/resourcemanager/src/stackit/resourcemanager/configuration.py b/services/resourcemanager/src/stackit/resourcemanager/configuration.py index a8973ec4..14dec45e 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/configuration.py +++ b/services/resourcemanager/src/stackit/resourcemanager/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ Resource Manager API @@ -14,7 +9,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -53,7 +70,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -71,7 +88,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -111,7 +133,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -130,12 +152,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/resourcemanager/src/stackit/resourcemanager/exceptions.py b/services/resourcemanager/src/stackit/resourcemanager/exceptions.py index 3687fe03..788747e3 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/exceptions.py +++ b/services/resourcemanager/src/stackit/resourcemanager/exceptions.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -151,6 +151,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -187,6 +194,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/__init__.py b/services/resourcemanager/src/stackit/resourcemanager/models/__init__.py index ded70b65..2fcfe0a0 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/models/__init__.py +++ b/services/resourcemanager/src/stackit/resourcemanager/models/__init__.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/create_folder_payload.py b/services/resourcemanager/src/stackit/resourcemanager/models/create_folder_payload.py index f8b3c415..3cc18891 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/models/create_folder_payload.py +++ b/services/resourcemanager/src/stackit/resourcemanager/models/create_folder_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -27,7 +27,7 @@ class CreateFolderPayload(BaseModel): """ CreateFolderPayload - """ + """ # noqa: E501 container_parent_id: StrictStr = Field( description="Identifier of the parent resource container - containerId as well as UUID identifier is supported.", diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/create_project_payload.py b/services/resourcemanager/src/stackit/resourcemanager/models/create_project_payload.py index 1ecde16d..a452bc30 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/models/create_project_payload.py +++ b/services/resourcemanager/src/stackit/resourcemanager/models/create_project_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -27,7 +27,7 @@ class CreateProjectPayload(BaseModel): """ CreateProjectPayload - """ + """ # noqa: E501 container_parent_id: StrictStr = Field( description="Identifier of the parent resource container - containerId as well as UUID identifier is supported.", diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/error_response.py b/services/resourcemanager/src/stackit/resourcemanager/models/error_response.py index 3f06f705..d6225a66 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/models/error_response.py +++ b/services/resourcemanager/src/stackit/resourcemanager/models/error_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ErrorResponse(BaseModel): """ ErrorResponse - """ + """ # noqa: E501 error: StrictStr = Field(description="The reason phrase of the status code.") message: StrictStr = Field(description="Description of the error.") diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/folder_response.py b/services/resourcemanager/src/stackit/resourcemanager/models/folder_response.py index 0b9e41f7..37d8925e 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/models/folder_response.py +++ b/services/resourcemanager/src/stackit/resourcemanager/models/folder_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class FolderResponse(BaseModel): """ FolderResponse - """ + """ # noqa: E501 container_id: StrictStr = Field(description="Globally unique, user-friendly identifier.", alias="containerId") creation_time: datetime = Field(description="Timestamp at which the folder was created.", alias="creationTime") diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/get_folder_details_response.py b/services/resourcemanager/src/stackit/resourcemanager/models/get_folder_details_response.py index 69258c45..1971ad9e 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/models/get_folder_details_response.py +++ b/services/resourcemanager/src/stackit/resourcemanager/models/get_folder_details_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -28,7 +28,7 @@ class GetFolderDetailsResponse(BaseModel): """ GetFolderDetailsResponse - """ + """ # noqa: E501 container_id: StrictStr = Field(description="Globally unique user-friendly identifier.", alias="containerId") creation_time: datetime = Field(description="Timestamp at which the folder was created.", alias="creationTime") diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/get_project_response.py b/services/resourcemanager/src/stackit/resourcemanager/models/get_project_response.py index 1a5205ce..60b1308a 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/models/get_project_response.py +++ b/services/resourcemanager/src/stackit/resourcemanager/models/get_project_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class GetProjectResponse(BaseModel): """ GetProjectResponse - """ + """ # noqa: E501 container_id: StrictStr = Field(description="Globally unique identifier.", alias="containerId") creation_time: datetime = Field(description="Timestamp at which the project was created.", alias="creationTime") diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/lifecycle_state.py b/services/resourcemanager/src/stackit/resourcemanager/models/lifecycle_state.py index 7770a4d8..7d486bab 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/models/lifecycle_state.py +++ b/services/resourcemanager/src/stackit/resourcemanager/models/lifecycle_state.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/list_folders_response.py b/services/resourcemanager/src/stackit/resourcemanager/models/list_folders_response.py index 132de13f..9580b584 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/models/list_folders_response.py +++ b/services/resourcemanager/src/stackit/resourcemanager/models/list_folders_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -28,7 +28,7 @@ class ListFoldersResponse(BaseModel): """ ListFoldersResponse - """ + """ # noqa: E501 items: List[ListFoldersResponseItemsInner] limit: Union[ diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/list_folders_response_items_inner.py b/services/resourcemanager/src/stackit/resourcemanager/models/list_folders_response_items_inner.py index b569c03a..45a7b024 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/models/list_folders_response_items_inner.py +++ b/services/resourcemanager/src/stackit/resourcemanager/models/list_folders_response_items_inner.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListFoldersResponseItemsInner(BaseModel): """ ListFoldersResponseItemsInner - """ + """ # noqa: E501 container_id: StrictStr = Field(description="Globally unique folder identifier.", alias="containerId") creation_time: datetime = Field(description="Timestamp at which the folder was created.", alias="creationTime") diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/list_organizations_response.py b/services/resourcemanager/src/stackit/resourcemanager/models/list_organizations_response.py index f89144ba..7b6da4a9 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/models/list_organizations_response.py +++ b/services/resourcemanager/src/stackit/resourcemanager/models/list_organizations_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -28,7 +28,7 @@ class ListOrganizationsResponse(BaseModel): """ ListOrganizationsResponse - """ + """ # noqa: E501 items: List[ListOrganizationsResponseItemsInner] limit: Union[ diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/list_organizations_response_items_inner.py b/services/resourcemanager/src/stackit/resourcemanager/models/list_organizations_response_items_inner.py index c7647f92..dc0ab923 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/models/list_organizations_response_items_inner.py +++ b/services/resourcemanager/src/stackit/resourcemanager/models/list_organizations_response_items_inner.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListOrganizationsResponseItemsInner(BaseModel): """ ListOrganizationsResponseItemsInner - """ + """ # noqa: E501 container_id: StrictStr = Field(description="Globally unique, user-friendly identifier.", alias="containerId") creation_time: datetime = Field( diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/list_projects_response.py b/services/resourcemanager/src/stackit/resourcemanager/models/list_projects_response.py index 8b7c95b1..2b22bbfe 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/models/list_projects_response.py +++ b/services/resourcemanager/src/stackit/resourcemanager/models/list_projects_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListProjectsResponse(BaseModel): """ ListProjectsResponse - """ + """ # noqa: E501 items: List[Project] limit: Union[ diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/member.py b/services/resourcemanager/src/stackit/resourcemanager/models/member.py index 83566153..7ceebfb4 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/models/member.py +++ b/services/resourcemanager/src/stackit/resourcemanager/models/member.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Member(BaseModel): """ Member - """ + """ # noqa: E501 role: StrictStr = Field(description="A valid role defined for the resource.") subject: StrictStr = Field(description="Unique identifier of the user, service account or client.") diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/organization_response.py b/services/resourcemanager/src/stackit/resourcemanager/models/organization_response.py index 8413b607..a21adec4 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/models/organization_response.py +++ b/services/resourcemanager/src/stackit/resourcemanager/models/organization_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class OrganizationResponse(BaseModel): """ OrganizationResponse - """ + """ # noqa: E501 container_id: StrictStr = Field(description="Globally unique, user-friendly identifier.", alias="containerId") creation_time: datetime = Field( diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/parent.py b/services/resourcemanager/src/stackit/resourcemanager/models/parent.py index 5fcfb105..4517630f 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/models/parent.py +++ b/services/resourcemanager/src/stackit/resourcemanager/models/parent.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Parent(BaseModel): """ Parent container. - """ + """ # noqa: E501 container_id: StrictStr = Field( description="User-friendly identifier of either organization or folder (will replace id).", alias="containerId" diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/parent_list_inner.py b/services/resourcemanager/src/stackit/resourcemanager/models/parent_list_inner.py index 6c9d1457..04d02d37 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/models/parent_list_inner.py +++ b/services/resourcemanager/src/stackit/resourcemanager/models/parent_list_inner.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class ParentListInner(BaseModel): """ ParentListInner - """ + """ # noqa: E501 container_id: StrictStr = Field( description="User-friendly identifier of either organization or folder (will replace id).", alias="containerId" diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/partial_update_folder_payload.py b/services/resourcemanager/src/stackit/resourcemanager/models/partial_update_folder_payload.py index 4f62d928..2588afd4 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/models/partial_update_folder_payload.py +++ b/services/resourcemanager/src/stackit/resourcemanager/models/partial_update_folder_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class PartialUpdateFolderPayload(BaseModel): """ PartialUpdateFolderPayload - """ + """ # noqa: E501 container_parent_id: Optional[StrictStr] = Field( default=None, diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/partial_update_organization_payload.py b/services/resourcemanager/src/stackit/resourcemanager/models/partial_update_organization_payload.py index 8346b5e3..4330fee4 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/models/partial_update_organization_payload.py +++ b/services/resourcemanager/src/stackit/resourcemanager/models/partial_update_organization_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class PartialUpdateOrganizationPayload(BaseModel): """ PartialUpdateOrganizationPayload - """ + """ # noqa: E501 labels: Optional[Dict[str, StrictStr]] = Field( default=None, diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/partial_update_project_payload.py b/services/resourcemanager/src/stackit/resourcemanager/models/partial_update_project_payload.py index e093f89e..6370472a 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/models/partial_update_project_payload.py +++ b/services/resourcemanager/src/stackit/resourcemanager/models/partial_update_project_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class PartialUpdateProjectPayload(BaseModel): """ PartialUpdateProjectPayload - """ + """ # noqa: E501 container_parent_id: Optional[StrictStr] = Field( default=None, diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/project.py b/services/resourcemanager/src/stackit/resourcemanager/models/project.py index 41e54816..2e8840df 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/models/project.py +++ b/services/resourcemanager/src/stackit/resourcemanager/models/project.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -28,7 +28,7 @@ class Project(BaseModel): """ Project - """ + """ # noqa: E501 container_id: StrictStr = Field(description="Globally unique, user-friendly identifier.", alias="containerId") creation_time: datetime = Field(description="Timestamp at which the project was created.", alias="creationTime") diff --git a/services/resourcemanager/src/stackit/resourcemanager/rest.py b/services/resourcemanager/src/stackit/resourcemanager/rest.py index 10f6f712..01075625 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/rest.py +++ b/services/resourcemanager/src/stackit/resourcemanager/rest.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -124,7 +124,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/runcommand/CHANGELOG.md b/services/runcommand/CHANGELOG.md index ae1c37b3..c958c7f2 100644 --- a/services/runcommand/CHANGELOG.md +++ b/services/runcommand/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.0.2 +- **Internal:** Improve deserializing and error types + ## v1.0.1 (2025-05-09) - **Feature:** Update user-agent header diff --git a/services/runcommand/pyproject.toml b/services/runcommand/pyproject.toml index 838e0db7..d5a62645 100644 --- a/services/runcommand/pyproject.toml +++ b/services/runcommand/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-runcommand" [tool.poetry] name = "stackit-runcommand" -version = "v1.0.1" +version = "v1.0.2" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/runcommand/src/stackit/runcommand/__init__.py b/services/runcommand/src/stackit/runcommand/__init__.py index 5ec28d7b..2624da33 100644 --- a/services/runcommand/src/stackit/runcommand/__init__.py +++ b/services/runcommand/src/stackit/runcommand/__init__.py @@ -12,37 +12,75 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "CommandDetails", + "CommandTemplate", + "CommandTemplateResponse", + "CommandTemplateSchema", + "Commands", + "CreateCommandPayload", + "ErrorResponse", + "GetCommandsResponse", + "ModelField", + "NewCommandResponse", + "ParametersSchema", + "Properties", +] + # import apis into sdk package -from stackit.runcommand.api.default_api import DefaultApi -from stackit.runcommand.api_client import ApiClient +from stackit.runcommand.api.default_api import DefaultApi as DefaultApi +from stackit.runcommand.api_client import ApiClient as ApiClient # import ApiClient -from stackit.runcommand.api_response import ApiResponse -from stackit.runcommand.configuration import HostConfiguration -from stackit.runcommand.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.runcommand.api_response import ApiResponse as ApiResponse +from stackit.runcommand.configuration import HostConfiguration as HostConfiguration +from stackit.runcommand.exceptions import ApiAttributeError as ApiAttributeError +from stackit.runcommand.exceptions import ApiException as ApiException +from stackit.runcommand.exceptions import ApiKeyError as ApiKeyError +from stackit.runcommand.exceptions import ApiTypeError as ApiTypeError +from stackit.runcommand.exceptions import ApiValueError as ApiValueError +from stackit.runcommand.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.runcommand.models.command_details import CommandDetails -from stackit.runcommand.models.command_template import CommandTemplate -from stackit.runcommand.models.command_template_response import CommandTemplateResponse -from stackit.runcommand.models.command_template_schema import CommandTemplateSchema -from stackit.runcommand.models.commands import Commands -from stackit.runcommand.models.create_command_payload import CreateCommandPayload -from stackit.runcommand.models.error_response import ErrorResponse -from stackit.runcommand.models.get_commands_response import GetCommandsResponse -from stackit.runcommand.models.model_field import ModelField -from stackit.runcommand.models.new_command_response import NewCommandResponse -from stackit.runcommand.models.parameters_schema import ParametersSchema -from stackit.runcommand.models.properties import Properties +from stackit.runcommand.models.command_details import CommandDetails as CommandDetails +from stackit.runcommand.models.command_template import ( + CommandTemplate as CommandTemplate, +) +from stackit.runcommand.models.command_template_response import ( + CommandTemplateResponse as CommandTemplateResponse, +) +from stackit.runcommand.models.command_template_schema import ( + CommandTemplateSchema as CommandTemplateSchema, +) +from stackit.runcommand.models.commands import Commands as Commands +from stackit.runcommand.models.create_command_payload import ( + CreateCommandPayload as CreateCommandPayload, +) +from stackit.runcommand.models.error_response import ErrorResponse as ErrorResponse +from stackit.runcommand.models.get_commands_response import ( + GetCommandsResponse as GetCommandsResponse, +) +from stackit.runcommand.models.model_field import ModelField as ModelField +from stackit.runcommand.models.new_command_response import ( + NewCommandResponse as NewCommandResponse, +) +from stackit.runcommand.models.parameters_schema import ( + ParametersSchema as ParametersSchema, +) +from stackit.runcommand.models.properties import Properties as Properties diff --git a/services/runcommand/src/stackit/runcommand/api/default_api.py b/services/runcommand/src/stackit/runcommand/api/default_api.py index 698a2b2e..02c58081 100644 --- a/services/runcommand/src/stackit/runcommand/api/default_api.py +++ b/services/runcommand/src/stackit/runcommand/api/default_api.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -91,7 +91,7 @@ def create_command( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_command_serialize( project_id=project_id, @@ -166,7 +166,7 @@ def create_command_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_command_serialize( project_id=project_id, @@ -241,7 +241,7 @@ def create_command_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_command_serialize( project_id=project_id, @@ -283,7 +283,7 @@ def _create_command_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -379,7 +379,7 @@ def get_command( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_command_serialize( project_id=project_id, @@ -454,7 +454,7 @@ def get_command_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_command_serialize( project_id=project_id, @@ -529,7 +529,7 @@ def get_command_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_command_serialize( project_id=project_id, @@ -571,7 +571,7 @@ def _get_command_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -659,7 +659,7 @@ def get_command_template( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_command_template_serialize( project_id=project_id, @@ -734,7 +734,7 @@ def get_command_template_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_command_template_serialize( project_id=project_id, @@ -809,7 +809,7 @@ def get_command_template_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_command_template_serialize( project_id=project_id, @@ -851,7 +851,7 @@ def _get_command_template_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -935,7 +935,7 @@ def list_command_templates( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_command_templates_serialize( os_type=os_type, @@ -1002,7 +1002,7 @@ def list_command_templates_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_command_templates_serialize( os_type=os_type, @@ -1069,7 +1069,7 @@ def list_command_templates_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_command_templates_serialize( os_type=os_type, @@ -1104,7 +1104,7 @@ def _list_command_templates_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1185,7 +1185,7 @@ def list_commands( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_commands_serialize( project_id=project_id, @@ -1256,7 +1256,7 @@ def list_commands_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_commands_serialize( project_id=project_id, @@ -1327,7 +1327,7 @@ def list_commands_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_commands_serialize( project_id=project_id, @@ -1367,7 +1367,7 @@ def _list_commands_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/runcommand/src/stackit/runcommand/api_client.py b/services/runcommand/src/stackit/runcommand/api_client.py index 10e29170..1430a72d 100644 --- a/services/runcommand/src/stackit/runcommand/api_client.py +++ b/services/runcommand/src/stackit/runcommand/api_client.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -332,6 +332,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -351,12 +355,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -458,7 +462,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -474,7 +478,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -489,6 +496,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/runcommand/src/stackit/runcommand/configuration.py b/services/runcommand/src/stackit/runcommand/configuration.py index 9506b757..4f40b7f2 100644 --- a/services/runcommand/src/stackit/runcommand/configuration.py +++ b/services/runcommand/src/stackit/runcommand/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT Run Commands Service API @@ -15,7 +10,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -54,7 +71,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -72,7 +89,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -112,7 +134,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -131,12 +153,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/runcommand/src/stackit/runcommand/exceptions.py b/services/runcommand/src/stackit/runcommand/exceptions.py index 5e72b3c0..d498bfe8 100644 --- a/services/runcommand/src/stackit/runcommand/exceptions.py +++ b/services/runcommand/src/stackit/runcommand/exceptions.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -152,6 +152,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -188,6 +195,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/runcommand/src/stackit/runcommand/models/__init__.py b/services/runcommand/src/stackit/runcommand/models/__init__.py index 973ced42..1d83b071 100644 --- a/services/runcommand/src/stackit/runcommand/models/__init__.py +++ b/services/runcommand/src/stackit/runcommand/models/__init__.py @@ -11,7 +11,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/runcommand/src/stackit/runcommand/models/command_details.py b/services/runcommand/src/stackit/runcommand/models/command_details.py index 7b50b502..cf6b325c 100644 --- a/services/runcommand/src/stackit/runcommand/models/command_details.py +++ b/services/runcommand/src/stackit/runcommand/models/command_details.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CommandDetails(BaseModel): """ CommandDetails - """ + """ # noqa: E501 command_template_name: Optional[StrictStr] = Field(default=None, alias="commandTemplateName") command_template_title: Optional[StrictStr] = Field(default=None, alias="commandTemplateTitle") diff --git a/services/runcommand/src/stackit/runcommand/models/command_template.py b/services/runcommand/src/stackit/runcommand/models/command_template.py index 3f2600d2..b02cd1cd 100644 --- a/services/runcommand/src/stackit/runcommand/models/command_template.py +++ b/services/runcommand/src/stackit/runcommand/models/command_template.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CommandTemplate(BaseModel): """ CommandTemplate - """ + """ # noqa: E501 name: Optional[StrictStr] = None os_type: Optional[List[StrictStr]] = Field(default=None, alias="osType") diff --git a/services/runcommand/src/stackit/runcommand/models/command_template_response.py b/services/runcommand/src/stackit/runcommand/models/command_template_response.py index 00dcc0c7..7765787c 100644 --- a/services/runcommand/src/stackit/runcommand/models/command_template_response.py +++ b/services/runcommand/src/stackit/runcommand/models/command_template_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class CommandTemplateResponse(BaseModel): """ CommandTemplateResponse - """ + """ # noqa: E501 items: Optional[List[CommandTemplate]] = None __properties: ClassVar[List[str]] = ["items"] diff --git a/services/runcommand/src/stackit/runcommand/models/command_template_schema.py b/services/runcommand/src/stackit/runcommand/models/command_template_schema.py index 323cf018..b9392e28 100644 --- a/services/runcommand/src/stackit/runcommand/models/command_template_schema.py +++ b/services/runcommand/src/stackit/runcommand/models/command_template_schema.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class CommandTemplateSchema(BaseModel): """ CommandTemplateSchema - """ + """ # noqa: E501 description: Optional[StrictStr] = None name: Optional[StrictStr] = None diff --git a/services/runcommand/src/stackit/runcommand/models/commands.py b/services/runcommand/src/stackit/runcommand/models/commands.py index c3836ce0..cddd29b9 100644 --- a/services/runcommand/src/stackit/runcommand/models/commands.py +++ b/services/runcommand/src/stackit/runcommand/models/commands.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class Commands(BaseModel): """ Commands - """ + """ # noqa: E501 command_template_name: Optional[StrictStr] = Field(default=None, alias="commandTemplateName") command_template_title: Optional[StrictStr] = Field(default=None, alias="commandTemplateTitle") diff --git a/services/runcommand/src/stackit/runcommand/models/create_command_payload.py b/services/runcommand/src/stackit/runcommand/models/create_command_payload.py index 80a886ab..19875b7e 100644 --- a/services/runcommand/src/stackit/runcommand/models/create_command_payload.py +++ b/services/runcommand/src/stackit/runcommand/models/create_command_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateCommandPayload(BaseModel): """ CreateCommandPayload - """ + """ # noqa: E501 command_template_name: StrictStr = Field(alias="commandTemplateName") parameters: Optional[Dict[str, StrictStr]] = None diff --git a/services/runcommand/src/stackit/runcommand/models/error_response.py b/services/runcommand/src/stackit/runcommand/models/error_response.py index 3519fd03..14b35765 100644 --- a/services/runcommand/src/stackit/runcommand/models/error_response.py +++ b/services/runcommand/src/stackit/runcommand/models/error_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ErrorResponse(BaseModel): """ ErrorResponse - """ + """ # noqa: E501 message: StrictStr = Field(description="Details about the error") status: StrictStr = Field( diff --git a/services/runcommand/src/stackit/runcommand/models/get_commands_response.py b/services/runcommand/src/stackit/runcommand/models/get_commands_response.py index 46119d20..2f8fa8d7 100644 --- a/services/runcommand/src/stackit/runcommand/models/get_commands_response.py +++ b/services/runcommand/src/stackit/runcommand/models/get_commands_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class GetCommandsResponse(BaseModel): """ GetCommandsResponse - """ + """ # noqa: E501 items: Optional[List[Commands]] = None __properties: ClassVar[List[str]] = ["items"] diff --git a/services/runcommand/src/stackit/runcommand/models/model_field.py b/services/runcommand/src/stackit/runcommand/models/model_field.py index 8a99ba04..5749f4d3 100644 --- a/services/runcommand/src/stackit/runcommand/models/model_field.py +++ b/services/runcommand/src/stackit/runcommand/models/model_field.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ModelField(BaseModel): """ ModelField - """ + """ # noqa: E501 default: Optional[StrictStr] = None description: Optional[StrictStr] = None diff --git a/services/runcommand/src/stackit/runcommand/models/new_command_response.py b/services/runcommand/src/stackit/runcommand/models/new_command_response.py index 76d47f9b..fa5b7f7c 100644 --- a/services/runcommand/src/stackit/runcommand/models/new_command_response.py +++ b/services/runcommand/src/stackit/runcommand/models/new_command_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class NewCommandResponse(BaseModel): """ NewCommandResponse - """ + """ # noqa: E501 id: Optional[StrictInt] = None __properties: ClassVar[List[str]] = ["id"] diff --git a/services/runcommand/src/stackit/runcommand/models/parameters_schema.py b/services/runcommand/src/stackit/runcommand/models/parameters_schema.py index 10c5c04a..cffe6a4b 100644 --- a/services/runcommand/src/stackit/runcommand/models/parameters_schema.py +++ b/services/runcommand/src/stackit/runcommand/models/parameters_schema.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ParametersSchema(BaseModel): """ ParametersSchema - """ + """ # noqa: E501 properties: Optional[Properties] = None __properties: ClassVar[List[str]] = ["properties"] diff --git a/services/runcommand/src/stackit/runcommand/models/properties.py b/services/runcommand/src/stackit/runcommand/models/properties.py index 3f02114f..e00cd995 100644 --- a/services/runcommand/src/stackit/runcommand/models/properties.py +++ b/services/runcommand/src/stackit/runcommand/models/properties.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class Properties(BaseModel): """ Properties - """ + """ # noqa: E501 confirm_password: Optional[ModelField] = Field(default=None, alias="ConfirmPassword") password: Optional[ModelField] = Field(default=None, alias="Password") diff --git a/services/runcommand/src/stackit/runcommand/rest.py b/services/runcommand/src/stackit/runcommand/rest.py index 2f12fce6..570d696a 100644 --- a/services/runcommand/src/stackit/runcommand/rest.py +++ b/services/runcommand/src/stackit/runcommand/rest.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -125,7 +125,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/secretsmanager/CHANGELOG.md b/services/secretsmanager/CHANGELOG.md index 90bdd0ae..c70191c9 100644 --- a/services/secretsmanager/CHANGELOG.md +++ b/services/secretsmanager/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.2.3 +- **Internal:** Improve deserializing and error types + ## v0.2.2 (2025-05-09) - **Feature:** Update user-agent header diff --git a/services/secretsmanager/pyproject.toml b/services/secretsmanager/pyproject.toml index 19f56f01..60e84383 100644 --- a/services/secretsmanager/pyproject.toml +++ b/services/secretsmanager/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-secretsmanager" [tool.poetry] name = "stackit-secretsmanager" -version = "v0.2.2" +version = "v0.2.3" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/secretsmanager/src/stackit/secretsmanager/__init__.py b/services/secretsmanager/src/stackit/secretsmanager/__init__.py index 77e42d18..0e7992c8 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/__init__.py +++ b/services/secretsmanager/src/stackit/secretsmanager/__init__.py @@ -11,41 +11,89 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "ACL", + "BadRequest", + "Conflict", + "CreateACLPayload", + "CreateInstancePayload", + "CreateUserPayload", + "Instance", + "ListACLsResponse", + "ListInstancesResponse", + "ListUsersResponse", + "NotFound", + "UpdateACLPayload", + "UpdateACLsPayload", + "UpdateInstancePayload", + "UpdateUserPayload", + "User", +] + # import apis into sdk package -from stackit.secretsmanager.api.default_api import DefaultApi -from stackit.secretsmanager.api_client import ApiClient +from stackit.secretsmanager.api.default_api import DefaultApi as DefaultApi +from stackit.secretsmanager.api_client import ApiClient as ApiClient # import ApiClient -from stackit.secretsmanager.api_response import ApiResponse -from stackit.secretsmanager.configuration import HostConfiguration -from stackit.secretsmanager.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.secretsmanager.api_response import ApiResponse as ApiResponse +from stackit.secretsmanager.configuration import HostConfiguration as HostConfiguration +from stackit.secretsmanager.exceptions import ApiAttributeError as ApiAttributeError +from stackit.secretsmanager.exceptions import ApiException as ApiException +from stackit.secretsmanager.exceptions import ApiKeyError as ApiKeyError +from stackit.secretsmanager.exceptions import ApiTypeError as ApiTypeError +from stackit.secretsmanager.exceptions import ApiValueError as ApiValueError +from stackit.secretsmanager.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.secretsmanager.models.acl import ACL -from stackit.secretsmanager.models.bad_request import BadRequest -from stackit.secretsmanager.models.conflict import Conflict -from stackit.secretsmanager.models.create_acl_payload import CreateACLPayload -from stackit.secretsmanager.models.create_instance_payload import CreateInstancePayload -from stackit.secretsmanager.models.create_user_payload import CreateUserPayload -from stackit.secretsmanager.models.instance import Instance -from stackit.secretsmanager.models.list_acls_response import ListACLsResponse -from stackit.secretsmanager.models.list_instances_response import ListInstancesResponse -from stackit.secretsmanager.models.list_users_response import ListUsersResponse -from stackit.secretsmanager.models.not_found import NotFound -from stackit.secretsmanager.models.update_acl_payload import UpdateACLPayload -from stackit.secretsmanager.models.update_acls_payload import UpdateACLsPayload -from stackit.secretsmanager.models.update_instance_payload import UpdateInstancePayload -from stackit.secretsmanager.models.update_user_payload import UpdateUserPayload -from stackit.secretsmanager.models.user import User +from stackit.secretsmanager.models.acl import ACL as ACL +from stackit.secretsmanager.models.bad_request import BadRequest as BadRequest +from stackit.secretsmanager.models.conflict import Conflict as Conflict +from stackit.secretsmanager.models.create_acl_payload import ( + CreateACLPayload as CreateACLPayload, +) +from stackit.secretsmanager.models.create_instance_payload import ( + CreateInstancePayload as CreateInstancePayload, +) +from stackit.secretsmanager.models.create_user_payload import ( + CreateUserPayload as CreateUserPayload, +) +from stackit.secretsmanager.models.instance import Instance as Instance +from stackit.secretsmanager.models.list_acls_response import ( + ListACLsResponse as ListACLsResponse, +) +from stackit.secretsmanager.models.list_instances_response import ( + ListInstancesResponse as ListInstancesResponse, +) +from stackit.secretsmanager.models.list_users_response import ( + ListUsersResponse as ListUsersResponse, +) +from stackit.secretsmanager.models.not_found import NotFound as NotFound +from stackit.secretsmanager.models.update_acl_payload import ( + UpdateACLPayload as UpdateACLPayload, +) +from stackit.secretsmanager.models.update_acls_payload import ( + UpdateACLsPayload as UpdateACLsPayload, +) +from stackit.secretsmanager.models.update_instance_payload import ( + UpdateInstancePayload as UpdateInstancePayload, +) +from stackit.secretsmanager.models.update_user_payload import ( + UpdateUserPayload as UpdateUserPayload, +) +from stackit.secretsmanager.models.user import User as User diff --git a/services/secretsmanager/src/stackit/secretsmanager/api/default_api.py b/services/secretsmanager/src/stackit/secretsmanager/api/default_api.py index c3df5bc0..ae0f6d75 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/api/default_api.py +++ b/services/secretsmanager/src/stackit/secretsmanager/api/default_api.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -96,7 +96,7 @@ def create_acl( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_acl_serialize( project_id=project_id, @@ -170,7 +170,7 @@ def create_acl_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_acl_serialize( project_id=project_id, @@ -244,7 +244,7 @@ def create_acl_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_acl_serialize( project_id=project_id, @@ -285,7 +285,7 @@ def _create_acl_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -375,7 +375,7 @@ def create_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -444,7 +444,7 @@ def create_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -513,7 +513,7 @@ def create_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -551,7 +551,7 @@ def _create_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -642,7 +642,7 @@ def create_user( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_user_serialize( project_id=project_id, @@ -717,7 +717,7 @@ def create_user_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_user_serialize( project_id=project_id, @@ -792,7 +792,7 @@ def create_user_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_user_serialize( project_id=project_id, @@ -834,7 +834,7 @@ def _create_user_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -927,7 +927,7 @@ def delete_acl( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_acl_serialize( project_id=project_id, @@ -1001,7 +1001,7 @@ def delete_acl_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_acl_serialize( project_id=project_id, @@ -1075,7 +1075,7 @@ def delete_acl_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_acl_serialize( project_id=project_id, @@ -1116,7 +1116,7 @@ def _delete_acl_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1198,7 +1198,7 @@ def delete_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1268,7 +1268,7 @@ def delete_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1338,7 +1338,7 @@ def delete_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1377,7 +1377,7 @@ def _delete_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1462,7 +1462,7 @@ def delete_user( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_user_serialize( project_id=project_id, @@ -1538,7 +1538,7 @@ def delete_user_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_user_serialize( project_id=project_id, @@ -1614,7 +1614,7 @@ def delete_user_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_user_serialize( project_id=project_id, @@ -1655,7 +1655,7 @@ def _delete_user_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1740,7 +1740,7 @@ def get_acl( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_acl_serialize( project_id=project_id, @@ -1814,7 +1814,7 @@ def get_acl_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_acl_serialize( project_id=project_id, @@ -1888,7 +1888,7 @@ def get_acl_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_acl_serialize( project_id=project_id, @@ -1929,7 +1929,7 @@ def _get_acl_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2011,7 +2011,7 @@ def get_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -2081,7 +2081,7 @@ def get_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -2151,7 +2151,7 @@ def get_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -2190,7 +2190,7 @@ def _get_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2275,7 +2275,7 @@ def get_user( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_user_serialize( project_id=project_id, @@ -2351,7 +2351,7 @@ def get_user_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_user_serialize( project_id=project_id, @@ -2427,7 +2427,7 @@ def get_user_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_user_serialize( project_id=project_id, @@ -2468,7 +2468,7 @@ def _get_user_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2550,7 +2550,7 @@ def list_acls( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_acls_serialize( project_id=project_id, @@ -2620,7 +2620,7 @@ def list_acls_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_acls_serialize( project_id=project_id, @@ -2690,7 +2690,7 @@ def list_acls_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_acls_serialize( project_id=project_id, @@ -2729,7 +2729,7 @@ def _list_acls_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2806,7 +2806,7 @@ def list_instances( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -2871,7 +2871,7 @@ def list_instances_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -2936,7 +2936,7 @@ def list_instances_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -2972,7 +2972,7 @@ def _list_instances_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3050,7 +3050,7 @@ def list_users( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_users_serialize( project_id=project_id, @@ -3120,7 +3120,7 @@ def list_users_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_users_serialize( project_id=project_id, @@ -3190,7 +3190,7 @@ def list_users_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_users_serialize( project_id=project_id, @@ -3229,7 +3229,7 @@ def _list_users_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3315,7 +3315,7 @@ def update_acl( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_acl_serialize( project_id=project_id, @@ -3393,7 +3393,7 @@ def update_acl_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_acl_serialize( project_id=project_id, @@ -3471,7 +3471,7 @@ def update_acl_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_acl_serialize( project_id=project_id, @@ -3514,7 +3514,7 @@ def _update_acl_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3609,7 +3609,7 @@ def update_acls( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_acls_serialize( project_id=project_id, @@ -3683,7 +3683,7 @@ def update_acls_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_acls_serialize( project_id=project_id, @@ -3757,7 +3757,7 @@ def update_acls_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_acls_serialize( project_id=project_id, @@ -3798,7 +3798,7 @@ def _update_acls_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3891,7 +3891,7 @@ def update_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_instance_serialize( project_id=project_id, @@ -3965,7 +3965,7 @@ def update_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_instance_serialize( project_id=project_id, @@ -4039,7 +4039,7 @@ def update_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_instance_serialize( project_id=project_id, @@ -4080,7 +4080,7 @@ def _update_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4178,7 +4178,7 @@ def update_user( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_user_serialize( project_id=project_id, @@ -4258,7 +4258,7 @@ def update_user_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_user_serialize( project_id=project_id, @@ -4338,7 +4338,7 @@ def update_user_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_user_serialize( project_id=project_id, @@ -4381,7 +4381,7 @@ def _update_user_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/secretsmanager/src/stackit/secretsmanager/api_client.py b/services/secretsmanager/src/stackit/secretsmanager/api_client.py index 6ebb126e..acaba12d 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/api_client.py +++ b/services/secretsmanager/src/stackit/secretsmanager/api_client.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -331,6 +331,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -350,12 +354,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -457,7 +461,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -473,7 +477,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -488,6 +495,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/secretsmanager/src/stackit/secretsmanager/configuration.py b/services/secretsmanager/src/stackit/secretsmanager/configuration.py index b2070b2b..42ceebd1 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/configuration.py +++ b/services/secretsmanager/src/stackit/secretsmanager/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT Secrets Manager API @@ -14,7 +9,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -53,7 +70,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -72,7 +89,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -112,7 +134,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -131,12 +153,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/secretsmanager/src/stackit/secretsmanager/exceptions.py b/services/secretsmanager/src/stackit/secretsmanager/exceptions.py index 223cf2d3..b9f9e976 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/exceptions.py +++ b/services/secretsmanager/src/stackit/secretsmanager/exceptions.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -151,6 +151,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -187,6 +194,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/__init__.py b/services/secretsmanager/src/stackit/secretsmanager/models/__init__.py index 53f34d16..e2399a01 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/models/__init__.py +++ b/services/secretsmanager/src/stackit/secretsmanager/models/__init__.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/acl.py b/services/secretsmanager/src/stackit/secretsmanager/models/acl.py index d8d8b166..c7877d67 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/models/acl.py +++ b/services/secretsmanager/src/stackit/secretsmanager/models/acl.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class ACL(BaseModel): """ ACL - """ + """ # noqa: E501 cidr: StrictStr = Field(description="The given IP/IP Range that is permitted to access.") id: StrictStr = Field(description="A auto generated unique id which identifies the acl.") diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/bad_request.py b/services/secretsmanager/src/stackit/secretsmanager/models/bad_request.py index 1aa0dbd4..c9a3104e 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/models/bad_request.py +++ b/services/secretsmanager/src/stackit/secretsmanager/models/bad_request.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class BadRequest(BaseModel): """ BadRequest - """ + """ # noqa: E501 message: StrictStr = Field(description="The error message for bad requests") __properties: ClassVar[List[str]] = ["message"] diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/conflict.py b/services/secretsmanager/src/stackit/secretsmanager/models/conflict.py index 2c2bfb83..98149919 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/models/conflict.py +++ b/services/secretsmanager/src/stackit/secretsmanager/models/conflict.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Conflict(BaseModel): """ Conflict - """ + """ # noqa: E501 message: StrictStr = Field(description="The error message for conflicts") __properties: ClassVar[List[str]] = ["message"] diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/create_acl_payload.py b/services/secretsmanager/src/stackit/secretsmanager/models/create_acl_payload.py index acaab559..94ed2d43 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/models/create_acl_payload.py +++ b/services/secretsmanager/src/stackit/secretsmanager/models/create_acl_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateACLPayload(BaseModel): """ CreateACLPayload - """ + """ # noqa: E501 cidr: StrictStr = Field(description="The given IP/IP Range that is permitted to access.") __properties: ClassVar[List[str]] = ["cidr"] diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/create_instance_payload.py b/services/secretsmanager/src/stackit/secretsmanager/models/create_instance_payload.py index bb63be6f..03a170e3 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/models/create_instance_payload.py +++ b/services/secretsmanager/src/stackit/secretsmanager/models/create_instance_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateInstancePayload(BaseModel): """ CreateInstancePayload - """ + """ # noqa: E501 name: StrictStr = Field(description="A user chosen name to distinguish multiple secrets manager instances.") __properties: ClassVar[List[str]] = ["name"] diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/create_user_payload.py b/services/secretsmanager/src/stackit/secretsmanager/models/create_user_payload.py index e2b45a84..60744400 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/models/create_user_payload.py +++ b/services/secretsmanager/src/stackit/secretsmanager/models/create_user_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateUserPayload(BaseModel): """ CreateUserPayload - """ + """ # noqa: E501 description: StrictStr = Field(description="A user chosen description to differentiate between multiple users.") write: StrictBool = Field( diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/instance.py b/services/secretsmanager/src/stackit/secretsmanager/models/instance.py index 732c30e6..5447b496 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/models/instance.py +++ b/services/secretsmanager/src/stackit/secretsmanager/models/instance.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Instance(BaseModel): """ Instance - """ + """ # noqa: E501 api_url: StrictStr = Field(description="The API endpoint for connecting to the secrets engine.", alias="apiUrl") creation_finished_date: Optional[StrictStr] = Field( diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/list_acls_response.py b/services/secretsmanager/src/stackit/secretsmanager/models/list_acls_response.py index 9e45b5db..3c74d5ab 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/models/list_acls_response.py +++ b/services/secretsmanager/src/stackit/secretsmanager/models/list_acls_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListACLsResponse(BaseModel): """ ListACLsResponse - """ + """ # noqa: E501 acls: List[ACL] __properties: ClassVar[List[str]] = ["acls"] diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/list_instances_response.py b/services/secretsmanager/src/stackit/secretsmanager/models/list_instances_response.py index 54ce21a1..d4b83522 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/models/list_instances_response.py +++ b/services/secretsmanager/src/stackit/secretsmanager/models/list_instances_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListInstancesResponse(BaseModel): """ ListInstancesResponse - """ + """ # noqa: E501 instances: List[Instance] __properties: ClassVar[List[str]] = ["instances"] diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/list_users_response.py b/services/secretsmanager/src/stackit/secretsmanager/models/list_users_response.py index 15ce919a..362c6624 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/models/list_users_response.py +++ b/services/secretsmanager/src/stackit/secretsmanager/models/list_users_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListUsersResponse(BaseModel): """ ListUsersResponse - """ + """ # noqa: E501 users: List[User] __properties: ClassVar[List[str]] = ["users"] diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/not_found.py b/services/secretsmanager/src/stackit/secretsmanager/models/not_found.py index 7f376a3b..90400c3e 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/models/not_found.py +++ b/services/secretsmanager/src/stackit/secretsmanager/models/not_found.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class NotFound(BaseModel): """ NotFound - """ + """ # noqa: E501 message: StrictStr = Field(description="The error message for not found resources") __properties: ClassVar[List[str]] = ["message"] diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/update_acl_payload.py b/services/secretsmanager/src/stackit/secretsmanager/models/update_acl_payload.py index 5d94f442..6c01906e 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/models/update_acl_payload.py +++ b/services/secretsmanager/src/stackit/secretsmanager/models/update_acl_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class UpdateACLPayload(BaseModel): """ UpdateACLPayload - """ + """ # noqa: E501 cidr: StrictStr = Field(description="The given IP/IP Range that is permitted to access.") __properties: ClassVar[List[str]] = ["cidr"] diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/update_acls_payload.py b/services/secretsmanager/src/stackit/secretsmanager/models/update_acls_payload.py index 72b5ae06..19e28027 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/models/update_acls_payload.py +++ b/services/secretsmanager/src/stackit/secretsmanager/models/update_acls_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class UpdateACLsPayload(BaseModel): """ UpdateACLsPayload - """ + """ # noqa: E501 cidrs: Optional[List[UpdateACLPayload]] = None __properties: ClassVar[List[str]] = ["cidrs"] diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/update_instance_payload.py b/services/secretsmanager/src/stackit/secretsmanager/models/update_instance_payload.py index cd2242f0..a3b88307 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/models/update_instance_payload.py +++ b/services/secretsmanager/src/stackit/secretsmanager/models/update_instance_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class UpdateInstancePayload(BaseModel): """ UpdateInstancePayload - """ + """ # noqa: E501 name: StrictStr = Field(description="A user chosen name to distinguish multiple secrets manager instances.") __properties: ClassVar[List[str]] = ["name"] diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/update_user_payload.py b/services/secretsmanager/src/stackit/secretsmanager/models/update_user_payload.py index 506a1c55..1922bb7d 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/models/update_user_payload.py +++ b/services/secretsmanager/src/stackit/secretsmanager/models/update_user_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class UpdateUserPayload(BaseModel): """ UpdateUserPayload - """ + """ # noqa: E501 description: Optional[StrictStr] = Field( default=None, description="A user chosen description to differentiate between multiple users." diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/user.py b/services/secretsmanager/src/stackit/secretsmanager/models/user.py index d469a48e..63aa0e93 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/models/user.py +++ b/services/secretsmanager/src/stackit/secretsmanager/models/user.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class User(BaseModel): """ User - """ + """ # noqa: E501 description: StrictStr = Field(description="A user chosen description to differentiate between multiple users.") id: StrictStr = Field(description="A auto generated unique id which identifies the users.") diff --git a/services/secretsmanager/src/stackit/secretsmanager/rest.py b/services/secretsmanager/src/stackit/secretsmanager/rest.py index 0c452a50..8af4c017 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/rest.py +++ b/services/secretsmanager/src/stackit/secretsmanager/rest.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -124,7 +124,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/serverbackup/CHANGELOG.md b/services/serverbackup/CHANGELOG.md index 9752a0c1..f1e319d2 100644 --- a/services/serverbackup/CHANGELOG.md +++ b/services/serverbackup/CHANGELOG.md @@ -1,3 +1,7 @@ +## v1.0.2 +- **Feature:** Add `force` parameter to `delete_backup` and `delete_volume_backup` methods +- **Internal:** Improve deserializing and error types + ## v1.0.1 (2025-05-09) - **Feature:** Update user-agent header diff --git a/services/serverbackup/pyproject.toml b/services/serverbackup/pyproject.toml index 3b283535..cdeb45c0 100644 --- a/services/serverbackup/pyproject.toml +++ b/services/serverbackup/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-serverbackup" [tool.poetry] name = "stackit-serverbackup" -version = "v1.0.1" +version = "v1.0.2" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/serverbackup/src/stackit/serverbackup/__init__.py b/services/serverbackup/src/stackit/serverbackup/__init__.py index 63eaf90e..d4f9c71d 100644 --- a/services/serverbackup/src/stackit/serverbackup/__init__.py +++ b/services/serverbackup/src/stackit/serverbackup/__init__.py @@ -12,61 +12,99 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "Backup", + "BackupJob", + "BackupPolicy", + "BackupPolicyBackupProperties", + "BackupProperties", + "BackupSchedule", + "BackupVolumeBackupsInner", + "CreateBackupPayload", + "CreateBackupSchedulePayload", + "EnableServiceResourcePayload", + "ErrorResponse", + "GetBackupPoliciesResponse", + "GetBackupSchedulesResponse", + "GetBackupServiceResponse", + "GetBackupsListResponse", + "RestoreBackupPayload", + "RestoreVolumeBackupPayload", + "UpdateBackupSchedulePayload", +] + # import apis into sdk package -from stackit.serverbackup.api.default_api import DefaultApi -from stackit.serverbackup.api_client import ApiClient +from stackit.serverbackup.api.default_api import DefaultApi as DefaultApi +from stackit.serverbackup.api_client import ApiClient as ApiClient # import ApiClient -from stackit.serverbackup.api_response import ApiResponse -from stackit.serverbackup.configuration import HostConfiguration -from stackit.serverbackup.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.serverbackup.api_response import ApiResponse as ApiResponse +from stackit.serverbackup.configuration import HostConfiguration as HostConfiguration +from stackit.serverbackup.exceptions import ApiAttributeError as ApiAttributeError +from stackit.serverbackup.exceptions import ApiException as ApiException +from stackit.serverbackup.exceptions import ApiKeyError as ApiKeyError +from stackit.serverbackup.exceptions import ApiTypeError as ApiTypeError +from stackit.serverbackup.exceptions import ApiValueError as ApiValueError +from stackit.serverbackup.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.serverbackup.models.backup import Backup -from stackit.serverbackup.models.backup_job import BackupJob -from stackit.serverbackup.models.backup_policy import BackupPolicy +from stackit.serverbackup.models.backup import Backup as Backup +from stackit.serverbackup.models.backup_job import BackupJob as BackupJob +from stackit.serverbackup.models.backup_policy import BackupPolicy as BackupPolicy from stackit.serverbackup.models.backup_policy_backup_properties import ( - BackupPolicyBackupProperties, + BackupPolicyBackupProperties as BackupPolicyBackupProperties, +) +from stackit.serverbackup.models.backup_properties import ( + BackupProperties as BackupProperties, ) -from stackit.serverbackup.models.backup_properties import BackupProperties -from stackit.serverbackup.models.backup_schedule import BackupSchedule +from stackit.serverbackup.models.backup_schedule import BackupSchedule as BackupSchedule from stackit.serverbackup.models.backup_volume_backups_inner import ( - BackupVolumeBackupsInner, + BackupVolumeBackupsInner as BackupVolumeBackupsInner, +) +from stackit.serverbackup.models.create_backup_payload import ( + CreateBackupPayload as CreateBackupPayload, ) -from stackit.serverbackup.models.create_backup_payload import CreateBackupPayload from stackit.serverbackup.models.create_backup_schedule_payload import ( - CreateBackupSchedulePayload, + CreateBackupSchedulePayload as CreateBackupSchedulePayload, ) from stackit.serverbackup.models.enable_service_resource_payload import ( - EnableServiceResourcePayload, + EnableServiceResourcePayload as EnableServiceResourcePayload, ) -from stackit.serverbackup.models.error_response import ErrorResponse +from stackit.serverbackup.models.error_response import ErrorResponse as ErrorResponse from stackit.serverbackup.models.get_backup_policies_response import ( - GetBackupPoliciesResponse, + GetBackupPoliciesResponse as GetBackupPoliciesResponse, ) from stackit.serverbackup.models.get_backup_schedules_response import ( - GetBackupSchedulesResponse, + GetBackupSchedulesResponse as GetBackupSchedulesResponse, ) from stackit.serverbackup.models.get_backup_service_response import ( - GetBackupServiceResponse, + GetBackupServiceResponse as GetBackupServiceResponse, +) +from stackit.serverbackup.models.get_backups_list_response import ( + GetBackupsListResponse as GetBackupsListResponse, +) +from stackit.serverbackup.models.restore_backup_payload import ( + RestoreBackupPayload as RestoreBackupPayload, ) -from stackit.serverbackup.models.get_backups_list_response import GetBackupsListResponse -from stackit.serverbackup.models.restore_backup_payload import RestoreBackupPayload from stackit.serverbackup.models.restore_volume_backup_payload import ( - RestoreVolumeBackupPayload, + RestoreVolumeBackupPayload as RestoreVolumeBackupPayload, ) from stackit.serverbackup.models.update_backup_schedule_payload import ( - UpdateBackupSchedulePayload, + UpdateBackupSchedulePayload as UpdateBackupSchedulePayload, ) diff --git a/services/serverbackup/src/stackit/serverbackup/api/default_api.py b/services/serverbackup/src/stackit/serverbackup/api/default_api.py index 0926df38..b3ace499 100644 --- a/services/serverbackup/src/stackit/serverbackup/api/default_api.py +++ b/services/serverbackup/src/stackit/serverbackup/api/default_api.py @@ -10,11 +10,11 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call +from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, validate_call from stackit.core.configuration import Configuration from typing_extensions import Annotated @@ -111,7 +111,7 @@ def create_backup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_backup_serialize( project_id=project_id, @@ -186,7 +186,7 @@ def create_backup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_backup_serialize( project_id=project_id, @@ -261,7 +261,7 @@ def create_backup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_backup_serialize( project_id=project_id, @@ -304,7 +304,7 @@ def _create_backup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -399,7 +399,7 @@ def create_backup_schedule( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_backup_schedule_serialize( project_id=project_id, @@ -473,7 +473,7 @@ def create_backup_schedule_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_backup_schedule_serialize( project_id=project_id, @@ -547,7 +547,7 @@ def create_backup_schedule_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_backup_schedule_serialize( project_id=project_id, @@ -589,7 +589,7 @@ def _create_backup_schedule_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -643,6 +643,7 @@ def delete_backup( server_id: Annotated[StrictStr, Field(description="server id")], region: Annotated[StrictStr, Field(description="region")], backup_id: Annotated[StrictStr, Field(description="id of the backup")], + force: Annotated[Optional[StrictBool], Field(description="force delete the backup")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -664,6 +665,8 @@ def delete_backup( :type region: str :param backup_id: id of the backup (required) :type backup_id: str + :param force: force delete the backup + :type force: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -684,13 +687,14 @@ def delete_backup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_backup_serialize( project_id=project_id, server_id=server_id, region=region, backup_id=backup_id, + force=force, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -717,6 +721,7 @@ def delete_backup_with_http_info( server_id: Annotated[StrictStr, Field(description="server id")], region: Annotated[StrictStr, Field(description="region")], backup_id: Annotated[StrictStr, Field(description="id of the backup")], + force: Annotated[Optional[StrictBool], Field(description="force delete the backup")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -738,6 +743,8 @@ def delete_backup_with_http_info( :type region: str :param backup_id: id of the backup (required) :type backup_id: str + :param force: force delete the backup + :type force: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -758,13 +765,14 @@ def delete_backup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_backup_serialize( project_id=project_id, server_id=server_id, region=region, backup_id=backup_id, + force=force, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -791,6 +799,7 @@ def delete_backup_without_preload_content( server_id: Annotated[StrictStr, Field(description="server id")], region: Annotated[StrictStr, Field(description="region")], backup_id: Annotated[StrictStr, Field(description="id of the backup")], + force: Annotated[Optional[StrictBool], Field(description="force delete the backup")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -812,6 +821,8 @@ def delete_backup_without_preload_content( :type region: str :param backup_id: id of the backup (required) :type backup_id: str + :param force: force delete the backup + :type force: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -832,13 +843,14 @@ def delete_backup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_backup_serialize( project_id=project_id, server_id=server_id, region=region, backup_id=backup_id, + force=force, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -860,6 +872,7 @@ def _delete_backup_serialize( server_id, region, backup_id, + force, _request_auth, _content_type, _headers, @@ -874,7 +887,7 @@ def _delete_backup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -887,6 +900,10 @@ def _delete_backup_serialize( if backup_id is not None: _path_params["backupId"] = backup_id # process the query parameters + if force is not None: + + _query_params.append(("force", force)) + # process the header parameters # process the form parameters # process the body parameter @@ -961,7 +978,7 @@ def delete_backup_schedule( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_backup_schedule_serialize( project_id=project_id, @@ -1035,7 +1052,7 @@ def delete_backup_schedule_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_backup_schedule_serialize( project_id=project_id, @@ -1109,7 +1126,7 @@ def delete_backup_schedule_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_backup_schedule_serialize( project_id=project_id, @@ -1151,7 +1168,7 @@ def _delete_backup_schedule_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1198,6 +1215,7 @@ def delete_volume_backup( region: Annotated[StrictStr, Field(description="region")], backup_id: Annotated[StrictStr, Field(description="id of the backup")], volume_backup_id: Annotated[StrictStr, Field(description="id of the volume backup")], + force: Annotated[Optional[StrictBool], Field(description="Force delete the volume backup")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1221,6 +1239,8 @@ def delete_volume_backup( :type backup_id: str :param volume_backup_id: id of the volume backup (required) :type volume_backup_id: str + :param force: Force delete the volume backup + :type force: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1241,7 +1261,7 @@ def delete_volume_backup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_volume_backup_serialize( project_id=project_id, @@ -1249,6 +1269,7 @@ def delete_volume_backup( region=region, backup_id=backup_id, volume_backup_id=volume_backup_id, + force=force, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1276,6 +1297,7 @@ def delete_volume_backup_with_http_info( region: Annotated[StrictStr, Field(description="region")], backup_id: Annotated[StrictStr, Field(description="id of the backup")], volume_backup_id: Annotated[StrictStr, Field(description="id of the volume backup")], + force: Annotated[Optional[StrictBool], Field(description="Force delete the volume backup")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1299,6 +1321,8 @@ def delete_volume_backup_with_http_info( :type backup_id: str :param volume_backup_id: id of the volume backup (required) :type volume_backup_id: str + :param force: Force delete the volume backup + :type force: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1319,7 +1343,7 @@ def delete_volume_backup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_volume_backup_serialize( project_id=project_id, @@ -1327,6 +1351,7 @@ def delete_volume_backup_with_http_info( region=region, backup_id=backup_id, volume_backup_id=volume_backup_id, + force=force, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1354,6 +1379,7 @@ def delete_volume_backup_without_preload_content( region: Annotated[StrictStr, Field(description="region")], backup_id: Annotated[StrictStr, Field(description="id of the backup")], volume_backup_id: Annotated[StrictStr, Field(description="id of the volume backup")], + force: Annotated[Optional[StrictBool], Field(description="Force delete the volume backup")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1377,6 +1403,8 @@ def delete_volume_backup_without_preload_content( :type backup_id: str :param volume_backup_id: id of the volume backup (required) :type volume_backup_id: str + :param force: Force delete the volume backup + :type force: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1397,7 +1425,7 @@ def delete_volume_backup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_volume_backup_serialize( project_id=project_id, @@ -1405,6 +1433,7 @@ def delete_volume_backup_without_preload_content( region=region, backup_id=backup_id, volume_backup_id=volume_backup_id, + force=force, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1427,6 +1456,7 @@ def _delete_volume_backup_serialize( region, backup_id, volume_backup_id, + force, _request_auth, _content_type, _headers, @@ -1441,7 +1471,7 @@ def _delete_volume_backup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1456,6 +1486,10 @@ def _delete_volume_backup_serialize( if volume_backup_id is not None: _path_params["volumeBackupId"] = volume_backup_id # process the query parameters + if force is not None: + + _query_params.append(("force", force)) + # process the header parameters # process the form parameters # process the body parameter @@ -1527,7 +1561,7 @@ def disable_service_resource( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._disable_service_resource_serialize( project_id=project_id, @@ -1597,7 +1631,7 @@ def disable_service_resource_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._disable_service_resource_serialize( project_id=project_id, @@ -1667,7 +1701,7 @@ def disable_service_resource_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._disable_service_resource_serialize( project_id=project_id, @@ -1707,7 +1741,7 @@ def _disable_service_resource_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1792,7 +1826,7 @@ def enable_service_resource( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._enable_service_resource_serialize( project_id=project_id, @@ -1866,7 +1900,7 @@ def enable_service_resource_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._enable_service_resource_serialize( project_id=project_id, @@ -1940,7 +1974,7 @@ def enable_service_resource_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._enable_service_resource_serialize( project_id=project_id, @@ -1982,7 +2016,7 @@ def _enable_service_resource_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2077,7 +2111,7 @@ def get_backup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_backup_serialize( project_id=project_id, @@ -2151,7 +2185,7 @@ def get_backup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_backup_serialize( project_id=project_id, @@ -2225,7 +2259,7 @@ def get_backup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_backup_serialize( project_id=project_id, @@ -2267,7 +2301,7 @@ def _get_backup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2354,7 +2388,7 @@ def get_backup_schedule( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_backup_schedule_serialize( project_id=project_id, @@ -2428,7 +2462,7 @@ def get_backup_schedule_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_backup_schedule_serialize( project_id=project_id, @@ -2502,7 +2536,7 @@ def get_backup_schedule_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_backup_schedule_serialize( project_id=project_id, @@ -2544,7 +2578,7 @@ def _get_backup_schedule_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2628,7 +2662,7 @@ def get_service_resource( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_service_resource_serialize( project_id=project_id, @@ -2698,7 +2732,7 @@ def get_service_resource_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_service_resource_serialize( project_id=project_id, @@ -2768,7 +2802,7 @@ def get_service_resource_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_service_resource_serialize( project_id=project_id, @@ -2808,7 +2842,7 @@ def _get_service_resource_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2884,7 +2918,7 @@ def list_backup_policies( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backup_policies_serialize( project_id=project_id, @@ -2946,7 +2980,7 @@ def list_backup_policies_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backup_policies_serialize( project_id=project_id, @@ -3008,7 +3042,7 @@ def list_backup_policies_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backup_policies_serialize( project_id=project_id, @@ -3044,7 +3078,7 @@ def _list_backup_policies_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3122,7 +3156,7 @@ def list_backup_schedules( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backup_schedules_serialize( project_id=project_id, @@ -3192,7 +3226,7 @@ def list_backup_schedules_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backup_schedules_serialize( project_id=project_id, @@ -3262,7 +3296,7 @@ def list_backup_schedules_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backup_schedules_serialize( project_id=project_id, @@ -3302,7 +3336,7 @@ def _list_backup_schedules_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3384,7 +3418,7 @@ def list_backups( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( project_id=project_id, @@ -3454,7 +3488,7 @@ def list_backups_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( project_id=project_id, @@ -3524,7 +3558,7 @@ def list_backups_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( project_id=project_id, @@ -3564,7 +3598,7 @@ def _list_backups_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3652,7 +3686,7 @@ def restore_backup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._restore_backup_serialize( project_id=project_id, @@ -3731,7 +3765,7 @@ def restore_backup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._restore_backup_serialize( project_id=project_id, @@ -3810,7 +3844,7 @@ def restore_backup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._restore_backup_serialize( project_id=project_id, @@ -3855,7 +3889,7 @@ def _restore_backup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3958,7 +3992,7 @@ def restore_volume_backup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._restore_volume_backup_serialize( project_id=project_id, @@ -4040,7 +4074,7 @@ def restore_volume_backup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._restore_volume_backup_serialize( project_id=project_id, @@ -4122,7 +4156,7 @@ def restore_volume_backup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._restore_volume_backup_serialize( project_id=project_id, @@ -4168,7 +4202,7 @@ def _restore_volume_backup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4270,7 +4304,7 @@ def update_backup_schedule( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_backup_schedule_serialize( project_id=project_id, @@ -4348,7 +4382,7 @@ def update_backup_schedule_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_backup_schedule_serialize( project_id=project_id, @@ -4426,7 +4460,7 @@ def update_backup_schedule_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_backup_schedule_serialize( project_id=project_id, @@ -4470,7 +4504,7 @@ def _update_backup_schedule_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/serverbackup/src/stackit/serverbackup/api_client.py b/services/serverbackup/src/stackit/serverbackup/api_client.py index d90bf75c..eee0dc0f 100644 --- a/services/serverbackup/src/stackit/serverbackup/api_client.py +++ b/services/serverbackup/src/stackit/serverbackup/api_client.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -332,6 +332,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -351,12 +355,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -458,7 +462,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -474,7 +478,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -489,6 +496,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/serverbackup/src/stackit/serverbackup/configuration.py b/services/serverbackup/src/stackit/serverbackup/configuration.py index 06e2482a..ee879015 100644 --- a/services/serverbackup/src/stackit/serverbackup/configuration.py +++ b/services/serverbackup/src/stackit/serverbackup/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT Server Backup Management API @@ -15,7 +10,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -54,7 +71,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -72,7 +89,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -112,7 +134,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -131,12 +153,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/serverbackup/src/stackit/serverbackup/exceptions.py b/services/serverbackup/src/stackit/serverbackup/exceptions.py index 0591a4ae..cab7ce2c 100644 --- a/services/serverbackup/src/stackit/serverbackup/exceptions.py +++ b/services/serverbackup/src/stackit/serverbackup/exceptions.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -152,6 +152,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -188,6 +195,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/serverbackup/src/stackit/serverbackup/models/__init__.py b/services/serverbackup/src/stackit/serverbackup/models/__init__.py index 30416d5a..312a47fd 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/__init__.py +++ b/services/serverbackup/src/stackit/serverbackup/models/__init__.py @@ -11,7 +11,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/serverbackup/src/stackit/serverbackup/models/backup.py b/services/serverbackup/src/stackit/serverbackup/models/backup.py index 787eaff1..3ef572f1 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/backup.py +++ b/services/serverbackup/src/stackit/serverbackup/models/backup.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class Backup(BaseModel): """ Backup - """ + """ # noqa: E501 created_at: StrictStr = Field(alias="createdAt") expire_at: StrictStr = Field(alias="expireAt") diff --git a/services/serverbackup/src/stackit/serverbackup/models/backup_job.py b/services/serverbackup/src/stackit/serverbackup/models/backup_job.py index 6b00e2b9..8ac51628 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/backup_job.py +++ b/services/serverbackup/src/stackit/serverbackup/models/backup_job.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class BackupJob(BaseModel): """ BackupJob - """ + """ # noqa: E501 id: StrictStr __properties: ClassVar[List[str]] = ["id"] diff --git a/services/serverbackup/src/stackit/serverbackup/models/backup_policy.py b/services/serverbackup/src/stackit/serverbackup/models/backup_policy.py index 57858e2f..412ae3d8 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/backup_policy.py +++ b/services/serverbackup/src/stackit/serverbackup/models/backup_policy.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class BackupPolicy(BaseModel): """ BackupPolicy - """ + """ # noqa: E501 backup_properties: Optional[BackupPolicyBackupProperties] = Field(default=None, alias="backupProperties") default: Optional[StrictBool] = None diff --git a/services/serverbackup/src/stackit/serverbackup/models/backup_policy_backup_properties.py b/services/serverbackup/src/stackit/serverbackup/models/backup_policy_backup_properties.py index 0963c3db..21c0dcfe 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/backup_policy_backup_properties.py +++ b/services/serverbackup/src/stackit/serverbackup/models/backup_policy_backup_properties.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class BackupPolicyBackupProperties(BaseModel): """ BackupPolicyBackupProperties - """ + """ # noqa: E501 name: Optional[StrictStr] = None retention_period: Optional[StrictInt] = Field(default=None, alias="retentionPeriod") diff --git a/services/serverbackup/src/stackit/serverbackup/models/backup_properties.py b/services/serverbackup/src/stackit/serverbackup/models/backup_properties.py index 5ebf9176..7938cf28 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/backup_properties.py +++ b/services/serverbackup/src/stackit/serverbackup/models/backup_properties.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class BackupProperties(BaseModel): """ BackupProperties - """ + """ # noqa: E501 name: StrictStr = Field(description="Max 255 characters") retention_period: Annotated[int, Field(le=36500, strict=True, ge=1)] = Field( diff --git a/services/serverbackup/src/stackit/serverbackup/models/backup_schedule.py b/services/serverbackup/src/stackit/serverbackup/models/backup_schedule.py index 0159ea91..6da5d260 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/backup_schedule.py +++ b/services/serverbackup/src/stackit/serverbackup/models/backup_schedule.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class BackupSchedule(BaseModel): """ BackupSchedule - """ + """ # noqa: E501 backup_properties: Optional[BackupProperties] = Field(default=None, alias="backupProperties") enabled: StrictBool diff --git a/services/serverbackup/src/stackit/serverbackup/models/backup_volume_backups_inner.py b/services/serverbackup/src/stackit/serverbackup/models/backup_volume_backups_inner.py index 3d1d7f33..aa5d2211 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/backup_volume_backups_inner.py +++ b/services/serverbackup/src/stackit/serverbackup/models/backup_volume_backups_inner.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class BackupVolumeBackupsInner(BaseModel): """ BackupVolumeBackupsInner - """ + """ # noqa: E501 id: Optional[StrictStr] = None last_restored_at: Optional[StrictStr] = Field(default=None, alias="lastRestoredAt") diff --git a/services/serverbackup/src/stackit/serverbackup/models/create_backup_payload.py b/services/serverbackup/src/stackit/serverbackup/models/create_backup_payload.py index abaf5ff7..a47a5eec 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/create_backup_payload.py +++ b/services/serverbackup/src/stackit/serverbackup/models/create_backup_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateBackupPayload(BaseModel): """ CreateBackupPayload - """ + """ # noqa: E501 name: StrictStr = Field(description="Max 255 characters") retention_period: Annotated[int, Field(le=36500, strict=True, ge=1)] = Field( diff --git a/services/serverbackup/src/stackit/serverbackup/models/create_backup_schedule_payload.py b/services/serverbackup/src/stackit/serverbackup/models/create_backup_schedule_payload.py index 6cccad25..b54241be 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/create_backup_schedule_payload.py +++ b/services/serverbackup/src/stackit/serverbackup/models/create_backup_schedule_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class CreateBackupSchedulePayload(BaseModel): """ CreateBackupSchedulePayload - """ + """ # noqa: E501 backup_properties: Optional[BackupProperties] = Field(default=None, alias="backupProperties") enabled: StrictBool diff --git a/services/serverbackup/src/stackit/serverbackup/models/enable_service_resource_payload.py b/services/serverbackup/src/stackit/serverbackup/models/enable_service_resource_payload.py index 7c9d7146..6e89b7a0 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/enable_service_resource_payload.py +++ b/services/serverbackup/src/stackit/serverbackup/models/enable_service_resource_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class EnableServiceResourcePayload(BaseModel): """ EnableServiceResourcePayload - """ + """ # noqa: E501 backup_policy_id: Optional[StrictStr] = Field(default=None, alias="backupPolicyId") __properties: ClassVar[List[str]] = ["backupPolicyId"] diff --git a/services/serverbackup/src/stackit/serverbackup/models/error_response.py b/services/serverbackup/src/stackit/serverbackup/models/error_response.py index fc17208b..e7d73adb 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/error_response.py +++ b/services/serverbackup/src/stackit/serverbackup/models/error_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ErrorResponse(BaseModel): """ ErrorResponse - """ + """ # noqa: E501 message: StrictStr = Field(description="Details about the error") status: StrictStr = Field( diff --git a/services/serverbackup/src/stackit/serverbackup/models/get_backup_policies_response.py b/services/serverbackup/src/stackit/serverbackup/models/get_backup_policies_response.py index 01bff28a..76460f0f 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/get_backup_policies_response.py +++ b/services/serverbackup/src/stackit/serverbackup/models/get_backup_policies_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class GetBackupPoliciesResponse(BaseModel): """ GetBackupPoliciesResponse - """ + """ # noqa: E501 items: Optional[List[BackupPolicy]] = None __properties: ClassVar[List[str]] = ["items"] diff --git a/services/serverbackup/src/stackit/serverbackup/models/get_backup_schedules_response.py b/services/serverbackup/src/stackit/serverbackup/models/get_backup_schedules_response.py index d2b6c0d4..fab99212 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/get_backup_schedules_response.py +++ b/services/serverbackup/src/stackit/serverbackup/models/get_backup_schedules_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class GetBackupSchedulesResponse(BaseModel): """ GetBackupSchedulesResponse - """ + """ # noqa: E501 items: Optional[List[BackupSchedule]] = None __properties: ClassVar[List[str]] = ["items"] diff --git a/services/serverbackup/src/stackit/serverbackup/models/get_backup_service_response.py b/services/serverbackup/src/stackit/serverbackup/models/get_backup_service_response.py index 3a80fa1d..dec3e28f 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/get_backup_service_response.py +++ b/services/serverbackup/src/stackit/serverbackup/models/get_backup_service_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class GetBackupServiceResponse(BaseModel): """ GetBackupServiceResponse - """ + """ # noqa: E501 enabled: Optional[StrictBool] = None __properties: ClassVar[List[str]] = ["enabled"] diff --git a/services/serverbackup/src/stackit/serverbackup/models/get_backups_list_response.py b/services/serverbackup/src/stackit/serverbackup/models/get_backups_list_response.py index e98e5def..421e4ccf 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/get_backups_list_response.py +++ b/services/serverbackup/src/stackit/serverbackup/models/get_backups_list_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class GetBackupsListResponse(BaseModel): """ GetBackupsListResponse - """ + """ # noqa: E501 items: Optional[List[Backup]] = None __properties: ClassVar[List[str]] = ["items"] diff --git a/services/serverbackup/src/stackit/serverbackup/models/restore_backup_payload.py b/services/serverbackup/src/stackit/serverbackup/models/restore_backup_payload.py index 9b5dbce2..84e24aac 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/restore_backup_payload.py +++ b/services/serverbackup/src/stackit/serverbackup/models/restore_backup_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class RestoreBackupPayload(BaseModel): """ RestoreBackupPayload - """ + """ # noqa: E501 start_server_after_restore: StrictBool = Field(alias="startServerAfterRestore") volume_ids: Optional[List[StrictStr]] = Field(default=None, alias="volumeIds") diff --git a/services/serverbackup/src/stackit/serverbackup/models/restore_volume_backup_payload.py b/services/serverbackup/src/stackit/serverbackup/models/restore_volume_backup_payload.py index 0d7ffd77..b5e23e58 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/restore_volume_backup_payload.py +++ b/services/serverbackup/src/stackit/serverbackup/models/restore_volume_backup_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class RestoreVolumeBackupPayload(BaseModel): """ RestoreVolumeBackupPayload - """ + """ # noqa: E501 restore_volume_id: StrictStr = Field(alias="restoreVolumeId") __properties: ClassVar[List[str]] = ["restoreVolumeId"] diff --git a/services/serverbackup/src/stackit/serverbackup/models/update_backup_schedule_payload.py b/services/serverbackup/src/stackit/serverbackup/models/update_backup_schedule_payload.py index addfe1fd..737e61d4 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/update_backup_schedule_payload.py +++ b/services/serverbackup/src/stackit/serverbackup/models/update_backup_schedule_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class UpdateBackupSchedulePayload(BaseModel): """ UpdateBackupSchedulePayload - """ + """ # noqa: E501 backup_properties: Optional[BackupProperties] = Field(default=None, alias="backupProperties") enabled: StrictBool diff --git a/services/serverbackup/src/stackit/serverbackup/rest.py b/services/serverbackup/src/stackit/serverbackup/rest.py index d52dfa0f..63a54b1e 100644 --- a/services/serverbackup/src/stackit/serverbackup/rest.py +++ b/services/serverbackup/src/stackit/serverbackup/rest.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -125,7 +125,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/serverupdate/CHANGELOG.md b/services/serverupdate/CHANGELOG.md index 8969ac8a..44516bcc 100644 --- a/services/serverupdate/CHANGELOG.md +++ b/services/serverupdate/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.0.3 +- **Internal:** Improve deserializing and error types + ## v1.0.2 (2025-05-09) - **Feature:** Update user-agent header diff --git a/services/serverupdate/pyproject.toml b/services/serverupdate/pyproject.toml index f5299c24..863559c2 100644 --- a/services/serverupdate/pyproject.toml +++ b/services/serverupdate/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-serverupdate" [tool.poetry] name = "stackit-serverupdate" -version = "v1.0.2" +version = "v1.0.3" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/serverupdate/src/stackit/serverupdate/__init__.py b/services/serverupdate/src/stackit/serverupdate/__init__.py index 19298904..36235330 100644 --- a/services/serverupdate/src/stackit/serverupdate/__init__.py +++ b/services/serverupdate/src/stackit/serverupdate/__init__.py @@ -12,52 +12,81 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "CreateUpdatePayload", + "CreateUpdateSchedulePayload", + "EnableServiceResourcePayload", + "ErrorResponse", + "GetUpdatePoliciesResponse", + "GetUpdateSchedulesResponse", + "GetUpdateServiceResponse", + "GetUpdatesListResponse", + "Update", + "UpdatePolicy", + "UpdateSchedule", + "UpdateScheduleCreateRequest", + "UpdateUpdateSchedulePayload", +] + # import apis into sdk package -from stackit.serverupdate.api.default_api import DefaultApi -from stackit.serverupdate.api_client import ApiClient +from stackit.serverupdate.api.default_api import DefaultApi as DefaultApi +from stackit.serverupdate.api_client import ApiClient as ApiClient # import ApiClient -from stackit.serverupdate.api_response import ApiResponse -from stackit.serverupdate.configuration import HostConfiguration -from stackit.serverupdate.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.serverupdate.api_response import ApiResponse as ApiResponse +from stackit.serverupdate.configuration import HostConfiguration as HostConfiguration +from stackit.serverupdate.exceptions import ApiAttributeError as ApiAttributeError +from stackit.serverupdate.exceptions import ApiException as ApiException +from stackit.serverupdate.exceptions import ApiKeyError as ApiKeyError +from stackit.serverupdate.exceptions import ApiTypeError as ApiTypeError +from stackit.serverupdate.exceptions import ApiValueError as ApiValueError +from stackit.serverupdate.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.serverupdate.models.create_update_payload import CreateUpdatePayload +from stackit.serverupdate.models.create_update_payload import ( + CreateUpdatePayload as CreateUpdatePayload, +) from stackit.serverupdate.models.create_update_schedule_payload import ( - CreateUpdateSchedulePayload, + CreateUpdateSchedulePayload as CreateUpdateSchedulePayload, ) from stackit.serverupdate.models.enable_service_resource_payload import ( - EnableServiceResourcePayload, + EnableServiceResourcePayload as EnableServiceResourcePayload, ) -from stackit.serverupdate.models.error_response import ErrorResponse +from stackit.serverupdate.models.error_response import ErrorResponse as ErrorResponse from stackit.serverupdate.models.get_update_policies_response import ( - GetUpdatePoliciesResponse, + GetUpdatePoliciesResponse as GetUpdatePoliciesResponse, ) from stackit.serverupdate.models.get_update_schedules_response import ( - GetUpdateSchedulesResponse, + GetUpdateSchedulesResponse as GetUpdateSchedulesResponse, ) from stackit.serverupdate.models.get_update_service_response import ( - GetUpdateServiceResponse, + GetUpdateServiceResponse as GetUpdateServiceResponse, +) +from stackit.serverupdate.models.get_updates_list_response import ( + GetUpdatesListResponse as GetUpdatesListResponse, ) -from stackit.serverupdate.models.get_updates_list_response import GetUpdatesListResponse -from stackit.serverupdate.models.update import Update -from stackit.serverupdate.models.update_policy import UpdatePolicy -from stackit.serverupdate.models.update_schedule import UpdateSchedule +from stackit.serverupdate.models.update import Update as Update +from stackit.serverupdate.models.update_policy import UpdatePolicy as UpdatePolicy +from stackit.serverupdate.models.update_schedule import UpdateSchedule as UpdateSchedule from stackit.serverupdate.models.update_schedule_create_request import ( - UpdateScheduleCreateRequest, + UpdateScheduleCreateRequest as UpdateScheduleCreateRequest, ) from stackit.serverupdate.models.update_update_schedule_payload import ( - UpdateUpdateSchedulePayload, + UpdateUpdateSchedulePayload as UpdateUpdateSchedulePayload, ) diff --git a/services/serverupdate/src/stackit/serverupdate/api/default_api.py b/services/serverupdate/src/stackit/serverupdate/api/default_api.py index d009290e..1782c75f 100644 --- a/services/serverupdate/src/stackit/serverupdate/api/default_api.py +++ b/services/serverupdate/src/stackit/serverupdate/api/default_api.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -106,7 +106,7 @@ def create_update( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_update_serialize( project_id=project_id, @@ -181,7 +181,7 @@ def create_update_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_update_serialize( project_id=project_id, @@ -256,7 +256,7 @@ def create_update_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_update_serialize( project_id=project_id, @@ -299,7 +299,7 @@ def _create_update_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -394,7 +394,7 @@ def create_update_schedule( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_update_schedule_serialize( project_id=project_id, @@ -468,7 +468,7 @@ def create_update_schedule_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_update_schedule_serialize( project_id=project_id, @@ -542,7 +542,7 @@ def create_update_schedule_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_update_schedule_serialize( project_id=project_id, @@ -584,7 +584,7 @@ def _create_update_schedule_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -679,7 +679,7 @@ def delete_update_schedule( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_update_schedule_serialize( project_id=project_id, @@ -753,7 +753,7 @@ def delete_update_schedule_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_update_schedule_serialize( project_id=project_id, @@ -827,7 +827,7 @@ def delete_update_schedule_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_update_schedule_serialize( project_id=project_id, @@ -869,7 +869,7 @@ def _delete_update_schedule_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -953,7 +953,7 @@ def disable_service_resource( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._disable_service_resource_serialize( project_id=project_id, @@ -1023,7 +1023,7 @@ def disable_service_resource_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._disable_service_resource_serialize( project_id=project_id, @@ -1093,7 +1093,7 @@ def disable_service_resource_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._disable_service_resource_serialize( project_id=project_id, @@ -1133,7 +1133,7 @@ def _disable_service_resource_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1218,7 +1218,7 @@ def enable_service_resource( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._enable_service_resource_serialize( project_id=project_id, @@ -1292,7 +1292,7 @@ def enable_service_resource_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._enable_service_resource_serialize( project_id=project_id, @@ -1366,7 +1366,7 @@ def enable_service_resource_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._enable_service_resource_serialize( project_id=project_id, @@ -1408,7 +1408,7 @@ def _enable_service_resource_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1500,7 +1500,7 @@ def get_service_resource( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_service_resource_serialize( project_id=project_id, @@ -1570,7 +1570,7 @@ def get_service_resource_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_service_resource_serialize( project_id=project_id, @@ -1640,7 +1640,7 @@ def get_service_resource_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_service_resource_serialize( project_id=project_id, @@ -1680,7 +1680,7 @@ def _get_service_resource_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1765,7 +1765,7 @@ def get_update( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_update_serialize( project_id=project_id, @@ -1839,7 +1839,7 @@ def get_update_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_update_serialize( project_id=project_id, @@ -1913,7 +1913,7 @@ def get_update_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_update_serialize( project_id=project_id, @@ -1955,7 +1955,7 @@ def _get_update_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2042,7 +2042,7 @@ def get_update_schedule( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_update_schedule_serialize( project_id=project_id, @@ -2116,7 +2116,7 @@ def get_update_schedule_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_update_schedule_serialize( project_id=project_id, @@ -2190,7 +2190,7 @@ def get_update_schedule_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_update_schedule_serialize( project_id=project_id, @@ -2232,7 +2232,7 @@ def _get_update_schedule_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2310,7 +2310,7 @@ def list_update_policies( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_update_policies_serialize( project_id=project_id, @@ -2372,7 +2372,7 @@ def list_update_policies_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_update_policies_serialize( project_id=project_id, @@ -2434,7 +2434,7 @@ def list_update_policies_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_update_policies_serialize( project_id=project_id, @@ -2470,7 +2470,7 @@ def _list_update_policies_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2548,7 +2548,7 @@ def list_update_schedules( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_update_schedules_serialize( project_id=project_id, @@ -2618,7 +2618,7 @@ def list_update_schedules_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_update_schedules_serialize( project_id=project_id, @@ -2688,7 +2688,7 @@ def list_update_schedules_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_update_schedules_serialize( project_id=project_id, @@ -2728,7 +2728,7 @@ def _list_update_schedules_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2810,7 +2810,7 @@ def list_updates( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_updates_serialize( project_id=project_id, @@ -2880,7 +2880,7 @@ def list_updates_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_updates_serialize( project_id=project_id, @@ -2950,7 +2950,7 @@ def list_updates_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_updates_serialize( project_id=project_id, @@ -2990,7 +2990,7 @@ def _list_updates_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3078,7 +3078,7 @@ def update_update_schedule( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_update_schedule_serialize( project_id=project_id, @@ -3156,7 +3156,7 @@ def update_update_schedule_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_update_schedule_serialize( project_id=project_id, @@ -3234,7 +3234,7 @@ def update_update_schedule_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_update_schedule_serialize( project_id=project_id, @@ -3278,7 +3278,7 @@ def _update_update_schedule_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/serverupdate/src/stackit/serverupdate/api_client.py b/services/serverupdate/src/stackit/serverupdate/api_client.py index bac0e6a1..b659b1b8 100644 --- a/services/serverupdate/src/stackit/serverupdate/api_client.py +++ b/services/serverupdate/src/stackit/serverupdate/api_client.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -332,6 +332,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -351,12 +355,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -458,7 +462,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -474,7 +478,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -489,6 +496,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/serverupdate/src/stackit/serverupdate/configuration.py b/services/serverupdate/src/stackit/serverupdate/configuration.py index e400d969..d3e803e0 100644 --- a/services/serverupdate/src/stackit/serverupdate/configuration.py +++ b/services/serverupdate/src/stackit/serverupdate/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT Server Update Management API @@ -15,7 +10,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -54,7 +71,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -72,7 +89,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -112,7 +134,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -131,12 +153,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/serverupdate/src/stackit/serverupdate/exceptions.py b/services/serverupdate/src/stackit/serverupdate/exceptions.py index a60279c4..1ad72e3c 100644 --- a/services/serverupdate/src/stackit/serverupdate/exceptions.py +++ b/services/serverupdate/src/stackit/serverupdate/exceptions.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -152,6 +152,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -188,6 +195,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/serverupdate/src/stackit/serverupdate/models/__init__.py b/services/serverupdate/src/stackit/serverupdate/models/__init__.py index b9eec8cb..e5254b31 100644 --- a/services/serverupdate/src/stackit/serverupdate/models/__init__.py +++ b/services/serverupdate/src/stackit/serverupdate/models/__init__.py @@ -11,7 +11,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/serverupdate/src/stackit/serverupdate/models/create_update_payload.py b/services/serverupdate/src/stackit/serverupdate/models/create_update_payload.py index ee988557..7a5ef8b2 100644 --- a/services/serverupdate/src/stackit/serverupdate/models/create_update_payload.py +++ b/services/serverupdate/src/stackit/serverupdate/models/create_update_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateUpdatePayload(BaseModel): """ CreateUpdatePayload - """ + """ # noqa: E501 backup_before_update: Optional[StrictBool] = Field(default=None, alias="backupBeforeUpdate") maintenance_window: Annotated[int, Field(le=24, strict=True, ge=1)] = Field(alias="maintenanceWindow") diff --git a/services/serverupdate/src/stackit/serverupdate/models/create_update_schedule_payload.py b/services/serverupdate/src/stackit/serverupdate/models/create_update_schedule_payload.py index ff573ddd..19b174c9 100644 --- a/services/serverupdate/src/stackit/serverupdate/models/create_update_schedule_payload.py +++ b/services/serverupdate/src/stackit/serverupdate/models/create_update_schedule_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateUpdateSchedulePayload(BaseModel): """ CreateUpdateSchedulePayload - """ + """ # noqa: E501 enabled: StrictBool maintenance_window: Annotated[int, Field(le=24, strict=True, ge=1)] = Field(alias="maintenanceWindow") diff --git a/services/serverupdate/src/stackit/serverupdate/models/enable_service_resource_payload.py b/services/serverupdate/src/stackit/serverupdate/models/enable_service_resource_payload.py index 5a4f8bdf..b4f7b550 100644 --- a/services/serverupdate/src/stackit/serverupdate/models/enable_service_resource_payload.py +++ b/services/serverupdate/src/stackit/serverupdate/models/enable_service_resource_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class EnableServiceResourcePayload(BaseModel): """ EnableServiceResourcePayload - """ + """ # noqa: E501 update_policy_id: Optional[StrictStr] = Field(default=None, alias="updatePolicyId") __properties: ClassVar[List[str]] = ["updatePolicyId"] diff --git a/services/serverupdate/src/stackit/serverupdate/models/error_response.py b/services/serverupdate/src/stackit/serverupdate/models/error_response.py index f3b89a6a..15adb7bd 100644 --- a/services/serverupdate/src/stackit/serverupdate/models/error_response.py +++ b/services/serverupdate/src/stackit/serverupdate/models/error_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ErrorResponse(BaseModel): """ ErrorResponse - """ + """ # noqa: E501 message: StrictStr = Field(description="Details about the error") status: StrictStr = Field( diff --git a/services/serverupdate/src/stackit/serverupdate/models/get_update_policies_response.py b/services/serverupdate/src/stackit/serverupdate/models/get_update_policies_response.py index 2a76ce6c..0cae8f44 100644 --- a/services/serverupdate/src/stackit/serverupdate/models/get_update_policies_response.py +++ b/services/serverupdate/src/stackit/serverupdate/models/get_update_policies_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class GetUpdatePoliciesResponse(BaseModel): """ GetUpdatePoliciesResponse - """ + """ # noqa: E501 items: Optional[List[UpdatePolicy]] = None __properties: ClassVar[List[str]] = ["items"] diff --git a/services/serverupdate/src/stackit/serverupdate/models/get_update_schedules_response.py b/services/serverupdate/src/stackit/serverupdate/models/get_update_schedules_response.py index c4e2c168..92025c4a 100644 --- a/services/serverupdate/src/stackit/serverupdate/models/get_update_schedules_response.py +++ b/services/serverupdate/src/stackit/serverupdate/models/get_update_schedules_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class GetUpdateSchedulesResponse(BaseModel): """ GetUpdateSchedulesResponse - """ + """ # noqa: E501 items: Optional[List[UpdateSchedule]] = None __properties: ClassVar[List[str]] = ["items"] diff --git a/services/serverupdate/src/stackit/serverupdate/models/get_update_service_response.py b/services/serverupdate/src/stackit/serverupdate/models/get_update_service_response.py index eb44ea56..a6f7303a 100644 --- a/services/serverupdate/src/stackit/serverupdate/models/get_update_service_response.py +++ b/services/serverupdate/src/stackit/serverupdate/models/get_update_service_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class GetUpdateServiceResponse(BaseModel): """ GetUpdateServiceResponse - """ + """ # noqa: E501 enabled: Optional[StrictBool] = None __properties: ClassVar[List[str]] = ["enabled"] diff --git a/services/serverupdate/src/stackit/serverupdate/models/get_updates_list_response.py b/services/serverupdate/src/stackit/serverupdate/models/get_updates_list_response.py index 30ea367f..3050fca8 100644 --- a/services/serverupdate/src/stackit/serverupdate/models/get_updates_list_response.py +++ b/services/serverupdate/src/stackit/serverupdate/models/get_updates_list_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class GetUpdatesListResponse(BaseModel): """ GetUpdatesListResponse - """ + """ # noqa: E501 items: Optional[List[Update]] = None __properties: ClassVar[List[str]] = ["items"] diff --git a/services/serverupdate/src/stackit/serverupdate/models/update.py b/services/serverupdate/src/stackit/serverupdate/models/update.py index cf466ed4..214052e1 100644 --- a/services/serverupdate/src/stackit/serverupdate/models/update.py +++ b/services/serverupdate/src/stackit/serverupdate/models/update.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class Update(BaseModel): """ Update - """ + """ # noqa: E501 end_date: Optional[StrictStr] = Field(default=None, alias="endDate") fail_reason: Optional[StrictStr] = Field(default=None, alias="failReason") diff --git a/services/serverupdate/src/stackit/serverupdate/models/update_policy.py b/services/serverupdate/src/stackit/serverupdate/models/update_policy.py index edc318d6..d1736029 100644 --- a/services/serverupdate/src/stackit/serverupdate/models/update_policy.py +++ b/services/serverupdate/src/stackit/serverupdate/models/update_policy.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class UpdatePolicy(BaseModel): """ UpdatePolicy - """ + """ # noqa: E501 default: Optional[StrictBool] = None description: Optional[StrictStr] = None diff --git a/services/serverupdate/src/stackit/serverupdate/models/update_schedule.py b/services/serverupdate/src/stackit/serverupdate/models/update_schedule.py index 3abd5c00..a7fccd49 100644 --- a/services/serverupdate/src/stackit/serverupdate/models/update_schedule.py +++ b/services/serverupdate/src/stackit/serverupdate/models/update_schedule.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class UpdateSchedule(BaseModel): """ UpdateSchedule - """ + """ # noqa: E501 enabled: StrictBool maintenance_window: Annotated[int, Field(le=24, strict=True, ge=1)] = Field(alias="maintenanceWindow") diff --git a/services/serverupdate/src/stackit/serverupdate/models/update_schedule_create_request.py b/services/serverupdate/src/stackit/serverupdate/models/update_schedule_create_request.py index a78ac8f9..be3428a5 100644 --- a/services/serverupdate/src/stackit/serverupdate/models/update_schedule_create_request.py +++ b/services/serverupdate/src/stackit/serverupdate/models/update_schedule_create_request.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class UpdateScheduleCreateRequest(BaseModel): """ UpdateScheduleCreateRequest - """ + """ # noqa: E501 enabled: StrictBool maintenance_window: Annotated[int, Field(le=24, strict=True, ge=1)] = Field(alias="maintenanceWindow") diff --git a/services/serverupdate/src/stackit/serverupdate/models/update_update_schedule_payload.py b/services/serverupdate/src/stackit/serverupdate/models/update_update_schedule_payload.py index db85baa6..d86f8f48 100644 --- a/services/serverupdate/src/stackit/serverupdate/models/update_update_schedule_payload.py +++ b/services/serverupdate/src/stackit/serverupdate/models/update_update_schedule_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class UpdateUpdateSchedulePayload(BaseModel): """ UpdateUpdateSchedulePayload - """ + """ # noqa: E501 enabled: StrictBool maintenance_window: Annotated[int, Field(le=24, strict=True, ge=1)] = Field(alias="maintenanceWindow") diff --git a/services/serverupdate/src/stackit/serverupdate/rest.py b/services/serverupdate/src/stackit/serverupdate/rest.py index 42a57625..d810cfee 100644 --- a/services/serverupdate/src/stackit/serverupdate/rest.py +++ b/services/serverupdate/src/stackit/serverupdate/rest.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -125,7 +125,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/serviceaccount/CHANGELOG.md b/services/serviceaccount/CHANGELOG.md index 08ee0dab..54c71d97 100644 --- a/services/serviceaccount/CHANGELOG.md +++ b/services/serviceaccount/CHANGELOG.md @@ -1,3 +1,6 @@ +## v0.2.2 +- **Internal:** Improve deserializing and error types + ## v0.2.1 (2025-05-09) - **Feature:** Update user-agent header diff --git a/services/serviceaccount/pyproject.toml b/services/serviceaccount/pyproject.toml index b8c14ccf..9d568740 100644 --- a/services/serviceaccount/pyproject.toml +++ b/services/serviceaccount/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-serviceaccount" [tool.poetry] name = "stackit-serviceaccount" -version = "v0.2.1" +version = "v0.2.2" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/serviceaccount/src/stackit/serviceaccount/__init__.py b/services/serviceaccount/src/stackit/serviceaccount/__init__.py index 7557a601..ebb80345 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/__init__.py +++ b/services/serviceaccount/src/stackit/serviceaccount/__init__.py @@ -11,75 +11,115 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "AccessToken", + "AccessTokenMetadata", + "AuthError", + "AuthErrorError", + "CreateAccessTokenPayload", + "CreateServiceAccountKeyPayload", + "CreateServiceAccountKeyResponse", + "CreateServiceAccountKeyResponseCredentials", + "CreateServiceAccountPayload", + "CreateShortLivedAccessTokenResponse", + "Error", + "GetServiceAccountKeyResponse", + "GetServiceAccountKeyResponseCredentials", + "JWK", + "JWKS", + "ListAccessTokensResponse", + "ListServiceAccountKeysResponse", + "ListServiceAccountsResponse", + "PartialUpdateServiceAccountKeyPayload", + "PartialUpdateServiceAccountKeyResponse", + "ServiceAccount", + "ServiceAccountKeyListResponse", +] + # import apis into sdk package -from stackit.serviceaccount.api.default_api import DefaultApi -from stackit.serviceaccount.api_client import ApiClient +from stackit.serviceaccount.api.default_api import DefaultApi as DefaultApi +from stackit.serviceaccount.api_client import ApiClient as ApiClient # import ApiClient -from stackit.serviceaccount.api_response import ApiResponse -from stackit.serviceaccount.configuration import HostConfiguration -from stackit.serviceaccount.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.serviceaccount.api_response import ApiResponse as ApiResponse +from stackit.serviceaccount.configuration import HostConfiguration as HostConfiguration +from stackit.serviceaccount.exceptions import ApiAttributeError as ApiAttributeError +from stackit.serviceaccount.exceptions import ApiException as ApiException +from stackit.serviceaccount.exceptions import ApiKeyError as ApiKeyError +from stackit.serviceaccount.exceptions import ApiTypeError as ApiTypeError +from stackit.serviceaccount.exceptions import ApiValueError as ApiValueError +from stackit.serviceaccount.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.serviceaccount.models.access_token import AccessToken -from stackit.serviceaccount.models.access_token_metadata import AccessTokenMetadata -from stackit.serviceaccount.models.auth_error import AuthError -from stackit.serviceaccount.models.auth_error_error import AuthErrorError +from stackit.serviceaccount.models.access_token import AccessToken as AccessToken +from stackit.serviceaccount.models.access_token_metadata import ( + AccessTokenMetadata as AccessTokenMetadata, +) +from stackit.serviceaccount.models.auth_error import AuthError as AuthError +from stackit.serviceaccount.models.auth_error_error import ( + AuthErrorError as AuthErrorError, +) from stackit.serviceaccount.models.create_access_token_payload import ( - CreateAccessTokenPayload, + CreateAccessTokenPayload as CreateAccessTokenPayload, ) from stackit.serviceaccount.models.create_service_account_key_payload import ( - CreateServiceAccountKeyPayload, + CreateServiceAccountKeyPayload as CreateServiceAccountKeyPayload, ) from stackit.serviceaccount.models.create_service_account_key_response import ( - CreateServiceAccountKeyResponse, + CreateServiceAccountKeyResponse as CreateServiceAccountKeyResponse, ) from stackit.serviceaccount.models.create_service_account_key_response_credentials import ( - CreateServiceAccountKeyResponseCredentials, + CreateServiceAccountKeyResponseCredentials as CreateServiceAccountKeyResponseCredentials, ) from stackit.serviceaccount.models.create_service_account_payload import ( - CreateServiceAccountPayload, + CreateServiceAccountPayload as CreateServiceAccountPayload, ) from stackit.serviceaccount.models.create_short_lived_access_token_response import ( - CreateShortLivedAccessTokenResponse, + CreateShortLivedAccessTokenResponse as CreateShortLivedAccessTokenResponse, ) -from stackit.serviceaccount.models.error import Error +from stackit.serviceaccount.models.error import Error as Error from stackit.serviceaccount.models.get_service_account_key_response import ( - GetServiceAccountKeyResponse, + GetServiceAccountKeyResponse as GetServiceAccountKeyResponse, ) from stackit.serviceaccount.models.get_service_account_key_response_credentials import ( - GetServiceAccountKeyResponseCredentials, + GetServiceAccountKeyResponseCredentials as GetServiceAccountKeyResponseCredentials, ) -from stackit.serviceaccount.models.jwk import JWK -from stackit.serviceaccount.models.jwks import JWKS +from stackit.serviceaccount.models.jwk import JWK as JWK +from stackit.serviceaccount.models.jwks import JWKS as JWKS from stackit.serviceaccount.models.list_access_tokens_response import ( - ListAccessTokensResponse, + ListAccessTokensResponse as ListAccessTokensResponse, ) from stackit.serviceaccount.models.list_service_account_keys_response import ( - ListServiceAccountKeysResponse, + ListServiceAccountKeysResponse as ListServiceAccountKeysResponse, ) from stackit.serviceaccount.models.list_service_accounts_response import ( - ListServiceAccountsResponse, + ListServiceAccountsResponse as ListServiceAccountsResponse, ) from stackit.serviceaccount.models.partial_update_service_account_key_payload import ( - PartialUpdateServiceAccountKeyPayload, + PartialUpdateServiceAccountKeyPayload as PartialUpdateServiceAccountKeyPayload, ) from stackit.serviceaccount.models.partial_update_service_account_key_response import ( - PartialUpdateServiceAccountKeyResponse, + PartialUpdateServiceAccountKeyResponse as PartialUpdateServiceAccountKeyResponse, +) +from stackit.serviceaccount.models.service_account import ( + ServiceAccount as ServiceAccount, ) -from stackit.serviceaccount.models.service_account import ServiceAccount from stackit.serviceaccount.models.service_account_key_list_response import ( - ServiceAccountKeyListResponse, + ServiceAccountKeyListResponse as ServiceAccountKeyListResponse, ) diff --git a/services/serviceaccount/src/stackit/serviceaccount/api/default_api.py b/services/serviceaccount/src/stackit/serviceaccount/api/default_api.py index 290cbd9d..eef8af61 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/api/default_api.py +++ b/services/serviceaccount/src/stackit/serviceaccount/api/default_api.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -126,7 +126,7 @@ def create_access_token( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_access_token_serialize( project_id=project_id, @@ -201,7 +201,7 @@ def create_access_token_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_access_token_serialize( project_id=project_id, @@ -276,7 +276,7 @@ def create_access_token_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_access_token_serialize( project_id=project_id, @@ -317,7 +317,7 @@ def _create_access_token_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -407,7 +407,7 @@ def create_service_account( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_service_account_serialize( project_id=project_id, @@ -477,7 +477,7 @@ def create_service_account_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_service_account_serialize( project_id=project_id, @@ -547,7 +547,7 @@ def create_service_account_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_service_account_serialize( project_id=project_id, @@ -586,7 +586,7 @@ def _create_service_account_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -677,7 +677,7 @@ def create_service_account_key( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_service_account_key_serialize( project_id=project_id, @@ -751,7 +751,7 @@ def create_service_account_key_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_service_account_key_serialize( project_id=project_id, @@ -825,7 +825,7 @@ def create_service_account_key_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_service_account_key_serialize( project_id=project_id, @@ -866,7 +866,7 @@ def _create_service_account_key_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -972,7 +972,7 @@ def create_short_lived_access_token( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_short_lived_access_token_serialize( grant_type=grant_type, @@ -1055,7 +1055,7 @@ def create_short_lived_access_token_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_short_lived_access_token_serialize( grant_type=grant_type, @@ -1138,7 +1138,7 @@ def create_short_lived_access_token_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_short_lived_access_token_serialize( grant_type=grant_type, @@ -1175,7 +1175,7 @@ def _create_short_lived_access_token_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1266,7 +1266,7 @@ def delete_access_token( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_access_token_serialize( project_id=project_id, @@ -1339,7 +1339,7 @@ def delete_access_token_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_access_token_serialize( project_id=project_id, @@ -1412,7 +1412,7 @@ def delete_access_token_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_access_token_serialize( project_id=project_id, @@ -1454,7 +1454,7 @@ def _delete_access_token_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1534,7 +1534,7 @@ def delete_service_account( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_service_account_serialize( project_id=project_id, @@ -1602,7 +1602,7 @@ def delete_service_account_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_service_account_serialize( project_id=project_id, @@ -1670,7 +1670,7 @@ def delete_service_account_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_service_account_serialize( project_id=project_id, @@ -1709,7 +1709,7 @@ def _delete_service_account_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1790,7 +1790,7 @@ def delete_service_account_key( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_service_account_key_serialize( project_id=project_id, @@ -1861,7 +1861,7 @@ def delete_service_account_key_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_service_account_key_serialize( project_id=project_id, @@ -1932,7 +1932,7 @@ def delete_service_account_key_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_service_account_key_serialize( project_id=project_id, @@ -1972,7 +1972,7 @@ def _delete_service_account_key_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2049,7 +2049,7 @@ def get_jwks( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_jwks_serialize( service_account_email=service_account_email, @@ -2109,7 +2109,7 @@ def get_jwks_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_jwks_serialize( service_account_email=service_account_email, @@ -2169,7 +2169,7 @@ def get_jwks_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_jwks_serialize( service_account_email=service_account_email, @@ -2202,7 +2202,7 @@ def _get_jwks_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2284,7 +2284,7 @@ def get_service_account_key( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_service_account_key_serialize( project_id=project_id, @@ -2359,7 +2359,7 @@ def get_service_account_key_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_service_account_key_serialize( project_id=project_id, @@ -2434,7 +2434,7 @@ def get_service_account_key_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_service_account_key_serialize( project_id=project_id, @@ -2476,7 +2476,7 @@ def _get_service_account_key_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2560,7 +2560,7 @@ def list_access_tokens( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_access_tokens_serialize( project_id=project_id, @@ -2628,7 +2628,7 @@ def list_access_tokens_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_access_tokens_serialize( project_id=project_id, @@ -2696,7 +2696,7 @@ def list_access_tokens_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_access_tokens_serialize( project_id=project_id, @@ -2735,7 +2735,7 @@ def _list_access_tokens_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2813,7 +2813,7 @@ def list_service_account_keys( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_service_account_keys_serialize( project_id=project_id, @@ -2880,7 +2880,7 @@ def list_service_account_keys_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_service_account_keys_serialize( project_id=project_id, @@ -2947,7 +2947,7 @@ def list_service_account_keys_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_service_account_keys_serialize( project_id=project_id, @@ -2985,7 +2985,7 @@ def _list_service_account_keys_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3060,7 +3060,7 @@ def list_service_accounts( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_service_accounts_serialize( project_id=project_id, @@ -3123,7 +3123,7 @@ def list_service_accounts_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_service_accounts_serialize( project_id=project_id, @@ -3186,7 +3186,7 @@ def list_service_accounts_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_service_accounts_serialize( project_id=project_id, @@ -3222,7 +3222,7 @@ def _list_service_accounts_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3306,7 +3306,7 @@ def partial_update_service_account_key( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_service_account_key_serialize( project_id=project_id, @@ -3384,7 +3384,7 @@ def partial_update_service_account_key_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_service_account_key_serialize( project_id=project_id, @@ -3462,7 +3462,7 @@ def partial_update_service_account_key_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_service_account_key_serialize( project_id=project_id, @@ -3505,7 +3505,7 @@ def _partial_update_service_account_key_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/serviceaccount/src/stackit/serviceaccount/api_client.py b/services/serviceaccount/src/stackit/serviceaccount/api_client.py index e86d1fb7..f62db580 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/api_client.py +++ b/services/serviceaccount/src/stackit/serviceaccount/api_client.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -331,6 +331,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -350,12 +354,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -457,7 +461,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -473,7 +477,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -488,6 +495,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/serviceaccount/src/stackit/serviceaccount/configuration.py b/services/serviceaccount/src/stackit/serviceaccount/configuration.py index baaf4134..06b6cf06 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/configuration.py +++ b/services/serviceaccount/src/stackit/serviceaccount/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ Service Account API @@ -14,7 +9,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -53,7 +70,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -71,7 +88,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -111,7 +133,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -130,12 +152,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/serviceaccount/src/stackit/serviceaccount/exceptions.py b/services/serviceaccount/src/stackit/serviceaccount/exceptions.py index c7a6f6df..737982c0 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/exceptions.py +++ b/services/serviceaccount/src/stackit/serviceaccount/exceptions.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -151,6 +151,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -187,6 +194,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/__init__.py b/services/serviceaccount/src/stackit/serviceaccount/models/__init__.py index 0b65f595..5fff0f6a 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/__init__.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/__init__.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/access_token.py b/services/serviceaccount/src/stackit/serviceaccount/models/access_token.py index dde28347..8aeee541 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/access_token.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/access_token.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class AccessToken(BaseModel): """ Contains token metadata and actual token. - """ + """ # noqa: E501 active: StrictBool = Field(description="Newly created access tokens are valid, and can be revoked if needed.") created_at: datetime = Field(description="Creation time of the access token.", alias="createdAt") diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/access_token_metadata.py b/services/serviceaccount/src/stackit/serviceaccount/models/access_token_metadata.py index 2a9ec9a0..df2ffbfe 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/access_token_metadata.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/access_token_metadata.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class AccessTokenMetadata(BaseModel): """ Does not contain the actual token. - """ + """ # noqa: E501 active: StrictBool = Field( description="If true, access token can be used for authorized API calls, if false, the token is not usable anymore." diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/auth_error.py b/services/serviceaccount/src/stackit/serviceaccount/models/auth_error.py index c1304e79..5372d234 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/auth_error.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/auth_error.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class AuthError(BaseModel): """ AuthError - """ + """ # noqa: E501 error: AuthErrorError __properties: ClassVar[List[str]] = ["error"] diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/auth_error_error.py b/services/serviceaccount/src/stackit/serviceaccount/models/auth_error_error.py index a417bd0a..a698c142 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/auth_error_error.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/auth_error_error.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class AuthErrorError(BaseModel): """ AuthErrorError - """ + """ # noqa: E501 code: StrictInt message: StrictStr diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/create_access_token_payload.py b/services/serviceaccount/src/stackit/serviceaccount/models/create_access_token_payload.py index b61b56c1..e635a10f 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/create_access_token_payload.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/create_access_token_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateAccessTokenPayload(BaseModel): """ CreateAccessTokenPayload - """ + """ # noqa: E501 ttl_days: Annotated[int, Field(le=180, strict=True, ge=1)] = Field( description="The duration in days for how long the new Access Token should be valid.", alias="ttlDays" diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_key_payload.py b/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_key_payload.py index def9ae38..e40ed290 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_key_payload.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_key_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateServiceAccountKeyPayload(BaseModel): """ CreateServiceAccountKeyPayload - """ + """ # noqa: E501 public_key: Optional[StrictStr] = Field( default=None, diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_key_response.py b/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_key_response.py index 74085417..5f618bb5 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_key_response.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_key_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -36,7 +36,7 @@ class CreateServiceAccountKeyResponse(BaseModel): """ CreateServiceAccountKeyResponse - """ + """ # noqa: E501 active: StrictBool created_at: datetime = Field(description="Creation time of the key", alias="createdAt") diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_key_response_credentials.py b/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_key_response_credentials.py index b6e1fdd0..2d9b3c78 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_key_response_credentials.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_key_response_credentials.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateServiceAccountKeyResponseCredentials(BaseModel): """ CreateServiceAccountKeyResponseCredentials - """ + """ # noqa: E501 aud: StrictStr = Field(description="Audience - service account API URL") iss: StrictStr = Field(description="Service account email") diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_payload.py b/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_payload.py index a176038c..7cf2f5c4 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_payload.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -25,7 +25,7 @@ class CreateServiceAccountPayload(BaseModel): """ CreateServiceAccountPayload - """ + """ # noqa: E501 name: Annotated[str, Field(min_length=1, strict=True, max_length=20)] = Field( description="The requested name of the service account. The service will generate a unique email from this name." diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/create_short_lived_access_token_response.py b/services/serviceaccount/src/stackit/serviceaccount/models/create_short_lived_access_token_response.py index abe1e10f..8afb1be2 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/create_short_lived_access_token_response.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/create_short_lived_access_token_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateShortLivedAccessTokenResponse(BaseModel): """ CreateShortLivedAccessTokenResponse - """ + """ # noqa: E501 access_token: StrictStr = Field(description="The short lived token that can be used for API access") expires_in: StrictInt diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/error.py b/services/serviceaccount/src/stackit/serviceaccount/models/error.py index 0c0f495e..9c1bcb0f 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/error.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/error.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class Error(BaseModel): """ Contains error information. - """ + """ # noqa: E501 error: StrictStr message: StrictStr diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/get_service_account_key_response.py b/services/serviceaccount/src/stackit/serviceaccount/models/get_service_account_key_response.py index 87ba3c71..583cd87b 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/get_service_account_key_response.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/get_service_account_key_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -36,7 +36,7 @@ class GetServiceAccountKeyResponse(BaseModel): """ GetServiceAccountKeyResponse - """ + """ # noqa: E501 active: StrictBool created_at: datetime = Field(description="Creation time of the key", alias="createdAt") diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/get_service_account_key_response_credentials.py b/services/serviceaccount/src/stackit/serviceaccount/models/get_service_account_key_response_credentials.py index 79ed20b7..7748c5d0 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/get_service_account_key_response_credentials.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/get_service_account_key_response_credentials.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class GetServiceAccountKeyResponseCredentials(BaseModel): """ GetServiceAccountKeyResponseCredentials - """ + """ # noqa: E501 aud: StrictStr = Field(description="Audience - service account API URL") iss: StrictStr = Field(description="Service account email") diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/jwk.py b/services/serviceaccount/src/stackit/serviceaccount/models/jwk.py index 100f4c72..5083215f 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/jwk.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/jwk.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class JWK(BaseModel): """ JSON Web Key according to https://datatracker.ietf.org/doc/html/rfc7517#section-4 - """ + """ # noqa: E501 alg: Optional[StrictStr] = None e: StrictStr diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/jwks.py b/services/serviceaccount/src/stackit/serviceaccount/models/jwks.py index 89200fcb..312fad5f 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/jwks.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/jwks.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class JWKS(BaseModel): """ JWKS - """ + """ # noqa: E501 keys: List[JWK] __properties: ClassVar[List[str]] = ["keys"] diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/list_access_tokens_response.py b/services/serviceaccount/src/stackit/serviceaccount/models/list_access_tokens_response.py index 1e85d08f..8ebd0ec3 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/list_access_tokens_response.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/list_access_tokens_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListAccessTokensResponse(BaseModel): """ ListAccessTokensResponse - """ + """ # noqa: E501 items: Optional[List[AccessTokenMetadata]] = None __properties: ClassVar[List[str]] = ["items"] diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/list_service_account_keys_response.py b/services/serviceaccount/src/stackit/serviceaccount/models/list_service_account_keys_response.py index 04c1bf2e..92730a02 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/list_service_account_keys_response.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/list_service_account_keys_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -28,7 +28,7 @@ class ListServiceAccountKeysResponse(BaseModel): """ ListServiceAccountKeysResponse - """ + """ # noqa: E501 items: List[ServiceAccountKeyListResponse] __properties: ClassVar[List[str]] = ["items"] diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/list_service_accounts_response.py b/services/serviceaccount/src/stackit/serviceaccount/models/list_service_accounts_response.py index 2504393f..78865960 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/list_service_accounts_response.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/list_service_accounts_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListServiceAccountsResponse(BaseModel): """ ListServiceAccountsResponse - """ + """ # noqa: E501 items: List[ServiceAccount] __properties: ClassVar[List[str]] = ["items"] diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/partial_update_service_account_key_payload.py b/services/serviceaccount/src/stackit/serviceaccount/models/partial_update_service_account_key_payload.py index 4fb1bf5a..c4c16a7f 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/partial_update_service_account_key_payload.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/partial_update_service_account_key_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class PartialUpdateServiceAccountKeyPayload(BaseModel): """ PartialUpdateServiceAccountKeyPayload - """ + """ # noqa: E501 active: Optional[StrictBool] = Field( default=None, description="Active keys are valid, while inactive keys are temporarily deactivated." diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/partial_update_service_account_key_response.py b/services/serviceaccount/src/stackit/serviceaccount/models/partial_update_service_account_key_response.py index 02413fe7..4917402d 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/partial_update_service_account_key_response.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/partial_update_service_account_key_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -32,7 +32,7 @@ class PartialUpdateServiceAccountKeyResponse(BaseModel): """ PartialUpdateServiceAccountKeyResponse - """ + """ # noqa: E501 active: StrictBool created_at: datetime = Field(description="Creation time of the key", alias="createdAt") diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/service_account.py b/services/serviceaccount/src/stackit/serviceaccount/models/service_account.py index 7ac89689..7d781fca 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/service_account.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/service_account.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class ServiceAccount(BaseModel): """ ServiceAccount - """ + """ # noqa: E501 email: StrictStr = Field( description="Unique identifier of the service account in format of an email address generated by the service containing the prefix provided by the user during creation." diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/service_account_key_list_response.py b/services/serviceaccount/src/stackit/serviceaccount/models/service_account_key_list_response.py index 6b686fc0..0b5463ce 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/service_account_key_list_response.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/service_account_key_list_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -32,7 +32,7 @@ class ServiceAccountKeyListResponse(BaseModel): """ ServiceAccountKeyListResponse - """ + """ # noqa: E501 active: StrictBool created_at: datetime = Field(description="Creation time of the key", alias="createdAt") diff --git a/services/serviceaccount/src/stackit/serviceaccount/rest.py b/services/serviceaccount/src/stackit/serviceaccount/rest.py index 01ecd4d5..36442489 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/rest.py +++ b/services/serviceaccount/src/stackit/serviceaccount/rest.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -124,7 +124,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/serviceenablement/CHANGELOG.md b/services/serviceenablement/CHANGELOG.md index b69b8d02..d062fb4a 100644 --- a/services/serviceenablement/CHANGELOG.md +++ b/services/serviceenablement/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.0.2 +- **Internal:** Improve deserializing and error types + ## v1.0.1 (2025-05-09) - **Feature:** Update user-agent header diff --git a/services/serviceenablement/pyproject.toml b/services/serviceenablement/pyproject.toml index eb286e78..b426c018 100644 --- a/services/serviceenablement/pyproject.toml +++ b/services/serviceenablement/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-serviceenablement" [tool.poetry] name = "stackit-serviceenablement" -version = "v1.0.1" +version = "v1.0.2" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/serviceenablement/src/stackit/serviceenablement/__init__.py b/services/serviceenablement/src/stackit/serviceenablement/__init__.py index 3ee40610..ffb121cf 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/__init__.py +++ b/services/serviceenablement/src/stackit/serviceenablement/__init__.py @@ -11,36 +11,65 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "ActionError", + "CheckService", + "CloudService", + "Dependencies", + "ErrorResponse", + "ListServiceStatusRegional200Response", + "Parameters", + "ParametersGeneral", + "ServiceStatus", +] + # import apis into sdk package -from stackit.serviceenablement.api.default_api import DefaultApi -from stackit.serviceenablement.api_client import ApiClient +from stackit.serviceenablement.api.default_api import DefaultApi as DefaultApi +from stackit.serviceenablement.api_client import ApiClient as ApiClient # import ApiClient -from stackit.serviceenablement.api_response import ApiResponse -from stackit.serviceenablement.configuration import HostConfiguration -from stackit.serviceenablement.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, +from stackit.serviceenablement.api_response import ApiResponse as ApiResponse +from stackit.serviceenablement.configuration import ( + HostConfiguration as HostConfiguration, ) +from stackit.serviceenablement.exceptions import ApiAttributeError as ApiAttributeError +from stackit.serviceenablement.exceptions import ApiException as ApiException +from stackit.serviceenablement.exceptions import ApiKeyError as ApiKeyError +from stackit.serviceenablement.exceptions import ApiTypeError as ApiTypeError +from stackit.serviceenablement.exceptions import ApiValueError as ApiValueError +from stackit.serviceenablement.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.serviceenablement.models.action_error import ActionError -from stackit.serviceenablement.models.check_service import CheckService -from stackit.serviceenablement.models.cloud_service import CloudService -from stackit.serviceenablement.models.dependencies import Dependencies -from stackit.serviceenablement.models.error_response import ErrorResponse +from stackit.serviceenablement.models.action_error import ActionError as ActionError +from stackit.serviceenablement.models.check_service import CheckService as CheckService +from stackit.serviceenablement.models.cloud_service import CloudService as CloudService +from stackit.serviceenablement.models.dependencies import Dependencies as Dependencies +from stackit.serviceenablement.models.error_response import ( + ErrorResponse as ErrorResponse, +) from stackit.serviceenablement.models.list_service_status_regional200_response import ( - ListServiceStatusRegional200Response, + ListServiceStatusRegional200Response as ListServiceStatusRegional200Response, +) +from stackit.serviceenablement.models.parameters import Parameters as Parameters +from stackit.serviceenablement.models.parameters_general import ( + ParametersGeneral as ParametersGeneral, +) +from stackit.serviceenablement.models.service_status import ( + ServiceStatus as ServiceStatus, ) -from stackit.serviceenablement.models.parameters import Parameters -from stackit.serviceenablement.models.parameters_general import ParametersGeneral -from stackit.serviceenablement.models.service_status import ServiceStatus diff --git a/services/serviceenablement/src/stackit/serviceenablement/api/default_api.py b/services/serviceenablement/src/stackit/serviceenablement/api/default_api.py index 90948a48..01cc9c21 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/api/default_api.py +++ b/services/serviceenablement/src/stackit/serviceenablement/api/default_api.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -85,7 +85,7 @@ def disable_service_regional( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._disable_service_regional_serialize( region=region, @@ -157,7 +157,7 @@ def disable_service_regional_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._disable_service_regional_serialize( region=region, @@ -229,7 +229,7 @@ def disable_service_regional_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._disable_service_regional_serialize( region=region, @@ -270,7 +270,7 @@ def _disable_service_regional_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -353,7 +353,7 @@ def enable_service_regional( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._enable_service_regional_serialize( region=region, @@ -425,7 +425,7 @@ def enable_service_regional_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._enable_service_regional_serialize( region=region, @@ -497,7 +497,7 @@ def enable_service_regional_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._enable_service_regional_serialize( region=region, @@ -538,7 +538,7 @@ def _enable_service_regional_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -621,7 +621,7 @@ def get_service_status_regional( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_service_status_regional_serialize( region=region, @@ -693,7 +693,7 @@ def get_service_status_regional_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_service_status_regional_serialize( region=region, @@ -765,7 +765,7 @@ def get_service_status_regional_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_service_status_regional_serialize( region=region, @@ -806,7 +806,7 @@ def _get_service_status_regional_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -889,7 +889,7 @@ def list_service_status_regional( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_service_status_regional_serialize( region=region, @@ -960,7 +960,7 @@ def list_service_status_regional_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_service_status_regional_serialize( region=region, @@ -1031,7 +1031,7 @@ def list_service_status_regional_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_service_status_regional_serialize( region=region, @@ -1071,7 +1071,7 @@ def _list_service_status_regional_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/serviceenablement/src/stackit/serviceenablement/api_client.py b/services/serviceenablement/src/stackit/serviceenablement/api_client.py index f0b478a9..b9941948 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/api_client.py +++ b/services/serviceenablement/src/stackit/serviceenablement/api_client.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -331,6 +331,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -350,12 +354,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -457,7 +461,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -473,7 +477,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -488,6 +495,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/serviceenablement/src/stackit/serviceenablement/configuration.py b/services/serviceenablement/src/stackit/serviceenablement/configuration.py index c99a2c17..eea549ea 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/configuration.py +++ b/services/serviceenablement/src/stackit/serviceenablement/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT Service Enablement API @@ -14,7 +9,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -53,7 +70,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -71,7 +88,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -111,7 +133,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -130,12 +152,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/serviceenablement/src/stackit/serviceenablement/exceptions.py b/services/serviceenablement/src/stackit/serviceenablement/exceptions.py index d62482df..90d04504 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/exceptions.py +++ b/services/serviceenablement/src/stackit/serviceenablement/exceptions.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -151,6 +151,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -187,6 +194,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/serviceenablement/src/stackit/serviceenablement/models/__init__.py b/services/serviceenablement/src/stackit/serviceenablement/models/__init__.py index db4a9e4a..7a49a423 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/models/__init__.py +++ b/services/serviceenablement/src/stackit/serviceenablement/models/__init__.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/serviceenablement/src/stackit/serviceenablement/models/action_error.py b/services/serviceenablement/src/stackit/serviceenablement/models/action_error.py index 8cbb31dc..5e33bcf6 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/models/action_error.py +++ b/services/serviceenablement/src/stackit/serviceenablement/models/action_error.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class ActionError(BaseModel): """ the last error for this service. - """ + """ # noqa: E501 action: Optional[StrictStr] = Field(default=None, description="the last action which was triggered on this service") code: Optional[StrictStr] = Field(default=None, description="the error code if provided by the service") diff --git a/services/serviceenablement/src/stackit/serviceenablement/models/check_service.py b/services/serviceenablement/src/stackit/serviceenablement/models/check_service.py index b1e8570e..bccdf41f 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/models/check_service.py +++ b/services/serviceenablement/src/stackit/serviceenablement/models/check_service.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class CheckService(BaseModel): """ CheckService - """ + """ # noqa: E501 resource: Optional[StrictStr] = Field(default=None, description="the identifier of the resource e.g. projectID") resource_type: Optional[StrictStr] = Field(default="project", alias="resourceType") diff --git a/services/serviceenablement/src/stackit/serviceenablement/models/cloud_service.py b/services/serviceenablement/src/stackit/serviceenablement/models/cloud_service.py index 84326ece..3ea90523 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/models/cloud_service.py +++ b/services/serviceenablement/src/stackit/serviceenablement/models/cloud_service.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -27,7 +27,7 @@ class CloudService(BaseModel): """ CloudService - """ + """ # noqa: E501 dependencies: Optional[Dependencies] = None labels: Optional[Dict[str, StrictStr]] = None diff --git a/services/serviceenablement/src/stackit/serviceenablement/models/dependencies.py b/services/serviceenablement/src/stackit/serviceenablement/models/dependencies.py index 3b55dd6f..460ddae1 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/models/dependencies.py +++ b/services/serviceenablement/src/stackit/serviceenablement/models/dependencies.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Dependencies(BaseModel): """ Dependencies - """ + """ # noqa: E501 hard: Optional[List[Annotated[str, Field(min_length=10, strict=True, max_length=255)]]] = Field( default=None, diff --git a/services/serviceenablement/src/stackit/serviceenablement/models/error_response.py b/services/serviceenablement/src/stackit/serviceenablement/models/error_response.py index f5c14367..3419206e 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/models/error_response.py +++ b/services/serviceenablement/src/stackit/serviceenablement/models/error_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ErrorResponse(BaseModel): """ ErrorResponse - """ + """ # noqa: E501 error: Optional[StrictStr] = None message: Optional[StrictStr] = None diff --git a/services/serviceenablement/src/stackit/serviceenablement/models/list_service_status_regional200_response.py b/services/serviceenablement/src/stackit/serviceenablement/models/list_service_status_regional200_response.py index f4b68605..225cd286 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/models/list_service_status_regional200_response.py +++ b/services/serviceenablement/src/stackit/serviceenablement/models/list_service_status_regional200_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListServiceStatusRegional200Response(BaseModel): """ ListServiceStatusRegional200Response - """ + """ # noqa: E501 items: Optional[List[ServiceStatus]] = None next_cursor: Optional[StrictStr] = Field(default=None, alias="nextCursor") diff --git a/services/serviceenablement/src/stackit/serviceenablement/models/parameters.py b/services/serviceenablement/src/stackit/serviceenablement/models/parameters.py index f189402c..228cd00d 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/models/parameters.py +++ b/services/serviceenablement/src/stackit/serviceenablement/models/parameters.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class Parameters(BaseModel): """ service parameters - """ + """ # noqa: E501 general: Optional[ParametersGeneral] = None additional_properties: Dict[str, Any] = {} diff --git a/services/serviceenablement/src/stackit/serviceenablement/models/parameters_general.py b/services/serviceenablement/src/stackit/serviceenablement/models/parameters_general.py index ab8d103e..91852630 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/models/parameters_general.py +++ b/services/serviceenablement/src/stackit/serviceenablement/models/parameters_general.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class ParametersGeneral(BaseModel): """ ParametersGeneral - """ + """ # noqa: E501 organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId") project_name: Optional[StrictStr] = Field(default=None, alias="projectName") diff --git a/services/serviceenablement/src/stackit/serviceenablement/models/service_status.py b/services/serviceenablement/src/stackit/serviceenablement/models/service_status.py index 1798932c..1819e16e 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/models/service_status.py +++ b/services/serviceenablement/src/stackit/serviceenablement/models/service_status.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -29,7 +29,7 @@ class ServiceStatus(BaseModel): """ ServiceStatus - """ + """ # noqa: E501 dependencies: Optional[Dependencies] = None enablement: Optional[StrictStr] = "REQUEST" diff --git a/services/serviceenablement/src/stackit/serviceenablement/rest.py b/services/serviceenablement/src/stackit/serviceenablement/rest.py index 11b85091..8a53c0af 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/rest.py +++ b/services/serviceenablement/src/stackit/serviceenablement/rest.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -124,7 +124,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/ske/CHANGELOG.md b/services/ske/CHANGELOG.md index 6411efd7..6013e25b 100644 --- a/services/ske/CHANGELOG.md +++ b/services/ske/CHANGELOG.md @@ -1,3 +1,11 @@ +## v1.0.0 +- **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. +- **Breaking Change:** Renamed `Argus` model to `Observability` +- **Breaking Change:** Renamed `argus` field to `observability` in `Extension` model +- **Breaking Change:** Removed enum validation in `code` field in `ClusterError` model +- **Deprecated:** Remove deprecated `allow_privileged_containers` field in `Kubernetes` model +- **Internal:** Improve deserializing and error types + ## v0.6.0 - **Feature:** Add new `ClusterErrorCode` types: `CLUSTERERRORCODE_INFRA_SNA_NETWORK_NOT_FOUND`, `CLUSTERERRORCODE_FETCHING_ERRORS_NOT_POSSIBLE` diff --git a/services/ske/pyproject.toml b/services/ske/pyproject.toml index c0d1f2c4..b531743c 100644 --- a/services/ske/pyproject.toml +++ b/services/ske/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-ske" [tool.poetry] name = "stackit-ske" -version = "v0.6.0" +version = "v1.0.0" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/ske/src/stackit/ske/__init__.py b/services/ske/src/stackit/ske/__init__.py index 2a0cd796..5550611d 100644 --- a/services/ske/src/stackit/ske/__init__.py +++ b/services/ske/src/stackit/ske/__init__.py @@ -7,66 +7,127 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "ACL", + "AvailabilityZone", + "CRI", + "Cluster", + "ClusterError", + "ClusterStatus", + "ClusterStatusState", + "CreateKubeconfigPayload", + "CreateOrUpdateClusterPayload", + "CredentialsRotationState", + "DNS", + "Extension", + "Hibernation", + "HibernationSchedule", + "Image", + "Kubeconfig", + "Kubernetes", + "KubernetesVersion", + "ListClustersResponse", + "LoginKubeconfig", + "Machine", + "MachineImage", + "MachineImageVersion", + "MachineType", + "Maintenance", + "MaintenanceAutoUpdate", + "Network", + "Nodepool", + "Observability", + "ProviderOptions", + "RuntimeError", + "Taint", + "TimeWindow", + "Volume", + "VolumeType", +] + # import apis into sdk package -from stackit.ske.api.default_api import DefaultApi -from stackit.ske.api_client import ApiClient +from stackit.ske.api.default_api import DefaultApi as DefaultApi +from stackit.ske.api_client import ApiClient as ApiClient # import ApiClient -from stackit.ske.api_response import ApiResponse -from stackit.ske.configuration import HostConfiguration -from stackit.ske.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.ske.api_response import ApiResponse as ApiResponse +from stackit.ske.configuration import HostConfiguration as HostConfiguration +from stackit.ske.exceptions import ApiAttributeError as ApiAttributeError +from stackit.ske.exceptions import ApiException as ApiException +from stackit.ske.exceptions import ApiKeyError as ApiKeyError +from stackit.ske.exceptions import ApiTypeError as ApiTypeError +from stackit.ske.exceptions import ApiValueError as ApiValueError +from stackit.ske.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.ske.models.acl import ACL -from stackit.ske.models.argus import Argus -from stackit.ske.models.availability_zone import AvailabilityZone -from stackit.ske.models.cluster import Cluster -from stackit.ske.models.cluster_error import ClusterError -from stackit.ske.models.cluster_status import ClusterStatus -from stackit.ske.models.cluster_status_state import ClusterStatusState -from stackit.ske.models.create_kubeconfig_payload import CreateKubeconfigPayload +from stackit.ske.models.acl import ACL as ACL +from stackit.ske.models.availability_zone import AvailabilityZone as AvailabilityZone +from stackit.ske.models.cluster import Cluster as Cluster +from stackit.ske.models.cluster_error import ClusterError as ClusterError +from stackit.ske.models.cluster_status import ClusterStatus as ClusterStatus +from stackit.ske.models.cluster_status_state import ( + ClusterStatusState as ClusterStatusState, +) +from stackit.ske.models.create_kubeconfig_payload import ( + CreateKubeconfigPayload as CreateKubeconfigPayload, +) from stackit.ske.models.create_or_update_cluster_payload import ( - CreateOrUpdateClusterPayload, + CreateOrUpdateClusterPayload as CreateOrUpdateClusterPayload, +) +from stackit.ske.models.credentials_rotation_state import ( + CredentialsRotationState as CredentialsRotationState, +) +from stackit.ske.models.cri import CRI as CRI +from stackit.ske.models.dns import DNS as DNS +from stackit.ske.models.extension import Extension as Extension +from stackit.ske.models.hibernation import Hibernation as Hibernation +from stackit.ske.models.hibernation_schedule import ( + HibernationSchedule as HibernationSchedule, +) +from stackit.ske.models.image import Image as Image +from stackit.ske.models.kubeconfig import Kubeconfig as Kubeconfig +from stackit.ske.models.kubernetes import Kubernetes as Kubernetes +from stackit.ske.models.kubernetes_version import KubernetesVersion as KubernetesVersion +from stackit.ske.models.list_clusters_response import ( + ListClustersResponse as ListClustersResponse, +) +from stackit.ske.models.login_kubeconfig import LoginKubeconfig as LoginKubeconfig +from stackit.ske.models.machine import Machine as Machine +from stackit.ske.models.machine_image import MachineImage as MachineImage +from stackit.ske.models.machine_image_version import ( + MachineImageVersion as MachineImageVersion, +) +from stackit.ske.models.machine_type import MachineType as MachineType +from stackit.ske.models.maintenance import Maintenance as Maintenance +from stackit.ske.models.maintenance_auto_update import ( + MaintenanceAutoUpdate as MaintenanceAutoUpdate, ) -from stackit.ske.models.credentials_rotation_state import CredentialsRotationState -from stackit.ske.models.cri import CRI -from stackit.ske.models.dns import DNS -from stackit.ske.models.extension import Extension -from stackit.ske.models.hibernation import Hibernation -from stackit.ske.models.hibernation_schedule import HibernationSchedule -from stackit.ske.models.image import Image -from stackit.ske.models.kubeconfig import Kubeconfig -from stackit.ske.models.kubernetes import Kubernetes -from stackit.ske.models.kubernetes_version import KubernetesVersion -from stackit.ske.models.list_clusters_response import ListClustersResponse -from stackit.ske.models.login_kubeconfig import LoginKubeconfig -from stackit.ske.models.machine import Machine -from stackit.ske.models.machine_image import MachineImage -from stackit.ske.models.machine_image_version import MachineImageVersion -from stackit.ske.models.machine_type import MachineType -from stackit.ske.models.maintenance import Maintenance -from stackit.ske.models.maintenance_auto_update import MaintenanceAutoUpdate -from stackit.ske.models.network import Network -from stackit.ske.models.nodepool import Nodepool -from stackit.ske.models.provider_options import ProviderOptions -from stackit.ske.models.runtime_error import RuntimeError -from stackit.ske.models.taint import Taint -from stackit.ske.models.time_window import TimeWindow -from stackit.ske.models.volume import Volume -from stackit.ske.models.volume_type import VolumeType +from stackit.ske.models.network import Network as Network +from stackit.ske.models.nodepool import Nodepool as Nodepool +from stackit.ske.models.observability import Observability as Observability +from stackit.ske.models.provider_options import ProviderOptions as ProviderOptions +from stackit.ske.models.runtime_error import RuntimeError as RuntimeError +from stackit.ske.models.taint import Taint as Taint +from stackit.ske.models.time_window import TimeWindow as TimeWindow +from stackit.ske.models.volume import Volume as Volume +from stackit.ske.models.volume_type import VolumeType as VolumeType diff --git a/services/ske/src/stackit/ske/api/default_api.py b/services/ske/src/stackit/ske/api/default_api.py index d9a364e0..9ab8fccb 100644 --- a/services/ske/src/stackit/ske/api/default_api.py +++ b/services/ske/src/stackit/ske/api/default_api.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -48,6 +48,7 @@ def __init__(self, configuration: Configuration = None) -> None: def complete_credentials_rotation( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -65,6 +66,8 @@ def complete_credentials_rotation( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -87,10 +90,11 @@ def complete_credentials_rotation( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._complete_credentials_rotation_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -102,6 +106,7 @@ def complete_credentials_rotation( "200": "object", "202": "object", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -115,6 +120,7 @@ def complete_credentials_rotation( def complete_credentials_rotation_with_http_info( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -132,6 +138,8 @@ def complete_credentials_rotation_with_http_info( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -154,10 +162,11 @@ def complete_credentials_rotation_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._complete_credentials_rotation_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -169,6 +178,7 @@ def complete_credentials_rotation_with_http_info( "200": "object", "202": "object", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -182,6 +192,7 @@ def complete_credentials_rotation_with_http_info( def complete_credentials_rotation_without_preload_content( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -199,6 +210,8 @@ def complete_credentials_rotation_without_preload_content( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -221,10 +234,11 @@ def complete_credentials_rotation_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._complete_credentials_rotation_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -236,6 +250,7 @@ def complete_credentials_rotation_without_preload_content( "200": "object", "202": "object", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -244,6 +259,7 @@ def complete_credentials_rotation_without_preload_content( def _complete_credentials_rotation_serialize( self, project_id, + region, cluster_name, _request_auth, _content_type, @@ -259,12 +275,14 @@ def _complete_credentials_rotation_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region if cluster_name is not None: _path_params["clusterName"] = cluster_name # process the query parameters @@ -281,7 +299,7 @@ def _complete_credentials_rotation_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/clusters/{clusterName}/complete-credentials-rotation", + resource_path="/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/complete-credentials-rotation", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -298,6 +316,7 @@ def _complete_credentials_rotation_serialize( def create_kubeconfig( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, create_kubeconfig_payload: CreateKubeconfigPayload, _request_timeout: Union[ @@ -316,6 +335,8 @@ def create_kubeconfig( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param create_kubeconfig_payload: (required) @@ -340,10 +361,11 @@ def create_kubeconfig( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_kubeconfig_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, create_kubeconfig_payload=create_kubeconfig_payload, _request_auth=_request_auth, @@ -354,6 +376,8 @@ def create_kubeconfig( _response_types_map: Dict[str, Optional[str]] = { "200": "Kubeconfig", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -366,6 +390,7 @@ def create_kubeconfig( def create_kubeconfig_with_http_info( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, create_kubeconfig_payload: CreateKubeconfigPayload, _request_timeout: Union[ @@ -384,6 +409,8 @@ def create_kubeconfig_with_http_info( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param create_kubeconfig_payload: (required) @@ -408,10 +435,11 @@ def create_kubeconfig_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_kubeconfig_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, create_kubeconfig_payload=create_kubeconfig_payload, _request_auth=_request_auth, @@ -422,6 +450,8 @@ def create_kubeconfig_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "Kubeconfig", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -434,6 +464,7 @@ def create_kubeconfig_with_http_info( def create_kubeconfig_without_preload_content( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, create_kubeconfig_payload: CreateKubeconfigPayload, _request_timeout: Union[ @@ -452,6 +483,8 @@ def create_kubeconfig_without_preload_content( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param create_kubeconfig_payload: (required) @@ -476,10 +509,11 @@ def create_kubeconfig_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_kubeconfig_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, create_kubeconfig_payload=create_kubeconfig_payload, _request_auth=_request_auth, @@ -490,6 +524,8 @@ def create_kubeconfig_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "Kubeconfig", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -497,6 +533,7 @@ def create_kubeconfig_without_preload_content( def _create_kubeconfig_serialize( self, project_id, + region, cluster_name, create_kubeconfig_payload, _request_auth, @@ -513,12 +550,14 @@ def _create_kubeconfig_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region if cluster_name is not None: _path_params["clusterName"] = cluster_name # process the query parameters @@ -545,7 +584,7 @@ def _create_kubeconfig_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/clusters/{clusterName}/kubeconfig", + resource_path="/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/kubeconfig", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -562,6 +601,7 @@ def _create_kubeconfig_serialize( def create_or_update_cluster( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, create_or_update_cluster_payload: CreateOrUpdateClusterPayload, _request_timeout: Union[ @@ -580,6 +620,8 @@ def create_or_update_cluster( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param create_or_update_cluster_payload: (required) @@ -604,10 +646,11 @@ def create_or_update_cluster( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_or_update_cluster_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, create_or_update_cluster_payload=create_or_update_cluster_payload, _request_auth=_request_auth, @@ -620,6 +663,7 @@ def create_or_update_cluster( "200": "Cluster", "202": "object", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -633,6 +677,7 @@ def create_or_update_cluster( def create_or_update_cluster_with_http_info( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, create_or_update_cluster_payload: CreateOrUpdateClusterPayload, _request_timeout: Union[ @@ -651,6 +696,8 @@ def create_or_update_cluster_with_http_info( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param create_or_update_cluster_payload: (required) @@ -675,10 +722,11 @@ def create_or_update_cluster_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_or_update_cluster_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, create_or_update_cluster_payload=create_or_update_cluster_payload, _request_auth=_request_auth, @@ -691,6 +739,7 @@ def create_or_update_cluster_with_http_info( "200": "Cluster", "202": "object", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -704,6 +753,7 @@ def create_or_update_cluster_with_http_info( def create_or_update_cluster_without_preload_content( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, create_or_update_cluster_payload: CreateOrUpdateClusterPayload, _request_timeout: Union[ @@ -722,6 +772,8 @@ def create_or_update_cluster_without_preload_content( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param create_or_update_cluster_payload: (required) @@ -746,10 +798,11 @@ def create_or_update_cluster_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_or_update_cluster_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, create_or_update_cluster_payload=create_or_update_cluster_payload, _request_auth=_request_auth, @@ -762,6 +815,7 @@ def create_or_update_cluster_without_preload_content( "200": "Cluster", "202": "object", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -770,6 +824,7 @@ def create_or_update_cluster_without_preload_content( def _create_or_update_cluster_serialize( self, project_id, + region, cluster_name, create_or_update_cluster_payload, _request_auth, @@ -786,12 +841,14 @@ def _create_or_update_cluster_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region if cluster_name is not None: _path_params["clusterName"] = cluster_name # process the query parameters @@ -818,7 +875,7 @@ def _create_or_update_cluster_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v1/projects/{projectId}/clusters/{clusterName}", + resource_path="/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -835,6 +892,7 @@ def _create_or_update_cluster_serialize( def delete_cluster( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -852,6 +910,8 @@ def delete_cluster( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -874,10 +934,11 @@ def delete_cluster( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_cluster_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -888,6 +949,8 @@ def delete_cluster( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -900,6 +963,7 @@ def delete_cluster( def delete_cluster_with_http_info( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -917,6 +981,8 @@ def delete_cluster_with_http_info( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -939,10 +1005,11 @@ def delete_cluster_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_cluster_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -953,6 +1020,8 @@ def delete_cluster_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -965,6 +1034,7 @@ def delete_cluster_with_http_info( def delete_cluster_without_preload_content( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -982,6 +1052,8 @@ def delete_cluster_without_preload_content( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -1004,10 +1076,11 @@ def delete_cluster_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_cluster_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -1018,6 +1091,8 @@ def delete_cluster_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -1025,6 +1100,7 @@ def delete_cluster_without_preload_content( def _delete_cluster_serialize( self, project_id, + region, cluster_name, _request_auth, _content_type, @@ -1040,12 +1116,14 @@ def _delete_cluster_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region if cluster_name is not None: _path_params["clusterName"] = cluster_name # process the query parameters @@ -1062,7 +1140,7 @@ def _delete_cluster_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v1/projects/{projectId}/clusters/{clusterName}", + resource_path="/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1079,6 +1157,7 @@ def _delete_cluster_serialize( def get_cluster( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -1096,6 +1175,8 @@ def get_cluster( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -1118,10 +1199,11 @@ def get_cluster( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_cluster_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -1131,6 +1213,8 @@ def get_cluster( _response_types_map: Dict[str, Optional[str]] = { "200": "Cluster", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1143,6 +1227,7 @@ def get_cluster( def get_cluster_with_http_info( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -1160,6 +1245,8 @@ def get_cluster_with_http_info( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -1182,10 +1269,11 @@ def get_cluster_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_cluster_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -1195,6 +1283,8 @@ def get_cluster_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "Cluster", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1207,6 +1297,7 @@ def get_cluster_with_http_info( def get_cluster_without_preload_content( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -1224,6 +1315,8 @@ def get_cluster_without_preload_content( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -1246,10 +1339,11 @@ def get_cluster_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_cluster_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -1259,6 +1353,8 @@ def get_cluster_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "Cluster", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -1266,6 +1362,7 @@ def get_cluster_without_preload_content( def _get_cluster_serialize( self, project_id, + region, cluster_name, _request_auth, _content_type, @@ -1281,12 +1378,14 @@ def _get_cluster_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region if cluster_name is not None: _path_params["clusterName"] = cluster_name # process the query parameters @@ -1303,7 +1402,7 @@ def _get_cluster_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/clusters/{clusterName}", + resource_path="/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1320,6 +1419,7 @@ def _get_cluster_serialize( def get_login_kubeconfig( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -1337,6 +1437,8 @@ def get_login_kubeconfig( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -1359,10 +1461,11 @@ def get_login_kubeconfig( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_login_kubeconfig_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -1372,6 +1475,8 @@ def get_login_kubeconfig( _response_types_map: Dict[str, Optional[str]] = { "200": "LoginKubeconfig", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1384,6 +1489,7 @@ def get_login_kubeconfig( def get_login_kubeconfig_with_http_info( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -1401,6 +1507,8 @@ def get_login_kubeconfig_with_http_info( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -1423,10 +1531,11 @@ def get_login_kubeconfig_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_login_kubeconfig_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -1436,6 +1545,8 @@ def get_login_kubeconfig_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "LoginKubeconfig", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1448,6 +1559,7 @@ def get_login_kubeconfig_with_http_info( def get_login_kubeconfig_without_preload_content( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -1465,6 +1577,8 @@ def get_login_kubeconfig_without_preload_content( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -1487,10 +1601,11 @@ def get_login_kubeconfig_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_login_kubeconfig_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -1500,6 +1615,8 @@ def get_login_kubeconfig_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "LoginKubeconfig", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -1507,6 +1624,7 @@ def get_login_kubeconfig_without_preload_content( def _get_login_kubeconfig_serialize( self, project_id, + region, cluster_name, _request_auth, _content_type, @@ -1522,12 +1640,14 @@ def _get_login_kubeconfig_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region if cluster_name is not None: _path_params["clusterName"] = cluster_name # process the query parameters @@ -1544,7 +1664,7 @@ def _get_login_kubeconfig_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/clusters/{clusterName}/kubeconfig/login", + resource_path="/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/kubeconfig/login", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1561,6 +1681,7 @@ def _get_login_kubeconfig_serialize( def list_clusters( self, project_id: StrictStr, + region: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1577,6 +1698,8 @@ def list_clusters( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1597,10 +1720,11 @@ def list_clusters( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_clusters_serialize( project_id=project_id, + region=region, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1610,6 +1734,7 @@ def list_clusters( _response_types_map: Dict[str, Optional[str]] = { "200": "ListClustersResponse", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1623,6 +1748,7 @@ def list_clusters( def list_clusters_with_http_info( self, project_id: StrictStr, + region: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1639,6 +1765,8 @@ def list_clusters_with_http_info( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1659,10 +1787,11 @@ def list_clusters_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_clusters_serialize( project_id=project_id, + region=region, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1672,6 +1801,7 @@ def list_clusters_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "ListClustersResponse", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1685,6 +1815,7 @@ def list_clusters_with_http_info( def list_clusters_without_preload_content( self, project_id: StrictStr, + region: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1701,6 +1832,8 @@ def list_clusters_without_preload_content( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1721,10 +1854,11 @@ def list_clusters_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_clusters_serialize( project_id=project_id, + region=region, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1734,6 +1868,7 @@ def list_clusters_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "ListClustersResponse", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1742,6 +1877,7 @@ def list_clusters_without_preload_content( def _list_clusters_serialize( self, project_id, + region, _request_auth, _content_type, _headers, @@ -1756,12 +1892,14 @@ def _list_clusters_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region # process the query parameters # process the header parameters # process the form parameters @@ -1776,7 +1914,7 @@ def _list_clusters_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/clusters", + resource_path="/v2/projects/{projectId}/regions/{region}/clusters", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1792,6 +1930,7 @@ def _list_clusters_serialize( @validate_call def list_provider_options( self, + region: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1806,6 +1945,8 @@ def list_provider_options( Returns a list of supported Kubernetes versions and a list of supported machine types for the cluster nodes. + :param region: (required) + :type region: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1826,14 +1967,20 @@ def list_provider_options( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_provider_options_serialize( - _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { "200": "ProviderOptions", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1845,6 +1992,7 @@ def list_provider_options( @validate_call def list_provider_options_with_http_info( self, + region: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1859,6 +2007,8 @@ def list_provider_options_with_http_info( Returns a list of supported Kubernetes versions and a list of supported machine types for the cluster nodes. + :param region: (required) + :type region: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1879,14 +2029,20 @@ def list_provider_options_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_provider_options_serialize( - _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { "200": "ProviderOptions", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1898,6 +2054,7 @@ def list_provider_options_with_http_info( @validate_call def list_provider_options_without_preload_content( self, + region: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1912,6 +2069,8 @@ def list_provider_options_without_preload_content( Returns a list of supported Kubernetes versions and a list of supported machine types for the cluster nodes. + :param region: (required) + :type region: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1932,20 +2091,27 @@ def list_provider_options_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_provider_options_serialize( - _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { "200": "ProviderOptions", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response def _list_provider_options_serialize( self, + region, _request_auth, _content_type, _headers, @@ -1960,10 +2126,12 @@ def _list_provider_options_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters + if region is not None: + _path_params["region"] = region # process the query parameters # process the header parameters # process the form parameters @@ -1978,7 +2146,7 @@ def _list_provider_options_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/provider-options", + resource_path="/v2/regions/{region}/provider-options", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1995,6 +2163,7 @@ def _list_provider_options_serialize( def start_credentials_rotation( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2012,6 +2181,8 @@ def start_credentials_rotation( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2034,10 +2205,11 @@ def start_credentials_rotation( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._start_credentials_rotation_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2049,6 +2221,7 @@ def start_credentials_rotation( "200": "object", "202": "object", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2062,6 +2235,7 @@ def start_credentials_rotation( def start_credentials_rotation_with_http_info( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2079,6 +2253,8 @@ def start_credentials_rotation_with_http_info( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2101,10 +2277,11 @@ def start_credentials_rotation_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._start_credentials_rotation_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2116,6 +2293,7 @@ def start_credentials_rotation_with_http_info( "200": "object", "202": "object", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2129,6 +2307,7 @@ def start_credentials_rotation_with_http_info( def start_credentials_rotation_without_preload_content( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2146,6 +2325,8 @@ def start_credentials_rotation_without_preload_content( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2168,10 +2349,11 @@ def start_credentials_rotation_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._start_credentials_rotation_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2183,6 +2365,7 @@ def start_credentials_rotation_without_preload_content( "200": "object", "202": "object", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2191,6 +2374,7 @@ def start_credentials_rotation_without_preload_content( def _start_credentials_rotation_serialize( self, project_id, + region, cluster_name, _request_auth, _content_type, @@ -2206,12 +2390,14 @@ def _start_credentials_rotation_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region if cluster_name is not None: _path_params["clusterName"] = cluster_name # process the query parameters @@ -2228,7 +2414,7 @@ def _start_credentials_rotation_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/clusters/{clusterName}/start-credentials-rotation", + resource_path="/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/start-credentials-rotation", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2245,6 +2431,7 @@ def _start_credentials_rotation_serialize( def trigger_hibernate( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2262,6 +2449,8 @@ def trigger_hibernate( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2284,10 +2473,11 @@ def trigger_hibernate( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_hibernate_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2298,6 +2488,8 @@ def trigger_hibernate( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2311,6 +2503,7 @@ def trigger_hibernate( def trigger_hibernate_with_http_info( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2328,6 +2521,8 @@ def trigger_hibernate_with_http_info( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2350,10 +2545,11 @@ def trigger_hibernate_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_hibernate_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2364,6 +2560,8 @@ def trigger_hibernate_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2377,6 +2575,7 @@ def trigger_hibernate_with_http_info( def trigger_hibernate_without_preload_content( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2394,6 +2593,8 @@ def trigger_hibernate_without_preload_content( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2416,10 +2617,11 @@ def trigger_hibernate_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_hibernate_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2430,6 +2632,8 @@ def trigger_hibernate_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2438,6 +2642,7 @@ def trigger_hibernate_without_preload_content( def _trigger_hibernate_serialize( self, project_id, + region, cluster_name, _request_auth, _content_type, @@ -2453,12 +2658,14 @@ def _trigger_hibernate_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region if cluster_name is not None: _path_params["clusterName"] = cluster_name # process the query parameters @@ -2475,7 +2682,7 @@ def _trigger_hibernate_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/clusters/{clusterName}/hibernate", + resource_path="/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/hibernate", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2492,6 +2699,7 @@ def _trigger_hibernate_serialize( def trigger_maintenance( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2509,6 +2717,8 @@ def trigger_maintenance( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2531,10 +2741,11 @@ def trigger_maintenance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_maintenance_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2545,6 +2756,8 @@ def trigger_maintenance( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2558,6 +2771,7 @@ def trigger_maintenance( def trigger_maintenance_with_http_info( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2575,6 +2789,8 @@ def trigger_maintenance_with_http_info( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2597,10 +2813,11 @@ def trigger_maintenance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_maintenance_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2611,6 +2828,8 @@ def trigger_maintenance_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2624,6 +2843,7 @@ def trigger_maintenance_with_http_info( def trigger_maintenance_without_preload_content( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2641,6 +2861,8 @@ def trigger_maintenance_without_preload_content( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2663,10 +2885,11 @@ def trigger_maintenance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_maintenance_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2677,6 +2900,8 @@ def trigger_maintenance_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2685,6 +2910,7 @@ def trigger_maintenance_without_preload_content( def _trigger_maintenance_serialize( self, project_id, + region, cluster_name, _request_auth, _content_type, @@ -2700,12 +2926,14 @@ def _trigger_maintenance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region if cluster_name is not None: _path_params["clusterName"] = cluster_name # process the query parameters @@ -2722,7 +2950,7 @@ def _trigger_maintenance_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/clusters/{clusterName}/maintenance", + resource_path="/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/maintenance", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2739,6 +2967,7 @@ def _trigger_maintenance_serialize( def trigger_reconcile( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2756,6 +2985,8 @@ def trigger_reconcile( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2778,10 +3009,11 @@ def trigger_reconcile( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_reconcile_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2792,6 +3024,8 @@ def trigger_reconcile( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2805,6 +3039,7 @@ def trigger_reconcile( def trigger_reconcile_with_http_info( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2822,6 +3057,8 @@ def trigger_reconcile_with_http_info( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2844,10 +3081,11 @@ def trigger_reconcile_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_reconcile_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2858,6 +3096,8 @@ def trigger_reconcile_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2871,6 +3111,7 @@ def trigger_reconcile_with_http_info( def trigger_reconcile_without_preload_content( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2888,6 +3129,8 @@ def trigger_reconcile_without_preload_content( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2910,10 +3153,11 @@ def trigger_reconcile_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_reconcile_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2924,6 +3168,8 @@ def trigger_reconcile_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2932,6 +3178,7 @@ def trigger_reconcile_without_preload_content( def _trigger_reconcile_serialize( self, project_id, + region, cluster_name, _request_auth, _content_type, @@ -2947,12 +3194,14 @@ def _trigger_reconcile_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region if cluster_name is not None: _path_params["clusterName"] = cluster_name # process the query parameters @@ -2969,7 +3218,7 @@ def _trigger_reconcile_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/clusters/{clusterName}/reconcile", + resource_path="/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/reconcile", path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/services/ske/src/stackit/ske/api_client.py b/services/ske/src/stackit/ske/api_client.py index eb3998b1..2cae64e9 100644 --- a/services/ske/src/stackit/ske/api_client.py +++ b/services/ske/src/stackit/ske/api_client.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -331,6 +331,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -350,12 +354,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -457,7 +461,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -473,7 +477,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -488,6 +495,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/ske/src/stackit/ske/configuration.py b/services/ske/src/stackit/ske/configuration.py index 18f50ee3..7af39b87 100644 --- a/services/ske/src/stackit/ske/configuration.py +++ b/services/ske/src/stackit/ske/configuration.py @@ -1,20 +1,37 @@ # coding: utf-8 -import sys - -import os - - """ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -36,7 +53,7 @@ def __init__( ) """Constructor """ - self._base_path = "https://ske.api.eu01.stackit.cloud" + self._base_path = "https://ske.api.stackit.cloud" """Default Base url """ self.server_index = 0 if server_index is None else server_index @@ -53,26 +70,30 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings """ return [ { - "url": "https://ske.api.{region}stackit.cloud", + "url": "https://ske.api.stackit.cloud", "description": "No description provided", "variables": { "region": { "description": "No description provided", - "default_value": "eu01.", - "enum_values": ["eu01."], + "default_value": "global", } }, } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -112,7 +133,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -131,12 +152,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/ske/src/stackit/ske/exceptions.py b/services/ske/src/stackit/ske/exceptions.py index e302d148..b536e7c8 100644 --- a/services/ske/src/stackit/ske/exceptions.py +++ b/services/ske/src/stackit/ske/exceptions.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -151,6 +151,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -187,6 +194,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/ske/src/stackit/ske/models/__init__.py b/services/ske/src/stackit/ske/models/__init__.py index f4fa80bd..e27a6df8 100644 --- a/services/ske/src/stackit/ske/models/__init__.py +++ b/services/ske/src/stackit/ske/models/__init__.py @@ -6,16 +6,15 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package from stackit.ske.models.acl import ACL -from stackit.ske.models.argus import Argus from stackit.ske.models.availability_zone import AvailabilityZone from stackit.ske.models.cluster import Cluster from stackit.ske.models.cluster_error import ClusterError @@ -45,6 +44,7 @@ from stackit.ske.models.maintenance_auto_update import MaintenanceAutoUpdate from stackit.ske.models.network import Network from stackit.ske.models.nodepool import Nodepool +from stackit.ske.models.observability import Observability from stackit.ske.models.provider_options import ProviderOptions from stackit.ske.models.runtime_error import RuntimeError from stackit.ske.models.taint import Taint diff --git a/services/ske/src/stackit/ske/models/acl.py b/services/ske/src/stackit/ske/models/acl.py index d9485a1f..8d133134 100644 --- a/services/ske/src/stackit/ske/models/acl.py +++ b/services/ske/src/stackit/ske/models/acl.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -18,15 +18,15 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing_extensions import Self +from typing_extensions import Annotated, Self class ACL(BaseModel): """ ACL - """ + """ # noqa: E501 - allowed_cidrs: List[StrictStr] = Field( + allowed_cidrs: Annotated[List[StrictStr], Field(max_length=10)] = Field( description="Array of CIDRs to allow access to the kubernetes API.", alias="allowedCidrs" ) enabled: StrictBool = Field(description="Enables the acl extension.") diff --git a/services/ske/src/stackit/ske/models/availability_zone.py b/services/ske/src/stackit/ske/models/availability_zone.py index 707a09f7..bc3015e9 100644 --- a/services/ske/src/stackit/ske/models/availability_zone.py +++ b/services/ske/src/stackit/ske/models/availability_zone.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class AvailabilityZone(BaseModel): """ AvailabilityZone - """ + """ # noqa: E501 name: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["name"] diff --git a/services/ske/src/stackit/ske/models/cluster.py b/services/ske/src/stackit/ske/models/cluster.py index 574dc127..2168bdc7 100644 --- a/services/ske/src/stackit/ske/models/cluster.py +++ b/services/ske/src/stackit/ske/models/cluster.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -32,7 +32,7 @@ class Cluster(BaseModel): """ Cluster - """ + """ # noqa: E501 extensions: Optional[Extension] = None hibernation: Optional[Hibernation] = None diff --git a/services/ske/src/stackit/ske/models/cluster_error.py b/services/ske/src/stackit/ske/models/cluster_error.py index 9a1c2da8..7ebf1a75 100644 --- a/services/ske/src/stackit/ske/models/cluster_error.py +++ b/services/ske/src/stackit/ske/models/cluster_error.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -17,41 +17,22 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing_extensions import Self class ClusterError(BaseModel): """ ClusterError - """ + """ # noqa: E501 - code: Optional[StrictStr] = None + code: Optional[StrictStr] = Field( + default=None, + description='Possible values: `"SKE_OBSERVABILITY_INSTANCE_NOT_FOUND"`, `"SKE_DNS_ZONE_NOT_FOUND"`, `"SKE_NODE_NO_VALID_HOST_FOUND"`, `"SKE_NODE_MISCONFIGURED_PDB"`, `"SKE_NODE_MACHINE_TYPE_NOT_FOUND"`, `"SKE_INFRA_SNA_NETWORK_NOT_FOUND"`, `"SKE_FETCHING_ERRORS_NOT_POSSIBLE"`', + ) message: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["code", "message"] - @field_validator("code") - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set( - [ - "SKE_OBSERVABILITY_INSTANCE_NOT_FOUND", - "SKE_DNS_ZONE_NOT_FOUND", - "SKE_NODE_NO_VALID_HOST_FOUND", - "SKE_NODE_MISCONFIGURED_PDB", - "SKE_NODE_MACHINE_TYPE_NOT_FOUND", - "SKE_INFRA_SNA_NETWORK_NOT_FOUND", - "SKE_FETCHING_ERRORS_NOT_POSSIBLE", - ] - ): - raise ValueError( - "must be one of enum values ('SKE_OBSERVABILITY_INSTANCE_NOT_FOUND', 'SKE_DNS_ZONE_NOT_FOUND', 'SKE_NODE_NO_VALID_HOST_FOUND', 'SKE_NODE_MISCONFIGURED_PDB', 'SKE_NODE_MACHINE_TYPE_NOT_FOUND', 'SKE_INFRA_SNA_NETWORK_NOT_FOUND', 'SKE_FETCHING_ERRORS_NOT_POSSIBLE')" - ) - return value - model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/services/ske/src/stackit/ske/models/cluster_status.py b/services/ske/src/stackit/ske/models/cluster_status.py index 93b7aca6..4c2a9b37 100644 --- a/services/ske/src/stackit/ske/models/cluster_status.py +++ b/services/ske/src/stackit/ske/models/cluster_status.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -30,7 +30,7 @@ class ClusterStatus(BaseModel): """ ClusterStatus - """ + """ # noqa: E501 aggregated: Optional[ClusterStatusState] = ClusterStatusState.STATE_UNSPECIFIED creation_time: Optional[datetime] = Field( diff --git a/services/ske/src/stackit/ske/models/cluster_status_state.py b/services/ske/src/stackit/ske/models/cluster_status_state.py index d7a54bf0..feeaf8e9 100644 --- a/services/ske/src/stackit/ske/models/cluster_status_state.py +++ b/services/ske/src/stackit/ske/models/cluster_status_state.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations diff --git a/services/ske/src/stackit/ske/models/create_kubeconfig_payload.py b/services/ske/src/stackit/ske/models/create_kubeconfig_payload.py index 6497e49f..0d1609c3 100644 --- a/services/ske/src/stackit/ske/models/create_kubeconfig_payload.py +++ b/services/ske/src/stackit/ske/models/create_kubeconfig_payload.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateKubeconfigPayload(BaseModel): """ CreateKubeconfigPayload - """ + """ # noqa: E501 expiration_seconds: Optional[StrictStr] = Field(default=None, alias="expirationSeconds") __properties: ClassVar[List[str]] = ["expirationSeconds"] diff --git a/services/ske/src/stackit/ske/models/create_or_update_cluster_payload.py b/services/ske/src/stackit/ske/models/create_or_update_cluster_payload.py index bbcd4222..d411fccd 100644 --- a/services/ske/src/stackit/ske/models/create_or_update_cluster_payload.py +++ b/services/ske/src/stackit/ske/models/create_or_update_cluster_payload.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -32,7 +32,7 @@ class CreateOrUpdateClusterPayload(BaseModel): """ CreateOrUpdateClusterPayload - """ + """ # noqa: E501 extensions: Optional[Extension] = None hibernation: Optional[Hibernation] = None diff --git a/services/ske/src/stackit/ske/models/credentials_rotation_state.py b/services/ske/src/stackit/ske/models/credentials_rotation_state.py index 31369153..adda37e8 100644 --- a/services/ske/src/stackit/ske/models/credentials_rotation_state.py +++ b/services/ske/src/stackit/ske/models/credentials_rotation_state.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CredentialsRotationState(BaseModel): """ CredentialsRotationState - """ + """ # noqa: E501 last_completion_time: Optional[datetime] = Field( default=None, description="Format: `2024-02-15T11:06:29Z`", alias="lastCompletionTime" @@ -35,7 +35,7 @@ class CredentialsRotationState(BaseModel): ) phase: Optional[StrictStr] = Field( default=None, - description="Phase of the credentials rotation. `NEVER` indicates that no credentials rotation has been performed using the new credentials rotation endpoints yet.", + description="Phase of the credentials rotation. `NEVER` indicates that no credentials rotation has been performed using the new credentials rotation endpoints yet. Using the deprecated [rotate-credentials](#tag/Credentials/operation/SkeService_GetClusterCredentials) endpoint will not update this status field.", ) __properties: ClassVar[List[str]] = ["lastCompletionTime", "lastInitiationTime", "phase"] diff --git a/services/ske/src/stackit/ske/models/cri.py b/services/ske/src/stackit/ske/models/cri.py index cb38abdc..174e71b3 100644 --- a/services/ske/src/stackit/ske/models/cri.py +++ b/services/ske/src/stackit/ske/models/cri.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CRI(BaseModel): """ CRI - """ + """ # noqa: E501 name: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["name"] diff --git a/services/ske/src/stackit/ske/models/dns.py b/services/ske/src/stackit/ske/models/dns.py index d069540a..3902f6d2 100644 --- a/services/ske/src/stackit/ske/models/dns.py +++ b/services/ske/src/stackit/ske/models/dns.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class DNS(BaseModel): """ DNS - """ + """ # noqa: E501 enabled: StrictBool = Field(description="Enables the dns extension.") zones: Optional[Annotated[List[Annotated[str, Field(strict=True)]], Field(max_length=20)]] = Field( diff --git a/services/ske/src/stackit/ske/models/extension.py b/services/ske/src/stackit/ske/models/extension.py index f7bed02b..c8c55afb 100644 --- a/services/ske/src/stackit/ske/models/extension.py +++ b/services/ske/src/stackit/ske/models/extension.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -21,19 +21,19 @@ from typing_extensions import Self from stackit.ske.models.acl import ACL -from stackit.ske.models.argus import Argus from stackit.ske.models.dns import DNS +from stackit.ske.models.observability import Observability class Extension(BaseModel): """ Extension - """ + """ # noqa: E501 acl: Optional[ACL] = None - argus: Optional[Argus] = None dns: Optional[DNS] = None - __properties: ClassVar[List[str]] = ["acl", "argus", "dns"] + observability: Optional[Observability] = None + __properties: ClassVar[List[str]] = ["acl", "dns", "observability"] model_config = ConfigDict( populate_by_name=True, @@ -75,12 +75,12 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of acl if self.acl: _dict["acl"] = self.acl.to_dict() - # override the default output from pydantic by calling `to_dict()` of argus - if self.argus: - _dict["argus"] = self.argus.to_dict() # override the default output from pydantic by calling `to_dict()` of dns if self.dns: _dict["dns"] = self.dns.to_dict() + # override the default output from pydantic by calling `to_dict()` of observability + if self.observability: + _dict["observability"] = self.observability.to_dict() return _dict @classmethod @@ -95,8 +95,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "acl": ACL.from_dict(obj["acl"]) if obj.get("acl") is not None else None, - "argus": Argus.from_dict(obj["argus"]) if obj.get("argus") is not None else None, "dns": DNS.from_dict(obj["dns"]) if obj.get("dns") is not None else None, + "observability": ( + Observability.from_dict(obj["observability"]) if obj.get("observability") is not None else None + ), } ) return _obj diff --git a/services/ske/src/stackit/ske/models/hibernation.py b/services/ske/src/stackit/ske/models/hibernation.py index 58078c70..79b03f4a 100644 --- a/services/ske/src/stackit/ske/models/hibernation.py +++ b/services/ske/src/stackit/ske/models/hibernation.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class Hibernation(BaseModel): """ Hibernation - """ + """ # noqa: E501 schedules: List[HibernationSchedule] __properties: ClassVar[List[str]] = ["schedules"] diff --git a/services/ske/src/stackit/ske/models/hibernation_schedule.py b/services/ske/src/stackit/ske/models/hibernation_schedule.py index 61634af8..b0ac8a54 100644 --- a/services/ske/src/stackit/ske/models/hibernation_schedule.py +++ b/services/ske/src/stackit/ske/models/hibernation_schedule.py @@ -5,17 +5,17 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class HibernationSchedule(BaseModel): """ HibernationSchedule - """ + """ # noqa: E501 end: Annotated[str, Field(strict=True)] start: Annotated[str, Field(strict=True)] diff --git a/services/ske/src/stackit/ske/models/image.py b/services/ske/src/stackit/ske/models/image.py index 9483ff85..900f297a 100644 --- a/services/ske/src/stackit/ske/models/image.py +++ b/services/ske/src/stackit/ske/models/image.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Image(BaseModel): """ For valid names and versions please take a look at [provider-options](#tag/ProviderOptions/operation/SkeService_GetProviderOptions) `machineImages`. - """ + """ # noqa: E501 name: StrictStr version: StrictStr diff --git a/services/ske/src/stackit/ske/models/kubeconfig.py b/services/ske/src/stackit/ske/models/kubeconfig.py index e4595746..e1bcc901 100644 --- a/services/ske/src/stackit/ske/models/kubeconfig.py +++ b/services/ske/src/stackit/ske/models/kubeconfig.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class Kubeconfig(BaseModel): """ Kubeconfig - """ + """ # noqa: E501 expiration_timestamp: Optional[datetime] = Field(default=None, alias="expirationTimestamp") kubeconfig: Optional[StrictStr] = None diff --git a/services/ske/src/stackit/ske/models/kubernetes.py b/services/ske/src/stackit/ske/models/kubernetes.py index 0f6ff58e..b905000c 100644 --- a/services/ske/src/stackit/ske/models/kubernetes.py +++ b/services/ske/src/stackit/ske/models/kubernetes.py @@ -5,35 +5,30 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator +from pydantic import BaseModel, ConfigDict, Field, field_validator from typing_extensions import Annotated, Self class Kubernetes(BaseModel): """ For valid versions please take a look at [provider-options](#tag/ProviderOptions/operation/SkeService_GetProviderOptions) `kubernetesVersions`. - """ + """ # noqa: E501 - allow_privileged_containers: Optional[StrictBool] = Field( - default=None, - description="DEPRECATED as of Kubernetes 1.25+ Flag to specify if privileged mode for containers is enabled or not. This should be used with care since it also disables a couple of other features like the use of some volume type (e.g. PVCs). By default this is set to true.", - alias="allowPrivilegedContainers", - ) version: Annotated[str, Field(strict=True)] - __properties: ClassVar[List[str]] = ["allowPrivilegedContainers", "version"] + __properties: ClassVar[List[str]] = ["version"] @field_validator("version") def version_validate_regular_expression(cls, value): @@ -90,7 +85,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"allowPrivilegedContainers": obj.get("allowPrivilegedContainers"), "version": obj.get("version")} - ) + _obj = cls.model_validate({"version": obj.get("version")}) return _obj diff --git a/services/ske/src/stackit/ske/models/kubernetes_version.py b/services/ske/src/stackit/ske/models/kubernetes_version.py index 516fdfe0..b5d506e7 100644 --- a/services/ske/src/stackit/ske/models/kubernetes_version.py +++ b/services/ske/src/stackit/ske/models/kubernetes_version.py @@ -5,17 +5,17 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from datetime import datetime from typing import Any, ClassVar, Dict, List, Optional, Set @@ -26,7 +26,7 @@ class KubernetesVersion(BaseModel): """ KubernetesVersion - """ + """ # noqa: E501 expiration_date: Optional[datetime] = Field(default=None, alias="expirationDate") feature_gates: Optional[Dict[str, StrictStr]] = Field(default=None, alias="featureGates") diff --git a/services/ske/src/stackit/ske/models/list_clusters_response.py b/services/ske/src/stackit/ske/models/list_clusters_response.py index 4061fa55..4e222e8a 100644 --- a/services/ske/src/stackit/ske/models/list_clusters_response.py +++ b/services/ske/src/stackit/ske/models/list_clusters_response.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListClustersResponse(BaseModel): """ ListClustersResponse - """ + """ # noqa: E501 items: Optional[List[Cluster]] = None __properties: ClassVar[List[str]] = ["items"] diff --git a/services/ske/src/stackit/ske/models/login_kubeconfig.py b/services/ske/src/stackit/ske/models/login_kubeconfig.py index 7573b413..1f69552e 100644 --- a/services/ske/src/stackit/ske/models/login_kubeconfig.py +++ b/services/ske/src/stackit/ske/models/login_kubeconfig.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class LoginKubeconfig(BaseModel): """ LoginKubeconfig - """ + """ # noqa: E501 kubeconfig: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["kubeconfig"] diff --git a/services/ske/src/stackit/ske/models/machine.py b/services/ske/src/stackit/ske/models/machine.py index 1dafce96..946bab74 100644 --- a/services/ske/src/stackit/ske/models/machine.py +++ b/services/ske/src/stackit/ske/models/machine.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class Machine(BaseModel): """ Machine - """ + """ # noqa: E501 image: Image type: StrictStr = Field( diff --git a/services/ske/src/stackit/ske/models/machine_image.py b/services/ske/src/stackit/ske/models/machine_image.py index c482241f..2793dddf 100644 --- a/services/ske/src/stackit/ske/models/machine_image.py +++ b/services/ske/src/stackit/ske/models/machine_image.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class MachineImage(BaseModel): """ MachineImage - """ + """ # noqa: E501 name: Optional[StrictStr] = None versions: Optional[List[MachineImageVersion]] = None diff --git a/services/ske/src/stackit/ske/models/machine_image_version.py b/services/ske/src/stackit/ske/models/machine_image_version.py index 641e8404..22939cbc 100644 --- a/services/ske/src/stackit/ske/models/machine_image_version.py +++ b/services/ske/src/stackit/ske/models/machine_image_version.py @@ -5,17 +5,17 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from datetime import datetime from typing import Any, ClassVar, Dict, List, Optional, Set @@ -28,7 +28,7 @@ class MachineImageVersion(BaseModel): """ MachineImageVersion - """ + """ # noqa: E501 cri: Optional[List[CRI]] = None expiration_date: Optional[datetime] = Field(default=None, alias="expirationDate") diff --git a/services/ske/src/stackit/ske/models/machine_type.py b/services/ske/src/stackit/ske/models/machine_type.py index ff2cc013..8e82508a 100644 --- a/services/ske/src/stackit/ske/models/machine_type.py +++ b/services/ske/src/stackit/ske/models/machine_type.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class MachineType(BaseModel): """ MachineType - """ + """ # noqa: E501 architecture: Optional[StrictStr] = None cpu: Optional[StrictInt] = None diff --git a/services/ske/src/stackit/ske/models/maintenance.py b/services/ske/src/stackit/ske/models/maintenance.py index b2bee629..2a3f5f61 100644 --- a/services/ske/src/stackit/ske/models/maintenance.py +++ b/services/ske/src/stackit/ske/models/maintenance.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class Maintenance(BaseModel): """ Maintenance - """ + """ # noqa: E501 auto_update: MaintenanceAutoUpdate = Field(alias="autoUpdate") time_window: TimeWindow = Field(alias="timeWindow") diff --git a/services/ske/src/stackit/ske/models/maintenance_auto_update.py b/services/ske/src/stackit/ske/models/maintenance_auto_update.py index bf3f9288..ffa803bf 100644 --- a/services/ske/src/stackit/ske/models/maintenance_auto_update.py +++ b/services/ske/src/stackit/ske/models/maintenance_auto_update.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class MaintenanceAutoUpdate(BaseModel): """ MaintenanceAutoUpdate - """ + """ # noqa: E501 kubernetes_version: Optional[StrictBool] = Field(default=None, alias="kubernetesVersion") machine_image_version: Optional[StrictBool] = Field(default=None, alias="machineImageVersion") diff --git a/services/ske/src/stackit/ske/models/network.py b/services/ske/src/stackit/ske/models/network.py index d3282c1a..4737457d 100644 --- a/services/ske/src/stackit/ske/models/network.py +++ b/services/ske/src/stackit/ske/models/network.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Network(BaseModel): """ Network - """ + """ # noqa: E501 id: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["id"] diff --git a/services/ske/src/stackit/ske/models/nodepool.py b/services/ske/src/stackit/ske/models/nodepool.py index 0bf62610..df8d62d3 100644 --- a/services/ske/src/stackit/ske/models/nodepool.py +++ b/services/ske/src/stackit/ske/models/nodepool.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class Nodepool(BaseModel): """ Nodepool - """ + """ # noqa: E501 allow_system_components: Optional[StrictBool] = Field( default=None, description="This needs to be true for at least one node pool.", alias="allowSystemComponents" diff --git a/services/ske/src/stackit/ske/models/argus.py b/services/ske/src/stackit/ske/models/observability.py similarity index 75% rename from services/ske/src/stackit/ske/models/argus.py rename to services/ske/src/stackit/ske/models/observability.py index ed7cbb35..9c28159d 100644 --- a/services/ske/src/stackit/ske/models/argus.py +++ b/services/ske/src/stackit/ske/models/observability.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -21,16 +21,16 @@ from typing_extensions import Self -class Argus(BaseModel): - """ - Argus +class Observability(BaseModel): """ + Observability + """ # noqa: E501 - argus_instance_id: StrictStr = Field( - description="Argus instance ID to choose which Argus instance is used.", alias="argusInstanceId" + enabled: StrictBool = Field(description="Enables the Observability extension.") + instance_id: StrictStr = Field( + description="Instance ID to choose which Observability instance is used.", alias="instanceId" ) - enabled: StrictBool = Field(description="Enables the argus extension.") - __properties: ClassVar[List[str]] = ["argusInstanceId", "enabled"] + __properties: ClassVar[List[str]] = ["enabled", "instanceId"] model_config = ConfigDict( populate_by_name=True, @@ -49,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Argus from a JSON string""" + """Create an instance of Observability from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,12 +73,12 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Argus from a dict""" + """Create an instance of Observability from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"argusInstanceId": obj.get("argusInstanceId"), "enabled": obj.get("enabled")}) + _obj = cls.model_validate({"enabled": obj.get("enabled"), "instanceId": obj.get("instanceId")}) return _obj diff --git a/services/ske/src/stackit/ske/models/provider_options.py b/services/ske/src/stackit/ske/models/provider_options.py index 3a6699d3..bf59ed95 100644 --- a/services/ske/src/stackit/ske/models/provider_options.py +++ b/services/ske/src/stackit/ske/models/provider_options.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -30,7 +30,7 @@ class ProviderOptions(BaseModel): """ ProviderOptions - """ + """ # noqa: E501 availability_zones: Optional[List[AvailabilityZone]] = Field(default=None, alias="availabilityZones") kubernetes_versions: Optional[List[KubernetesVersion]] = Field(default=None, alias="kubernetesVersions") diff --git a/services/ske/src/stackit/ske/models/runtime_error.py b/services/ske/src/stackit/ske/models/runtime_error.py index d05a6f96..b4fa5006 100644 --- a/services/ske/src/stackit/ske/models/runtime_error.py +++ b/services/ske/src/stackit/ske/models/runtime_error.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,11 +24,11 @@ class RuntimeError(BaseModel): """ RuntimeError - """ + """ # noqa: E501 code: Optional[StrictStr] = Field( default=None, - description='- Code: `SKE_UNSPECIFIED` Message: "An error occurred. Please open a support ticket if this error persists." - Code: `SKE_TMP_AUTH_ERROR` Message: "Authentication failed. This is a temporary error. Please wait while the system recovers." - Code: `SKE_QUOTA_EXCEEDED` Message: "Your project\'s resource quotas are exhausted. Please make sure your quota is sufficient for the ordered cluster." - Code: `SKE_ARGUS_INSTANCE_NOT_FOUND` Message: "The provided Argus instance could not be found." - Code: `SKE_RATE_LIMITS` Message: "While provisioning your cluster, request rate limits where incurred. Please wait while the system recovers." - Code: `SKE_INFRA_ERROR` Message: "An error occurred with the underlying infrastructure. Please open a support ticket if this error persists." - Code: `SKE_REMAINING_RESOURCES` Message: "There are remaining Kubernetes resources in your cluster that prevent deletion. Please make sure to remove them." - Code: `SKE_CONFIGURATION_PROBLEM` Message: "A configuration error occurred. Please open a support ticket if this error persists." - Code: `SKE_UNREADY_NODES` Message: "Not all worker nodes are ready. Please open a support ticket if this error persists." - Code: `SKE_API_SERVER_ERROR` Message: "The Kubernetes API server is not reporting readiness. Please open a support ticket if this error persists." - Code: `SKE_DNS_ZONE_NOT_FOUND` Message: "The provided DNS zone for the STACKIT DNS extension could not be found. Please ensure you defined a valid domain that belongs to a STACKIT DNS zone." ', + description='- Code: `SKE_UNSPECIFIED` Message: "An error occurred. Please open a support ticket if this error persists." - Code: `SKE_TMP_AUTH_ERROR` Message: "Authentication failed. This is a temporary error. Please wait while the system recovers." - Code: `SKE_QUOTA_EXCEEDED` Message: "Your project\'s resource quotas are exhausted. Please make sure your quota is sufficient for the ordered cluster." - Code: `SKE_OBSERVABILITY_INSTANCE_NOT_FOUND` Message: "The provided Observability instance could not be found." - Code: `SKE_RATE_LIMITS` Message: "While provisioning your cluster, request rate limits where incurred. Please wait while the system recovers." - Code: `SKE_INFRA_ERROR` Message: "An error occurred with the underlying infrastructure. Please open a support ticket if this error persists." - Code: `SKE_REMAINING_RESOURCES` Message: "There are remaining Kubernetes resources in your cluster that prevent deletion. Please make sure to remove them." - Code: `SKE_CONFIGURATION_PROBLEM` Message: "A configuration error occurred. Please open a support ticket if this error persists." - Code: `SKE_UNREADY_NODES` Message: "Not all worker nodes are ready. Please open a support ticket if this error persists." - Code: `SKE_API_SERVER_ERROR` Message: "The Kubernetes API server is not reporting readiness. Please open a support ticket if this error persists." - Code: `SKE_DNS_ZONE_NOT_FOUND` Message: "The provided DNS zone for the STACKIT DNS extension could not be found. Please ensure you defined a valid domain that belongs to a STACKIT DNS zone." ', ) details: Optional[StrictStr] = None message: Optional[StrictStr] = None @@ -45,7 +45,7 @@ def code_validate_enum(cls, value): "SKE_UNSPECIFIED", "SKE_TMP_AUTH_ERROR", "SKE_QUOTA_EXCEEDED", - "SKE_ARGUS_INSTANCE_NOT_FOUND", + "SKE_OBSERVABILITY_INSTANCE_NOT_FOUND", "SKE_RATE_LIMITS", "SKE_INFRA_ERROR", "SKE_REMAINING_RESOURCES", @@ -56,7 +56,7 @@ def code_validate_enum(cls, value): ] ): raise ValueError( - "must be one of enum values ('SKE_UNSPECIFIED', 'SKE_TMP_AUTH_ERROR', 'SKE_QUOTA_EXCEEDED', 'SKE_ARGUS_INSTANCE_NOT_FOUND', 'SKE_RATE_LIMITS', 'SKE_INFRA_ERROR', 'SKE_REMAINING_RESOURCES', 'SKE_CONFIGURATION_PROBLEM', 'SKE_UNREADY_NODES', 'SKE_API_SERVER_ERROR', 'SKE_DNS_ZONE_NOT_FOUND')" + "must be one of enum values ('SKE_UNSPECIFIED', 'SKE_TMP_AUTH_ERROR', 'SKE_QUOTA_EXCEEDED', 'SKE_OBSERVABILITY_INSTANCE_NOT_FOUND', 'SKE_RATE_LIMITS', 'SKE_INFRA_ERROR', 'SKE_REMAINING_RESOURCES', 'SKE_CONFIGURATION_PROBLEM', 'SKE_UNREADY_NODES', 'SKE_API_SERVER_ERROR', 'SKE_DNS_ZONE_NOT_FOUND')" ) return value diff --git a/services/ske/src/stackit/ske/models/taint.py b/services/ske/src/stackit/ske/models/taint.py index b4d7be73..d9e5852b 100644 --- a/services/ske/src/stackit/ske/models/taint.py +++ b/services/ske/src/stackit/ske/models/taint.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Taint(BaseModel): """ Taint - """ + """ # noqa: E501 effect: StrictStr key: StrictStr diff --git a/services/ske/src/stackit/ske/models/time_window.py b/services/ske/src/stackit/ske/models/time_window.py index 0bbdbe72..47e6964d 100644 --- a/services/ske/src/stackit/ske/models/time_window.py +++ b/services/ske/src/stackit/ske/models/time_window.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class TimeWindow(BaseModel): """ TimeWindow - """ + """ # noqa: E501 end: datetime start: datetime diff --git a/services/ske/src/stackit/ske/models/volume.py b/services/ske/src/stackit/ske/models/volume.py index e27c288e..55472491 100644 --- a/services/ske/src/stackit/ske/models/volume.py +++ b/services/ske/src/stackit/ske/models/volume.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Volume(BaseModel): """ Volume - """ + """ # noqa: E501 size: Annotated[int, Field(le=10240, strict=True, ge=20)] type: Optional[StrictStr] = Field( diff --git a/services/ske/src/stackit/ske/models/volume_type.py b/services/ske/src/stackit/ske/models/volume_type.py index 0d70b8dd..9e37df52 100644 --- a/services/ske/src/stackit/ske/models/volume_type.py +++ b/services/ske/src/stackit/ske/models/volume_type.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class VolumeType(BaseModel): """ VolumeType - """ + """ # noqa: E501 name: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["name"] diff --git a/services/ske/src/stackit/ske/rest.py b/services/ske/src/stackit/ske/rest.py index 1e2fe8e1..3f6e1fde 100644 --- a/services/ske/src/stackit/ske/rest.py +++ b/services/ske/src/stackit/ske/rest.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -124,7 +124,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/sqlserverflex/CHANGELOG.md b/services/sqlserverflex/CHANGELOG.md index f029a0e6..8ff6b2ed 100644 --- a/services/sqlserverflex/CHANGELOG.md +++ b/services/sqlserverflex/CHANGELOG.md @@ -1,3 +1,5 @@ +## v1.0.3 + ## v1.0.2 (2025-05-14) - **Feature:** Add new method `list_metrics` diff --git a/services/sqlserverflex/pyproject.toml b/services/sqlserverflex/pyproject.toml index e9cf204f..44cac000 100644 --- a/services/sqlserverflex/pyproject.toml +++ b/services/sqlserverflex/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-sqlserverflex" [tool.poetry] name = "stackit-sqlserverflex" -version = "v1.0.2" +version = "v1.0.3" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/__init__.py b/services/sqlserverflex/src/stackit/sqlserverflex/__init__.py index c088aac1..bf9bb1e1 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/__init__.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/__init__.py @@ -12,100 +12,229 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "ACL", + "Backup", + "BackupListBackupsResponseGrouped", + "CreateDatabasePayload", + "CreateDatabaseResponse", + "CreateInstancePayload", + "CreateInstanceResponse", + "CreateUserPayload", + "CreateUserResponse", + "DataPoint", + "Database", + "DatabaseDocumentationCreateDatabaseRequestOptions", + "DatabaseOptions", + "Flavor", + "GetBackupResponse", + "GetDatabaseResponse", + "GetInstanceResponse", + "GetUserResponse", + "Host", + "HostMetric", + "Instance", + "InstanceDocumentationACL", + "InstanceDocumentationOptions", + "InstanceDocumentationStorage", + "InstanceError", + "InstanceFlavorEntry", + "InstanceListInstance", + "InstanceListUser", + "ListBackupsResponse", + "ListCollationsResponse", + "ListCompatibilityResponse", + "ListDatabasesResponse", + "ListFlavorsResponse", + "ListInstancesResponse", + "ListMetricsResponse", + "ListRestoreJobsResponse", + "ListRolesResponse", + "ListStoragesResponse", + "ListUsersResponse", + "ListVersionsResponse", + "MssqlDatabaseCollation", + "MssqlDatabaseCompatibility", + "PartialUpdateInstancePayload", + "ResetUserResponse", + "RestoreRunningRestore", + "SingleDatabase", + "SingleUser", + "Storage", + "StorageRange", + "TriggerDatabaseRestorePayload", + "Type", + "UpdateInstancePayload", + "UpdateInstanceResponse", + "User", + "UserResponseUser", +] + # import apis into sdk package -from stackit.sqlserverflex.api.default_api import DefaultApi -from stackit.sqlserverflex.api_client import ApiClient +from stackit.sqlserverflex.api.default_api import DefaultApi as DefaultApi +from stackit.sqlserverflex.api_client import ApiClient as ApiClient # import ApiClient -from stackit.sqlserverflex.api_response import ApiResponse -from stackit.sqlserverflex.configuration import HostConfiguration -from stackit.sqlserverflex.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.sqlserverflex.api_response import ApiResponse as ApiResponse +from stackit.sqlserverflex.configuration import HostConfiguration as HostConfiguration +from stackit.sqlserverflex.exceptions import ApiAttributeError as ApiAttributeError +from stackit.sqlserverflex.exceptions import ApiException as ApiException +from stackit.sqlserverflex.exceptions import ApiKeyError as ApiKeyError +from stackit.sqlserverflex.exceptions import ApiTypeError as ApiTypeError +from stackit.sqlserverflex.exceptions import ApiValueError as ApiValueError +from stackit.sqlserverflex.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.sqlserverflex.models.acl import ACL -from stackit.sqlserverflex.models.backup import Backup +from stackit.sqlserverflex.models.acl import ACL as ACL +from stackit.sqlserverflex.models.backup import Backup as Backup from stackit.sqlserverflex.models.backup_list_backups_response_grouped import ( - BackupListBackupsResponseGrouped, -) -from stackit.sqlserverflex.models.create_database_payload import CreateDatabasePayload -from stackit.sqlserverflex.models.create_database_response import CreateDatabaseResponse -from stackit.sqlserverflex.models.create_instance_payload import CreateInstancePayload -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 + BackupListBackupsResponseGrouped as BackupListBackupsResponseGrouped, +) +from stackit.sqlserverflex.models.create_database_payload import ( + CreateDatabasePayload as CreateDatabasePayload, +) +from stackit.sqlserverflex.models.create_database_response import ( + CreateDatabaseResponse as CreateDatabaseResponse, +) +from stackit.sqlserverflex.models.create_instance_payload import ( + CreateInstancePayload as CreateInstancePayload, +) +from stackit.sqlserverflex.models.create_instance_response import ( + CreateInstanceResponse as CreateInstanceResponse, +) +from stackit.sqlserverflex.models.create_user_payload import ( + CreateUserPayload as CreateUserPayload, +) +from stackit.sqlserverflex.models.create_user_response import ( + CreateUserResponse as CreateUserResponse, +) +from stackit.sqlserverflex.models.data_point import DataPoint as DataPoint +from stackit.sqlserverflex.models.database import Database as Database from stackit.sqlserverflex.models.database_documentation_create_database_request_options import ( - DatabaseDocumentationCreateDatabaseRequestOptions, -) -from stackit.sqlserverflex.models.database_options import DatabaseOptions -from stackit.sqlserverflex.models.flavor import Flavor -from stackit.sqlserverflex.models.get_backup_response import GetBackupResponse -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 + DatabaseDocumentationCreateDatabaseRequestOptions as DatabaseDocumentationCreateDatabaseRequestOptions, +) +from stackit.sqlserverflex.models.database_options import ( + DatabaseOptions as DatabaseOptions, +) +from stackit.sqlserverflex.models.flavor import Flavor as Flavor +from stackit.sqlserverflex.models.get_backup_response import ( + GetBackupResponse as GetBackupResponse, +) +from stackit.sqlserverflex.models.get_database_response import ( + GetDatabaseResponse as GetDatabaseResponse, +) +from stackit.sqlserverflex.models.get_instance_response import ( + GetInstanceResponse as GetInstanceResponse, +) +from stackit.sqlserverflex.models.get_user_response import ( + GetUserResponse as GetUserResponse, +) +from stackit.sqlserverflex.models.host import Host as Host +from stackit.sqlserverflex.models.host_metric import HostMetric as HostMetric +from stackit.sqlserverflex.models.instance import Instance as Instance from stackit.sqlserverflex.models.instance_documentation_acl import ( - InstanceDocumentationACL, + InstanceDocumentationACL as InstanceDocumentationACL, ) from stackit.sqlserverflex.models.instance_documentation_options import ( - InstanceDocumentationOptions, + InstanceDocumentationOptions as InstanceDocumentationOptions, ) from stackit.sqlserverflex.models.instance_documentation_storage import ( - InstanceDocumentationStorage, -) -from stackit.sqlserverflex.models.instance_error import InstanceError -from stackit.sqlserverflex.models.instance_flavor_entry import InstanceFlavorEntry -from stackit.sqlserverflex.models.instance_list_instance import InstanceListInstance -from stackit.sqlserverflex.models.instance_list_user import InstanceListUser -from stackit.sqlserverflex.models.list_backups_response import ListBackupsResponse -from stackit.sqlserverflex.models.list_collations_response import ListCollationsResponse + InstanceDocumentationStorage as InstanceDocumentationStorage, +) +from stackit.sqlserverflex.models.instance_error import InstanceError as InstanceError +from stackit.sqlserverflex.models.instance_flavor_entry import ( + InstanceFlavorEntry as InstanceFlavorEntry, +) +from stackit.sqlserverflex.models.instance_list_instance import ( + InstanceListInstance as InstanceListInstance, +) +from stackit.sqlserverflex.models.instance_list_user import ( + InstanceListUser as InstanceListUser, +) +from stackit.sqlserverflex.models.list_backups_response import ( + ListBackupsResponse as ListBackupsResponse, +) +from stackit.sqlserverflex.models.list_collations_response import ( + ListCollationsResponse as ListCollationsResponse, +) from stackit.sqlserverflex.models.list_compatibility_response import ( - ListCompatibilityResponse, + ListCompatibilityResponse as ListCompatibilityResponse, +) +from stackit.sqlserverflex.models.list_databases_response import ( + ListDatabasesResponse as ListDatabasesResponse, +) +from stackit.sqlserverflex.models.list_flavors_response import ( + ListFlavorsResponse as ListFlavorsResponse, +) +from stackit.sqlserverflex.models.list_instances_response import ( + ListInstancesResponse as ListInstancesResponse, +) +from stackit.sqlserverflex.models.list_metrics_response import ( + ListMetricsResponse as ListMetricsResponse, ) -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, + ListRestoreJobsResponse as ListRestoreJobsResponse, +) +from stackit.sqlserverflex.models.list_roles_response import ( + ListRolesResponse as ListRolesResponse, +) +from stackit.sqlserverflex.models.list_storages_response import ( + ListStoragesResponse as ListStoragesResponse, +) +from stackit.sqlserverflex.models.list_users_response import ( + ListUsersResponse as ListUsersResponse, +) +from stackit.sqlserverflex.models.list_versions_response import ( + ListVersionsResponse as ListVersionsResponse, +) +from stackit.sqlserverflex.models.mssql_database_collation import ( + MssqlDatabaseCollation as MssqlDatabaseCollation, ) -from stackit.sqlserverflex.models.list_roles_response import ListRolesResponse -from stackit.sqlserverflex.models.list_storages_response import ListStoragesResponse -from stackit.sqlserverflex.models.list_users_response import ListUsersResponse -from stackit.sqlserverflex.models.list_versions_response import ListVersionsResponse -from stackit.sqlserverflex.models.mssql_database_collation import MssqlDatabaseCollation from stackit.sqlserverflex.models.mssql_database_compatibility import ( - MssqlDatabaseCompatibility, + MssqlDatabaseCompatibility as MssqlDatabaseCompatibility, ) from stackit.sqlserverflex.models.partial_update_instance_payload import ( - PartialUpdateInstancePayload, -) -from stackit.sqlserverflex.models.reset_user_response import ResetUserResponse -from stackit.sqlserverflex.models.restore_running_restore import RestoreRunningRestore -from stackit.sqlserverflex.models.single_database import SingleDatabase -from stackit.sqlserverflex.models.single_user import SingleUser -from stackit.sqlserverflex.models.storage import Storage -from stackit.sqlserverflex.models.storage_range import StorageRange + PartialUpdateInstancePayload as PartialUpdateInstancePayload, +) +from stackit.sqlserverflex.models.reset_user_response import ( + ResetUserResponse as ResetUserResponse, +) +from stackit.sqlserverflex.models.restore_running_restore import ( + RestoreRunningRestore as RestoreRunningRestore, +) +from stackit.sqlserverflex.models.single_database import ( + SingleDatabase as SingleDatabase, +) +from stackit.sqlserverflex.models.single_user import SingleUser as SingleUser +from stackit.sqlserverflex.models.storage import Storage as Storage +from stackit.sqlserverflex.models.storage_range import StorageRange as StorageRange from stackit.sqlserverflex.models.trigger_database_restore_payload import ( - TriggerDatabaseRestorePayload, + TriggerDatabaseRestorePayload as TriggerDatabaseRestorePayload, +) +from stackit.sqlserverflex.models.type import Type as Type +from stackit.sqlserverflex.models.update_instance_payload import ( + UpdateInstancePayload as UpdateInstancePayload, +) +from stackit.sqlserverflex.models.update_instance_response import ( + UpdateInstanceResponse as UpdateInstanceResponse, +) +from stackit.sqlserverflex.models.user import User as User +from stackit.sqlserverflex.models.user_response_user import ( + UserResponseUser as UserResponseUser, ) -from stackit.sqlserverflex.models.type import Type -from stackit.sqlserverflex.models.update_instance_payload import UpdateInstancePayload -from stackit.sqlserverflex.models.update_instance_response import UpdateInstanceResponse -from stackit.sqlserverflex.models.user import User -from stackit.sqlserverflex.models.user_response_user import UserResponseUser diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/api/default_api.py b/services/sqlserverflex/src/stackit/sqlserverflex/api/default_api.py index ff7df605..5e4ba6f8 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/api/default_api.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/api/default_api.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -126,7 +126,7 @@ def create_database( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_database_serialize( project_id=project_id, @@ -202,7 +202,7 @@ def create_database_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_database_serialize( project_id=project_id, @@ -278,7 +278,7 @@ def create_database_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_database_serialize( project_id=project_id, @@ -321,7 +321,7 @@ def _create_database_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -414,7 +414,7 @@ def create_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -486,7 +486,7 @@ def create_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -558,7 +558,7 @@ def create_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_instance_serialize( project_id=project_id, @@ -599,7 +599,7 @@ def _create_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -698,7 +698,7 @@ def create_user( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_user_serialize( project_id=project_id, @@ -779,7 +779,7 @@ def create_user_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_user_serialize( project_id=project_id, @@ -860,7 +860,7 @@ def create_user_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_user_serialize( project_id=project_id, @@ -903,7 +903,7 @@ def _create_user_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -999,7 +999,7 @@ def delete_database( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_database_serialize( project_id=project_id, @@ -1075,7 +1075,7 @@ def delete_database_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_database_serialize( project_id=project_id, @@ -1151,7 +1151,7 @@ def delete_database_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_database_serialize( project_id=project_id, @@ -1194,7 +1194,7 @@ def _delete_database_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1279,7 +1279,7 @@ def delete_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1351,7 +1351,7 @@ def delete_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1423,7 +1423,7 @@ def delete_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_instance_serialize( project_id=project_id, @@ -1464,7 +1464,7 @@ def _delete_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1550,7 +1550,7 @@ def delete_user( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_user_serialize( project_id=project_id, @@ -1626,7 +1626,7 @@ def delete_user_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_user_serialize( project_id=project_id, @@ -1702,7 +1702,7 @@ def delete_user_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_user_serialize( project_id=project_id, @@ -1745,7 +1745,7 @@ def _delete_user_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1833,7 +1833,7 @@ def get_backup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_backup_serialize( project_id=project_id, @@ -1909,7 +1909,7 @@ def get_backup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_backup_serialize( project_id=project_id, @@ -1985,7 +1985,7 @@ def get_backup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_backup_serialize( project_id=project_id, @@ -2028,7 +2028,7 @@ def _get_backup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2116,7 +2116,7 @@ def get_database( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_database_serialize( project_id=project_id, @@ -2192,7 +2192,7 @@ def get_database_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_database_serialize( project_id=project_id, @@ -2268,7 +2268,7 @@ def get_database_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_database_serialize( project_id=project_id, @@ -2311,7 +2311,7 @@ def _get_database_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2396,7 +2396,7 @@ def get_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -2468,7 +2468,7 @@ def get_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -2540,7 +2540,7 @@ def get_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_instance_serialize( project_id=project_id, @@ -2581,7 +2581,7 @@ def _get_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2667,7 +2667,7 @@ def get_user( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_user_serialize( project_id=project_id, @@ -2744,7 +2744,7 @@ def get_user_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_user_serialize( project_id=project_id, @@ -2821,7 +2821,7 @@ def get_user_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_user_serialize( project_id=project_id, @@ -2865,7 +2865,7 @@ def _get_user_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2950,7 +2950,7 @@ def list_backups( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( project_id=project_id, @@ -3022,7 +3022,7 @@ def list_backups_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( project_id=project_id, @@ -3094,7 +3094,7 @@ def list_backups_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_backups_serialize( project_id=project_id, @@ -3135,7 +3135,7 @@ def _list_backups_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3218,7 +3218,7 @@ def list_collations( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_collations_serialize( project_id=project_id, @@ -3290,7 +3290,7 @@ def list_collations_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_collations_serialize( project_id=project_id, @@ -3362,7 +3362,7 @@ def list_collations_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_collations_serialize( project_id=project_id, @@ -3403,7 +3403,7 @@ def _list_collations_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3486,7 +3486,7 @@ def list_compatibility( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_compatibility_serialize( project_id=project_id, @@ -3558,7 +3558,7 @@ def list_compatibility_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_compatibility_serialize( project_id=project_id, @@ -3630,7 +3630,7 @@ def list_compatibility_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_compatibility_serialize( project_id=project_id, @@ -3671,7 +3671,7 @@ def _list_compatibility_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3754,7 +3754,7 @@ def list_databases( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_databases_serialize( project_id=project_id, @@ -3826,7 +3826,7 @@ def list_databases_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_databases_serialize( project_id=project_id, @@ -3898,7 +3898,7 @@ def list_databases_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_databases_serialize( project_id=project_id, @@ -3939,7 +3939,7 @@ def _list_databases_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4019,7 +4019,7 @@ def list_flavors( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_flavors_serialize( project_id=project_id, @@ -4087,7 +4087,7 @@ def list_flavors_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_flavors_serialize( project_id=project_id, @@ -4155,7 +4155,7 @@ def list_flavors_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_flavors_serialize( project_id=project_id, @@ -4194,7 +4194,7 @@ def _list_flavors_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4272,7 +4272,7 @@ def list_instances( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -4340,7 +4340,7 @@ def list_instances_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -4408,7 +4408,7 @@ def list_instances_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_instances_serialize( project_id=project_id, @@ -4447,7 +4447,7 @@ def _list_instances_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4560,7 +4560,7 @@ def list_metrics( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_metrics_serialize( project_id=project_id, @@ -4667,7 +4667,7 @@ def list_metrics_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_metrics_serialize( project_id=project_id, @@ -4774,7 +4774,7 @@ def list_metrics_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_metrics_serialize( project_id=project_id, @@ -4822,7 +4822,7 @@ def _list_metrics_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4921,7 +4921,7 @@ def list_restore_jobs( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_restore_jobs_serialize( project_id=project_id, @@ -4993,7 +4993,7 @@ def list_restore_jobs_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_restore_jobs_serialize( project_id=project_id, @@ -5065,7 +5065,7 @@ def list_restore_jobs_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_restore_jobs_serialize( project_id=project_id, @@ -5106,7 +5106,7 @@ def _list_restore_jobs_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5189,7 +5189,7 @@ def list_roles( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_roles_serialize( project_id=project_id, @@ -5261,7 +5261,7 @@ def list_roles_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_roles_serialize( project_id=project_id, @@ -5333,7 +5333,7 @@ def list_roles_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_roles_serialize( project_id=project_id, @@ -5374,7 +5374,7 @@ def _list_roles_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5457,7 +5457,7 @@ def list_storages( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_storages_serialize( project_id=project_id, @@ -5529,7 +5529,7 @@ def list_storages_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_storages_serialize( project_id=project_id, @@ -5601,7 +5601,7 @@ def list_storages_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_storages_serialize( project_id=project_id, @@ -5642,7 +5642,7 @@ def _list_storages_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5725,7 +5725,7 @@ def list_users( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_users_serialize( project_id=project_id, @@ -5797,7 +5797,7 @@ def list_users_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_users_serialize( project_id=project_id, @@ -5869,7 +5869,7 @@ def list_users_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_users_serialize( project_id=project_id, @@ -5910,7 +5910,7 @@ def _list_users_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5993,7 +5993,7 @@ def list_versions( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_versions_serialize( project_id=project_id, @@ -6065,7 +6065,7 @@ def list_versions_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_versions_serialize( project_id=project_id, @@ -6137,7 +6137,7 @@ def list_versions_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_versions_serialize( project_id=project_id, @@ -6178,7 +6178,7 @@ def _list_versions_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -6266,7 +6266,7 @@ def partial_update_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_instance_serialize( project_id=project_id, @@ -6342,7 +6342,7 @@ def partial_update_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_instance_serialize( project_id=project_id, @@ -6418,7 +6418,7 @@ def partial_update_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._partial_update_instance_serialize( project_id=project_id, @@ -6461,7 +6461,7 @@ def _partial_update_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -6557,7 +6557,7 @@ def reset_user( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._reset_user_serialize( project_id=project_id, @@ -6634,7 +6634,7 @@ def reset_user_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._reset_user_serialize( project_id=project_id, @@ -6711,7 +6711,7 @@ def reset_user_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._reset_user_serialize( project_id=project_id, @@ -6755,7 +6755,7 @@ def _reset_user_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -6837,7 +6837,7 @@ def terminate_project( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._terminate_project_serialize( project_id=project_id, @@ -6905,7 +6905,7 @@ def terminate_project_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._terminate_project_serialize( project_id=project_id, @@ -6973,7 +6973,7 @@ def terminate_project_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._terminate_project_serialize( project_id=project_id, @@ -7012,7 +7012,7 @@ def _terminate_project_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -7096,7 +7096,7 @@ def trigger_database_backup( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_database_backup_serialize( project_id=project_id, @@ -7173,7 +7173,7 @@ def trigger_database_backup_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_database_backup_serialize( project_id=project_id, @@ -7250,7 +7250,7 @@ def trigger_database_backup_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_database_backup_serialize( project_id=project_id, @@ -7294,7 +7294,7 @@ def _trigger_database_backup_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -7385,7 +7385,7 @@ def trigger_database_restore( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_database_restore_serialize( project_id=project_id, @@ -7466,7 +7466,7 @@ def trigger_database_restore_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_database_restore_serialize( project_id=project_id, @@ -7547,7 +7547,7 @@ def trigger_database_restore_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_database_restore_serialize( project_id=project_id, @@ -7593,7 +7593,7 @@ def _trigger_database_restore_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -7691,7 +7691,7 @@ def update_instance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_instance_serialize( project_id=project_id, @@ -7767,7 +7767,7 @@ def update_instance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_instance_serialize( project_id=project_id, @@ -7843,7 +7843,7 @@ def update_instance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._update_instance_serialize( project_id=project_id, @@ -7886,7 +7886,7 @@ def _update_instance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/api_client.py b/services/sqlserverflex/src/stackit/sqlserverflex/api_client.py index 2ac52ecd..2d129c4d 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/api_client.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/api_client.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -332,6 +332,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -351,12 +355,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -458,7 +462,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -474,7 +478,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -489,6 +496,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/configuration.py b/services/sqlserverflex/src/stackit/sqlserverflex/configuration.py index 25046cae..47d92ce2 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/configuration.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT MSSQL Service API @@ -15,7 +10,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -54,7 +71,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -72,7 +89,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -112,7 +134,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -131,12 +153,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/exceptions.py b/services/sqlserverflex/src/stackit/sqlserverflex/exceptions.py index b57dc75e..ed802f3b 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/exceptions.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/exceptions.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -152,6 +152,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -188,6 +195,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/__init__.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/__init__.py index 49e15790..94eafc84 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/__init__.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/__init__.py @@ -11,7 +11,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/acl.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/acl.py index 11120df8..23312605 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/acl.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/acl.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ACL(BaseModel): """ ACL - """ + """ # noqa: E501 items: Optional[List[StrictStr]] = None __properties: ClassVar[List[str]] = ["items"] diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/backup.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/backup.py index 5284e73e..6f912aec 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/backup.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/backup.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class Backup(BaseModel): """ Backup - """ + """ # noqa: E501 end_time: Optional[StrictStr] = Field(default=None, alias="endTime") error: Optional[StrictStr] = None diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/backup_list_backups_response_grouped.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/backup_list_backups_response_grouped.py index 8352b4e6..bdc3bcbb 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/backup_list_backups_response_grouped.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/backup_list_backups_response_grouped.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class BackupListBackupsResponseGrouped(BaseModel): """ BackupListBackupsResponseGrouped - """ + """ # noqa: E501 backups: Optional[List[Backup]] = None name: Optional[StrictStr] = None diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/create_database_payload.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/create_database_payload.py index 9b39e27c..884ab96d 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/create_database_payload.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/create_database_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class CreateDatabasePayload(BaseModel): """ CreateDatabasePayload - """ + """ # noqa: E501 name: StrictStr options: DatabaseDocumentationCreateDatabaseRequestOptions diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/create_database_response.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/create_database_response.py index a7219940..16a58ece 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/create_database_response.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/create_database_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateDatabaseResponse(BaseModel): """ CreateDatabaseResponse - """ + """ # noqa: E501 id: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["id"] diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/create_instance_payload.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/create_instance_payload.py index 1764ea26..cd4de47a 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/create_instance_payload.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/create_instance_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -35,7 +35,7 @@ class CreateInstancePayload(BaseModel): """ CreateInstancePayload - """ + """ # noqa: E501 acl: Optional[InstanceDocumentationACL] = Field( default=None, diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/create_instance_response.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/create_instance_response.py index a994c5e1..1fb60f01 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/create_instance_response.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/create_instance_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateInstanceResponse(BaseModel): """ CreateInstanceResponse - """ + """ # noqa: E501 id: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["id"] diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/create_user_payload.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/create_user_payload.py index caf29c06..dfa7bb9b 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/create_user_payload.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/create_user_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateUserPayload(BaseModel): """ CreateUserPayload - """ + """ # noqa: E501 default_database: Optional[StrictStr] = None roles: List[StrictStr] diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/create_user_response.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/create_user_response.py index a9000845..b52d2287 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/create_user_response.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/create_user_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class CreateUserResponse(BaseModel): """ CreateUserResponse - """ + """ # noqa: E501 item: Optional[SingleUser] = None __properties: ClassVar[List[str]] = ["item"] diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/data_point.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/data_point.py index a3900542..a40843a2 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/data_point.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/data_point.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class DataPoint(BaseModel): """ DataPoint - """ + """ # noqa: E501 timestamp: Optional[StrictStr] = None value: Optional[Union[StrictFloat, StrictInt]] = None diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/database.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/database.py index 395ab76d..ef580dac 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/database.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/database.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class Database(BaseModel): """ Database - """ + """ # noqa: E501 id: Optional[StrictStr] = None name: Optional[StrictStr] = None diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/database_documentation_create_database_request_options.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/database_documentation_create_database_request_options.py index c69322c0..79e3ca3d 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/database_documentation_create_database_request_options.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/database_documentation_create_database_request_options.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class DatabaseDocumentationCreateDatabaseRequestOptions(BaseModel): """ DatabaseDocumentationCreateDatabaseRequestOptions - """ + """ # noqa: E501 collation: Optional[StrictStr] = Field(default=None, description="Collation of the database") compatibility_level: Optional[StrictStr] = Field( diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/database_options.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/database_options.py index 40c825df..9a18857b 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/database_options.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/database_options.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class DatabaseOptions(BaseModel): """ DatabaseOptions - """ + """ # noqa: E501 collation_name: Optional[StrictStr] = Field( default=None, description="Name of the collation of the database", alias="collationName" diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/flavor.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/flavor.py index 97321d31..dbe47ca3 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/flavor.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/flavor.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class Flavor(BaseModel): """ Flavor - """ + """ # noqa: E501 cpu: Optional[StrictInt] = None description: Optional[StrictStr] = None diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/get_backup_response.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/get_backup_response.py index a2cf2ae1..5f0ec42e 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/get_backup_response.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/get_backup_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class GetBackupResponse(BaseModel): """ GetBackupResponse - """ + """ # noqa: E501 end_time: Optional[StrictStr] = Field( default=None, description="Backup end time represents local server time", alias="endTime" diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/get_database_response.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/get_database_response.py index 924e23d7..9e51ccdc 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/get_database_response.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/get_database_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class GetDatabaseResponse(BaseModel): """ GetDatabaseResponse - """ + """ # noqa: E501 database: Optional[SingleDatabase] = None __properties: ClassVar[List[str]] = ["database"] diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/get_instance_response.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/get_instance_response.py index 14279133..5669108c 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/get_instance_response.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/get_instance_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class GetInstanceResponse(BaseModel): """ GetInstanceResponse - """ + """ # noqa: E501 item: Optional[Instance] = None __properties: ClassVar[List[str]] = ["item"] diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/get_user_response.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/get_user_response.py index f3199652..37131613 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/get_user_response.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/get_user_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class GetUserResponse(BaseModel): """ GetUserResponse - """ + """ # noqa: E501 item: Optional[UserResponseUser] = None __properties: ClassVar[List[str]] = ["item"] diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/host.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/host.py index 981fb1ef..68452336 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/host.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/host.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class Host(BaseModel): """ Host - """ + """ # noqa: E501 host_metrics: Optional[List[HostMetric]] = Field(default=None, alias="hostMetrics") id: Optional[StrictStr] = None diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/host_metric.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/host_metric.py index b0678d9c..11b3801b 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/host_metric.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/host_metric.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class HostMetric(BaseModel): """ HostMetric - """ + """ # noqa: E501 datapoints: Optional[List[DataPoint]] = None name: Optional[StrictStr] = None diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/instance.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/instance.py index ac5c645e..b235a4e1 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/instance.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/instance.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class Instance(BaseModel): """ Instance - """ + """ # noqa: E501 acl: Optional[ACL] = None backup_schedule: Optional[StrictStr] = Field(default=None, alias="backupSchedule") diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_documentation_acl.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_documentation_acl.py index eed3d4b9..80c35137 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_documentation_acl.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_documentation_acl.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class InstanceDocumentationACL(BaseModel): """ InstanceDocumentationACL - """ + """ # noqa: E501 items: Optional[List[StrictStr]] = Field(default=None, description="a simple list with IP addresses with CIDR.") __properties: ClassVar[List[str]] = ["items"] diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_documentation_options.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_documentation_options.py index 0b5d24ea..aa1bdacf 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_documentation_options.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_documentation_options.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class InstanceDocumentationOptions(BaseModel): """ InstanceDocumentationOptions - """ + """ # noqa: E501 edition: Optional[StrictStr] = Field(default="developer", description="Edition of the MSSQL server instance") retention_days: Optional[StrictStr] = Field( diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_documentation_storage.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_documentation_storage.py index bfa0dd8a..1429b09f 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_documentation_storage.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_documentation_storage.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class InstanceDocumentationStorage(BaseModel): """ InstanceDocumentationStorage - """ + """ # noqa: E501 var_class: Optional[StrictStr] = Field( default="premium-perf12-stackit", description="Class of the instance.", alias="class" diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_error.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_error.py index 4a864016..c1731540 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_error.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_error.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class InstanceError(BaseModel): """ InstanceError - """ + """ # noqa: E501 code: Optional[StrictInt] = None fields: Optional[Dict[str, List[StrictStr]]] = None diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_flavor_entry.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_flavor_entry.py index f6353604..191cfd2c 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_flavor_entry.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_flavor_entry.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class InstanceFlavorEntry(BaseModel): """ InstanceFlavorEntry - """ + """ # noqa: E501 categories: Optional[StrictStr] = None cpu: Optional[StrictInt] = None diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_list_instance.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_list_instance.py index 2cfd6a34..9b7e11b7 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_list_instance.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_list_instance.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class InstanceListInstance(BaseModel): """ InstanceListInstance - """ + """ # noqa: E501 id: Optional[StrictStr] = None name: Optional[StrictStr] = None diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_list_user.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_list_user.py index bcba5097..8a396207 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_list_user.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/instance_list_user.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class InstanceListUser(BaseModel): """ InstanceListUser - """ + """ # noqa: E501 id: Optional[StrictStr] = None username: Optional[StrictStr] = None diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_backups_response.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_backups_response.py index 68774176..18d64b15 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_backups_response.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_backups_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class ListBackupsResponse(BaseModel): """ ListBackupsResponse - """ + """ # noqa: E501 databases: Optional[List[BackupListBackupsResponseGrouped]] = None __properties: ClassVar[List[str]] = ["databases"] diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_collations_response.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_collations_response.py index 3f509e38..128220bc 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_collations_response.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_collations_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListCollationsResponse(BaseModel): """ ListCollationsResponse - """ + """ # noqa: E501 collations: Optional[List[MssqlDatabaseCollation]] = None __properties: ClassVar[List[str]] = ["collations"] diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_compatibility_response.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_compatibility_response.py index 71caeae0..c8d7c887 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_compatibility_response.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_compatibility_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class ListCompatibilityResponse(BaseModel): """ ListCompatibilityResponse - """ + """ # noqa: E501 compatibilities: Optional[List[MssqlDatabaseCompatibility]] = None __properties: ClassVar[List[str]] = ["compatibilities"] diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_databases_response.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_databases_response.py index 1655adc4..e95c3de6 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_databases_response.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_databases_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListDatabasesResponse(BaseModel): """ ListDatabasesResponse - """ + """ # noqa: E501 databases: Optional[List[Database]] = None __properties: ClassVar[List[str]] = ["databases"] diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_flavors_response.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_flavors_response.py index 8889c412..cf77398a 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_flavors_response.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_flavors_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListFlavorsResponse(BaseModel): """ ListFlavorsResponse - """ + """ # noqa: E501 flavors: Optional[List[InstanceFlavorEntry]] = None __properties: ClassVar[List[str]] = ["flavors"] diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_instances_response.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_instances_response.py index e492024d..9fdd74b9 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_instances_response.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_instances_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListInstancesResponse(BaseModel): """ ListInstancesResponse - """ + """ # noqa: E501 count: Optional[StrictInt] = None items: Optional[List[InstanceListInstance]] = None diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_metrics_response.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_metrics_response.py index 93f82907..72404bb8 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_metrics_response.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_metrics_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListMetricsResponse(BaseModel): """ ListMetricsResponse - """ + """ # noqa: E501 hosts: Optional[List[Host]] = None __properties: ClassVar[List[str]] = ["hosts"] diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_restore_jobs_response.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_restore_jobs_response.py index 25919882..9aeceb3d 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_restore_jobs_response.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_restore_jobs_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListRestoreJobsResponse(BaseModel): """ ListRestoreJobsResponse - """ + """ # noqa: E501 running_restores: Optional[List[RestoreRunningRestore]] = Field(default=None, alias="runningRestores") __properties: ClassVar[List[str]] = ["runningRestores"] diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_roles_response.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_roles_response.py index 2a00641c..4cb47243 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_roles_response.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_roles_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ListRolesResponse(BaseModel): """ ListRolesResponse - """ + """ # noqa: E501 roles: Optional[List[StrictStr]] = None __properties: ClassVar[List[str]] = ["roles"] diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_storages_response.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_storages_response.py index cfba90f1..8d06af93 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_storages_response.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_storages_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListStoragesResponse(BaseModel): """ ListStoragesResponse - """ + """ # noqa: E501 storage_classes: Optional[List[StrictStr]] = Field(default=None, alias="storageClasses") storage_range: Optional[StorageRange] = Field(default=None, alias="storageRange") diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_users_response.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_users_response.py index f9eb441c..7edfbf5b 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_users_response.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_users_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListUsersResponse(BaseModel): """ ListUsersResponse - """ + """ # noqa: E501 count: Optional[StrictInt] = None items: Optional[List[InstanceListUser]] = None diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_versions_response.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_versions_response.py index 42c3707b..38ef02c7 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/list_versions_response.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/list_versions_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ListVersionsResponse(BaseModel): """ ListVersionsResponse - """ + """ # noqa: E501 versions: Optional[List[StrictStr]] = None __properties: ClassVar[List[str]] = ["versions"] diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/mssql_database_collation.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/mssql_database_collation.py index 5e064070..65ce2d35 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/mssql_database_collation.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/mssql_database_collation.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class MssqlDatabaseCollation(BaseModel): """ MssqlDatabaseCollation - """ + """ # noqa: E501 collation_name: Optional[StrictStr] = None description: Optional[StrictStr] = None diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/mssql_database_compatibility.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/mssql_database_compatibility.py index e45560ae..83505083 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/mssql_database_compatibility.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/mssql_database_compatibility.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class MssqlDatabaseCompatibility(BaseModel): """ MssqlDatabaseCompatibility - """ + """ # noqa: E501 compatibility_level: Optional[StrictInt] = None description: Optional[StrictStr] = None diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/partial_update_instance_payload.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/partial_update_instance_payload.py index 9178de36..a2593fdc 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/partial_update_instance_payload.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/partial_update_instance_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class PartialUpdateInstancePayload(BaseModel): """ PartialUpdateInstancePayload - """ + """ # noqa: E501 acl: Optional[InstanceDocumentationACL] = Field( default=None, diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/reset_user_response.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/reset_user_response.py index 4e9f29d1..8b206c14 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/reset_user_response.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/reset_user_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ResetUserResponse(BaseModel): """ ResetUserResponse - """ + """ # noqa: E501 item: Optional[SingleUser] = None __properties: ClassVar[List[str]] = ["item"] diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/restore_running_restore.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/restore_running_restore.py index 81bc9d04..552d4c67 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/restore_running_restore.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/restore_running_restore.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class RestoreRunningRestore(BaseModel): """ RestoreRunningRestore - """ + """ # noqa: E501 command: Optional[StrictStr] = None database_name: Optional[StrictStr] = None diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/single_database.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/single_database.py index 44c47223..e76c0703 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/single_database.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/single_database.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class SingleDatabase(BaseModel): """ SingleDatabase - """ + """ # noqa: E501 id: Optional[StrictStr] = Field(default=None, description="Database id") name: Optional[StrictStr] = Field(default=None, description="Database name") diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/single_user.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/single_user.py index 96fb3d34..04ee99c2 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/single_user.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/single_user.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class SingleUser(BaseModel): """ SingleUser - """ + """ # noqa: E501 default_database: Optional[StrictStr] = None host: Optional[StrictStr] = None diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/storage.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/storage.py index 3ca017e6..84853e48 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/storage.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/storage.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class Storage(BaseModel): """ Storage - """ + """ # noqa: E501 var_class: Optional[StrictStr] = Field(default=None, alias="class") size: Optional[StrictInt] = None diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/storage_range.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/storage_range.py index 46197d9e..75885acf 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/storage_range.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/storage_range.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class StorageRange(BaseModel): """ StorageRange - """ + """ # noqa: E501 max: Optional[StrictInt] = None min: Optional[StrictInt] = None diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/trigger_database_restore_payload.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/trigger_database_restore_payload.py index 1cff4697..147fd214 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/trigger_database_restore_payload.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/trigger_database_restore_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class TriggerDatabaseRestorePayload(BaseModel): """ TriggerDatabaseRestorePayload - """ + """ # noqa: E501 name: StrictStr = Field(description="Name for the restored database no overwrite allowed at the moment") restore_date_time: StrictStr = Field( diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/type.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/type.py index fa30ca1e..7834830c 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/type.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/type.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/update_instance_payload.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/update_instance_payload.py index b60ea61f..fd437e3e 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/update_instance_payload.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/update_instance_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class UpdateInstancePayload(BaseModel): """ UpdateInstancePayload - """ + """ # noqa: E501 acl: InstanceDocumentationACL = Field( description="ACL is the Access Control List defining the IP ranges allowed to connect to the database" diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/update_instance_response.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/update_instance_response.py index 1a33dd86..ab276ffc 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/update_instance_response.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/update_instance_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class UpdateInstanceResponse(BaseModel): """ UpdateInstanceResponse - """ + """ # noqa: E501 item: Optional[Instance] = None __properties: ClassVar[List[str]] = ["item"] diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/user.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/user.py index 1fcb8424..070629c4 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/user.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/user.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class User(BaseModel): """ User - """ + """ # noqa: E501 database: Optional[StrictStr] = None host: Optional[StrictStr] = None diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/models/user_response_user.py b/services/sqlserverflex/src/stackit/sqlserverflex/models/user_response_user.py index 389f4682..b5b6a196 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/models/user_response_user.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/models/user_response_user.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class UserResponseUser(BaseModel): """ UserResponseUser - """ + """ # noqa: E501 default_database: Optional[StrictStr] = None host: Optional[StrictStr] = None diff --git a/services/sqlserverflex/src/stackit/sqlserverflex/rest.py b/services/sqlserverflex/src/stackit/sqlserverflex/rest.py index 80fe225a..412e0d33 100644 --- a/services/sqlserverflex/src/stackit/sqlserverflex/rest.py +++ b/services/sqlserverflex/src/stackit/sqlserverflex/rest.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -125,7 +125,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: diff --git a/services/stackitmarketplace/CHANGELOG.md b/services/stackitmarketplace/CHANGELOG.md index 64e07caa..20bb5746 100644 --- a/services/stackitmarketplace/CHANGELOG.md +++ b/services/stackitmarketplace/CHANGELOG.md @@ -1,10 +1,13 @@ +## v1.5.1 +- **Internal:** Improve deserializing and error types + ## v1.5.0 - **Feature:** Add new `Assets` model for managing service certificate assets - **Feature:** Add new `LocalizedVersion` model for localized content management - **Feature:** Add new `NoticePeriod` model with types: `SAME_DAY`, `DAYS`, `MONTHS` - **Feature:** Add new `ServiceCertificate` model for service certification -## v1.4.0 +## v1.4.0 - **Feature:** Add support for offer types - new model `OfferType` - new attribute `CatalogProductDetail` for `CatalogProductDetail` model diff --git a/services/stackitmarketplace/pyproject.toml b/services/stackitmarketplace/pyproject.toml index 2b33b2d9..e6ef10fe 100644 --- a/services/stackitmarketplace/pyproject.toml +++ b/services/stackitmarketplace/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-stackitmarketplace" [tool.poetry] name = "stackit-stackitmarketplace" -version = "v1.5.0" +version = "v1.5.1" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/__init__.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/__init__.py index a2c31bc1..58516779 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/__init__.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/__init__.py @@ -12,100 +12,175 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "ApproveSubscriptionPayload", + "Assets", + "BecomeVendor", + "CatalogPricingOptionHighlight", + "CatalogProductDetail", + "CatalogProductDetailsVendor", + "CatalogProductFacetsValueInner", + "CatalogProductHighlight", + "CatalogProductOverview", + "CatalogProductOverviewVendor", + "CatalogProductPricingOption", + "CatalogProductSupportResource", + "CatalogProductVendorTerms", + "ContactSales", + "DeliveryMethod", + "ErrorResponse", + "InquiriesCreateInquiryPayload", + "InquiryBecomeVendor", + "InquiryContactSales", + "InquiryFormType", + "InquiryRegisterTesting", + "InquirySuggestProduct", + "ListCatalogProductsResponse", + "ListVendorSubscriptionsResponse", + "LocalizedVersion", + "NoticePeriod", + "OfferType", + "PriceType", + "PricingOptionUnit", + "ProductLifecycleState", + "RegisterTesting", + "ResolveCustomerPayload", + "ServiceCertificate", + "SubscriptionLifecycleState", + "SubscriptionProduct", + "SuggestProduct", + "VendorSubscription", +] + # import apis into sdk package -from stackit.stackitmarketplace.api.default_api import DefaultApi -from stackit.stackitmarketplace.api_client import ApiClient +from stackit.stackitmarketplace.api.default_api import DefaultApi as DefaultApi +from stackit.stackitmarketplace.api_client import ApiClient as ApiClient # import ApiClient -from stackit.stackitmarketplace.api_response import ApiResponse -from stackit.stackitmarketplace.configuration import HostConfiguration -from stackit.stackitmarketplace.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.stackitmarketplace.api_response import ApiResponse as ApiResponse +from stackit.stackitmarketplace.configuration import ( + HostConfiguration as HostConfiguration, +) +from stackit.stackitmarketplace.exceptions import ApiAttributeError as ApiAttributeError +from stackit.stackitmarketplace.exceptions import ApiException as ApiException +from stackit.stackitmarketplace.exceptions import ApiKeyError as ApiKeyError +from stackit.stackitmarketplace.exceptions import ApiTypeError as ApiTypeError +from stackit.stackitmarketplace.exceptions import ApiValueError as ApiValueError +from stackit.stackitmarketplace.exceptions import OpenApiException as OpenApiException # import models into sdk package from stackit.stackitmarketplace.models.approve_subscription_payload import ( - ApproveSubscriptionPayload, + ApproveSubscriptionPayload as ApproveSubscriptionPayload, ) -from stackit.stackitmarketplace.models.assets import Assets -from stackit.stackitmarketplace.models.become_vendor import BecomeVendor +from stackit.stackitmarketplace.models.assets import Assets as Assets +from stackit.stackitmarketplace.models.become_vendor import BecomeVendor as BecomeVendor from stackit.stackitmarketplace.models.catalog_pricing_option_highlight import ( - CatalogPricingOptionHighlight, + CatalogPricingOptionHighlight as CatalogPricingOptionHighlight, ) from stackit.stackitmarketplace.models.catalog_product_detail import ( - CatalogProductDetail, + CatalogProductDetail as CatalogProductDetail, ) from stackit.stackitmarketplace.models.catalog_product_details_vendor import ( - CatalogProductDetailsVendor, + CatalogProductDetailsVendor as CatalogProductDetailsVendor, ) from stackit.stackitmarketplace.models.catalog_product_facets_value_inner import ( - CatalogProductFacetsValueInner, + CatalogProductFacetsValueInner as CatalogProductFacetsValueInner, ) from stackit.stackitmarketplace.models.catalog_product_highlight import ( - CatalogProductHighlight, + CatalogProductHighlight as CatalogProductHighlight, ) from stackit.stackitmarketplace.models.catalog_product_overview import ( - CatalogProductOverview, + CatalogProductOverview as CatalogProductOverview, ) from stackit.stackitmarketplace.models.catalog_product_overview_vendor import ( - CatalogProductOverviewVendor, + CatalogProductOverviewVendor as CatalogProductOverviewVendor, ) from stackit.stackitmarketplace.models.catalog_product_pricing_option import ( - CatalogProductPricingOption, + CatalogProductPricingOption as CatalogProductPricingOption, ) from stackit.stackitmarketplace.models.catalog_product_support_resource import ( - CatalogProductSupportResource, + CatalogProductSupportResource as CatalogProductSupportResource, ) from stackit.stackitmarketplace.models.catalog_product_vendor_terms import ( - CatalogProductVendorTerms, + CatalogProductVendorTerms as CatalogProductVendorTerms, +) +from stackit.stackitmarketplace.models.contact_sales import ContactSales as ContactSales +from stackit.stackitmarketplace.models.delivery_method import ( + DeliveryMethod as DeliveryMethod, +) +from stackit.stackitmarketplace.models.error_response import ( + ErrorResponse as ErrorResponse, ) -from stackit.stackitmarketplace.models.contact_sales import ContactSales -from stackit.stackitmarketplace.models.delivery_method import DeliveryMethod -from stackit.stackitmarketplace.models.error_response import ErrorResponse from stackit.stackitmarketplace.models.inquiries_create_inquiry_payload import ( - InquiriesCreateInquiryPayload, + InquiriesCreateInquiryPayload as InquiriesCreateInquiryPayload, +) +from stackit.stackitmarketplace.models.inquiry_become_vendor import ( + InquiryBecomeVendor as InquiryBecomeVendor, +) +from stackit.stackitmarketplace.models.inquiry_contact_sales import ( + InquiryContactSales as InquiryContactSales, +) +from stackit.stackitmarketplace.models.inquiry_form_type import ( + InquiryFormType as InquiryFormType, ) -from stackit.stackitmarketplace.models.inquiry_become_vendor import InquiryBecomeVendor -from stackit.stackitmarketplace.models.inquiry_contact_sales import InquiryContactSales -from stackit.stackitmarketplace.models.inquiry_form_type import InquiryFormType from stackit.stackitmarketplace.models.inquiry_register_testing import ( - InquiryRegisterTesting, + InquiryRegisterTesting as InquiryRegisterTesting, ) from stackit.stackitmarketplace.models.inquiry_suggest_product import ( - InquirySuggestProduct, + InquirySuggestProduct as InquirySuggestProduct, ) from stackit.stackitmarketplace.models.list_catalog_products_response import ( - ListCatalogProductsResponse, + ListCatalogProductsResponse as ListCatalogProductsResponse, ) from stackit.stackitmarketplace.models.list_vendor_subscriptions_response import ( - ListVendorSubscriptionsResponse, + ListVendorSubscriptionsResponse as ListVendorSubscriptionsResponse, +) +from stackit.stackitmarketplace.models.localized_version import ( + LocalizedVersion as LocalizedVersion, +) +from stackit.stackitmarketplace.models.notice_period import NoticePeriod as NoticePeriod +from stackit.stackitmarketplace.models.offer_type import OfferType as OfferType +from stackit.stackitmarketplace.models.price_type import PriceType as PriceType +from stackit.stackitmarketplace.models.pricing_option_unit import ( + PricingOptionUnit as PricingOptionUnit, ) -from stackit.stackitmarketplace.models.localized_version import LocalizedVersion -from stackit.stackitmarketplace.models.notice_period import NoticePeriod -from stackit.stackitmarketplace.models.offer_type import OfferType -from stackit.stackitmarketplace.models.price_type import PriceType -from stackit.stackitmarketplace.models.pricing_option_unit import PricingOptionUnit from stackit.stackitmarketplace.models.product_lifecycle_state import ( - ProductLifecycleState, + ProductLifecycleState as ProductLifecycleState, +) +from stackit.stackitmarketplace.models.register_testing import ( + RegisterTesting as RegisterTesting, ) -from stackit.stackitmarketplace.models.register_testing import RegisterTesting from stackit.stackitmarketplace.models.resolve_customer_payload import ( - ResolveCustomerPayload, + ResolveCustomerPayload as ResolveCustomerPayload, +) +from stackit.stackitmarketplace.models.service_certificate import ( + ServiceCertificate as ServiceCertificate, ) -from stackit.stackitmarketplace.models.service_certificate import ServiceCertificate from stackit.stackitmarketplace.models.subscription_lifecycle_state import ( - SubscriptionLifecycleState, + SubscriptionLifecycleState as SubscriptionLifecycleState, +) +from stackit.stackitmarketplace.models.subscription_product import ( + SubscriptionProduct as SubscriptionProduct, +) +from stackit.stackitmarketplace.models.suggest_product import ( + SuggestProduct as SuggestProduct, +) +from stackit.stackitmarketplace.models.vendor_subscription import ( + VendorSubscription as VendorSubscription, ) -from stackit.stackitmarketplace.models.subscription_product import SubscriptionProduct -from stackit.stackitmarketplace.models.suggest_product import SuggestProduct -from stackit.stackitmarketplace.models.vendor_subscription import VendorSubscription diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/api/default_api.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/api/default_api.py index 96f28c39..037ebfb0 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/api/default_api.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/api/default_api.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -109,7 +109,7 @@ def approve_subscription( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._approve_subscription_serialize( project_id=project_id, @@ -183,7 +183,7 @@ def approve_subscription_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._approve_subscription_serialize( project_id=project_id, @@ -257,7 +257,7 @@ def approve_subscription_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._approve_subscription_serialize( project_id=project_id, @@ -298,7 +298,7 @@ def _approve_subscription_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -386,7 +386,7 @@ def get_catalog_product( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_catalog_product_serialize( product_id=product_id, @@ -454,7 +454,7 @@ def get_catalog_product_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_catalog_product_serialize( product_id=product_id, @@ -522,7 +522,7 @@ def get_catalog_product_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_catalog_product_serialize( product_id=product_id, @@ -561,7 +561,7 @@ def _get_catalog_product_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -643,7 +643,7 @@ def get_vendor_subscription( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_vendor_subscription_serialize( project_id=project_id, @@ -713,7 +713,7 @@ def get_vendor_subscription_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_vendor_subscription_serialize( project_id=project_id, @@ -783,7 +783,7 @@ def get_vendor_subscription_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_vendor_subscription_serialize( project_id=project_id, @@ -822,7 +822,7 @@ def _get_vendor_subscription_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -897,7 +897,7 @@ def inquiries_create_inquiry( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._inquiries_create_inquiry_serialize( inquiries_create_inquiry_payload=inquiries_create_inquiry_payload, @@ -961,7 +961,7 @@ def inquiries_create_inquiry_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._inquiries_create_inquiry_serialize( inquiries_create_inquiry_payload=inquiries_create_inquiry_payload, @@ -1025,7 +1025,7 @@ def inquiries_create_inquiry_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._inquiries_create_inquiry_serialize( inquiries_create_inquiry_payload=inquiries_create_inquiry_payload, @@ -1062,7 +1062,7 @@ def _inquiries_create_inquiry_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1179,7 +1179,7 @@ def list_catalog_products( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_catalog_products_serialize( cursor=cursor, @@ -1282,7 +1282,7 @@ def list_catalog_products_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_catalog_products_serialize( cursor=cursor, @@ -1385,7 +1385,7 @@ def list_catalog_products_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_catalog_products_serialize( cursor=cursor, @@ -1429,7 +1429,7 @@ def _list_catalog_products_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1546,7 +1546,7 @@ def list_vendor_subscriptions( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_vendor_subscriptions_serialize( project_id=project_id, @@ -1638,7 +1638,7 @@ def list_vendor_subscriptions_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_vendor_subscriptions_serialize( project_id=project_id, @@ -1730,7 +1730,7 @@ def list_vendor_subscriptions_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_vendor_subscriptions_serialize( project_id=project_id, @@ -1772,7 +1772,7 @@ def _list_vendor_subscriptions_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1860,7 +1860,7 @@ def resolve_customer( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._resolve_customer_serialize( project_id=project_id, @@ -1928,7 +1928,7 @@ def resolve_customer_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._resolve_customer_serialize( project_id=project_id, @@ -1996,7 +1996,7 @@ def resolve_customer_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._resolve_customer_serialize( project_id=project_id, @@ -2035,7 +2035,7 @@ def _resolve_customer_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2123,7 +2123,7 @@ def vendors_subscriptions_reject( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._vendors_subscriptions_reject_serialize( project_id=project_id, @@ -2193,7 +2193,7 @@ def vendors_subscriptions_reject_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._vendors_subscriptions_reject_serialize( project_id=project_id, @@ -2263,7 +2263,7 @@ def vendors_subscriptions_reject_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._vendors_subscriptions_reject_serialize( project_id=project_id, @@ -2302,7 +2302,7 @@ def _vendors_subscriptions_reject_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/api_client.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/api_client.py index fcae85d1..a1bf16fc 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/api_client.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/api_client.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -332,6 +332,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -351,12 +355,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -458,7 +462,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -474,7 +478,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -489,6 +496,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/configuration.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/configuration.py index eaa1facc..32c8472d 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/configuration.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT Marketplace API @@ -15,7 +10,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -54,7 +71,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -72,7 +89,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -112,7 +134,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -131,12 +153,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/exceptions.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/exceptions.py index d3bf0cf8..b6368ea8 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/exceptions.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/exceptions.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -152,6 +152,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -188,6 +195,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/__init__.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/__init__.py index e078b229..cd1d92d2 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/__init__.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/__init__.py @@ -11,7 +11,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/approve_subscription_payload.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/approve_subscription_payload.py index 3a487162..1745229e 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/approve_subscription_payload.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/approve_subscription_payload.py @@ -10,13 +10,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -26,7 +26,7 @@ class ApproveSubscriptionPayload(BaseModel): """ ApproveSubscriptionPayload - """ + """ # noqa: E501 instance_target: Optional[Annotated[str, Field(strict=True, max_length=512)]] = Field( default=None, diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/assets.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/assets.py index a8bdafd5..594ec205 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/assets.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/assets.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class Assets(BaseModel): """ The assets associated with the product. - """ + """ # noqa: E501 service_certificate: Optional[ServiceCertificate] = Field(default=None, alias="serviceCertificate") __properties: ClassVar[List[str]] = ["serviceCertificate"] diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/become_vendor.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/become_vendor.py index 3f3025fe..f6bda797 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/become_vendor.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/become_vendor.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -28,7 +28,7 @@ class BecomeVendor(BaseModel): """ Become a Vendor. - """ + """ # noqa: E501 become_vendor: InquiryBecomeVendor = Field(alias="becomeVendor") type: InquiryFormType diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_pricing_option_highlight.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_pricing_option_highlight.py index ab658310..85016fb2 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_pricing_option_highlight.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_pricing_option_highlight.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CatalogPricingOptionHighlight(BaseModel): """ CatalogPricingOptionHighlight - """ + """ # noqa: E501 highlight_content: Optional[StrictStr] = Field( default=None, description="The highlight content.", alias="highlightContent" diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_detail.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_detail.py index 90985f3a..cf1b5317 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_detail.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_detail.py @@ -10,13 +10,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set, Union from pydantic import ( @@ -56,7 +56,7 @@ class CatalogProductDetail(BaseModel): """ CatalogProductDetail - """ + """ # noqa: E501 assets: Optional[Assets] = None categories: Optional[List[StrictStr]] = Field( diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_details_vendor.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_details_vendor.py index f110cbf7..f09574b5 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_details_vendor.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_details_vendor.py @@ -10,13 +10,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set, Union from pydantic import ( @@ -33,7 +33,7 @@ class CatalogProductDetailsVendor(BaseModel): """ CatalogProductDetailsVendor - """ + """ # noqa: E501 description: StrictStr = Field(description="The vendor description.") logo: Union[StrictBytes, StrictStr] = Field(description="The logo base64 encoded.") diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_facets_value_inner.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_facets_value_inner.py index 4f43790a..d3f5ad78 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_facets_value_inner.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_facets_value_inner.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CatalogProductFacetsValueInner(BaseModel): """ CatalogProductFacetsValueInner - """ + """ # noqa: E501 count: StrictInt = Field(description="The number of items associated with this facet value.") value: StrictStr = Field(description="The value of the facet.") diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_highlight.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_highlight.py index 3c7dc923..da37abb7 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_highlight.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_highlight.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CatalogProductHighlight(BaseModel): """ CatalogProductHighlight - """ + """ # noqa: E501 highlight_content: Optional[StrictStr] = Field( default=None, description="The highlight content.", alias="highlightContent" diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_overview.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_overview.py index 4bd2629a..9f9461de 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_overview.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_overview.py @@ -10,13 +10,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set, Union from pydantic import ( @@ -41,7 +41,7 @@ class CatalogProductOverview(BaseModel): """ CatalogProductOverview - """ + """ # noqa: E501 delivery_method: DeliveryMethod = Field(alias="deliveryMethod") lifecycle_state: ProductLifecycleState = Field(alias="lifecycleState") diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_overview_vendor.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_overview_vendor.py index e6a26e6c..0a2eeb48 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_overview_vendor.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_overview_vendor.py @@ -10,13 +10,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -26,7 +26,7 @@ class CatalogProductOverviewVendor(BaseModel): """ CatalogProductOverviewVendor - """ + """ # noqa: E501 name: Annotated[str, Field(strict=True, max_length=512)] = Field(description="The product's vendor name.") vendor_id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_pricing_option.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_pricing_option.py index b8916f21..26d751c3 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_pricing_option.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_pricing_option.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -32,7 +32,7 @@ class CatalogProductPricingOption(BaseModel): """ CatalogProductPricingOption - """ + """ # noqa: E501 description: StrictStr = Field(description="The pricing option description.") highlights: List[CatalogPricingOptionHighlight] = Field(description="The list of highlights.") diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_support_resource.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_support_resource.py index 3760ce6a..c6d41fe0 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_support_resource.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_support_resource.py @@ -10,13 +10,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -26,7 +26,7 @@ class CatalogProductSupportResource(BaseModel): """ CatalogProductSupportResource - """ + """ # noqa: E501 support_link: Optional[Annotated[str, Field(strict=True, max_length=512)]] = Field( default=None, description="The support resource link.", alias="supportLink" diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_vendor_terms.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_vendor_terms.py index 67bb19c4..4ce8c6ba 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_vendor_terms.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/catalog_product_vendor_terms.py @@ -10,13 +10,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -26,7 +26,7 @@ class CatalogProductVendorTerms(BaseModel): """ CatalogProductVendorTerms - """ + """ # noqa: E501 description: StrictStr = Field(description="The terms of service description.") title: StrictStr = Field(description="The terms of service title.") diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/contact_sales.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/contact_sales.py index beb4f3d0..4fdc2c65 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/contact_sales.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/contact_sales.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -28,7 +28,7 @@ class ContactSales(BaseModel): """ Contact sales. - """ + """ # noqa: E501 contact_sales: InquiryContactSales = Field(alias="contactSales") type: InquiryFormType diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/delivery_method.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/delivery_method.py index 4a0ac914..4b594f3d 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/delivery_method.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/delivery_method.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/error_response.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/error_response.py index 40f579d4..007e6ffd 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/error_response.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/error_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ErrorResponse(BaseModel): """ ErrorResponse - """ + """ # noqa: E501 error: StrictStr = Field(description="Reason phrase of the status code.") message: StrictStr = Field(description="Description of the error.") diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiries_create_inquiry_payload.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiries_create_inquiry_payload.py index 3cf3a6c5..d06e4a20 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiries_create_inquiry_payload.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiries_create_inquiry_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiry_become_vendor.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiry_become_vendor.py index d5193bbc..e7a6ca2f 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiry_become_vendor.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiry_become_vendor.py @@ -10,13 +10,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -26,7 +26,7 @@ class InquiryBecomeVendor(BaseModel): """ Become a vendor. - """ + """ # noqa: E501 contact_email: StrictStr = Field(description="A e-mail address.", alias="contactEmail") message: Annotated[str, Field(strict=True, max_length=512)] = Field(description="A custom message.") diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiry_contact_sales.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiry_contact_sales.py index 955395c9..0b8ed7e2 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiry_contact_sales.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiry_contact_sales.py @@ -10,13 +10,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -26,7 +26,7 @@ class InquiryContactSales(BaseModel): """ Contact sales. - """ + """ # noqa: E501 company_name: Annotated[str, Field(strict=True, max_length=512)] = Field( description="The company name.", alias="companyName" diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiry_form_type.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiry_form_type.py index b87dfe6f..1f65eb17 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiry_form_type.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiry_form_type.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiry_register_testing.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiry_register_testing.py index 5ffdc85f..eb69fc2d 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiry_register_testing.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiry_register_testing.py @@ -10,13 +10,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -26,7 +26,7 @@ class InquiryRegisterTesting(BaseModel): """ Register for testing. - """ + """ # noqa: E501 contact_email: StrictStr = Field(description="A e-mail address.", alias="contactEmail") full_name: Annotated[str, Field(strict=True, max_length=512)] = Field( diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiry_suggest_product.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiry_suggest_product.py index c979e6d2..e24bed89 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiry_suggest_product.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/inquiry_suggest_product.py @@ -10,13 +10,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -26,7 +26,7 @@ class InquirySuggestProduct(BaseModel): """ Suggest a product. - """ + """ # noqa: E501 company_name: Annotated[str, Field(strict=True, max_length=512)] = Field( description="The suggested product's company name.", alias="companyName" diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/list_catalog_products_response.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/list_catalog_products_response.py index 68c6af11..4d2f4af3 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/list_catalog_products_response.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/list_catalog_products_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -32,7 +32,7 @@ class ListCatalogProductsResponse(BaseModel): """ ListCatalogProductsResponse - """ + """ # noqa: E501 cursor: StrictStr = Field( description="A pagination cursor that represents a position in the dataset. If given, results will be returned from the item after the cursor. If not given, results will be returned from the beginning." diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/list_vendor_subscriptions_response.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/list_vendor_subscriptions_response.py index cfbaada8..940b4bca 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/list_vendor_subscriptions_response.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/list_vendor_subscriptions_response.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ListVendorSubscriptionsResponse(BaseModel): """ ListVendorSubscriptionsResponse - """ + """ # noqa: E501 cursor: StrictStr = Field( description="A pagination cursor that represents a position in the dataset. If given, results will be returned from the item after the cursor. If not given, results will be returned from the beginning." diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/localized_version.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/localized_version.py index 6c669ed9..abd4fc52 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/localized_version.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/localized_version.py @@ -10,13 +10,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -26,7 +26,7 @@ class LocalizedVersion(BaseModel): """ The localized version (file name) of a file. - """ + """ # noqa: E501 de: Optional[Annotated[str, Field(strict=True)]] = Field( default=None, description="The file version matching the file name (localized)." diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/notice_period.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/notice_period.py index 7b0e1b45..3c998941 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/notice_period.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/notice_period.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class NoticePeriod(BaseModel): """ The notice period for a product and plan. - """ + """ # noqa: E501 type: Optional[StrictStr] = Field(default=None, description="The notice period type.") value: Optional[StrictInt] = Field( diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/offer_type.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/offer_type.py index d55aae71..aff8a29d 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/offer_type.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/offer_type.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/price_type.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/price_type.py index cdda7080..6cfe9117 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/price_type.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/price_type.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/pricing_option_unit.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/pricing_option_unit.py index e707e333..dcc9b2ec 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/pricing_option_unit.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/pricing_option_unit.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/product_lifecycle_state.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/product_lifecycle_state.py index 5e829c29..3f14671e 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/product_lifecycle_state.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/product_lifecycle_state.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/register_testing.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/register_testing.py index 63061206..4bc59deb 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/register_testing.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/register_testing.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -30,7 +30,7 @@ class RegisterTesting(BaseModel): """ Register for testing. - """ + """ # noqa: E501 register_testing: InquiryRegisterTesting = Field(alias="registerTesting") type: InquiryFormType diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/resolve_customer_payload.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/resolve_customer_payload.py index bbddc462..4ca7ceda 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/resolve_customer_payload.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/resolve_customer_payload.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ResolveCustomerPayload(BaseModel): """ ResolveCustomerPayload - """ + """ # noqa: E501 token: StrictStr = Field(description="Opaque token exchangeable for subscription details.") __properties: ClassVar[List[str]] = ["token"] diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/service_certificate.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/service_certificate.py index d2f00b8c..8ab713d2 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/service_certificate.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/service_certificate.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class ServiceCertificate(BaseModel): """ The related service certificate of the (subscription) product. - """ + """ # noqa: E501 version: Optional[LocalizedVersion] = None __properties: ClassVar[List[str]] = ["version"] diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_lifecycle_state.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_lifecycle_state.py index e5b835af..2de1988d 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_lifecycle_state.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_lifecycle_state.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_product.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_product.py index b27a03c8..c3825758 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_product.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/subscription_product.py @@ -10,13 +10,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -33,7 +33,7 @@ class SubscriptionProduct(BaseModel): """ The product of a subscription - """ + """ # noqa: E501 assets: Optional[Assets] = None delivery_method: DeliveryMethod = Field(alias="deliveryMethod") diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/suggest_product.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/suggest_product.py index 8d052cf9..eded1983 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/suggest_product.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/suggest_product.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -30,7 +30,7 @@ class SuggestProduct(BaseModel): """ Suggest a product. - """ + """ # noqa: E501 suggest_product: InquirySuggestProduct = Field(alias="suggestProduct") type: InquiryFormType diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/vendor_subscription.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/vendor_subscription.py index 1bbfef6e..e8ed999d 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/models/vendor_subscription.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/models/vendor_subscription.py @@ -10,13 +10,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -31,7 +31,7 @@ class VendorSubscription(BaseModel): """ VendorSubscription - """ + """ # noqa: E501 lifecycle_state: SubscriptionLifecycleState = Field(alias="lifecycleState") organization_id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( diff --git a/services/stackitmarketplace/src/stackit/stackitmarketplace/rest.py b/services/stackitmarketplace/src/stackit/stackitmarketplace/rest.py index 931dbe73..fe03dba8 100644 --- a/services/stackitmarketplace/src/stackit/stackitmarketplace/rest.py +++ b/services/stackitmarketplace/src/stackit/stackitmarketplace/rest.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -125,7 +125,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: