diff --git a/services/postgresflex/oas_commit b/services/postgresflex/oas_commit index e3713dde3..e693657c0 100644 --- a/services/postgresflex/oas_commit +++ b/services/postgresflex/oas_commit @@ -1 +1 @@ -0e64886dd0847341800d7191ed193b75413be998 +bbdb648871c5a2359e5be79600214ea253488bb7 diff --git a/services/postgresflex/src/stackit/postgresflex/__init__.py b/services/postgresflex/src/stackit/postgresflex/__init__.py index 8abff3da0..2c6141da4 100644 --- a/services/postgresflex/src/stackit/postgresflex/__init__.py +++ b/services/postgresflex/src/stackit/postgresflex/__init__.py @@ -5,9 +5,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -29,61 +29,67 @@ "ApiKeyError", "ApiAttributeError", "ApiException", - "ACL", - "ApiConfiguration", - "ApiExtensionConfigLoadResponse", - "ApiExtensionConfigureResponse", - "ApiExtensionDeleteResponse", - "ApiExtensionList", - "ApiExtensionLoadResponse", - "ApiInstallResponse", - "ApiInstalledListResponse", - "Backup", + "BackupData", + "BackupSort", + "CloneInstanceOverrides", "CloneInstancePayload", "CloneInstanceResponse", "CreateDatabasePayload", + "CreateDatabaseResponse", "CreateInstancePayload", "CreateInstanceResponse", "CreateUserPayload", "CreateUserResponse", + "DatabaseRoles", + "DatabaseSort", "Error", - "ExtensionsConfiguration", - "ExtensionsExtensionListResponse", - "ExtensionsNewConfig", - "Flavor", - "GetBackupResponse", + "FlavorSort", + "FlavorStorageClassesStorageClass", + "GetDatabaseResponse", + "GetInstanceResponse", "GetUserResponse", - "Instance", - "InstanceCreateDatabaseResponse", - "InstanceDataPoint", - "InstanceDatabase", - "InstanceHost", - "InstanceHostMetric", - "InstanceListDatabasesResponse", - "InstanceListInstance", - "InstanceMetricsResponse", - "InstanceResponse", - "ListBackupsResponse", + "InstanceConnectionInfo", + "InstanceConnectionInfoWrite", + "InstanceEncryption", + "InstanceNetwork", + "InstanceNetworkAccessScope", + "InstanceNetworkCreate", + "InstanceNetworkOpt", + "InstanceNetworkUpdate", + "InstanceSort", + "InstanceStorageRange", + "ListBackupResponse", + "ListCollationsResponse", + "ListDatabase", + "ListDatabasesResponse", + "ListFlavors", "ListFlavorsResponse", + "ListInstance", "ListInstancesResponse", - "ListStoragesResponse", - "ListUsersResponse", - "ListUsersResponseItem", - "ListVersionsResponse", + "ListRolesResponse", + "ListUser", + "ListUserResponse", + "ListVersionResponse", + "Pagination", + "PartialUpdateDatabasePayload", "PartialUpdateInstancePayload", - "PartialUpdateInstanceResponse", "PartialUpdateUserPayload", - "PostgresDatabaseParameter", - "PostgresDatabaseParameterResponse", - "ResetUserResponse", + "ResetUserPasswordResponse", + "State", "Storage", - "StorageRange", + "StorageCreate", "StorageUpdate", - "UpdateBackupSchedulePayload", + "UpdateDatabasePartiallyResponse", + "UpdateDatabasePayload", + "UpdateDatabaseResponse", "UpdateInstancePayload", + "UpdateInstanceProtectionPayload", + "UpdateInstanceProtectionResponse", "UpdateUserPayload", - "User", - "UserResponse", + "UserSort", + "ValidationError", + "ValidationErrorValidationInner", + "Version", ] # import apis into sdk package @@ -101,32 +107,11 @@ from stackit.postgresflex.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.postgresflex.models.acl import ACL as ACL -from stackit.postgresflex.models.api_configuration import ( - ApiConfiguration as ApiConfiguration, +from stackit.postgresflex.models.backup_data import BackupData as BackupData +from stackit.postgresflex.models.backup_sort import BackupSort as BackupSort +from stackit.postgresflex.models.clone_instance_overrides import ( + CloneInstanceOverrides as CloneInstanceOverrides, ) -from stackit.postgresflex.models.api_extension_config_load_response import ( - ApiExtensionConfigLoadResponse as ApiExtensionConfigLoadResponse, -) -from stackit.postgresflex.models.api_extension_configure_response import ( - ApiExtensionConfigureResponse as ApiExtensionConfigureResponse, -) -from stackit.postgresflex.models.api_extension_delete_response import ( - ApiExtensionDeleteResponse as ApiExtensionDeleteResponse, -) -from stackit.postgresflex.models.api_extension_list import ( - ApiExtensionList as ApiExtensionList, -) -from stackit.postgresflex.models.api_extension_load_response import ( - ApiExtensionLoadResponse as ApiExtensionLoadResponse, -) -from stackit.postgresflex.models.api_install_response import ( - ApiInstallResponse as ApiInstallResponse, -) -from stackit.postgresflex.models.api_installed_list_response import ( - ApiInstalledListResponse as ApiInstalledListResponse, -) -from stackit.postgresflex.models.backup import Backup as Backup from stackit.postgresflex.models.clone_instance_payload import ( CloneInstancePayload as CloneInstancePayload, ) @@ -136,6 +121,9 @@ from stackit.postgresflex.models.create_database_payload import ( CreateDatabasePayload as CreateDatabasePayload, ) +from stackit.postgresflex.models.create_database_response import ( + CreateDatabaseResponse as CreateDatabaseResponse, +) from stackit.postgresflex.models.create_instance_payload import ( CreateInstancePayload as CreateInstancePayload, ) @@ -148,99 +136,121 @@ from stackit.postgresflex.models.create_user_response import ( CreateUserResponse as CreateUserResponse, ) +from stackit.postgresflex.models.database_roles import DatabaseRoles as DatabaseRoles +from stackit.postgresflex.models.database_sort import DatabaseSort as DatabaseSort 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 as ExtensionsExtensionListResponse, +from stackit.postgresflex.models.flavor_sort import FlavorSort as FlavorSort +from stackit.postgresflex.models.flavor_storage_classes_storage_class import ( + FlavorStorageClassesStorageClass as FlavorStorageClassesStorageClass, ) -from stackit.postgresflex.models.extensions_new_config import ( - ExtensionsNewConfig as ExtensionsNewConfig, +from stackit.postgresflex.models.get_database_response import ( + GetDatabaseResponse as GetDatabaseResponse, ) -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_instance_response import ( + GetInstanceResponse as GetInstanceResponse, ) from stackit.postgresflex.models.get_user_response import ( GetUserResponse as GetUserResponse, ) -from stackit.postgresflex.models.instance import Instance as Instance -from stackit.postgresflex.models.instance_create_database_response import ( - InstanceCreateDatabaseResponse as InstanceCreateDatabaseResponse, +from stackit.postgresflex.models.instance_connection_info import ( + InstanceConnectionInfo as InstanceConnectionInfo, +) +from stackit.postgresflex.models.instance_connection_info_write import ( + InstanceConnectionInfoWrite as InstanceConnectionInfoWrite, +) +from stackit.postgresflex.models.instance_encryption import ( + InstanceEncryption as InstanceEncryption, ) -from stackit.postgresflex.models.instance_data_point import ( - InstanceDataPoint as InstanceDataPoint, +from stackit.postgresflex.models.instance_network import ( + InstanceNetwork as InstanceNetwork, ) -from stackit.postgresflex.models.instance_database import ( - InstanceDatabase as InstanceDatabase, +from stackit.postgresflex.models.instance_network_access_scope import ( + InstanceNetworkAccessScope as InstanceNetworkAccessScope, ) -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_network_create import ( + InstanceNetworkCreate as InstanceNetworkCreate, ) -from stackit.postgresflex.models.instance_list_databases_response import ( - InstanceListDatabasesResponse as InstanceListDatabasesResponse, +from stackit.postgresflex.models.instance_network_opt import ( + InstanceNetworkOpt as InstanceNetworkOpt, ) -from stackit.postgresflex.models.instance_list_instance import ( - InstanceListInstance as InstanceListInstance, +from stackit.postgresflex.models.instance_network_update import ( + InstanceNetworkUpdate as InstanceNetworkUpdate, ) -from stackit.postgresflex.models.instance_metrics_response import ( - InstanceMetricsResponse as InstanceMetricsResponse, +from stackit.postgresflex.models.instance_sort import InstanceSort as InstanceSort +from stackit.postgresflex.models.instance_storage_range import ( + InstanceStorageRange as InstanceStorageRange, ) -from stackit.postgresflex.models.instance_response import ( - InstanceResponse as InstanceResponse, +from stackit.postgresflex.models.list_backup_response import ( + ListBackupResponse as ListBackupResponse, ) -from stackit.postgresflex.models.list_backups_response import ( - ListBackupsResponse as ListBackupsResponse, +from stackit.postgresflex.models.list_collations_response import ( + ListCollationsResponse as ListCollationsResponse, ) +from stackit.postgresflex.models.list_database import ListDatabase as ListDatabase +from stackit.postgresflex.models.list_databases_response import ( + ListDatabasesResponse as ListDatabasesResponse, +) +from stackit.postgresflex.models.list_flavors import ListFlavors as ListFlavors from stackit.postgresflex.models.list_flavors_response import ( ListFlavorsResponse as ListFlavorsResponse, ) +from stackit.postgresflex.models.list_instance import ListInstance as ListInstance 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_roles_response import ( + ListRolesResponse as ListRolesResponse, ) -from stackit.postgresflex.models.list_users_response import ( - ListUsersResponse as ListUsersResponse, +from stackit.postgresflex.models.list_user import ListUser as ListUser +from stackit.postgresflex.models.list_user_response import ( + ListUserResponse as ListUserResponse, ) -from stackit.postgresflex.models.list_users_response_item import ( - ListUsersResponseItem as ListUsersResponseItem, +from stackit.postgresflex.models.list_version_response import ( + ListVersionResponse as ListVersionResponse, ) -from stackit.postgresflex.models.list_versions_response import ( - ListVersionsResponse as ListVersionsResponse, +from stackit.postgresflex.models.pagination import Pagination as Pagination +from stackit.postgresflex.models.partial_update_database_payload import ( + PartialUpdateDatabasePayload as PartialUpdateDatabasePayload, ) from stackit.postgresflex.models.partial_update_instance_payload import ( PartialUpdateInstancePayload as PartialUpdateInstancePayload, ) -from stackit.postgresflex.models.partial_update_instance_response import ( - PartialUpdateInstanceResponse as PartialUpdateInstanceResponse, -) from stackit.postgresflex.models.partial_update_user_payload import ( PartialUpdateUserPayload as PartialUpdateUserPayload, ) -from stackit.postgresflex.models.postgres_database_parameter import ( - PostgresDatabaseParameter as PostgresDatabaseParameter, -) -from stackit.postgresflex.models.postgres_database_parameter_response import ( - PostgresDatabaseParameterResponse as PostgresDatabaseParameterResponse, -) -from stackit.postgresflex.models.reset_user_response import ( - ResetUserResponse as ResetUserResponse, +from stackit.postgresflex.models.reset_user_password_response import ( + ResetUserPasswordResponse as ResetUserPasswordResponse, ) +from stackit.postgresflex.models.state import State as State from stackit.postgresflex.models.storage import Storage as Storage -from stackit.postgresflex.models.storage_range import StorageRange as StorageRange +from stackit.postgresflex.models.storage_create import StorageCreate as StorageCreate from stackit.postgresflex.models.storage_update import StorageUpdate as StorageUpdate -from stackit.postgresflex.models.update_backup_schedule_payload import ( - UpdateBackupSchedulePayload as UpdateBackupSchedulePayload, +from stackit.postgresflex.models.update_database_partially_response import ( + UpdateDatabasePartiallyResponse as UpdateDatabasePartiallyResponse, +) +from stackit.postgresflex.models.update_database_payload import ( + UpdateDatabasePayload as UpdateDatabasePayload, +) +from stackit.postgresflex.models.update_database_response import ( + UpdateDatabaseResponse as UpdateDatabaseResponse, ) from stackit.postgresflex.models.update_instance_payload import ( UpdateInstancePayload as UpdateInstancePayload, ) +from stackit.postgresflex.models.update_instance_protection_payload import ( + UpdateInstanceProtectionPayload as UpdateInstanceProtectionPayload, +) +from stackit.postgresflex.models.update_instance_protection_response import ( + UpdateInstanceProtectionResponse as UpdateInstanceProtectionResponse, +) from stackit.postgresflex.models.update_user_payload import ( UpdateUserPayload as UpdateUserPayload, ) -from stackit.postgresflex.models.user import User as User -from stackit.postgresflex.models.user_response import UserResponse as UserResponse +from stackit.postgresflex.models.user_sort import UserSort as UserSort +from stackit.postgresflex.models.validation_error import ( + ValidationError as ValidationError, +) +from stackit.postgresflex.models.validation_error_validation_inner import ( + ValidationErrorValidationInner as ValidationErrorValidationInner, +) +from stackit.postgresflex.models.version import Version as Version diff --git a/services/postgresflex/src/stackit/postgresflex/api/default_api.py b/services/postgresflex/src/stackit/postgresflex/api/default_api.py index f1f329cd2..f41c82eb2 100644 --- a/services/postgresflex/src/stackit/postgresflex/api/default_api.py +++ b/services/postgresflex/src/stackit/postgresflex/api/default_api.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -26,49 +26,52 @@ from stackit.postgresflex.api_client import ApiClient, RequestSerialized from stackit.postgresflex.api_response import ApiResponse +from stackit.postgresflex.models.backup_data import BackupData +from stackit.postgresflex.models.backup_sort import BackupSort 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_database_response import CreateDatabaseResponse 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.get_backup_response import GetBackupResponse +from stackit.postgresflex.models.database_sort import DatabaseSort +from stackit.postgresflex.models.flavor_sort import FlavorSort +from stackit.postgresflex.models.get_database_response import GetDatabaseResponse +from stackit.postgresflex.models.get_instance_response import GetInstanceResponse from stackit.postgresflex.models.get_user_response import GetUserResponse -from stackit.postgresflex.models.instance_create_database_response import ( - InstanceCreateDatabaseResponse, -) -from stackit.postgresflex.models.instance_list_databases_response import ( - InstanceListDatabasesResponse, -) -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.instance_sort import InstanceSort +from stackit.postgresflex.models.list_backup_response import ListBackupResponse +from stackit.postgresflex.models.list_collations_response import ListCollationsResponse +from stackit.postgresflex.models.list_databases_response import ListDatabasesResponse 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_versions_response import ListVersionsResponse +from stackit.postgresflex.models.list_roles_response import ListRolesResponse +from stackit.postgresflex.models.list_user_response import ListUserResponse +from stackit.postgresflex.models.list_version_response import ListVersionResponse +from stackit.postgresflex.models.partial_update_database_payload import ( + PartialUpdateDatabasePayload, +) from stackit.postgresflex.models.partial_update_instance_payload import ( PartialUpdateInstancePayload, ) -from stackit.postgresflex.models.partial_update_instance_response import ( - PartialUpdateInstanceResponse, -) from stackit.postgresflex.models.partial_update_user_payload import ( PartialUpdateUserPayload, ) -from stackit.postgresflex.models.postgres_database_parameter_response import ( - PostgresDatabaseParameterResponse, -) -from stackit.postgresflex.models.reset_user_response import ResetUserResponse -from stackit.postgresflex.models.update_backup_schedule_payload import ( - UpdateBackupSchedulePayload, +from stackit.postgresflex.models.reset_user_password_response import ( + ResetUserPasswordResponse, ) +from stackit.postgresflex.models.update_database_payload import UpdateDatabasePayload from stackit.postgresflex.models.update_instance_payload import UpdateInstancePayload +from stackit.postgresflex.models.update_instance_protection_payload import ( + UpdateInstanceProtectionPayload, +) +from stackit.postgresflex.models.update_instance_protection_response import ( + UpdateInstanceProtectionResponse, +) from stackit.postgresflex.models.update_user_payload import UpdateUserPayload +from stackit.postgresflex.models.user_sort import UserSort from stackit.postgresflex.rest import RESTResponseType @@ -88,10 +91,15 @@ def __init__(self, configuration: Configuration = None) -> None: @validate_call def clone_instance( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - clone_instance_payload: Annotated[CloneInstancePayload, Field(description="Body")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + clone_instance_payload: Annotated[ + Optional[CloneInstancePayload], + Field( + description="The request body with the parameters for cloning an instance by a point in time into a new instance." + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -104,15 +112,15 @@ def clone_instance( ) -> CloneInstanceResponse: """Clone Instance - Clone an existing instance of a postgres database to a new destination instance + Clone Instance - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param clone_instance_payload: Body (required) + :param clone_instance_payload: The request body with the parameters for cloning an instance by a point in time into a new instance. :type clone_instance_payload: CloneInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -148,11 +156,16 @@ def clone_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "CloneInstanceResponse", + "202": "CloneInstanceResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "409": "Error", + "422": "ValidationError", + "500": "Error", + "501": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -164,10 +177,15 @@ def clone_instance( @validate_call def clone_instance_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - clone_instance_payload: Annotated[CloneInstancePayload, Field(description="Body")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + clone_instance_payload: Annotated[ + Optional[CloneInstancePayload], + Field( + description="The request body with the parameters for cloning an instance by a point in time into a new instance." + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -180,15 +198,15 @@ def clone_instance_with_http_info( ) -> ApiResponse[CloneInstanceResponse]: """Clone Instance - Clone an existing instance of a postgres database to a new destination instance + Clone Instance - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param clone_instance_payload: Body (required) + :param clone_instance_payload: The request body with the parameters for cloning an instance by a point in time into a new instance. :type clone_instance_payload: CloneInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -224,11 +242,16 @@ def clone_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "CloneInstanceResponse", + "202": "CloneInstanceResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "409": "Error", + "422": "ValidationError", + "500": "Error", + "501": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -240,10 +263,15 @@ def clone_instance_with_http_info( @validate_call def clone_instance_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - clone_instance_payload: Annotated[CloneInstancePayload, Field(description="Body")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + clone_instance_payload: Annotated[ + Optional[CloneInstancePayload], + Field( + description="The request body with the parameters for cloning an instance by a point in time into a new instance." + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -256,15 +284,15 @@ def clone_instance_without_preload_content( ) -> RESTResponseType: """Clone Instance - Clone an existing instance of a postgres database to a new destination instance + Clone Instance - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param clone_instance_payload: Body (required) + :param clone_instance_payload: The request body with the parameters for cloning an instance by a point in time into a new instance. :type clone_instance_payload: CloneInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -300,11 +328,16 @@ def clone_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "CloneInstanceResponse", + "202": "CloneInstanceResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "409": "Error", + "422": "ValidationError", + "500": "Error", + "501": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -363,7 +396,7 @@ def _clone_instance_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/clone", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/clone", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -379,10 +412,13 @@ def _clone_instance_serialize( @validate_call def create_database( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - create_database_payload: Annotated[CreateDatabasePayload, Field(description="body")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + create_database_payload: Annotated[ + CreateDatabasePayload, + Field(description="The request body containing the information for the new database."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -392,18 +428,18 @@ def create_database( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> InstanceCreateDatabaseResponse: + ) -> CreateDatabaseResponse: """Create Database - Create database for a user Note: The name of a valid user must be provided in the \"options\" map field using the key \"owner\" + Create database for a user. Note: The name of a valid user must be provided in the 'options' map field using the key 'owner' - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param create_database_payload: body (required) + :param create_database_payload: The request body containing the information for the new database. (required) :type create_database_payload: CreateDatabasePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -439,11 +475,16 @@ def create_database( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "InstanceCreateDatabaseResponse", + "200": "CreateDatabaseResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "409": "Error", + "422": "ValidationError", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -455,10 +496,13 @@ def create_database( @validate_call def create_database_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - create_database_payload: Annotated[CreateDatabasePayload, Field(description="body")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + create_database_payload: Annotated[ + CreateDatabasePayload, + Field(description="The request body containing the information for the new database."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -468,18 +512,18 @@ def create_database_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[InstanceCreateDatabaseResponse]: + ) -> ApiResponse[CreateDatabaseResponse]: """Create Database - Create database for a user Note: The name of a valid user must be provided in the \"options\" map field using the key \"owner\" + Create database for a user. Note: The name of a valid user must be provided in the 'options' map field using the key 'owner' - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param create_database_payload: body (required) + :param create_database_payload: The request body containing the information for the new database. (required) :type create_database_payload: CreateDatabasePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -515,11 +559,16 @@ def create_database_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "InstanceCreateDatabaseResponse", + "200": "CreateDatabaseResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "409": "Error", + "422": "ValidationError", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -531,10 +580,13 @@ def create_database_with_http_info( @validate_call def create_database_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - create_database_payload: Annotated[CreateDatabasePayload, Field(description="body")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + create_database_payload: Annotated[ + CreateDatabasePayload, + Field(description="The request body containing the information for the new database."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -547,15 +599,15 @@ def create_database_without_preload_content( ) -> RESTResponseType: """Create Database - Create database for a user Note: The name of a valid user must be provided in the \"options\" map field using the key \"owner\" + Create database for a user. Note: The name of a valid user must be provided in the 'options' map field using the key 'owner' - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param create_database_payload: body (required) + :param create_database_payload: The request body containing the information for the new database. (required) :type create_database_payload: CreateDatabasePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -591,11 +643,16 @@ def create_database_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "InstanceCreateDatabaseResponse", + "200": "CreateDatabaseResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "409": "Error", + "422": "ValidationError", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -654,7 +711,7 @@ def _create_database_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/databases", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -670,9 +727,14 @@ def _create_database_serialize( @validate_call def create_instance( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - create_instance_payload: Annotated[CreateInstancePayload, Field(description="Body")], + create_instance_payload: Annotated[ + CreateInstancePayload, + Field( + description="The request body with the parameters for the instance creation. Every parameter is required." + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -685,13 +747,13 @@ def create_instance( ) -> CreateInstanceResponse: """Create Instance - Create a new instance of a postgres database + Create a new instance of a postgres database instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param create_instance_payload: Body (required) + :param create_instance_payload: The request body with the parameters for the instance creation. Every parameter is required. (required) :type create_instance_payload: CreateInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -726,11 +788,14 @@ def create_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateInstanceResponse", + "202": "CreateInstanceResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "422": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -742,9 +807,14 @@ def create_instance( @validate_call def create_instance_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - create_instance_payload: Annotated[CreateInstancePayload, Field(description="Body")], + create_instance_payload: Annotated[ + CreateInstancePayload, + Field( + description="The request body with the parameters for the instance creation. Every parameter is required." + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -757,13 +827,13 @@ def create_instance_with_http_info( ) -> ApiResponse[CreateInstanceResponse]: """Create Instance - Create a new instance of a postgres database + Create a new instance of a postgres database instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param create_instance_payload: Body (required) + :param create_instance_payload: The request body with the parameters for the instance creation. Every parameter is required. (required) :type create_instance_payload: CreateInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -798,11 +868,14 @@ def create_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateInstanceResponse", + "202": "CreateInstanceResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "422": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -814,9 +887,14 @@ def create_instance_with_http_info( @validate_call def create_instance_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - create_instance_payload: Annotated[CreateInstancePayload, Field(description="Body")], + create_instance_payload: Annotated[ + CreateInstancePayload, + Field( + description="The request body with the parameters for the instance creation. Every parameter is required." + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -829,13 +907,13 @@ def create_instance_without_preload_content( ) -> RESTResponseType: """Create Instance - Create a new instance of a postgres database + Create a new instance of a postgres database instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param create_instance_payload: Body (required) + :param create_instance_payload: The request body with the parameters for the instance creation. Every parameter is required. (required) :type create_instance_payload: CreateInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -870,11 +948,14 @@ def create_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateInstanceResponse", + "202": "CreateInstanceResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "422": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -930,7 +1011,7 @@ def _create_instance_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v2/projects/{projectId}/regions/{region}/instances", + resource_path="/v3/projects/{projectId}/regions/{region}/instances", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -946,10 +1027,12 @@ def _create_instance_serialize( @validate_call def create_user( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - create_user_payload: Annotated[CreateUserPayload, Field(description="body")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + create_user_payload: Annotated[ + CreateUserPayload, Field(description="The request body containing the user details.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -962,15 +1045,15 @@ def create_user( ) -> CreateUserResponse: """Create User - Create user for an instance + Create user for an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param create_user_payload: body (required) + :param create_user_payload: The request body containing the user details. (required) :type create_user_payload: CreateUserPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1006,11 +1089,16 @@ def create_user( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateUserResponse", + "202": "CreateUserResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "409": "Error", + "422": "ValidationError", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1022,10 +1110,12 @@ def create_user( @validate_call def create_user_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - create_user_payload: Annotated[CreateUserPayload, Field(description="body")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + create_user_payload: Annotated[ + CreateUserPayload, Field(description="The request body containing the user details.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1038,15 +1128,15 @@ def create_user_with_http_info( ) -> ApiResponse[CreateUserResponse]: """Create User - Create user for an instance + Create user for an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param create_user_payload: body (required) + :param create_user_payload: The request body containing the user details. (required) :type create_user_payload: CreateUserPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1082,11 +1172,16 @@ def create_user_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateUserResponse", + "202": "CreateUserResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "409": "Error", + "422": "ValidationError", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1098,10 +1193,12 @@ def create_user_with_http_info( @validate_call def create_user_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - create_user_payload: Annotated[CreateUserPayload, Field(description="body")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + create_user_payload: Annotated[ + CreateUserPayload, Field(description="The request body containing the user details.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1114,15 +1211,15 @@ def create_user_without_preload_content( ) -> RESTResponseType: """Create User - Create user for an instance + Create user for an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param create_user_payload: body (required) + :param create_user_payload: The request body containing the user details. (required) :type create_user_payload: CreateUserPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1158,11 +1255,16 @@ def create_user_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateUserResponse", + "202": "CreateUserResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "409": "Error", + "422": "ValidationError", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -1221,7 +1323,7 @@ def _create_user_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1237,10 +1339,10 @@ def _create_user_serialize( @validate_call def delete_database( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - database_id: Annotated[StrictStr, Field(description="Database ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + database_id: Annotated[StrictInt, Field(description="The ID of the database.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1253,16 +1355,16 @@ def delete_database( ) -> None: """Delete Database - Delete database for an instance + Delete database for an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param database_id: Database ID (required) - :type database_id: str + :param database_id: The ID of the database. (required) + :type database_id: int :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 @@ -1297,11 +1399,14 @@ def delete_database( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "202": None, "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1313,10 +1418,10 @@ def delete_database( @validate_call def delete_database_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - database_id: Annotated[StrictStr, Field(description="Database ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + database_id: Annotated[StrictInt, Field(description="The ID of the database.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1329,16 +1434,16 @@ def delete_database_with_http_info( ) -> ApiResponse[None]: """Delete Database - Delete database for an instance + Delete database for an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param database_id: Database ID (required) - :type database_id: str + :param database_id: The ID of the database. (required) + :type database_id: int :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 @@ -1373,11 +1478,14 @@ def delete_database_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "202": None, "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1389,10 +1497,10 @@ def delete_database_with_http_info( @validate_call def delete_database_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - database_id: Annotated[StrictStr, Field(description="Database ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + database_id: Annotated[StrictInt, Field(description="The ID of the database.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1405,16 +1513,16 @@ def delete_database_without_preload_content( ) -> RESTResponseType: """Delete Database - Delete database for an instance + Delete database for an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param database_id: Database ID (required) - :type database_id: str + :param database_id: The ID of the database. (required) + :type database_id: int :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 @@ -1449,11 +1557,14 @@ def delete_database_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "202": None, "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -1504,7 +1615,7 @@ def _delete_database_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1520,9 +1631,9 @@ def _delete_database_serialize( @validate_call def delete_instance( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1535,13 +1646,13 @@ def delete_instance( ) -> None: """Delete Instance - Delete available instance + Delete an available postgres instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1579,9 +1690,11 @@ def delete_instance( "202": None, "400": "Error", "401": "Error", + "403": "Error", "404": "Error", - "405": None, + "412": "Error", "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1593,9 +1706,9 @@ def delete_instance( @validate_call def delete_instance_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1608,13 +1721,13 @@ def delete_instance_with_http_info( ) -> ApiResponse[None]: """Delete Instance - Delete available instance + Delete an available postgres instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1652,9 +1765,11 @@ def delete_instance_with_http_info( "202": None, "400": "Error", "401": "Error", + "403": "Error", "404": "Error", - "405": None, + "412": "Error", "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1666,9 +1781,9 @@ def delete_instance_with_http_info( @validate_call def delete_instance_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1681,13 +1796,13 @@ def delete_instance_without_preload_content( ) -> RESTResponseType: """Delete Instance - Delete available instance + Delete an available postgres instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1725,9 +1840,11 @@ def delete_instance_without_preload_content( "202": None, "400": "Error", "401": "Error", + "403": "Error", "404": "Error", - "405": None, + "412": "Error", "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -1775,7 +1892,7 @@ def _delete_instance_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v2/projects/{projectId}/regions/{region}/instances/{instanceId}", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1791,10 +1908,10 @@ def _delete_instance_serialize( @validate_call def delete_user( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - user_id: Annotated[StrictStr, Field(description="User ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + user_id: Annotated[StrictInt, Field(description="The ID of the user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1807,16 +1924,16 @@ def delete_user( ) -> None: """Delete User - Delete user for an instance + Delete an user from a specific instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param user_id: User ID (required) - :type user_id: str + :param user_id: The ID of the user. (required) + :type user_id: int :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 @@ -1851,11 +1968,15 @@ def delete_user( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "202": None, "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "409": "Error", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1867,10 +1988,10 @@ def delete_user( @validate_call def delete_user_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - user_id: Annotated[StrictStr, Field(description="User ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + user_id: Annotated[StrictInt, Field(description="The ID of the user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1883,16 +2004,16 @@ def delete_user_with_http_info( ) -> ApiResponse[None]: """Delete User - Delete user for an instance + Delete an user from a specific instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param user_id: User ID (required) - :type user_id: str + :param user_id: The ID of the user. (required) + :type user_id: int :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 @@ -1927,11 +2048,15 @@ def delete_user_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "202": None, "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "409": "Error", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1943,10 +2068,10 @@ def delete_user_with_http_info( @validate_call def delete_user_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - user_id: Annotated[StrictStr, Field(description="User ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + user_id: Annotated[StrictInt, Field(description="The ID of the user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1959,16 +2084,16 @@ def delete_user_without_preload_content( ) -> RESTResponseType: """Delete User - Delete user for an instance + Delete an user from a specific instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param user_id: User ID (required) - :type user_id: str + :param user_id: The ID of the user. (required) + :type user_id: int :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 @@ -2003,11 +2128,15 @@ def delete_user_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "202": None, "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "409": "Error", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -2058,7 +2187,7 @@ def _delete_user_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2072,11 +2201,12 @@ def _delete_user_serialize( ) @validate_call - def force_delete_instance( + def get_backup( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + backup_id: Annotated[StrictInt, Field(description="The ID of the backup.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2086,17 +2216,19 @@ def force_delete_instance( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Force delete instance + ) -> BackupData: + """Get specific backup - Forces the deletion of an delayed deleted instance + Get information about a specific backup for an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str + :param backup_id: The ID of the backup. (required) + :type backup_id: int :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 @@ -2119,10 +2251,11 @@ def force_delete_instance( :return: Returns the result object. """ # noqa: E501 - _param = self._force_delete_instance_serialize( + _param = self._get_backup_serialize( project_id=project_id, region=region, instance_id=instance_id, + backup_id=backup_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2130,12 +2263,14 @@ def force_delete_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "BackupData", "400": "Error", "401": "Error", - "405": None, - "406": "Error", + "403": "Error", + "404": "Error", "500": "Error", + "501": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2145,11 +2280,12 @@ def force_delete_instance( ).data @validate_call - def force_delete_instance_with_http_info( + def get_backup_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + backup_id: Annotated[StrictInt, Field(description="The ID of the backup.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2159,17 +2295,19 @@ def force_delete_instance_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Force delete instance + ) -> ApiResponse[BackupData]: + """Get specific backup - Forces the deletion of an delayed deleted instance + Get information about a specific backup for an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str + :param backup_id: The ID of the backup. (required) + :type backup_id: int :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 @@ -2192,10 +2330,11 @@ def force_delete_instance_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._force_delete_instance_serialize( + _param = self._get_backup_serialize( project_id=project_id, region=region, instance_id=instance_id, + backup_id=backup_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2203,12 +2342,14 @@ def force_delete_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "BackupData", "400": "Error", "401": "Error", - "405": None, - "406": "Error", + "403": "Error", + "404": "Error", "500": "Error", + "501": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2218,11 +2359,12 @@ def force_delete_instance_with_http_info( ) @validate_call - def force_delete_instance_without_preload_content( + def get_backup_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + backup_id: Annotated[StrictInt, Field(description="The ID of the backup.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2233,16 +2375,18 @@ def force_delete_instance_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Force delete instance + """Get specific backup - Forces the deletion of an delayed deleted instance + Get information about a specific backup for an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str + :param backup_id: The ID of the backup. (required) + :type backup_id: int :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 @@ -2265,10 +2409,11 @@ def force_delete_instance_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._force_delete_instance_serialize( + _param = self._get_backup_serialize( project_id=project_id, region=region, instance_id=instance_id, + backup_id=backup_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2276,21 +2421,24 @@ def force_delete_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": None, + "200": "BackupData", "400": "Error", "401": "Error", - "405": None, - "406": "Error", + "403": "Error", + "404": "Error", "500": "Error", + "501": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _force_delete_instance_serialize( + def _get_backup_serialize( self, project_id, region, instance_id, + backup_id, _request_auth, _content_type, _headers, @@ -2315,6 +2463,8 @@ def _force_delete_instance_serialize( _path_params["region"] = region if instance_id is not None: _path_params["instanceId"] = instance_id + if backup_id is not None: + _path_params["backupId"] = backup_id # process the query parameters # process the header parameters # process the form parameters @@ -2328,8 +2478,8 @@ def _force_delete_instance_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/force", + method="GET", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/{backupId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2343,12 +2493,12 @@ def _force_delete_instance_serialize( ) @validate_call - def get_backup( + def get_database( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - backup_id: Annotated[StrictStr, Field(description="Backup ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + database_id: Annotated[StrictInt, Field(description="The ID of the database.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2358,19 +2508,19 @@ def get_backup( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetBackupResponse: - """Get specific backup + ) -> GetDatabaseResponse: + """Get Specific Database - Get specific available backup + Get information about a specific database in an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param backup_id: Backup ID (required) - :type backup_id: str + :param database_id: The ID of the database. (required) + :type database_id: int :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 @@ -2393,11 +2543,11 @@ def get_backup( :return: Returns the result object. """ # noqa: E501 - _param = self._get_backup_serialize( + _param = self._get_database_serialize( project_id=project_id, region=region, instance_id=instance_id, - backup_id=backup_id, + database_id=database_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2405,12 +2555,13 @@ def get_backup( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetBackupResponse", + "200": "GetDatabaseResponse", "400": "Error", "401": "Error", - "404": None, - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2420,12 +2571,12 @@ def get_backup( ).data @validate_call - def get_backup_with_http_info( + def get_database_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - backup_id: Annotated[StrictStr, Field(description="Backup ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + database_id: Annotated[StrictInt, Field(description="The ID of the database.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2435,19 +2586,19 @@ def get_backup_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetBackupResponse]: - """Get specific backup + ) -> ApiResponse[GetDatabaseResponse]: + """Get Specific Database - Get specific available backup + Get information about a specific database in an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param backup_id: Backup ID (required) - :type backup_id: str + :param database_id: The ID of the database. (required) + :type database_id: int :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 @@ -2470,11 +2621,11 @@ def get_backup_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_backup_serialize( + _param = self._get_database_serialize( project_id=project_id, region=region, instance_id=instance_id, - backup_id=backup_id, + database_id=database_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2482,12 +2633,13 @@ def get_backup_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetBackupResponse", + "200": "GetDatabaseResponse", "400": "Error", "401": "Error", - "404": None, - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2497,12 +2649,12 @@ def get_backup_with_http_info( ) @validate_call - def get_backup_without_preload_content( + def get_database_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - backup_id: Annotated[StrictStr, Field(description="Backup ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + database_id: Annotated[StrictInt, Field(description="The ID of the database.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2513,18 +2665,18 @@ def get_backup_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get specific backup + """Get Specific Database - Get specific available backup + Get information about a specific database in an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param backup_id: Backup ID (required) - :type backup_id: str + :param database_id: The ID of the database. (required) + :type database_id: int :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 @@ -2547,11 +2699,11 @@ def get_backup_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_backup_serialize( + _param = self._get_database_serialize( project_id=project_id, region=region, instance_id=instance_id, - backup_id=backup_id, + database_id=database_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2559,22 +2711,23 @@ def get_backup_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetBackupResponse", + "200": "GetDatabaseResponse", "400": "Error", "401": "Error", - "404": None, - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_backup_serialize( + def _get_database_serialize( self, project_id, region, instance_id, - backup_id, + database_id, _request_auth, _content_type, _headers, @@ -2599,8 +2752,8 @@ def _get_backup_serialize( _path_params["region"] = region if instance_id is not None: _path_params["instanceId"] = instance_id - if backup_id is not None: - _path_params["backupId"] = backup_id + if database_id is not None: + _path_params["databaseId"] = database_id # process the query parameters # process the header parameters # process the form parameters @@ -2615,7 +2768,7 @@ def _get_backup_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/{backupId}", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2631,9 +2784,9 @@ def _get_backup_serialize( @validate_call def get_instance( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2643,16 +2796,16 @@ def get_instance( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> InstanceResponse: - """Get specific instance + ) -> GetInstanceResponse: + """Get Specific Instance - Get specific available instances + Get information about a specific available instance - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -2687,11 +2840,13 @@ def get_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "InstanceResponse", + "200": "GetInstanceResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2703,9 +2858,9 @@ def get_instance( @validate_call def get_instance_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2715,16 +2870,16 @@ def get_instance_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[InstanceResponse]: - """Get specific instance + ) -> ApiResponse[GetInstanceResponse]: + """Get Specific Instance - Get specific available instances + Get information about a specific available instance - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -2759,11 +2914,13 @@ def get_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "InstanceResponse", + "200": "GetInstanceResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2775,9 +2932,9 @@ def get_instance_with_http_info( @validate_call def get_instance_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2788,15 +2945,15 @@ def get_instance_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get specific instance + """Get Specific Instance - Get specific available instances + Get information about a specific available instance - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -2831,11 +2988,13 @@ def get_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "InstanceResponse", + "200": "GetInstanceResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -2883,7 +3042,7 @@ def _get_instance_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v2/projects/{projectId}/regions/{region}/instances/{instanceId}", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2899,10 +3058,10 @@ def _get_instance_serialize( @validate_call def get_user( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - user_id: Annotated[StrictStr, Field(description="User ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + user_id: Annotated[StrictInt, Field(description="The ID of the user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2915,16 +3074,16 @@ def get_user( ) -> GetUserResponse: """Get User - Get specific available user for an instance + Get a specific available user for an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param user_id: User ID (required) - :type user_id: str + :param user_id: The ID of the user. (required) + :type user_id: int :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 @@ -2962,8 +3121,10 @@ def get_user( "200": "GetUserResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2975,10 +3136,10 @@ def get_user( @validate_call def get_user_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - user_id: Annotated[StrictStr, Field(description="User ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + user_id: Annotated[StrictInt, Field(description="The ID of the user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2991,16 +3152,16 @@ def get_user_with_http_info( ) -> ApiResponse[GetUserResponse]: """Get User - Get specific available user for an instance + Get a specific available user for an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param user_id: User ID (required) - :type user_id: str + :param user_id: The ID of the user. (required) + :type user_id: int :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 @@ -3038,8 +3199,10 @@ def get_user_with_http_info( "200": "GetUserResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3051,10 +3214,10 @@ def get_user_with_http_info( @validate_call def get_user_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - user_id: Annotated[StrictStr, Field(description="User ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + user_id: Annotated[StrictInt, Field(description="The ID of the user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3067,16 +3230,16 @@ def get_user_without_preload_content( ) -> RESTResponseType: """Get User - Get specific available user for an instance + Get a specific available user for an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param user_id: User ID (required) - :type user_id: str + :param user_id: The ID of the user. (required) + :type user_id: int :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 @@ -3114,8 +3277,10 @@ def get_user_without_preload_content( "200": "GetUserResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -3166,7 +3331,7 @@ def _get_user_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3182,9 +3347,16 @@ def _get_user_serialize( @validate_call def list_backups( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + page: Annotated[ + Optional[StrictInt], Field(description="Number of the page of items list to be returned.") + ] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of items to be returned on each page.")] = None, + sort: Annotated[ + Optional[BackupSort], Field(description="Sorting of the backups to be returned on each page.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3194,17 +3366,23 @@ def list_backups( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListBackupsResponse: + ) -> ListBackupResponse: """List backups - List all backups which are available for a specific instance + List all backups which are available for a specific instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str + :param page: Number of the page of items list to be returned. + :type page: int + :param size: Number of items to be returned on each page. + :type size: int + :param sort: Sorting of the backups to be returned on each page. + :type sort: BackupSort :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 @@ -3231,6 +3409,9 @@ def list_backups( project_id=project_id, region=region, instance_id=instance_id, + page=page, + size=size, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3238,12 +3419,14 @@ def list_backups( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListBackupsResponse", + "200": "ListBackupResponse", "400": "Error", "401": "Error", - "404": None, - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "501": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3255,9 +3438,16 @@ def list_backups( @validate_call def list_backups_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + page: Annotated[ + Optional[StrictInt], Field(description="Number of the page of items list to be returned.") + ] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of items to be returned on each page.")] = None, + sort: Annotated[ + Optional[BackupSort], Field(description="Sorting of the backups to be returned on each page.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3267,17 +3457,23 @@ def list_backups_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListBackupsResponse]: + ) -> ApiResponse[ListBackupResponse]: """List backups - List all backups which are available for a specific instance + List all backups which are available for a specific instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str + :param page: Number of the page of items list to be returned. + :type page: int + :param size: Number of items to be returned on each page. + :type size: int + :param sort: Sorting of the backups to be returned on each page. + :type sort: BackupSort :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 @@ -3304,6 +3500,9 @@ def list_backups_with_http_info( project_id=project_id, region=region, instance_id=instance_id, + page=page, + size=size, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3311,12 +3510,14 @@ def list_backups_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListBackupsResponse", + "200": "ListBackupResponse", "400": "Error", "401": "Error", - "404": None, - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "501": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3328,9 +3529,16 @@ def list_backups_with_http_info( @validate_call def list_backups_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + page: Annotated[ + Optional[StrictInt], Field(description="Number of the page of items list to be returned.") + ] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of items to be returned on each page.")] = None, + sort: Annotated[ + Optional[BackupSort], Field(description="Sorting of the backups to be returned on each page.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3343,14 +3551,20 @@ def list_backups_without_preload_content( ) -> RESTResponseType: """List backups - List all backups which are available for a specific instance + List all backups which are available for a specific instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str + :param page: Number of the page of items list to be returned. + :type page: int + :param size: Number of items to be returned on each page. + :type size: int + :param sort: Sorting of the backups to be returned on each page. + :type sort: BackupSort :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 @@ -3377,6 +3591,9 @@ def list_backups_without_preload_content( project_id=project_id, region=region, instance_id=instance_id, + page=page, + size=size, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3384,12 +3601,14 @@ def list_backups_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListBackupsResponse", + "200": "ListBackupResponse", "400": "Error", "401": "Error", - "404": None, - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "501": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -3399,6 +3618,9 @@ def _list_backups_serialize( project_id, region, instance_id, + page, + size, + sort, _request_auth, _content_type, _headers, @@ -3424,6 +3646,18 @@ def _list_backups_serialize( if instance_id is not None: _path_params["instanceId"] = instance_id # process the query parameters + if page is not None: + + _query_params.append(("page", page)) + + if size is not None: + + _query_params.append(("size", size)) + + if sort is not None: + + _query_params.append(("sort", sort.value)) + # process the header parameters # process the form parameters # process the body parameter @@ -3437,7 +3671,7 @@ def _list_backups_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/backups", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3451,11 +3685,11 @@ def _list_backups_serialize( ) @validate_call - def list_database_parameters( + def list_collations( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3465,16 +3699,16 @@ def list_database_parameters( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PostgresDatabaseParameterResponse: - """List Databases parameter + ) -> ListCollationsResponse: + """Get Collations for an Instance - List available databases parameter + Get available collations for an instance - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -3498,7 +3732,7 @@ def list_database_parameters( :return: Returns the result object. """ # noqa: E501 - _param = self._list_database_parameters_serialize( + _param = self._list_collations_serialize( project_id=project_id, region=region, instance_id=instance_id, @@ -3509,11 +3743,14 @@ def list_database_parameters( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PostgresDatabaseParameterResponse", + "200": "ListCollationsResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "501": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3523,11 +3760,11 @@ def list_database_parameters( ).data @validate_call - def list_database_parameters_with_http_info( + def list_collations_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3537,16 +3774,16 @@ def list_database_parameters_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PostgresDatabaseParameterResponse]: - """List Databases parameter + ) -> ApiResponse[ListCollationsResponse]: + """Get Collations for an Instance - List available databases parameter + Get available collations for an instance - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -3570,7 +3807,7 @@ def list_database_parameters_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_database_parameters_serialize( + _param = self._list_collations_serialize( project_id=project_id, region=region, instance_id=instance_id, @@ -3581,11 +3818,14 @@ def list_database_parameters_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PostgresDatabaseParameterResponse", + "200": "ListCollationsResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "501": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3595,11 +3835,11 @@ def list_database_parameters_with_http_info( ) @validate_call - def list_database_parameters_without_preload_content( + def list_collations_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3610,15 +3850,15 @@ def list_database_parameters_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List Databases parameter + """Get Collations for an Instance - List available databases parameter + Get available collations for an instance - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -3642,7 +3882,7 @@ def list_database_parameters_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_database_parameters_serialize( + _param = self._list_collations_serialize( project_id=project_id, region=region, instance_id=instance_id, @@ -3653,16 +3893,19 @@ def list_database_parameters_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PostgresDatabaseParameterResponse", + "200": "ListCollationsResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "501": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_database_parameters_serialize( + def _list_collations_serialize( self, project_id, region, @@ -3705,7 +3948,7 @@ def _list_database_parameters_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/parameter", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/collations", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3721,9 +3964,16 @@ def _list_database_parameters_serialize( @validate_call def list_databases( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + page: Annotated[ + Optional[StrictInt], Field(description="Number of the page of items list to be returned.") + ] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of items to be returned on each page.")] = None, + sort: Annotated[ + Optional[DatabaseSort], Field(description="Sorting of the databases to be returned on each page.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3733,17 +3983,23 @@ def list_databases( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> InstanceListDatabasesResponse: + ) -> ListDatabasesResponse: """List Databases - List available databases for an instance + List available databases for an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str + :param page: Number of the page of items list to be returned. + :type page: int + :param size: Number of items to be returned on each page. + :type size: int + :param sort: Sorting of the databases to be returned on each page. + :type sort: DatabaseSort :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 @@ -3770,6 +4026,9 @@ def list_databases( project_id=project_id, region=region, instance_id=instance_id, + page=page, + size=size, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3777,11 +4036,13 @@ def list_databases( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "InstanceListDatabasesResponse", + "200": "ListDatabasesResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3793,9 +4054,16 @@ def list_databases( @validate_call def list_databases_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + page: Annotated[ + Optional[StrictInt], Field(description="Number of the page of items list to be returned.") + ] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of items to be returned on each page.")] = None, + sort: Annotated[ + Optional[DatabaseSort], Field(description="Sorting of the databases to be returned on each page.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3805,17 +4073,23 @@ def list_databases_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[InstanceListDatabasesResponse]: + ) -> ApiResponse[ListDatabasesResponse]: """List Databases - List available databases for an instance + List available databases for an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str + :param page: Number of the page of items list to be returned. + :type page: int + :param size: Number of items to be returned on each page. + :type size: int + :param sort: Sorting of the databases to be returned on each page. + :type sort: DatabaseSort :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 @@ -3842,6 +4116,9 @@ def list_databases_with_http_info( project_id=project_id, region=region, instance_id=instance_id, + page=page, + size=size, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3849,11 +4126,13 @@ def list_databases_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "InstanceListDatabasesResponse", + "200": "ListDatabasesResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3865,9 +4144,16 @@ def list_databases_with_http_info( @validate_call def list_databases_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + page: Annotated[ + Optional[StrictInt], Field(description="Number of the page of items list to be returned.") + ] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of items to be returned on each page.")] = None, + sort: Annotated[ + Optional[DatabaseSort], Field(description="Sorting of the databases to be returned on each page.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3880,14 +4166,20 @@ def list_databases_without_preload_content( ) -> RESTResponseType: """List Databases - List available databases for an instance + List available databases for an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str + :param page: Number of the page of items list to be returned. + :type page: int + :param size: Number of items to be returned on each page. + :type size: int + :param sort: Sorting of the databases to be returned on each page. + :type sort: DatabaseSort :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 @@ -3914,6 +4206,9 @@ def list_databases_without_preload_content( project_id=project_id, region=region, instance_id=instance_id, + page=page, + size=size, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3921,11 +4216,13 @@ def list_databases_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "InstanceListDatabasesResponse", + "200": "ListDatabasesResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -3935,6 +4232,9 @@ def _list_databases_serialize( project_id, region, instance_id, + page, + size, + sort, _request_auth, _content_type, _headers, @@ -3960,6 +4260,18 @@ def _list_databases_serialize( if instance_id is not None: _path_params["instanceId"] = instance_id # process the query parameters + if page is not None: + + _query_params.append(("page", page)) + + if size is not None: + + _query_params.append(("size", size)) + + if sort is not None: + + _query_params.append(("sort", sort.value)) + # process the header parameters # process the form parameters # process the body parameter @@ -3973,7 +4285,7 @@ def _list_databases_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/databases", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3989,8 +4301,15 @@ def _list_databases_serialize( @validate_call def list_flavors( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], + page: Annotated[ + Optional[StrictInt], Field(description="Number of the page of items list to be returned.") + ] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of items to be returned on each page.")] = None, + sort: Annotated[ + Optional[FlavorSort], Field(description="Sorting of the flavors to be returned on each page.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4003,12 +4322,18 @@ def list_flavors( ) -> ListFlavorsResponse: """Get Flavors - Get available flavors for a specific projectID + Get all available flavors for a project. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str + :param page: Number of the page of items list to be returned. + :type page: int + :param size: Number of items to be returned on each page. + :type size: int + :param sort: Sorting of the flavors to be returned on each page. + :type sort: FlavorSort :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 @@ -4034,6 +4359,9 @@ def list_flavors( _param = self._list_flavors_serialize( project_id=project_id, region=region, + page=page, + size=size, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4044,8 +4372,11 @@ def list_flavors( "200": "ListFlavorsResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "501": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -4057,8 +4388,15 @@ def list_flavors( @validate_call def list_flavors_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], + page: Annotated[ + Optional[StrictInt], Field(description="Number of the page of items list to be returned.") + ] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of items to be returned on each page.")] = None, + sort: Annotated[ + Optional[FlavorSort], Field(description="Sorting of the flavors to be returned on each page.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4071,12 +4409,18 @@ def list_flavors_with_http_info( ) -> ApiResponse[ListFlavorsResponse]: """Get Flavors - Get available flavors for a specific projectID + Get all available flavors for a project. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str + :param page: Number of the page of items list to be returned. + :type page: int + :param size: Number of items to be returned on each page. + :type size: int + :param sort: Sorting of the flavors to be returned on each page. + :type sort: FlavorSort :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 @@ -4102,6 +4446,9 @@ def list_flavors_with_http_info( _param = self._list_flavors_serialize( project_id=project_id, region=region, + page=page, + size=size, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4112,8 +4459,11 @@ def list_flavors_with_http_info( "200": "ListFlavorsResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "501": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -4125,8 +4475,15 @@ def list_flavors_with_http_info( @validate_call def list_flavors_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], + page: Annotated[ + Optional[StrictInt], Field(description="Number of the page of items list to be returned.") + ] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of items to be returned on each page.")] = None, + sort: Annotated[ + Optional[FlavorSort], Field(description="Sorting of the flavors to be returned on each page.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4139,12 +4496,18 @@ def list_flavors_without_preload_content( ) -> RESTResponseType: """Get Flavors - Get available flavors for a specific projectID + Get all available flavors for a project. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str + :param page: Number of the page of items list to be returned. + :type page: int + :param size: Number of items to be returned on each page. + :type size: int + :param sort: Sorting of the flavors to be returned on each page. + :type sort: FlavorSort :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 @@ -4170,6 +4533,9 @@ def list_flavors_without_preload_content( _param = self._list_flavors_serialize( project_id=project_id, region=region, + page=page, + size=size, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4180,8 +4546,11 @@ def list_flavors_without_preload_content( "200": "ListFlavorsResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "501": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -4190,6 +4559,9 @@ def _list_flavors_serialize( self, project_id, region, + page, + size, + sort, _request_auth, _content_type, _headers, @@ -4213,6 +4585,18 @@ def _list_flavors_serialize( if region is not None: _path_params["region"] = region # process the query parameters + if page is not None: + + _query_params.append(("page", page)) + + if size is not None: + + _query_params.append(("size", size)) + + if sort is not None: + + _query_params.append(("sort", sort.value)) + # process the header parameters # process the form parameters # process the body parameter @@ -4226,7 +4610,7 @@ def _list_flavors_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v2/projects/{projectId}/regions/{region}/flavors", + resource_path="/v3/projects/{projectId}/regions/{region}/flavors", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4242,8 +4626,15 @@ def _list_flavors_serialize( @validate_call def list_instances( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], + page: Annotated[ + Optional[StrictInt], Field(description="Number of the page of items list to be returned.") + ] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of items to be returned on each page.")] = None, + sort: Annotated[ + Optional[InstanceSort], Field(description="Sorting of the items to be returned on each page.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4256,12 +4647,18 @@ def list_instances( ) -> ListInstancesResponse: """List Instances - List available instances + List all available instances for your project. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str + :param page: Number of the page of items list to be returned. + :type page: int + :param size: Number of items to be returned on each page. + :type size: int + :param sort: Sorting of the items to be returned on each page. + :type sort: InstanceSort :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 @@ -4287,6 +4684,9 @@ def list_instances( _param = self._list_instances_serialize( project_id=project_id, region=region, + page=page, + size=size, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4297,8 +4697,10 @@ def list_instances( "200": "ListInstancesResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -4310,8 +4712,15 @@ def list_instances( @validate_call def list_instances_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], + page: Annotated[ + Optional[StrictInt], Field(description="Number of the page of items list to be returned.") + ] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of items to be returned on each page.")] = None, + sort: Annotated[ + Optional[InstanceSort], Field(description="Sorting of the items to be returned on each page.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4324,12 +4733,18 @@ def list_instances_with_http_info( ) -> ApiResponse[ListInstancesResponse]: """List Instances - List available instances + List all available instances for your project. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str + :param page: Number of the page of items list to be returned. + :type page: int + :param size: Number of items to be returned on each page. + :type size: int + :param sort: Sorting of the items to be returned on each page. + :type sort: InstanceSort :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 @@ -4355,6 +4770,9 @@ def list_instances_with_http_info( _param = self._list_instances_serialize( project_id=project_id, region=region, + page=page, + size=size, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4365,8 +4783,10 @@ def list_instances_with_http_info( "200": "ListInstancesResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -4378,8 +4798,15 @@ def list_instances_with_http_info( @validate_call def list_instances_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], + page: Annotated[ + Optional[StrictInt], Field(description="Number of the page of items list to be returned.") + ] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of items to be returned on each page.")] = None, + sort: Annotated[ + Optional[InstanceSort], Field(description="Sorting of the items to be returned on each page.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4392,12 +4819,18 @@ def list_instances_without_preload_content( ) -> RESTResponseType: """List Instances - List available instances + List all available instances for your project. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str + :param page: Number of the page of items list to be returned. + :type page: int + :param size: Number of items to be returned on each page. + :type size: int + :param sort: Sorting of the items to be returned on each page. + :type sort: InstanceSort :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 @@ -4423,6 +4856,9 @@ def list_instances_without_preload_content( _param = self._list_instances_serialize( project_id=project_id, region=region, + page=page, + size=size, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4433,8 +4869,10 @@ def list_instances_without_preload_content( "200": "ListInstancesResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -4443,6 +4881,9 @@ def _list_instances_serialize( self, project_id, region, + page, + size, + sort, _request_auth, _content_type, _headers, @@ -4466,6 +4907,18 @@ def _list_instances_serialize( if region is not None: _path_params["region"] = region # process the query parameters + if page is not None: + + _query_params.append(("page", page)) + + if size is not None: + + _query_params.append(("size", size)) + + if sort is not None: + + _query_params.append(("sort", sort.value)) + # process the header parameters # process the form parameters # process the body parameter @@ -4479,7 +4932,7 @@ def _list_instances_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v2/projects/{projectId}/regions/{region}/instances", + resource_path="/v3/projects/{projectId}/regions/{region}/instances", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4493,36 +4946,11 @@ def _list_instances_serialize( ) @validate_call - def list_metrics( + def list_roles( self, - project_id: Annotated[StrictStr, Field(description="The UUID of the project.")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="The UUID of the instance.")], - metric: Annotated[ - StrictStr, - Field( - description="The name of the metric. Valid metrics are 'cpu', 'memory', 'max-connections', 'connections' and 'disk-use'." - ), - ], - granularity: Annotated[StrictStr, Field(description="The granularity in ISO8601 e.g. 5 minutes are 'PT5M'.")], - period: Annotated[ - Optional[StrictStr], - Field( - description="The period in ISO8601 format e.g. 5 minutes are 'PT5M'. If no period is provided, the standard value of 5 minutes is used." - ), - ] = None, - start: Annotated[ - Optional[StrictStr], - Field( - description="The start of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. If no start time is provided, current server time as UTC is used." - ), - ] = None, - end: Annotated[ - Optional[StrictStr], - Field( - description="The end of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'." - ), - ] = None, + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4532,27 +4960,17 @@ def list_metrics( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> InstanceMetricsResponse: - """Get Metric + ) -> ListRolesResponse: + """List Roles - Returns a metric for an instance. The metric will only be for the master pod if needed. Granularity parameter is always needed. If start and end time is provided, period is not considered in max-connections and disk-use. If you provide start time, you have to provide end time as well and vice versa. + List available roles for an instance. - :param project_id: The UUID of the project. (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: The UUID of the instance. (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param metric: The name of the metric. Valid metrics are 'cpu', 'memory', 'max-connections', 'connections' and 'disk-use'. (required) - :type metric: str - :param granularity: The granularity in ISO8601 e.g. 5 minutes are 'PT5M'. (required) - :type granularity: str - :param period: The period in ISO8601 format e.g. 5 minutes are 'PT5M'. If no period is provided, the standard value of 5 minutes is used. - :type period: str - :param start: The start of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. If no start time is provided, current server time as UTC is used. - :type start: str - :param end: The end of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. - :type end: 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 @@ -4575,15 +4993,10 @@ def list_metrics( :return: Returns the result object. """ # noqa: E501 - _param = self._list_metrics_serialize( + _param = self._list_roles_serialize( project_id=project_id, region=region, instance_id=instance_id, - metric=metric, - granularity=granularity, - period=period, - start=start, - end=end, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4591,11 +5004,13 @@ def list_metrics( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "InstanceMetricsResponse", + "200": "ListRolesResponse", "400": "Error", "401": "Error", - "405": "Error", + "403": "Error", + "404": "Error", "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -4605,36 +5020,11 @@ def list_metrics( ).data @validate_call - def list_metrics_with_http_info( + def list_roles_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="The UUID of the project.")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="The UUID of the instance.")], - metric: Annotated[ - StrictStr, - Field( - description="The name of the metric. Valid metrics are 'cpu', 'memory', 'max-connections', 'connections' and 'disk-use'." - ), - ], - granularity: Annotated[StrictStr, Field(description="The granularity in ISO8601 e.g. 5 minutes are 'PT5M'.")], - period: Annotated[ - Optional[StrictStr], - Field( - description="The period in ISO8601 format e.g. 5 minutes are 'PT5M'. If no period is provided, the standard value of 5 minutes is used." - ), - ] = None, - start: Annotated[ - Optional[StrictStr], - Field( - description="The start of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. If no start time is provided, current server time as UTC is used." - ), - ] = None, - end: Annotated[ - Optional[StrictStr], - Field( - description="The end of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'." - ), - ] = None, + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4644,27 +5034,17 @@ def list_metrics_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[InstanceMetricsResponse]: - """Get Metric + ) -> ApiResponse[ListRolesResponse]: + """List Roles - Returns a metric for an instance. The metric will only be for the master pod if needed. Granularity parameter is always needed. If start and end time is provided, period is not considered in max-connections and disk-use. If you provide start time, you have to provide end time as well and vice versa. + List available roles for an instance. - :param project_id: The UUID of the project. (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: The UUID of the instance. (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param metric: The name of the metric. Valid metrics are 'cpu', 'memory', 'max-connections', 'connections' and 'disk-use'. (required) - :type metric: str - :param granularity: The granularity in ISO8601 e.g. 5 minutes are 'PT5M'. (required) - :type granularity: str - :param period: The period in ISO8601 format e.g. 5 minutes are 'PT5M'. If no period is provided, the standard value of 5 minutes is used. - :type period: str - :param start: The start of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. If no start time is provided, current server time as UTC is used. - :type start: str - :param end: The end of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. - :type end: 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 @@ -4687,15 +5067,10 @@ def list_metrics_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_metrics_serialize( + _param = self._list_roles_serialize( project_id=project_id, region=region, instance_id=instance_id, - metric=metric, - granularity=granularity, - period=period, - start=start, - end=end, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4703,11 +5078,13 @@ def list_metrics_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "InstanceMetricsResponse", + "200": "ListRolesResponse", "400": "Error", "401": "Error", - "405": "Error", + "403": "Error", + "404": "Error", "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -4717,36 +5094,11 @@ def list_metrics_with_http_info( ) @validate_call - def list_metrics_without_preload_content( + def list_roles_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="The UUID of the project.")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="The UUID of the instance.")], - metric: Annotated[ - StrictStr, - Field( - description="The name of the metric. Valid metrics are 'cpu', 'memory', 'max-connections', 'connections' and 'disk-use'." - ), - ], - granularity: Annotated[StrictStr, Field(description="The granularity in ISO8601 e.g. 5 minutes are 'PT5M'.")], - period: Annotated[ - Optional[StrictStr], - Field( - description="The period in ISO8601 format e.g. 5 minutes are 'PT5M'. If no period is provided, the standard value of 5 minutes is used." - ), - ] = None, - start: Annotated[ - Optional[StrictStr], - Field( - description="The start of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. If no start time is provided, current server time as UTC is used." - ), - ] = None, - end: Annotated[ - Optional[StrictStr], - Field( - description="The end of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'." - ), - ] = None, + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4757,26 +5109,16 @@ def list_metrics_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Metric + """List Roles - Returns a metric for an instance. The metric will only be for the master pod if needed. Granularity parameter is always needed. If start and end time is provided, period is not considered in max-connections and disk-use. If you provide start time, you have to provide end time as well and vice versa. + List available roles for an instance. - :param project_id: The UUID of the project. (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: The UUID of the instance. (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param metric: The name of the metric. Valid metrics are 'cpu', 'memory', 'max-connections', 'connections' and 'disk-use'. (required) - :type metric: str - :param granularity: The granularity in ISO8601 e.g. 5 minutes are 'PT5M'. (required) - :type granularity: str - :param period: The period in ISO8601 format e.g. 5 minutes are 'PT5M'. If no period is provided, the standard value of 5 minutes is used. - :type period: str - :param start: The start of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. If no start time is provided, current server time as UTC is used. - :type start: str - :param end: The end of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. - :type end: 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 @@ -4799,15 +5141,10 @@ def list_metrics_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_metrics_serialize( + _param = self._list_roles_serialize( project_id=project_id, region=region, instance_id=instance_id, - metric=metric, - granularity=granularity, - period=period, - start=start, - end=end, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4815,25 +5152,22 @@ def list_metrics_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "InstanceMetricsResponse", + "200": "ListRolesResponse", "400": "Error", "401": "Error", - "405": "Error", + "403": "Error", + "404": "Error", "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_metrics_serialize( + def _list_roles_serialize( self, project_id, region, instance_id, - metric, - granularity, - period, - start, - end, _request_auth, _content_type, _headers, @@ -4858,25 +5192,7 @@ def _list_metrics_serialize( _path_params["region"] = region if instance_id is not None: _path_params["instanceId"] = instance_id - if metric is not None: - _path_params["metric"] = metric # process the query parameters - if granularity is not None: - - _query_params.append(("granularity", granularity)) - - if period is not None: - - _query_params.append(("period", period)) - - if start is not None: - - _query_params.append(("start", start)) - - if end is not None: - - _query_params.append(("end", end)) - # process the header parameters # process the form parameters # process the body parameter @@ -4890,7 +5206,7 @@ def _list_metrics_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/metrics/{metric}", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/roles", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4904,11 +5220,18 @@ def _list_metrics_serialize( ) @validate_call - def list_storages( + def list_users( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - flavor_id: Annotated[StrictStr, Field(description="Flavor ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + page: Annotated[ + Optional[StrictInt], Field(description="Number of the page of items list to be returned.") + ] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of items to be returned on each page.")] = None, + sort: Annotated[ + Optional[UserSort], Field(description="Sorting of the users to be returned on each page.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4918,17 +5241,23 @@ def list_storages( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListStoragesResponse: - """Get Storages + ) -> ListUserResponse: + """List Users - Get available storages for a specific flavor + List available users for an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param flavor_id: Flavor ID (required) - :type flavor_id: str + :param instance_id: The ID of the instance. (required) + :type instance_id: str + :param page: Number of the page of items list to be returned. + :type page: int + :param size: Number of items to be returned on each page. + :type size: int + :param sort: Sorting of the users to be returned on each page. + :type sort: UserSort :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 @@ -4951,10 +5280,13 @@ def list_storages( :return: Returns the result object. """ # noqa: E501 - _param = self._list_storages_serialize( + _param = self._list_users_serialize( project_id=project_id, region=region, - flavor_id=flavor_id, + instance_id=instance_id, + page=page, + size=size, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4962,11 +5294,13 @@ def list_storages( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListStoragesResponse", + "200": "ListUserResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -4976,11 +5310,18 @@ def list_storages( ).data @validate_call - def list_storages_with_http_info( + def list_users_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - flavor_id: Annotated[StrictStr, Field(description="Flavor ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + page: Annotated[ + Optional[StrictInt], Field(description="Number of the page of items list to be returned.") + ] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of items to be returned on each page.")] = None, + sort: Annotated[ + Optional[UserSort], Field(description="Sorting of the users to be returned on each page.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4990,17 +5331,23 @@ def list_storages_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListStoragesResponse]: - """Get Storages + ) -> ApiResponse[ListUserResponse]: + """List Users - Get available storages for a specific flavor + List available users for an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param flavor_id: Flavor ID (required) - :type flavor_id: str + :param instance_id: The ID of the instance. (required) + :type instance_id: str + :param page: Number of the page of items list to be returned. + :type page: int + :param size: Number of items to be returned on each page. + :type size: int + :param sort: Sorting of the users to be returned on each page. + :type sort: UserSort :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 @@ -5023,10 +5370,13 @@ def list_storages_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_storages_serialize( + _param = self._list_users_serialize( project_id=project_id, region=region, - flavor_id=flavor_id, + instance_id=instance_id, + page=page, + size=size, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5034,11 +5384,13 @@ def list_storages_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListStoragesResponse", + "200": "ListUserResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -5048,11 +5400,18 @@ def list_storages_with_http_info( ) @validate_call - def list_storages_without_preload_content( + def list_users_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - flavor_id: Annotated[StrictStr, Field(description="Flavor ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + page: Annotated[ + Optional[StrictInt], Field(description="Number of the page of items list to be returned.") + ] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of items to be returned on each page.")] = None, + sort: Annotated[ + Optional[UserSort], Field(description="Sorting of the users to be returned on each page.") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5063,16 +5422,22 @@ def list_storages_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Storages + """List Users - Get available storages for a specific flavor + List available users for an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param flavor_id: Flavor ID (required) - :type flavor_id: str + :param instance_id: The ID of the instance. (required) + :type instance_id: str + :param page: Number of the page of items list to be returned. + :type page: int + :param size: Number of items to be returned on each page. + :type size: int + :param sort: Sorting of the users to be returned on each page. + :type sort: UserSort :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 @@ -5095,10 +5460,13 @@ def list_storages_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_storages_serialize( + _param = self._list_users_serialize( project_id=project_id, region=region, - flavor_id=flavor_id, + instance_id=instance_id, + page=page, + size=size, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5106,20 +5474,25 @@ def list_storages_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListStoragesResponse", + "200": "ListUserResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_storages_serialize( + def _list_users_serialize( self, project_id, region, - flavor_id, + instance_id, + page, + size, + sort, _request_auth, _content_type, _headers, @@ -5142,9 +5515,21 @@ def _list_storages_serialize( _path_params["projectId"] = project_id if region is not None: _path_params["region"] = region - if flavor_id is not None: - _path_params["flavorId"] = flavor_id + if instance_id is not None: + _path_params["instanceId"] = instance_id # process the query parameters + if page is not None: + + _query_params.append(("page", page)) + + if size is not None: + + _query_params.append(("size", size)) + + if sort is not None: + + _query_params.append(("sort", sort.value)) + # process the header parameters # process the form parameters # process the body parameter @@ -5158,7 +5543,7 @@ def _list_storages_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v2/projects/{projectId}/regions/{region}/storages/{flavorId}", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5172,11 +5557,10 @@ def _list_storages_serialize( ) @validate_call - def list_users( + def list_versions( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5186,17 +5570,15 @@ def list_users( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListUsersResponse: - """List Users + ) -> ListVersionResponse: + """Get Versions - List available users for an instance + Get available postgres versions for the project. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) - :type instance_id: 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 @@ -5219,10 +5601,9 @@ def list_users( :return: Returns the result object. """ # noqa: E501 - _param = self._list_users_serialize( + _param = self._list_versions_serialize( project_id=project_id, region=region, - instance_id=instance_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5230,11 +5611,13 @@ def list_users( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListUsersResponse", + "200": "ListVersionResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "501": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -5244,11 +5627,10 @@ def list_users( ).data @validate_call - def list_users_with_http_info( + def list_versions_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5258,17 +5640,15 @@ def list_users_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListUsersResponse]: - """List Users + ) -> ApiResponse[ListVersionResponse]: + """Get Versions - List available users for an instance + Get available postgres versions for the project. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) - :type instance_id: 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 @@ -5291,10 +5671,9 @@ def list_users_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_users_serialize( + _param = self._list_versions_serialize( project_id=project_id, region=region, - instance_id=instance_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5302,11 +5681,13 @@ def list_users_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListUsersResponse", + "200": "ListVersionResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "501": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -5316,11 +5697,10 @@ def list_users_with_http_info( ) @validate_call - def list_users_without_preload_content( + def list_versions_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5331,16 +5711,14 @@ def list_users_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List Users + """Get Versions - List available users for an instance + Get available postgres versions for the project. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) - :type instance_id: 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 @@ -5363,10 +5741,9 @@ def list_users_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_users_serialize( + _param = self._list_versions_serialize( project_id=project_id, region=region, - instance_id=instance_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5374,20 +5751,21 @@ def list_users_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListUsersResponse", + "200": "ListVersionResponse", "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "500": "Error", + "501": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_users_serialize( + def _list_versions_serialize( self, project_id, region, - instance_id, _request_auth, _content_type, _headers, @@ -5410,8 +5788,6 @@ def _list_users_serialize( _path_params["projectId"] = project_id if region is not None: _path_params["region"] = region - if instance_id is not None: - _path_params["instanceId"] = instance_id # process the query parameters # process the header parameters # process the form parameters @@ -5426,7 +5802,7 @@ def _list_users_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users", + resource_path="/v3/projects/{projectId}/regions/{region}/versions", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5440,11 +5816,16 @@ def _list_users_serialize( ) @validate_call - def list_versions( + def partial_update_database( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[Optional[StrictStr], Field(description="Instance ID")] = None, + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + database_id: Annotated[StrictInt, Field(description="The ID of the database.")], + partial_update_database_payload: Annotated[ + PartialUpdateDatabasePayload, + Field(description="The request body containing the information for the database update."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5454,17 +5835,21 @@ def list_versions( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListVersionsResponse: - """Get Versions + ) -> None: + """Update Database partially - Get available versions for postgres database + Update a database partially in an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID + :param instance_id: The ID of the instance. (required) :type instance_id: str + :param database_id: The ID of the database. (required) + :type database_id: int + :param partial_update_database_payload: The request body containing the information for the database update. (required) + :type partial_update_database_payload: PartialUpdateDatabasePayload :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 @@ -5487,10 +5872,12 @@ def list_versions( :return: Returns the result object. """ # noqa: E501 - _param = self._list_versions_serialize( + _param = self._partial_update_database_serialize( project_id=project_id, region=region, instance_id=instance_id, + database_id=database_id, + partial_update_database_payload=partial_update_database_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5498,11 +5885,15 @@ def list_versions( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListVersionsResponse", + "202": None, "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "422": "ValidationError", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -5512,11 +5903,16 @@ def list_versions( ).data @validate_call - def list_versions_with_http_info( + def partial_update_database_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[Optional[StrictStr], Field(description="Instance ID")] = None, + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + database_id: Annotated[StrictInt, Field(description="The ID of the database.")], + partial_update_database_payload: Annotated[ + PartialUpdateDatabasePayload, + Field(description="The request body containing the information for the database update."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5526,17 +5922,21 @@ def list_versions_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListVersionsResponse]: - """Get Versions + ) -> ApiResponse[None]: + """Update Database partially - Get available versions for postgres database + Update a database partially in an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID + :param instance_id: The ID of the instance. (required) :type instance_id: str + :param database_id: The ID of the database. (required) + :type database_id: int + :param partial_update_database_payload: The request body containing the information for the database update. (required) + :type partial_update_database_payload: PartialUpdateDatabasePayload :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 @@ -5559,10 +5959,12 @@ def list_versions_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_versions_serialize( + _param = self._partial_update_database_serialize( project_id=project_id, region=region, instance_id=instance_id, + database_id=database_id, + partial_update_database_payload=partial_update_database_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5570,11 +5972,15 @@ def list_versions_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListVersionsResponse", + "202": None, "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "422": "ValidationError", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -5584,11 +5990,16 @@ def list_versions_with_http_info( ) @validate_call - def list_versions_without_preload_content( + def partial_update_database_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[Optional[StrictStr], Field(description="Instance ID")] = None, + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + database_id: Annotated[StrictInt, Field(description="The ID of the database.")], + partial_update_database_payload: Annotated[ + PartialUpdateDatabasePayload, + Field(description="The request body containing the information for the database update."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5599,16 +6010,20 @@ def list_versions_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Versions + """Update Database partially - Get available versions for postgres database + Update a database partially in an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID + :param instance_id: The ID of the instance. (required) :type instance_id: str + :param database_id: The ID of the database. (required) + :type database_id: int + :param partial_update_database_payload: The request body containing the information for the database update. (required) + :type partial_update_database_payload: PartialUpdateDatabasePayload :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 @@ -5631,10 +6046,12 @@ def list_versions_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_versions_serialize( + _param = self._partial_update_database_serialize( project_id=project_id, region=region, instance_id=instance_id, + database_id=database_id, + partial_update_database_payload=partial_update_database_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5642,20 +6059,26 @@ def list_versions_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListVersionsResponse", + "202": None, "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "422": "ValidationError", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_versions_serialize( + def _partial_update_database_serialize( self, project_id, region, instance_id, + database_id, + partial_update_database_payload, _request_auth, _content_type, _headers, @@ -5678,25 +6101,35 @@ def _list_versions_serialize( _path_params["projectId"] = project_id if region is not None: _path_params["region"] = region - # process the query parameters if instance_id is not None: - - _query_params.append(("instanceId", instance_id)) - + _path_params["instanceId"] = instance_id + if database_id is not None: + _path_params["databaseId"] = database_id + # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if partial_update_database_payload is not None: + _body_params = partial_update_database_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v2/projects/{projectId}/regions/{region}/versions", + method="PATCH", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5712,10 +6145,13 @@ def _list_versions_serialize( @validate_call def partial_update_instance( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - partial_update_instance_payload: Annotated[PartialUpdateInstancePayload, Field(description="Body")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + partial_update_instance_payload: Annotated[ + PartialUpdateInstancePayload, + Field(description="The request body with the parameters for updating the instance."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5725,18 +6161,18 @@ def partial_update_instance( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PartialUpdateInstanceResponse: - """Update Instance + ) -> None: + """Update Instance Partially - Update available instance of a postgres database. Supported Versions are 12, 13, 14, 15 -- only upgrades are allowed! + Update an available instance of a postgres database. No fields are required. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param partial_update_instance_payload: Body (required) + :param partial_update_instance_payload: The request body with the parameters for updating the instance. (required) :type partial_update_instance_payload: PartialUpdateInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -5772,11 +6208,16 @@ def partial_update_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PartialUpdateInstanceResponse", + "202": None, "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "412": "Error", + "422": "ValidationError", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -5788,10 +6229,13 @@ def partial_update_instance( @validate_call def partial_update_instance_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - partial_update_instance_payload: Annotated[PartialUpdateInstancePayload, Field(description="Body")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + partial_update_instance_payload: Annotated[ + PartialUpdateInstancePayload, + Field(description="The request body with the parameters for updating the instance."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5801,18 +6245,18 @@ def partial_update_instance_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PartialUpdateInstanceResponse]: - """Update Instance + ) -> ApiResponse[None]: + """Update Instance Partially - Update available instance of a postgres database. Supported Versions are 12, 13, 14, 15 -- only upgrades are allowed! + Update an available instance of a postgres database. No fields are required. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param partial_update_instance_payload: Body (required) + :param partial_update_instance_payload: The request body with the parameters for updating the instance. (required) :type partial_update_instance_payload: PartialUpdateInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -5848,11 +6292,16 @@ def partial_update_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PartialUpdateInstanceResponse", + "202": None, "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "412": "Error", + "422": "ValidationError", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -5864,10 +6313,13 @@ def partial_update_instance_with_http_info( @validate_call def partial_update_instance_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - partial_update_instance_payload: Annotated[PartialUpdateInstancePayload, Field(description="Body")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + partial_update_instance_payload: Annotated[ + PartialUpdateInstancePayload, + Field(description="The request body with the parameters for updating the instance."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5878,17 +6330,17 @@ def partial_update_instance_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update Instance + """Update Instance Partially - Update available instance of a postgres database. Supported Versions are 12, 13, 14, 15 -- only upgrades are allowed! + Update an available instance of a postgres database. No fields are required. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param partial_update_instance_payload: Body (required) + :param partial_update_instance_payload: The request body with the parameters for updating the instance. (required) :type partial_update_instance_payload: PartialUpdateInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -5924,11 +6376,16 @@ def partial_update_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PartialUpdateInstanceResponse", + "202": None, "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "412": "Error", + "422": "ValidationError", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -5987,7 +6444,7 @@ def _partial_update_instance_serialize( return self.api_client.param_serialize( method="PATCH", - resource_path="/v2/projects/{projectId}/regions/{region}/instances/{instanceId}", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6003,14 +6460,14 @@ def _partial_update_instance_serialize( @validate_call def partial_update_user( self, - project_id: Annotated[StrictStr, Field(description="The ID of the project")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="The ID of the instance")], - user_id: Annotated[StrictStr, Field(description="The ID of the user in the database")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + user_id: Annotated[StrictInt, Field(description="The ID of the user.")], partial_update_user_payload: Annotated[ Optional[PartialUpdateUserPayload], Field( - description="The Request body only required in PUT endpoint. If empty request body is send via patch, then login and createdb roles are removed from user. The field " + description="The Request body containing the new information for the user. If empty request body is send via patch, then login and createdb roles are removed from user." ), ] = None, _request_timeout: Union[ @@ -6023,19 +6480,19 @@ def partial_update_user( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Update User + """Update User Partially - Update user for an instance. Only the roles are updatable. + Update an user partially for an instance. - :param project_id: The ID of the project (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: The ID of the instance (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param user_id: The ID of the user in the database (required) - :type user_id: str - :param partial_update_user_payload: The Request body only required in PUT endpoint. If empty request body is send via patch, then login and createdb roles are removed from user. The field + :param user_id: The ID of the user. (required) + :type user_id: int + :param partial_update_user_payload: The Request body containing the new information for the user. If empty request body is send via patch, then login and createdb roles are removed from user. :type partial_update_user_payload: PartialUpdateUserPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -6072,11 +6529,15 @@ def partial_update_user( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "202": None, "400": "Error", "401": "Error", - "405": None, + "403": "Error", + "404": "Error", + "422": "ValidationError", + "423": "Error", "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -6088,14 +6549,14 @@ def partial_update_user( @validate_call def partial_update_user_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="The ID of the project")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="The ID of the instance")], - user_id: Annotated[StrictStr, Field(description="The ID of the user in the database")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + user_id: Annotated[StrictInt, Field(description="The ID of the user.")], partial_update_user_payload: Annotated[ Optional[PartialUpdateUserPayload], Field( - description="The Request body only required in PUT endpoint. If empty request body is send via patch, then login and createdb roles are removed from user. The field " + description="The Request body containing the new information for the user. If empty request body is send via patch, then login and createdb roles are removed from user." ), ] = None, _request_timeout: Union[ @@ -6108,19 +6569,19 @@ def partial_update_user_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Update User + """Update User Partially - Update user for an instance. Only the roles are updatable. + Update an user partially for an instance. - :param project_id: The ID of the project (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: The ID of the instance (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param user_id: The ID of the user in the database (required) - :type user_id: str - :param partial_update_user_payload: The Request body only required in PUT endpoint. If empty request body is send via patch, then login and createdb roles are removed from user. The field + :param user_id: The ID of the user. (required) + :type user_id: int + :param partial_update_user_payload: The Request body containing the new information for the user. If empty request body is send via patch, then login and createdb roles are removed from user. :type partial_update_user_payload: PartialUpdateUserPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -6157,11 +6618,15 @@ def partial_update_user_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "202": None, "400": "Error", "401": "Error", - "405": None, + "403": "Error", + "404": "Error", + "422": "ValidationError", + "423": "Error", "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -6173,14 +6638,14 @@ def partial_update_user_with_http_info( @validate_call def partial_update_user_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="The ID of the project")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="The ID of the instance")], - user_id: Annotated[StrictStr, Field(description="The ID of the user in the database")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + user_id: Annotated[StrictInt, Field(description="The ID of the user.")], partial_update_user_payload: Annotated[ Optional[PartialUpdateUserPayload], Field( - description="The Request body only required in PUT endpoint. If empty request body is send via patch, then login and createdb roles are removed from user. The field " + description="The Request body containing the new information for the user. If empty request body is send via patch, then login and createdb roles are removed from user." ), ] = None, _request_timeout: Union[ @@ -6193,19 +6658,19 @@ def partial_update_user_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update User + """Update User Partially - Update user for an instance. Only the roles are updatable. + Update an user partially for an instance. - :param project_id: The ID of the project (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: The ID of the instance (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param user_id: The ID of the user in the database (required) - :type user_id: str - :param partial_update_user_payload: The Request body only required in PUT endpoint. If empty request body is send via patch, then login and createdb roles are removed from user. The field + :param user_id: The ID of the user. (required) + :type user_id: int + :param partial_update_user_payload: The Request body containing the new information for the user. If empty request body is send via patch, then login and createdb roles are removed from user. :type partial_update_user_payload: PartialUpdateUserPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -6242,11 +6707,15 @@ def partial_update_user_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "202": None, "400": "Error", "401": "Error", - "405": None, + "403": "Error", + "404": "Error", + "422": "ValidationError", + "423": "Error", "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -6308,7 +6777,7 @@ def _partial_update_user_serialize( return self.api_client.param_serialize( method="PATCH", - resource_path="/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6322,12 +6791,12 @@ def _partial_update_user_serialize( ) @validate_call - def reset_user( + def reset_user_password( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - user_id: Annotated[StrictStr, Field(description="user ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + user_id: Annotated[StrictInt, Field(description="The ID of the user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6337,19 +6806,19 @@ def reset_user( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ResetUserResponse: + ) -> ResetUserPasswordResponse: """Reset User - Reset user password for a postgres instance + Reset an user from an specific instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param user_id: user ID (required) - :type user_id: str + :param user_id: The ID of the user. (required) + :type user_id: int :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 @@ -6372,7 +6841,7 @@ def reset_user( :return: Returns the result object. """ # noqa: E501 - _param = self._reset_user_serialize( + _param = self._reset_user_password_serialize( project_id=project_id, region=region, instance_id=instance_id, @@ -6384,12 +6853,15 @@ def reset_user( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "ResetUserResponse", + "202": "ResetUserPasswordResponse", "400": "Error", "401": "Error", + "403": "Error", "404": "Error", - "405": None, + "422": "ValidationError", + "423": "Error", "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -6399,12 +6871,12 @@ def reset_user( ).data @validate_call - def reset_user_with_http_info( + def reset_user_password_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - user_id: Annotated[StrictStr, Field(description="user ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + user_id: Annotated[StrictInt, Field(description="The ID of the user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6414,19 +6886,19 @@ def reset_user_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ResetUserResponse]: + ) -> ApiResponse[ResetUserPasswordResponse]: """Reset User - Reset user password for a postgres instance + Reset an user from an specific instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param user_id: user ID (required) - :type user_id: str + :param user_id: The ID of the user. (required) + :type user_id: int :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 @@ -6449,7 +6921,7 @@ def reset_user_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._reset_user_serialize( + _param = self._reset_user_password_serialize( project_id=project_id, region=region, instance_id=instance_id, @@ -6461,12 +6933,15 @@ def reset_user_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "ResetUserResponse", + "202": "ResetUserPasswordResponse", "400": "Error", "401": "Error", + "403": "Error", "404": "Error", - "405": None, + "422": "ValidationError", + "423": "Error", "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -6476,12 +6951,12 @@ def reset_user_with_http_info( ) @validate_call - def reset_user_without_preload_content( + def reset_user_password_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - user_id: Annotated[StrictStr, Field(description="user ID")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + user_id: Annotated[StrictInt, Field(description="The ID of the user.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6494,16 +6969,16 @@ def reset_user_without_preload_content( ) -> RESTResponseType: """Reset User - Reset user password for a postgres instance + Reset an user from an specific instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param user_id: user ID (required) - :type user_id: str + :param user_id: The ID of the user. (required) + :type user_id: int :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 @@ -6526,7 +7001,7 @@ def reset_user_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._reset_user_serialize( + _param = self._reset_user_password_serialize( project_id=project_id, region=region, instance_id=instance_id, @@ -6538,17 +7013,20 @@ def reset_user_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "ResetUserResponse", + "202": "ResetUserPasswordResponse", "400": "Error", "401": "Error", + "403": "Error", "404": "Error", - "405": None, + "422": "ValidationError", + "423": "Error", "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _reset_user_serialize( + def _reset_user_password_serialize( self, project_id, region, @@ -6594,7 +7072,7 @@ def _reset_user_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}/reset", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}/reset", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6608,12 +7086,16 @@ def _reset_user_serialize( ) @validate_call - def update_backup_schedule( + def update_database( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - update_backup_schedule_payload: Annotated[UpdateBackupSchedulePayload, Field(description="Body")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + database_id: Annotated[StrictInt, Field(description="The ID of the database.")], + update_database_payload: Annotated[ + UpdateDatabasePayload, + Field(description="The request body containing the information for the database update."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6624,18 +7106,20 @@ def update_backup_schedule( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Update Backup Schedule + """Update Database - Update backup schedule + Update a database in an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param update_backup_schedule_payload: Body (required) - :type update_backup_schedule_payload: UpdateBackupSchedulePayload + :param database_id: The ID of the database. (required) + :type database_id: int + :param update_database_payload: The request body containing the information for the database update. (required) + :type update_database_payload: UpdateDatabasePayload :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 @@ -6658,11 +7142,12 @@ def update_backup_schedule( :return: Returns the result object. """ # noqa: E501 - _param = self._update_backup_schedule_serialize( + _param = self._update_database_serialize( project_id=project_id, region=region, instance_id=instance_id, - update_backup_schedule_payload=update_backup_schedule_payload, + database_id=database_id, + update_database_payload=update_database_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6670,13 +7155,15 @@ def update_backup_schedule( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "202": None, "400": "Error", "401": "Error", - "403": None, - "404": None, - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "422": "ValidationError", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -6686,12 +7173,16 @@ def update_backup_schedule( ).data @validate_call - def update_backup_schedule_with_http_info( + def update_database_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - update_backup_schedule_payload: Annotated[UpdateBackupSchedulePayload, Field(description="Body")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + database_id: Annotated[StrictInt, Field(description="The ID of the database.")], + update_database_payload: Annotated[ + UpdateDatabasePayload, + Field(description="The request body containing the information for the database update."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6702,18 +7193,20 @@ def update_backup_schedule_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Update Backup Schedule + """Update Database - Update backup schedule + Update a database in an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param update_backup_schedule_payload: Body (required) - :type update_backup_schedule_payload: UpdateBackupSchedulePayload + :param database_id: The ID of the database. (required) + :type database_id: int + :param update_database_payload: The request body containing the information for the database update. (required) + :type update_database_payload: UpdateDatabasePayload :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 @@ -6736,11 +7229,12 @@ def update_backup_schedule_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_backup_schedule_serialize( + _param = self._update_database_serialize( project_id=project_id, region=region, instance_id=instance_id, - update_backup_schedule_payload=update_backup_schedule_payload, + database_id=database_id, + update_database_payload=update_database_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6748,13 +7242,15 @@ def update_backup_schedule_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "202": None, "400": "Error", "401": "Error", - "403": None, - "404": None, - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "422": "ValidationError", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -6764,12 +7260,16 @@ def update_backup_schedule_with_http_info( ) @validate_call - def update_backup_schedule_without_preload_content( + def update_database_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - update_backup_schedule_payload: Annotated[UpdateBackupSchedulePayload, Field(description="Body")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + database_id: Annotated[StrictInt, Field(description="The ID of the database.")], + update_database_payload: Annotated[ + UpdateDatabasePayload, + Field(description="The request body containing the information for the database update."), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6780,18 +7280,20 @@ def update_backup_schedule_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update Backup Schedule + """Update Database - Update backup schedule + Update a database in an instance. - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param update_backup_schedule_payload: Body (required) - :type update_backup_schedule_payload: UpdateBackupSchedulePayload + :param database_id: The ID of the database. (required) + :type database_id: int + :param update_database_payload: The request body containing the information for the database update. (required) + :type update_database_payload: UpdateDatabasePayload :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 @@ -6814,11 +7316,12 @@ def update_backup_schedule_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_backup_schedule_serialize( + _param = self._update_database_serialize( project_id=project_id, region=region, instance_id=instance_id, - update_backup_schedule_payload=update_backup_schedule_payload, + database_id=database_id, + update_database_payload=update_database_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6826,23 +7329,26 @@ def update_backup_schedule_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "202": None, "400": "Error", "401": "Error", - "403": None, - "404": None, - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "422": "ValidationError", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_backup_schedule_serialize( + def _update_database_serialize( self, project_id, region, instance_id, - update_backup_schedule_payload, + database_id, + update_database_payload, _request_auth, _content_type, _headers, @@ -6867,12 +7373,14 @@ def _update_backup_schedule_serialize( _path_params["region"] = region if instance_id is not None: _path_params["instanceId"] = instance_id + if database_id is not None: + _path_params["databaseId"] = database_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if update_backup_schedule_payload is not None: - _body_params = update_backup_schedule_payload + if update_database_payload is not None: + _body_params = update_database_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -6891,7 +7399,7 @@ def _update_backup_schedule_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6907,10 +7415,12 @@ def _update_backup_schedule_serialize( @validate_call def update_instance( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - update_instance_payload: Annotated[UpdateInstancePayload, Field(description="Body")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + update_instance_payload: Annotated[ + UpdateInstancePayload, Field(description="The request body with the parameters for updating the instance") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6920,18 +7430,18 @@ def update_instance( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PartialUpdateInstanceResponse: + ) -> None: """Update Instance - Update available instance of a postgres database. Supported Versions are 12, 13, 14, 15 -- only upgrades are allowed! + Updates an available instance of a postgres database - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param update_instance_payload: Body (required) + :param update_instance_payload: The request body with the parameters for updating the instance (required) :type update_instance_payload: UpdateInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -6967,11 +7477,16 @@ def update_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PartialUpdateInstanceResponse", + "202": None, "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "412": "Error", + "422": "ValidationError", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -6983,10 +7498,12 @@ def update_instance( @validate_call def update_instance_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - update_instance_payload: Annotated[UpdateInstancePayload, Field(description="Body")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + update_instance_payload: Annotated[ + UpdateInstancePayload, Field(description="The request body with the parameters for updating the instance") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6996,18 +7513,18 @@ def update_instance_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PartialUpdateInstanceResponse]: + ) -> ApiResponse[None]: """Update Instance - Update available instance of a postgres database. Supported Versions are 12, 13, 14, 15 -- only upgrades are allowed! + Updates an available instance of a postgres database - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param update_instance_payload: Body (required) + :param update_instance_payload: The request body with the parameters for updating the instance (required) :type update_instance_payload: UpdateInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -7043,11 +7560,16 @@ def update_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PartialUpdateInstanceResponse", + "202": None, "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "412": "Error", + "422": "ValidationError", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -7059,10 +7581,12 @@ def update_instance_with_http_info( @validate_call def update_instance_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="Project ID")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="Instance ID")], - update_instance_payload: Annotated[UpdateInstancePayload, Field(description="Body")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + update_instance_payload: Annotated[ + UpdateInstancePayload, Field(description="The request body with the parameters for updating the instance") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7075,15 +7599,15 @@ def update_instance_without_preload_content( ) -> RESTResponseType: """Update Instance - Update available instance of a postgres database. Supported Versions are 12, 13, 14, 15 -- only upgrades are allowed! + Updates an available instance of a postgres database - :param project_id: Project ID (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: Instance ID (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param update_instance_payload: Body (required) + :param update_instance_payload: The request body with the parameters for updating the instance (required) :type update_instance_payload: UpdateInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -7119,11 +7643,16 @@ def update_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PartialUpdateInstanceResponse", + "202": None, "400": "Error", "401": "Error", - "405": None, - "500": None, + "403": "Error", + "404": "Error", + "412": "Error", + "422": "ValidationError", + "423": "Error", + "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -7182,7 +7711,319 @@ def _update_instance_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v2/projects/{projectId}/regions/{region}/instances/{instanceId}", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def update_instance_protection( + self, + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], + region: Annotated[StrictStr, Field(description="The region which should be addressed")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + update_instance_protection_payload: Annotated[ + UpdateInstanceProtectionPayload, + Field(description="The request body with flag isDeletable. Parameter is required."), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UpdateInstanceProtectionResponse: + """Toggle Instance Protection + + Toggle the deletion protection for an instance. + + :param project_id: The STACKIT project ID. (required) + :type project_id: str + :param region: The region which should be addressed (required) + :type region: str + :param instance_id: The ID of the instance. (required) + :type instance_id: str + :param update_instance_protection_payload: The request body with flag isDeletable. Parameter is required. (required) + :type update_instance_protection_payload: UpdateInstanceProtectionPayload + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_instance_protection_serialize( + project_id=project_id, + region=region, + instance_id=instance_id, + update_instance_protection_payload=update_instance_protection_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "UpdateInstanceProtectionResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "422": "ValidationError", + "500": "Error", + "501": "Error", + "503": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def update_instance_protection_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], + region: Annotated[StrictStr, Field(description="The region which should be addressed")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + update_instance_protection_payload: Annotated[ + UpdateInstanceProtectionPayload, + Field(description="The request body with flag isDeletable. Parameter is required."), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UpdateInstanceProtectionResponse]: + """Toggle Instance Protection + + Toggle the deletion protection for an instance. + + :param project_id: The STACKIT project ID. (required) + :type project_id: str + :param region: The region which should be addressed (required) + :type region: str + :param instance_id: The ID of the instance. (required) + :type instance_id: str + :param update_instance_protection_payload: The request body with flag isDeletable. Parameter is required. (required) + :type update_instance_protection_payload: UpdateInstanceProtectionPayload + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_instance_protection_serialize( + project_id=project_id, + region=region, + instance_id=instance_id, + update_instance_protection_payload=update_instance_protection_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "UpdateInstanceProtectionResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "422": "ValidationError", + "500": "Error", + "501": "Error", + "503": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def update_instance_protection_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], + region: Annotated[StrictStr, Field(description="The region which should be addressed")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + update_instance_protection_payload: Annotated[ + UpdateInstanceProtectionPayload, + Field(description="The request body with flag isDeletable. Parameter is required."), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Toggle Instance Protection + + Toggle the deletion protection for an instance. + + :param project_id: The STACKIT project ID. (required) + :type project_id: str + :param region: The region which should be addressed (required) + :type region: str + :param instance_id: The ID of the instance. (required) + :type instance_id: str + :param update_instance_protection_payload: The request body with flag isDeletable. Parameter is required. (required) + :type update_instance_protection_payload: UpdateInstanceProtectionPayload + :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 + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_instance_protection_serialize( + project_id=project_id, + region=region, + instance_id=instance_id, + update_instance_protection_payload=update_instance_protection_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "UpdateInstanceProtectionResponse", + "400": "Error", + "401": "Error", + "403": "Error", + "404": "Error", + "422": "ValidationError", + "500": "Error", + "501": "Error", + "503": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _update_instance_protection_serialize( + self, + project_id, + region, + instance_id, + update_instance_protection_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _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 instance_id is not None: + _path_params["instanceId"] = instance_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if update_instance_protection_payload is not None: + _body_params = update_instance_protection_payload + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="POST", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/protections", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7198,16 +8039,13 @@ def _update_instance_serialize( @validate_call def update_user( self, - project_id: Annotated[StrictStr, Field(description="The ID of the project")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="The ID of the instance")], - user_id: Annotated[StrictStr, Field(description="The ID of the user in the database")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + user_id: Annotated[StrictInt, Field(description="The ID of the user.")], update_user_payload: Annotated[ - Optional[UpdateUserPayload], - Field( - description="The Request body only required in PUT endpoint. If empty request body is send via patch, then login and createdb roles are removed from user. The field " - ), - ] = None, + UpdateUserPayload, Field(description="The Request body containing the updated infos for the user.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7220,17 +8058,17 @@ def update_user( ) -> None: """Update User - Update user for an instance. Only the roles are updatable. + Update user for an instance. - :param project_id: The ID of the project (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: The ID of the instance (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param user_id: The ID of the user in the database (required) - :type user_id: str - :param update_user_payload: The Request body only required in PUT endpoint. If empty request body is send via patch, then login and createdb roles are removed from user. The field + :param user_id: The ID of the user. (required) + :type user_id: int + :param update_user_payload: The Request body containing the updated infos for the user. (required) :type update_user_payload: UpdateUserPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -7267,11 +8105,15 @@ def update_user( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "202": None, "400": "Error", "401": "Error", - "405": None, + "403": "Error", + "404": "Error", + "422": "ValidationError", + "423": "Error", "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -7283,16 +8125,13 @@ def update_user( @validate_call def update_user_with_http_info( self, - project_id: Annotated[StrictStr, Field(description="The ID of the project")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="The ID of the instance")], - user_id: Annotated[StrictStr, Field(description="The ID of the user in the database")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + user_id: Annotated[StrictInt, Field(description="The ID of the user.")], update_user_payload: Annotated[ - Optional[UpdateUserPayload], - Field( - description="The Request body only required in PUT endpoint. If empty request body is send via patch, then login and createdb roles are removed from user. The field " - ), - ] = None, + UpdateUserPayload, Field(description="The Request body containing the updated infos for the user.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7305,17 +8144,17 @@ def update_user_with_http_info( ) -> ApiResponse[None]: """Update User - Update user for an instance. Only the roles are updatable. + Update user for an instance. - :param project_id: The ID of the project (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: The ID of the instance (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param user_id: The ID of the user in the database (required) - :type user_id: str - :param update_user_payload: The Request body only required in PUT endpoint. If empty request body is send via patch, then login and createdb roles are removed from user. The field + :param user_id: The ID of the user. (required) + :type user_id: int + :param update_user_payload: The Request body containing the updated infos for the user. (required) :type update_user_payload: UpdateUserPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -7352,11 +8191,15 @@ def update_user_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "202": None, "400": "Error", "401": "Error", - "405": None, + "403": "Error", + "404": "Error", + "422": "ValidationError", + "423": "Error", "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -7368,16 +8211,13 @@ def update_user_with_http_info( @validate_call def update_user_without_preload_content( self, - project_id: Annotated[StrictStr, Field(description="The ID of the project")], + project_id: Annotated[StrictStr, Field(description="The STACKIT project ID.")], region: Annotated[StrictStr, Field(description="The region which should be addressed")], - instance_id: Annotated[StrictStr, Field(description="The ID of the instance")], - user_id: Annotated[StrictStr, Field(description="The ID of the user in the database")], + instance_id: Annotated[StrictStr, Field(description="The ID of the instance.")], + user_id: Annotated[StrictInt, Field(description="The ID of the user.")], update_user_payload: Annotated[ - Optional[UpdateUserPayload], - Field( - description="The Request body only required in PUT endpoint. If empty request body is send via patch, then login and createdb roles are removed from user. The field " - ), - ] = None, + UpdateUserPayload, Field(description="The Request body containing the updated infos for the user.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7390,17 +8230,17 @@ def update_user_without_preload_content( ) -> RESTResponseType: """Update User - Update user for an instance. Only the roles are updatable. + Update user for an instance. - :param project_id: The ID of the project (required) + :param project_id: The STACKIT project ID. (required) :type project_id: str :param region: The region which should be addressed (required) :type region: str - :param instance_id: The ID of the instance (required) + :param instance_id: The ID of the instance. (required) :type instance_id: str - :param user_id: The ID of the user in the database (required) - :type user_id: str - :param update_user_payload: The Request body only required in PUT endpoint. If empty request body is send via patch, then login and createdb roles are removed from user. The field + :param user_id: The ID of the user. (required) + :type user_id: int + :param update_user_payload: The Request body containing the updated infos for the user. (required) :type update_user_payload: UpdateUserPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -7437,11 +8277,15 @@ def update_user_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, + "202": None, "400": "Error", "401": "Error", - "405": None, + "403": "Error", + "404": "Error", + "422": "ValidationError", + "423": "Error", "500": "Error", + "503": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -7503,7 +8347,7 @@ def _update_user_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}", + resource_path="/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/services/postgresflex/src/stackit/postgresflex/api_client.py b/services/postgresflex/src/stackit/postgresflex/api_client.py index 993ad5c99..2e8c2ab39 100644 --- a/services/postgresflex/src/stackit/postgresflex/api_client.py +++ b/services/postgresflex/src/stackit/postgresflex/api_client.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/services/postgresflex/src/stackit/postgresflex/configuration.py b/services/postgresflex/src/stackit/postgresflex/configuration.py index de61061d4..8717f7b8a 100644 --- a/services/postgresflex/src/stackit/postgresflex/configuration.py +++ b/services/postgresflex/src/stackit/postgresflex/configuration.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/services/postgresflex/src/stackit/postgresflex/exceptions.py b/services/postgresflex/src/stackit/postgresflex/exceptions.py index 3c35356ac..e0da3c65b 100644 --- a/services/postgresflex/src/stackit/postgresflex/exceptions.py +++ b/services/postgresflex/src/stackit/postgresflex/exceptions.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -46,7 +46,7 @@ def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None) -> full_msg = msg if path_to_item: full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) + super(ApiTypeError, self).__init__(full_msg, path_to_item, valid_classes, key_type) class ApiValueError(OpenApiException, ValueError): @@ -64,7 +64,7 @@ def __init__(self, msg, path_to_item=None) -> None: full_msg = msg if path_to_item: full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) + super(ApiValueError, self).__init__(full_msg, path_to_item) class ApiAttributeError(OpenApiException, AttributeError): @@ -83,7 +83,7 @@ def __init__(self, msg, path_to_item=None) -> None: full_msg = msg if path_to_item: full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiAttributeError, self).__init__(full_msg) + super(ApiAttributeError, self).__init__(full_msg, path_to_item) class ApiKeyError(OpenApiException, KeyError): @@ -100,7 +100,7 @@ def __init__(self, msg, path_to_item=None) -> None: full_msg = msg if path_to_item: full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) + super(ApiKeyError, self).__init__(full_msg, path_to_item) class ApiException(OpenApiException): diff --git a/services/postgresflex/src/stackit/postgresflex/models/__init__.py b/services/postgresflex/src/stackit/postgresflex/models/__init__.py index 811954e0a..f004faebb 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/__init__.py +++ b/services/postgresflex/src/stackit/postgresflex/models/__init__.py @@ -4,9 +4,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -14,88 +14,86 @@ """ # noqa: E501 # import models into model package -from stackit.postgresflex.models.acl import ACL -from stackit.postgresflex.models.api_configuration import ApiConfiguration -from stackit.postgresflex.models.api_extension_config_load_response import ( - ApiExtensionConfigLoadResponse, -) -from stackit.postgresflex.models.api_extension_configure_response import ( - ApiExtensionConfigureResponse, -) -from stackit.postgresflex.models.api_extension_delete_response import ( - ApiExtensionDeleteResponse, -) -from stackit.postgresflex.models.api_extension_list import ApiExtensionList -from stackit.postgresflex.models.api_extension_load_response import ( - ApiExtensionLoadResponse, -) -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.backup_data import BackupData +from stackit.postgresflex.models.backup_sort import BackupSort +from stackit.postgresflex.models.clone_instance_overrides import CloneInstanceOverrides 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_database_response import CreateDatabaseResponse 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.database_roles import DatabaseRoles +from stackit.postgresflex.models.database_sort import DatabaseSort from stackit.postgresflex.models.error import Error -from stackit.postgresflex.models.extensions_configuration import ExtensionsConfiguration -from stackit.postgresflex.models.extensions_extension_list_response import ( - ExtensionsExtensionListResponse, +from stackit.postgresflex.models.flavor_sort import FlavorSort +from stackit.postgresflex.models.flavor_storage_classes_storage_class import ( + FlavorStorageClassesStorageClass, ) -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_database_response import GetDatabaseResponse +from stackit.postgresflex.models.get_instance_response import GetInstanceResponse from stackit.postgresflex.models.get_user_response import GetUserResponse -from stackit.postgresflex.models.instance import Instance -from stackit.postgresflex.models.instance_create_database_response import ( - InstanceCreateDatabaseResponse, -) -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, +from stackit.postgresflex.models.instance_connection_info import InstanceConnectionInfo +from stackit.postgresflex.models.instance_connection_info_write import ( + InstanceConnectionInfoWrite, ) -from stackit.postgresflex.models.instance_list_instance import InstanceListInstance -from stackit.postgresflex.models.instance_metrics_response import ( - InstanceMetricsResponse, +from stackit.postgresflex.models.instance_encryption import InstanceEncryption +from stackit.postgresflex.models.instance_network import InstanceNetwork +from stackit.postgresflex.models.instance_network_access_scope import ( + InstanceNetworkAccessScope, ) -from stackit.postgresflex.models.instance_response import InstanceResponse -from stackit.postgresflex.models.list_backups_response import ListBackupsResponse +from stackit.postgresflex.models.instance_network_create import InstanceNetworkCreate +from stackit.postgresflex.models.instance_network_opt import InstanceNetworkOpt +from stackit.postgresflex.models.instance_network_update import InstanceNetworkUpdate +from stackit.postgresflex.models.instance_sort import InstanceSort +from stackit.postgresflex.models.instance_storage_range import InstanceStorageRange +from stackit.postgresflex.models.list_backup_response import ListBackupResponse +from stackit.postgresflex.models.list_collations_response import ListCollationsResponse +from stackit.postgresflex.models.list_database import ListDatabase +from stackit.postgresflex.models.list_databases_response import ListDatabasesResponse +from stackit.postgresflex.models.list_flavors import ListFlavors from stackit.postgresflex.models.list_flavors_response import ListFlavorsResponse +from stackit.postgresflex.models.list_instance import ListInstance 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 +from stackit.postgresflex.models.list_roles_response import ListRolesResponse +from stackit.postgresflex.models.list_user import ListUser +from stackit.postgresflex.models.list_user_response import ListUserResponse +from stackit.postgresflex.models.list_version_response import ListVersionResponse +from stackit.postgresflex.models.pagination import Pagination +from stackit.postgresflex.models.partial_update_database_payload import ( + PartialUpdateDatabasePayload, +) from stackit.postgresflex.models.partial_update_instance_payload import ( PartialUpdateInstancePayload, ) -from stackit.postgresflex.models.partial_update_instance_response import ( - PartialUpdateInstanceResponse, -) from stackit.postgresflex.models.partial_update_user_payload import ( PartialUpdateUserPayload, ) -from stackit.postgresflex.models.postgres_database_parameter import ( - PostgresDatabaseParameter, -) -from stackit.postgresflex.models.postgres_database_parameter_response import ( - PostgresDatabaseParameterResponse, +from stackit.postgresflex.models.reset_user_password_response import ( + ResetUserPasswordResponse, ) -from stackit.postgresflex.models.reset_user_response import ResetUserResponse +from stackit.postgresflex.models.state import State from stackit.postgresflex.models.storage import Storage -from stackit.postgresflex.models.storage_range import StorageRange +from stackit.postgresflex.models.storage_create import StorageCreate from stackit.postgresflex.models.storage_update import StorageUpdate -from stackit.postgresflex.models.update_backup_schedule_payload import ( - UpdateBackupSchedulePayload, +from stackit.postgresflex.models.update_database_partially_response import ( + UpdateDatabasePartiallyResponse, ) +from stackit.postgresflex.models.update_database_payload import UpdateDatabasePayload +from stackit.postgresflex.models.update_database_response import UpdateDatabaseResponse from stackit.postgresflex.models.update_instance_payload import UpdateInstancePayload +from stackit.postgresflex.models.update_instance_protection_payload import ( + UpdateInstanceProtectionPayload, +) +from stackit.postgresflex.models.update_instance_protection_response import ( + UpdateInstanceProtectionResponse, +) 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_sort import UserSort +from stackit.postgresflex.models.validation_error import ValidationError +from stackit.postgresflex.models.validation_error_validation_inner import ( + ValidationErrorValidationInner, +) +from stackit.postgresflex.models.version import Version 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 deleted file mode 100644 index c50285748..000000000 --- a/services/postgresflex/src/stackit/postgresflex/models/api_extension_configure_response.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding: utf-8 - -""" - STACKIT PostgreSQL Flex API - - This is the documentation for the STACKIT postgres service - - The version of the OpenAPI document: 2.0.0 - Contact: support@stackit.cloud - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -from __future__ import annotations - -import json -import pprint -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field -from pydantic_core import to_jsonable_python -from typing_extensions import Self - -from stackit.postgresflex.models.api_configuration import ApiConfiguration - - -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" - ) - __properties: ClassVar[List[str]] = ["configuration"] - - model_config = ConfigDict( - validate_by_name=True, - validate_by_alias=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - return json.dumps(to_jsonable_python(self.to_dict())) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApiExtensionConfigureResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in configuration (list) - _items = [] - if self.configuration: - for _item_configuration in self.configuration: - if _item_configuration: - _items.append(_item_configuration.to_dict()) - _dict["configuration"] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApiExtensionConfigureResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "configuration": ( - [ApiConfiguration.from_dict(_item) for _item in obj["configuration"]] - if obj.get("configuration") is not None - else None - ) - } - ) - return _obj 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 deleted file mode 100644 index 79f81365c..000000000 --- a/services/postgresflex/src/stackit/postgresflex/models/api_installed_list_response.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - STACKIT PostgreSQL Flex API - - This is the documentation for the STACKIT postgres service - - The version of the OpenAPI document: 2.0.0 - Contact: support@stackit.cloud - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -from __future__ import annotations - -import json -import pprint -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict -from pydantic_core import to_jsonable_python -from typing_extensions import Self - -from stackit.postgresflex.models.api_extension_list import ApiExtensionList - - -class ApiInstalledListResponse(BaseModel): - """ - ApiInstalledListResponse - """ # noqa: E501 - - installed: Optional[List[ApiExtensionList]] = None - __properties: ClassVar[List[str]] = ["installed"] - - model_config = ConfigDict( - validate_by_name=True, - validate_by_alias=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - return json.dumps(to_jsonable_python(self.to_dict())) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApiInstalledListResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in installed (list) - _items = [] - if self.installed: - for _item_installed in self.installed: - if _item_installed: - _items.append(_item_installed.to_dict()) - _dict["installed"] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApiInstalledListResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "installed": ( - [ApiExtensionList.from_dict(_item) for _item in obj["installed"]] - if obj.get("installed") is not None - else None - ) - } - ) - return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/backup.py b/services/postgresflex/src/stackit/postgresflex/models/backup_data.py similarity index 65% rename from services/postgresflex/src/stackit/postgresflex/models/backup.py rename to services/postgresflex/src/stackit/postgresflex/models/backup_data.py index 30997b482..84aad4d35 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/backup.py +++ b/services/postgresflex/src/stackit/postgresflex/models/backup_data.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -23,20 +23,20 @@ from typing_extensions import Self -class Backup(BaseModel): +class BackupData(BaseModel): """ - Backup + BackupData """ # noqa: E501 - end_time: Optional[StrictStr] = Field(default=None, alias="endTime") - error: Optional[StrictStr] = None - id: Optional[StrictStr] = None - labels: Optional[List[StrictStr]] = None - name: Optional[StrictStr] = None - options: Optional[Dict[str, StrictStr]] = None - size: Optional[StrictInt] = None - start_time: Optional[StrictStr] = Field(default=None, alias="startTime") - __properties: ClassVar[List[str]] = ["endTime", "error", "id", "labels", "name", "options", "size", "startTime"] + completion_time: StrictStr = Field( + description="The time when the backup was completed in RFC3339 format.", alias="completionTime" + ) + id: StrictInt = Field(description="The ID of the backup.") + name: StrictStr = Field(description="The name of the backup.") + retained_until: StrictStr = Field(description="The time until the backup will be retained.", alias="retainedUntil") + size: StrictInt = Field(description="The size of the backup in bytes.") + type: StrictStr = Field(description="The type of the backup, which can be automated or manual triggered.") + __properties: ClassVar[List[str]] = ["completionTime", "id", "name", "retainedUntil", "size", "type"] model_config = ConfigDict( validate_by_name=True, @@ -55,7 +55,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Backup from a JSON string""" + """Create an instance of BackupData from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -79,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Backup from a dict""" + """Create an instance of BackupData from a dict""" if obj is None: return None @@ -88,14 +88,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "endTime": obj.get("endTime"), - "error": obj.get("error"), + "completionTime": obj.get("completionTime"), "id": obj.get("id"), - "labels": obj.get("labels"), "name": obj.get("name"), - "options": obj.get("options"), + "retainedUntil": obj.get("retainedUntil"), "size": obj.get("size"), - "startTime": obj.get("startTime"), + "type": obj.get("type"), } ) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/backup_sort.py b/services/postgresflex/src/stackit/postgresflex/models/backup_sort.py new file mode 100644 index 000000000..578f47689 --- /dev/null +++ b/services/postgresflex/src/stackit/postgresflex/models/backup_sort.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + STACKIT PostgreSQL Flex API + + This is the documentation for the STACKIT Postgres Flex service + + The version of the OpenAPI document: 3.0.0 + Contact: support@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +from enum import Enum + +from typing_extensions import Self + + +class BackupSort(str, Enum): + """ + BackupSort + """ + + """ + allowed enum values + """ + COMPLETION_TIME_DOT_DESC = "completion_time.desc" + COMPLETION_TIME_DOT_ASC = "completion_time.asc" + END_TIME_DOT_DESC = "end_time.desc" + END_TIME_DOT_ASC = "end_time.asc" + NAME_DOT_DESC = "name.desc" + NAME_DOT_ASC = "name.asc" + RETAINED_UNTIL_DOT_DESC = "retained_until.desc" + RETAINED_UNTIL_DOT_ASC = "retained_until.asc" + SIZE_DOT_DESC = "size.desc" + SIZE_DOT_ASC = "size.asc" + TYPE_DOT_DESC = "type.desc" + TYPE_DOT_ASC = "type.asc" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of BackupSort from a JSON string""" + return cls(json.loads(json_str)) diff --git a/services/postgresflex/src/stackit/postgresflex/models/clone_instance_overrides.py b/services/postgresflex/src/stackit/postgresflex/models/clone_instance_overrides.py new file mode 100644 index 000000000..a06da0994 --- /dev/null +++ b/services/postgresflex/src/stackit/postgresflex/models/clone_instance_overrides.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + STACKIT PostgreSQL Flex API + + This is the documentation for the STACKIT Postgres Flex service + + The version of the OpenAPI document: 3.0.0 + Contact: support@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic_core import to_jsonable_python +from typing_extensions import Annotated, Self + + +class CloneInstanceOverrides(BaseModel): + """ + CloneInstanceOverrides + """ # noqa: E501 + + var_class: Optional[StrictStr] = Field( + default=None, description="The storage class for the storage.", alias="class" + ) + name: Optional[Annotated[str, Field(min_length=3, strict=True, max_length=63)]] = Field( + default=None, + description="The name of the cloned instance. If not provided, the default naming behavior of appending '-clone' to the source instance name is used.", + ) + size: StrictInt = Field(description="The storage size in Gigabytes.") + __properties: ClassVar[List[str]] = ["class", "name", "size"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CloneInstanceOverrides from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CloneInstanceOverrides from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"class": obj.get("class"), "name": obj.get("name"), "size": obj.get("size")}) + return _obj 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 63c404a06..d8e15316c 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/clone_instance_payload.py +++ b/services/postgresflex/src/stackit/postgresflex/models/clone_instance_payload.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -16,25 +16,41 @@ import json import pprint +import re # noqa: F401 +from datetime import datetime from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, field_validator from pydantic_core import to_jsonable_python from typing_extensions import Self +from stackit.postgresflex.models.clone_instance_overrides import CloneInstanceOverrides + class CloneInstancePayload(BaseModel): """ CloneInstancePayload """ # noqa: E501 - var_class: Optional[StrictStr] = Field(default=None, alias="class") - size: Optional[StrictInt] = None - timestamp: Optional[StrictStr] = Field( - default=None, - description="The timestamp should be specified in UTC time following the format provided in the example.", + instance_overrides: CloneInstanceOverrides = Field(alias="instanceOverrides") + point_in_time: datetime = Field( + description="the time for the point in time recovery it will be calculated between first backup and last backup", + alias="pointInTime", ) - __properties: ClassVar[List[str]] = ["class", "size", "timestamp"] + __properties: ClassVar[List[str]] = ["instanceOverrides", "pointInTime"] + + @field_validator("point_in_time", mode="before") + def point_in_time_change_year_zero_to_one(cls, value): + """Workaround which prevents year 0 issue""" + if isinstance(value, str): + # Check for year "0000" at the beginning of the string + # This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ + if value.startswith("0000-01-01T") and re.match( + r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value + ): + # Workaround: Replace "0000" with "0001" + return "0001" + value[4:] # Take "0001" and append the rest of the string + return value model_config = ConfigDict( validate_by_name=True, @@ -73,6 +89,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of instance_overrides + if self.instance_overrides: + _dict["instanceOverrides"] = self.instance_overrides.to_dict() return _dict @classmethod @@ -85,6 +104,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate( - {"class": obj.get("class"), "size": obj.get("size"), "timestamp": obj.get("timestamp")} + { + "instanceOverrides": ( + CloneInstanceOverrides.from_dict(obj["instanceOverrides"]) + if obj.get("instanceOverrides") is not None + else None + ), + "pointInTime": obj.get("pointInTime"), + } ) return _obj 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 b7d68ecc6..dc202c043 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/clone_instance_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/clone_instance_response.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -17,8 +17,9 @@ import json import pprint from typing import Any, ClassVar, Dict, List, Optional, Set +from uuid import UUID -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field from pydantic_core import to_jsonable_python from typing_extensions import Self @@ -28,8 +29,8 @@ class CloneInstanceResponse(BaseModel): CloneInstanceResponse """ # noqa: E501 - instance_id: Optional[StrictStr] = Field(default=None, alias="instanceId") - __properties: ClassVar[List[str]] = ["instanceId"] + id: UUID = Field(description="The ID of the instance.") + __properties: ClassVar[List[str]] = ["id"] model_config = ConfigDict( validate_by_name=True, @@ -79,5 +80,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({"instanceId": obj.get("instanceId")}) + _obj = cls.model_validate({"id": obj.get("id")}) return _obj 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 117dc67ce..859e5d548 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/create_database_payload.py +++ b/services/postgresflex/src/stackit/postgresflex/models/create_database_payload.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -28,9 +28,9 @@ class CreateDatabasePayload(BaseModel): CreateDatabasePayload """ # noqa: E501 - name: Optional[StrictStr] = None - options: Optional[Dict[str, StrictStr]] = Field(default=None, description="Database specific options") - __properties: ClassVar[List[str]] = ["name", "options"] + name: StrictStr = Field(description="The name of the database.") + owner: Optional[StrictStr] = Field(default=None, description="The owner of the database.") + __properties: ClassVar[List[str]] = ["name", "owner"] model_config = ConfigDict( validate_by_name=True, @@ -80,5 +80,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({"name": obj.get("name"), "options": obj.get("options")}) + _obj = cls.model_validate({"name": obj.get("name"), "owner": obj.get("owner")}) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_create_database_response.py b/services/postgresflex/src/stackit/postgresflex/models/create_database_response.py similarity index 81% rename from services/postgresflex/src/stackit/postgresflex/models/instance_create_database_response.py rename to services/postgresflex/src/stackit/postgresflex/models/create_database_response.py index f9eb5f7f9..a2195635b 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/instance_create_database_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/create_database_response.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,17 +18,17 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt from pydantic_core import to_jsonable_python from typing_extensions import Self -class InstanceCreateDatabaseResponse(BaseModel): +class CreateDatabaseResponse(BaseModel): """ - InstanceCreateDatabaseResponse + CreateDatabaseResponse """ # noqa: E501 - id: Optional[StrictStr] = None + id: StrictInt = Field(description="The id of the database.") __properties: ClassVar[List[str]] = ["id"] model_config = ConfigDict( @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceCreateDatabaseResponse from a JSON string""" + """Create an instance of CreateDatabaseResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -72,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceCreateDatabaseResponse from a dict""" + """Create an instance of CreateDatabaseResponse from a dict""" if obj is None: return None 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 759ba551d..88bc6a55d 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/create_instance_payload.py +++ b/services/postgresflex/src/stackit/postgresflex/models/create_instance_payload.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,12 +18,13 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from pydantic_core import to_jsonable_python -from typing_extensions import Self +from typing_extensions import Annotated, Self -from stackit.postgresflex.models.acl import ACL -from stackit.postgresflex.models.storage import Storage +from stackit.postgresflex.models.instance_encryption import InstanceEncryption +from stackit.postgresflex.models.instance_network_create import InstanceNetworkCreate +from stackit.postgresflex.models.storage_create import StorageCreate class CreateInstancePayload(BaseModel): @@ -31,23 +32,36 @@ class CreateInstancePayload(BaseModel): CreateInstancePayload """ # noqa: E501 - acl: ACL - backup_schedule: StrictStr = Field(alias="backupSchedule") - flavor_id: StrictStr = Field(alias="flavorId") - labels: Optional[Dict[str, StrictStr]] = Field(default=None, description="Labels field is not certain/clear") - name: StrictStr - options: Dict[str, StrictStr] - replicas: StrictInt - storage: Storage - version: StrictStr + backup_schedule: StrictStr = Field( + description="The schedule for when the database backup will be created. Currently, ONLY daily schedules are supported (every 24 hours). The schedule is written as a cron schedule.", + alias="backupSchedule", + ) + encryption: Optional[InstanceEncryption] = None + flavor_id: StrictStr = Field(description="The id of the instance flavor.", alias="flavorId") + labels: Optional[Dict[str, Optional[StrictStr]]] = Field( + default=None, + description="Key-value pairs, 63 characters max, begin and end with an alphanumerical character, may contain dashes (-), underscores (_), dots (.), and alphanumerics between. Key MUST be at least 1 character. Max 64 labels Regex for keys: ^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$ Regex for values: ^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$ The stackit- prefix is reserved and cannot be used for Keys. ", + ) + name: Annotated[str, Field(min_length=3, strict=True, max_length=63)] = Field( + description="The name of the instance." + ) + network: InstanceNetworkCreate + retention_days: Optional[Annotated[int, Field(le=365, strict=True, ge=32)]] = Field( + description="How long backups are retained. The value can only be between 32 and 90 days.", + alias="retentionDays", + ) + storage: StorageCreate + version: StrictStr = Field( + description="The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3#tag/Version) for supported version parameters." + ) __properties: ClassVar[List[str]] = [ - "acl", "backupSchedule", + "encryption", "flavorId", "labels", "name", - "options", - "replicas", + "network", + "retentionDays", "storage", "version", ] @@ -89,12 +103,20 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # 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 encryption + if self.encryption: + _dict["encryption"] = self.encryption.to_dict() + # override the default output from pydantic by calling `to_dict()` of network + if self.network: + _dict["network"] = self.network.to_dict() # override the default output from pydantic by calling `to_dict()` of storage if self.storage: _dict["storage"] = self.storage.to_dict() + # set to None if retention_days (nullable) is None + # and model_fields_set contains the field + if self.retention_days is None and "retention_days" in self.model_fields_set: + _dict["retentionDays"] = None + return _dict @classmethod @@ -108,14 +130,16 @@ 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, "backupSchedule": obj.get("backupSchedule"), + "encryption": ( + InstanceEncryption.from_dict(obj["encryption"]) if obj.get("encryption") is not None else None + ), "flavorId": obj.get("flavorId"), "labels": obj.get("labels"), "name": obj.get("name"), - "options": obj.get("options"), - "replicas": obj.get("replicas"), - "storage": Storage.from_dict(obj["storage"]) if obj.get("storage") is not None else None, + "network": InstanceNetworkCreate.from_dict(obj["network"]) if obj.get("network") is not None else None, + "retentionDays": obj.get("retentionDays"), + "storage": StorageCreate.from_dict(obj["storage"]) if obj.get("storage") is not None else None, "version": obj.get("version"), } ) 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 c6fe88e65..9833abdda 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/create_instance_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/create_instance_response.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -17,8 +17,9 @@ import json import pprint from typing import Any, ClassVar, Dict, List, Optional, Set +from uuid import UUID -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict, Field from pydantic_core import to_jsonable_python from typing_extensions import Self @@ -28,7 +29,7 @@ class CreateInstanceResponse(BaseModel): CreateInstanceResponse """ # noqa: E501 - id: Optional[StrictStr] = None + id: UUID = Field(description="The ID of the instance.") __properties: ClassVar[List[str]] = ["id"] model_config = ConfigDict( 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 a8c8147c7..18f4c885b 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/create_user_payload.py +++ b/services/postgresflex/src/stackit/postgresflex/models/create_user_payload.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,9 +18,9 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from pydantic_core import to_jsonable_python -from typing_extensions import Self +from typing_extensions import Annotated, Self class CreateUserPayload(BaseModel): @@ -28,9 +28,12 @@ class CreateUserPayload(BaseModel): CreateUserPayload """ # noqa: E501 - roles: Optional[List[StrictStr]] = None - username: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["roles", "username"] + name: StrictStr = Field(description="The name of the user.") + roles: Optional[List[Annotated[str, Field(min_length=1, strict=True, max_length=63)]]] = Field( + default=None, + description="A list containing the user roles for the instance. Please refer to the List Roles endpoint for a list of all available Roles.", + ) + __properties: ClassVar[List[str]] = ["name", "roles"] model_config = ConfigDict( validate_by_name=True, @@ -80,5 +83,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({"roles": obj.get("roles"), "username": obj.get("username")}) + _obj = cls.model_validate({"name": obj.get("name"), "roles": obj.get("roles")}) return _obj 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 1740eb378..f6c0e9891 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/create_user_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/create_user_response.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,20 +18,21 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from pydantic_core import to_jsonable_python from typing_extensions import Self -from stackit.postgresflex.models.user import User - class CreateUserResponse(BaseModel): """ CreateUserResponse """ # noqa: E501 - item: Optional[User] = None - __properties: ClassVar[List[str]] = ["item"] + id: StrictInt = Field(description="The ID of the user.") + name: StrictStr = Field(description="The name of the user.") + password: StrictStr = Field(description="The password for the user.") + state: StrictStr = Field(description="The current state of the user.") + __properties: ClassVar[List[str]] = ["id", "name", "password", "state"] model_config = ConfigDict( validate_by_name=True, @@ -70,9 +71,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of item - if self.item: - _dict["item"] = self.item.to_dict() return _dict @classmethod @@ -84,5 +82,7 @@ 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({"item": User.from_dict(obj["item"]) if obj.get("item") is not None else None}) + _obj = cls.model_validate( + {"id": obj.get("id"), "name": obj.get("name"), "password": obj.get("password"), "state": obj.get("state")} + ) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_database.py b/services/postgresflex/src/stackit/postgresflex/models/database_roles.py similarity index 75% rename from services/postgresflex/src/stackit/postgresflex/models/instance_database.py rename to services/postgresflex/src/stackit/postgresflex/models/database_roles.py index a98ab82a0..07670b5f6 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/instance_database.py +++ b/services/postgresflex/src/stackit/postgresflex/models/database_roles.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -23,15 +23,14 @@ from typing_extensions import Self -class InstanceDatabase(BaseModel): +class DatabaseRoles(BaseModel): """ - InstanceDatabase + The name and the roles for a database for a user. """ # noqa: E501 - id: Optional[StrictStr] = None - name: Optional[StrictStr] = None - options: Optional[Dict[str, Any]] = Field(default=None, description="Database specific options") - __properties: ClassVar[List[str]] = ["id", "name", "options"] + name: StrictStr = Field(description="The name of the database.") + roles: List[StrictStr] = Field(description="The name and the roles for a database") + __properties: ClassVar[List[str]] = ["name", "roles"] model_config = ConfigDict( validate_by_name=True, @@ -50,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceDatabase from a JSON string""" + """Create an instance of DatabaseRoles from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -74,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 InstanceDatabase from a dict""" + """Create an instance of DatabaseRoles from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"id": obj.get("id"), "name": obj.get("name"), "options": obj.get("options")}) + _obj = cls.model_validate({"name": obj.get("name"), "roles": obj.get("roles")}) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/database_sort.py b/services/postgresflex/src/stackit/postgresflex/models/database_sort.py new file mode 100644 index 000000000..4cc677593 --- /dev/null +++ b/services/postgresflex/src/stackit/postgresflex/models/database_sort.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + STACKIT PostgreSQL Flex API + + This is the documentation for the STACKIT Postgres Flex service + + The version of the OpenAPI document: 3.0.0 + Contact: support@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +from enum import Enum + +from typing_extensions import Self + + +class DatabaseSort(str, Enum): + """ + DatabaseSort + """ + + """ + allowed enum values + """ + CREATED_AT_DOT_DESC = "created_at.desc" + CREATED_AT_DOT_ASC = "created_at.asc" + DATABASE_ID_DOT_DESC = "database_id.desc" + DATABASE_ID_DOT_ASC = "database_id.asc" + DATABASE_NAME_DOT_DESC = "database_name.desc" + DATABASE_NAME_DOT_ASC = "database_name.asc" + DATABASE_OWNER_DOT_DESC = "database_owner.desc" + DATABASE_OWNER_DOT_ASC = "database_owner.asc" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of DatabaseSort from a JSON string""" + return cls(json.loads(json_str)) diff --git a/services/postgresflex/src/stackit/postgresflex/models/error.py b/services/postgresflex/src/stackit/postgresflex/models/error.py index a3888d1d9..77fbadc65 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/error.py +++ b/services/postgresflex/src/stackit/postgresflex/models/error.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,7 +18,7 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from pydantic_core import to_jsonable_python from typing_extensions import Self @@ -28,11 +28,11 @@ class Error(BaseModel): Error """ # noqa: E501 - code: Optional[StrictInt] = None - fields: Optional[Dict[str, List[StrictStr]]] = None - message: Optional[StrictStr] = None - type: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["code", "fields", "message", "type"] + code: StrictInt = Field(description="The http error code of the error.") + message: StrictStr = Field(description="More detailed information about the error.") + trace_id: StrictStr = Field(description="The trace id of the request.", alias="traceId") + type: StrictStr = Field(description="Describes in which state the api was when the error happened.") + __properties: ClassVar[List[str]] = ["code", "message", "traceId", "type"] model_config = ConfigDict( validate_by_name=True, @@ -85,8 +85,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "code": obj.get("code"), - "fields": obj.get("fields"), "message": obj.get("message"), + "traceId": obj.get("traceId"), "type": obj.get("type"), } ) 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 deleted file mode 100644 index 9f29da046..000000000 --- a/services/postgresflex/src/stackit/postgresflex/models/extensions_extension_list_response.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - STACKIT PostgreSQL Flex API - - This is the documentation for the STACKIT postgres service - - The version of the OpenAPI document: 2.0.0 - Contact: support@stackit.cloud - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -from __future__ import annotations - -import json -import pprint -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict -from pydantic_core import to_jsonable_python -from typing_extensions import Self - -from stackit.postgresflex.models.api_extension_list import ApiExtensionList - - -class ExtensionsExtensionListResponse(BaseModel): - """ - ExtensionsExtensionListResponse - """ # noqa: E501 - - list: Optional[List[ApiExtensionList]] = None - __properties: ClassVar[List[str]] = ["list"] - - model_config = ConfigDict( - validate_by_name=True, - validate_by_alias=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - return json.dumps(to_jsonable_python(self.to_dict())) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ExtensionsExtensionListResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in list (list) - _items = [] - if self.list: - for _item_list in self.list: - if _item_list: - _items.append(_item_list.to_dict()) - _dict["list"] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ExtensionsExtensionListResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "list": ( - [ApiExtensionList.from_dict(_item) for _item in obj["list"]] - if obj.get("list") is not None - else None - ) - } - ) - return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/flavor_sort.py b/services/postgresflex/src/stackit/postgresflex/models/flavor_sort.py new file mode 100644 index 000000000..88cb7b3fa --- /dev/null +++ b/services/postgresflex/src/stackit/postgresflex/models/flavor_sort.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + STACKIT PostgreSQL Flex API + + This is the documentation for the STACKIT Postgres Flex service + + The version of the OpenAPI document: 3.0.0 + Contact: support@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +from enum import Enum + +from typing_extensions import Self + + +class FlavorSort(str, Enum): + """ + FlavorSort + """ + + """ + allowed enum values + """ + CPU_DOT_DESC = "cpu.desc" + CPU_DOT_ASC = "cpu.asc" + FLAVOR_DESCRIPTION_DOT_ASC = "flavor_description.asc" + FLAVOR_DESCRIPTION_DOT_DESC = "flavor_description.desc" + ID_DOT_DESC = "id.desc" + ID_DOT_ASC = "id.asc" + SIZE_MAX_DOT_DESC = "size_max.desc" + SIZE_MAX_DOT_ASC = "size_max.asc" + RAM_DOT_DESC = "ram.desc" + RAM_DOT_ASC = "ram.asc" + SIZE_MIN_DOT_DESC = "size_min.desc" + SIZE_MIN_DOT_ASC = "size_min.asc" + STORAGE_CLASS_DOT_ASC = "storage_class.asc" + STORAGE_CLASS_DOT_DESC = "storage_class.desc" + NODE_TYPE_DOT_ASC = "node_type.asc" + NODE_TYPE_DOT_DESC = "node_type.desc" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of FlavorSort from a JSON string""" + return cls(json.loads(json_str)) diff --git a/services/postgresflex/src/stackit/postgresflex/models/flavor.py b/services/postgresflex/src/stackit/postgresflex/models/flavor_storage_classes_storage_class.py similarity index 69% rename from services/postgresflex/src/stackit/postgresflex/models/flavor.py rename to services/postgresflex/src/stackit/postgresflex/models/flavor_storage_classes_storage_class.py index 2ecdb6386..f539bdd4d 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/flavor.py +++ b/services/postgresflex/src/stackit/postgresflex/models/flavor_storage_classes_storage_class.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,21 +18,20 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from pydantic_core import to_jsonable_python from typing_extensions import Self -class Flavor(BaseModel): +class FlavorStorageClassesStorageClass(BaseModel): """ - Flavor + a storageClass defines how efficient the storage can work """ # noqa: E501 - cpu: Optional[StrictInt] = None - description: Optional[StrictStr] = None - id: Optional[StrictStr] = None - memory: Optional[StrictInt] = None - __properties: ClassVar[List[str]] = ["cpu", "description", "id", "memory"] + var_class: StrictStr = Field(alias="class") + max_io_per_sec: StrictInt = Field(alias="maxIoPerSec") + max_through_in_mb: StrictInt = Field(alias="maxThroughInMb") + __properties: ClassVar[List[str]] = ["class", "maxIoPerSec", "maxThroughInMb"] model_config = ConfigDict( validate_by_name=True, @@ -51,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Flavor from a JSON string""" + """Create an instance of FlavorStorageClassesStorageClass from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -75,7 +74,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Flavor from a dict""" + """Create an instance of FlavorStorageClassesStorageClass from a dict""" if obj is None: return None @@ -84,10 +83,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "cpu": obj.get("cpu"), - "description": obj.get("description"), - "id": obj.get("id"), - "memory": obj.get("memory"), + "class": obj.get("class"), + "maxIoPerSec": obj.get("maxIoPerSec"), + "maxThroughInMb": obj.get("maxThroughInMb"), } ) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/get_database_response.py b/services/postgresflex/src/stackit/postgresflex/models/get_database_response.py new file mode 100644 index 000000000..2d171e7a5 --- /dev/null +++ b/services/postgresflex/src/stackit/postgresflex/models/get_database_response.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + STACKIT PostgreSQL Flex API + + This is the documentation for the STACKIT Postgres Flex service + + The version of the OpenAPI document: 3.0.0 + Contact: support@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic_core import to_jsonable_python +from typing_extensions import Self + + +class GetDatabaseResponse(BaseModel): + """ + GetDatabaseResponse + """ # noqa: E501 + + id: StrictInt = Field(description="The id of the database.") + name: StrictStr = Field(description="The name of the database.") + owner: StrictStr = Field(description="The owner of the database.") + __properties: ClassVar[List[str]] = ["id", "name", "owner"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetDatabaseResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetDatabaseResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"id": obj.get("id"), "name": obj.get("name"), "owner": obj.get("owner")}) + return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/get_instance_response.py b/services/postgresflex/src/stackit/postgresflex/models/get_instance_response.py new file mode 100644 index 000000000..e403de697 --- /dev/null +++ b/services/postgresflex/src/stackit/postgresflex/models/get_instance_response.py @@ -0,0 +1,177 @@ +# coding: utf-8 + +""" + STACKIT PostgreSQL Flex API + + This is the documentation for the STACKIT Postgres Flex service + + The version of the OpenAPI document: 3.0.0 + Contact: support@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set +from uuid import UUID + +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictStr, +) +from pydantic_core import to_jsonable_python +from typing_extensions import Annotated, Self + +from stackit.postgresflex.models.instance_connection_info import InstanceConnectionInfo +from stackit.postgresflex.models.instance_encryption import InstanceEncryption +from stackit.postgresflex.models.instance_network import InstanceNetwork +from stackit.postgresflex.models.state import State +from stackit.postgresflex.models.storage import Storage + + +class GetInstanceResponse(BaseModel): + """ + GetInstanceResponse + """ # noqa: E501 + + acl: Optional[List[StrictStr]] = Field(default=None, description="List of IPV4 cidr.") + backup_schedule: StrictStr = Field( + description="The schedule for when the database backup will be created. Currently, ONLY daily schedules are supported (every 24 hours). The schedule is written as a cron schedule.", + alias="backupSchedule", + ) + connection_info: InstanceConnectionInfo = Field(alias="connectionInfo") + encryption: Optional[InstanceEncryption] = None + flavor_id: StrictStr = Field(description="The id of the instance flavor.", alias="flavorId") + id: UUID = Field(description="The ID of the instance.") + is_deletable: StrictBool = Field(description="Whether the instance can be deleted or not.", alias="isDeletable") + labels: Optional[Dict[str, Optional[StrictStr]]] = Field( + default=None, + description="Key-value pairs, 63 characters max, begin and end with an alphanumerical character, may contain dashes (-), underscores (_), dots (.), and alphanumerics between. Key MUST be at least 1 character. Max 64 labels Regex for keys: ^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$ Regex for values: ^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$ The stackit- prefix is reserved and cannot be used for Keys. ", + ) + name: Annotated[str, Field(min_length=3, strict=True, max_length=63)] = Field( + description="The name of the instance." + ) + network: InstanceNetwork + retention_days: Optional[Annotated[int, Field(le=365, strict=True, ge=32)]] = Field( + description="How long backups are retained. The value can only be between 32 and 90 days.", + alias="retentionDays", + ) + state: State + storage: Storage + version: StrictStr = Field( + description="The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3#tag/Version) for supported version parameters." + ) + __properties: ClassVar[List[str]] = [ + "acl", + "backupSchedule", + "connectionInfo", + "encryption", + "flavorId", + "id", + "isDeletable", + "labels", + "name", + "network", + "retentionDays", + "state", + "storage", + "version", + ] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetInstanceResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of connection_info + if self.connection_info: + _dict["connectionInfo"] = self.connection_info.to_dict() + # override the default output from pydantic by calling `to_dict()` of encryption + if self.encryption: + _dict["encryption"] = self.encryption.to_dict() + # override the default output from pydantic by calling `to_dict()` of network + if self.network: + _dict["network"] = self.network.to_dict() + # override the default output from pydantic by calling `to_dict()` of storage + if self.storage: + _dict["storage"] = self.storage.to_dict() + # set to None if retention_days (nullable) is None + # and model_fields_set contains the field + if self.retention_days is None and "retention_days" in self.model_fields_set: + _dict["retentionDays"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetInstanceResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "acl": obj.get("acl"), + "backupSchedule": obj.get("backupSchedule"), + "connectionInfo": ( + InstanceConnectionInfo.from_dict(obj["connectionInfo"]) + if obj.get("connectionInfo") is not None + else None + ), + "encryption": ( + InstanceEncryption.from_dict(obj["encryption"]) if obj.get("encryption") is not None else None + ), + "flavorId": obj.get("flavorId"), + "id": obj.get("id"), + "isDeletable": obj.get("isDeletable"), + "labels": obj.get("labels"), + "name": obj.get("name"), + "network": InstanceNetwork.from_dict(obj["network"]) if obj.get("network") is not None else None, + "retentionDays": obj.get("retentionDays"), + "state": obj.get("state"), + "storage": Storage.from_dict(obj["storage"]) if obj.get("storage") is not None else None, + "version": obj.get("version"), + } + ) + return _obj 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 00483a761..591e0f4c8 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/get_user_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/get_user_response.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,11 +18,9 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from pydantic_core import to_jsonable_python -from typing_extensions import Self - -from stackit.postgresflex.models.user_response import UserResponse +from typing_extensions import Annotated, Self class GetUserResponse(BaseModel): @@ -30,8 +28,13 @@ class GetUserResponse(BaseModel): GetUserResponse """ # noqa: E501 - item: Optional[UserResponse] = None - __properties: ClassVar[List[str]] = ["item"] + id: StrictInt = Field(description="The ID of the user.") + name: StrictStr = Field(description="The name of the user.") + roles: List[Annotated[str, Field(min_length=1, strict=True, max_length=63)]] = Field( + description="A list of user roles." + ) + state: StrictStr = Field(description="The current state of the user.") + __properties: ClassVar[List[str]] = ["id", "name", "roles", "state"] model_config = ConfigDict( validate_by_name=True, @@ -70,9 +73,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of item - if self.item: - _dict["item"] = self.item.to_dict() return _dict @classmethod @@ -85,6 +85,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate( - {"item": UserResponse.from_dict(obj["item"]) if obj.get("item") is not None else None} + {"id": obj.get("id"), "name": obj.get("name"), "roles": obj.get("roles"), "state": obj.get("state")} ) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance.py b/services/postgresflex/src/stackit/postgresflex/models/instance.py deleted file mode 100644 index 0601bf945..000000000 --- a/services/postgresflex/src/stackit/postgresflex/models/instance.py +++ /dev/null @@ -1,129 +0,0 @@ -# coding: utf-8 - -""" - STACKIT PostgreSQL Flex API - - This is the documentation for the STACKIT postgres service - - The version of the OpenAPI document: 2.0.0 - Contact: support@stackit.cloud - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -from __future__ import annotations - -import json -import pprint -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from pydantic_core import to_jsonable_python -from typing_extensions import Self - -from stackit.postgresflex.models.acl import ACL -from stackit.postgresflex.models.flavor import Flavor -from stackit.postgresflex.models.storage import Storage - - -class Instance(BaseModel): - """ - Instance - """ # noqa: E501 - - acl: Optional[ACL] = None - backup_schedule: Optional[StrictStr] = Field(default=None, alias="backupSchedule") - flavor: Optional[Flavor] = None - id: Optional[StrictStr] = None - name: Optional[StrictStr] = None - options: Optional[Dict[str, StrictStr]] = None - replicas: Optional[StrictInt] = None - status: Optional[StrictStr] = None - storage: Optional[Storage] = None - version: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = [ - "acl", - "backupSchedule", - "flavor", - "id", - "name", - "options", - "replicas", - "status", - "storage", - "version", - ] - - model_config = ConfigDict( - validate_by_name=True, - validate_by_alias=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - return json.dumps(to_jsonable_python(self.to_dict())) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Instance from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of acl - if self.acl: - _dict["acl"] = self.acl.to_dict() - # override the default output from pydantic by calling `to_dict()` of flavor - if self.flavor: - _dict["flavor"] = self.flavor.to_dict() - # override the default output from pydantic by calling `to_dict()` of storage - if self.storage: - _dict["storage"] = self.storage.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Instance from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "acl": ACL.from_dict(obj["acl"]) if obj.get("acl") is not None else None, - "backupSchedule": obj.get("backupSchedule"), - "flavor": Flavor.from_dict(obj["flavor"]) if obj.get("flavor") is not None else None, - "id": obj.get("id"), - "name": obj.get("name"), - "options": obj.get("options"), - "replicas": obj.get("replicas"), - "status": obj.get("status"), - "storage": Storage.from_dict(obj["storage"]) if obj.get("storage") is not None else None, - "version": obj.get("version"), - } - ) - return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_response.py b/services/postgresflex/src/stackit/postgresflex/models/instance_connection_info.py similarity index 71% rename from services/postgresflex/src/stackit/postgresflex/models/instance_response.py rename to services/postgresflex/src/stackit/postgresflex/models/instance_connection_info.py index 09e6b3717..7f2de4aa4 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/instance_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/instance_connection_info.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -22,16 +22,18 @@ from pydantic_core import to_jsonable_python from typing_extensions import Self -from stackit.postgresflex.models.instance import Instance +from stackit.postgresflex.models.instance_connection_info_write import ( + InstanceConnectionInfoWrite, +) -class InstanceResponse(BaseModel): +class InstanceConnectionInfo(BaseModel): """ - InstanceResponse + The connection information of the instance """ # noqa: E501 - item: Optional[Instance] = None - __properties: ClassVar[List[str]] = ["item"] + write: InstanceConnectionInfoWrite + __properties: ClassVar[List[str]] = ["write"] model_config = ConfigDict( validate_by_name=True, @@ -50,7 +52,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceResponse from a JSON string""" + """Create an instance of InstanceConnectionInfo from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -70,19 +72,21 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of item - if self.item: - _dict["item"] = self.item.to_dict() + # override the default output from pydantic by calling `to_dict()` of write + if self.write: + _dict["write"] = self.write.to_dict() return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceResponse from a dict""" + """Create an instance of InstanceConnectionInfo from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"item": Instance.from_dict(obj["item"]) if obj.get("item") is not None else None}) + _obj = cls.model_validate( + {"write": InstanceConnectionInfoWrite.from_dict(obj["write"]) if obj.get("write") is not None else None} + ) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_connection_info_write.py b/services/postgresflex/src/stackit/postgresflex/models/instance_connection_info_write.py new file mode 100644 index 000000000..079a20ac5 --- /dev/null +++ b/services/postgresflex/src/stackit/postgresflex/models/instance_connection_info_write.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + STACKIT PostgreSQL Flex API + + This is the documentation for the STACKIT Postgres Flex service + + The version of the OpenAPI document: 3.0.0 + Contact: support@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic_core import to_jsonable_python +from typing_extensions import Self + + +class InstanceConnectionInfoWrite(BaseModel): + """ + The DNS name and port in the instance overview + """ # noqa: E501 + + host: StrictStr = Field(description="The host of the instance.") + port: StrictInt = Field(description="The port of the instance.") + __properties: ClassVar[List[str]] = ["host", "port"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of InstanceConnectionInfoWrite from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InstanceConnectionInfoWrite from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"host": obj.get("host"), "port": obj.get("port")}) + return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_data_point.py b/services/postgresflex/src/stackit/postgresflex/models/instance_data_point.py deleted file mode 100644 index 9c82bb602..000000000 --- a/services/postgresflex/src/stackit/postgresflex/models/instance_data_point.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding: utf-8 - -""" - STACKIT PostgreSQL Flex API - - This is the documentation for the STACKIT postgres service - - The version of the OpenAPI document: 2.0.0 - Contact: support@stackit.cloud - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -from __future__ import annotations - -import json -import pprint -from typing import Any, ClassVar, Dict, List, Optional, Set, Union - -from pydantic import ( - BaseModel, - ConfigDict, - StrictFloat, - StrictInt, - StrictStr, -) -from pydantic_core import to_jsonable_python -from typing_extensions import Self - - -class InstanceDataPoint(BaseModel): - """ - InstanceDataPoint - """ # noqa: E501 - - timestamp: Optional[StrictStr] = None - value: Optional[Union[StrictFloat, StrictInt]] = None - __properties: ClassVar[List[str]] = ["timestamp", "value"] - - model_config = ConfigDict( - validate_by_name=True, - validate_by_alias=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - return json.dumps(to_jsonable_python(self.to_dict())) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceDataPoint from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceDataPoint from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({"timestamp": obj.get("timestamp"), "value": obj.get("value")}) - return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_encryption.py b/services/postgresflex/src/stackit/postgresflex/models/instance_encryption.py new file mode 100644 index 000000000..e823c6378 --- /dev/null +++ b/services/postgresflex/src/stackit/postgresflex/models/instance_encryption.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + STACKIT PostgreSQL Flex API + + This is the documentation for the STACKIT Postgres Flex service + + The version of the OpenAPI document: 3.0.0 + Contact: support@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic_core import to_jsonable_python +from typing_extensions import Self + + +class InstanceEncryption(BaseModel): + """ + The configuration for instance's volume and backup storage encryption. ⚠️ **Note:** This feature is in private preview. Supplying this object is only permitted for enabled accounts. If your account does not have access, the request will be rejected. + """ # noqa: E501 + + kek_key_id: StrictStr = Field(description="The encryption-key key identifier", alias="kekKeyId") + kek_key_ring_id: StrictStr = Field(description="The encryption-key keyring identifier", alias="kekKeyRingId") + kek_key_version: StrictStr = Field(description="The encryption-key version", alias="kekKeyVersion") + service_account: StrictStr = Field(alias="serviceAccount") + __properties: ClassVar[List[str]] = ["kekKeyId", "kekKeyRingId", "kekKeyVersion", "serviceAccount"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of InstanceEncryption from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InstanceEncryption from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "kekKeyId": obj.get("kekKeyId"), + "kekKeyRingId": obj.get("kekKeyRingId"), + "kekKeyVersion": obj.get("kekKeyVersion"), + "serviceAccount": obj.get("serviceAccount"), + } + ) + return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_host.py b/services/postgresflex/src/stackit/postgresflex/models/instance_network.py similarity index 62% rename from services/postgresflex/src/stackit/postgresflex/models/instance_host.py rename to services/postgresflex/src/stackit/postgresflex/models/instance_network.py index d41c48f60..fa3e69cfd 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/instance_host.py +++ b/services/postgresflex/src/stackit/postgresflex/models/instance_network.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -22,17 +22,23 @@ from pydantic_core import to_jsonable_python from typing_extensions import Self -from stackit.postgresflex.models.instance_host_metric import InstanceHostMetric +from stackit.postgresflex.models.instance_network_access_scope import ( + InstanceNetworkAccessScope, +) -class InstanceHost(BaseModel): +class InstanceNetwork(BaseModel): """ - InstanceHost + The access configuration of the instance """ # noqa: E501 - host_metrics: Optional[List[InstanceHostMetric]] = Field(default=None, alias="hostMetrics") - id: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["hostMetrics", "id"] + access_scope: Optional[InstanceNetworkAccessScope] = Field( + default=InstanceNetworkAccessScope.PUBLIC, alias="accessScope" + ) + acl: List[StrictStr] = Field(description="List of IPV4 cidr.") + instance_address: Optional[StrictStr] = Field(default=None, alias="instanceAddress") + router_address: Optional[StrictStr] = Field(default=None, alias="routerAddress") + __properties: ClassVar[List[str]] = ["accessScope", "acl", "instanceAddress", "routerAddress"] model_config = ConfigDict( validate_by_name=True, @@ -51,7 +57,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceHost from a JSON string""" + """Create an instance of InstanceNetwork from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -71,18 +77,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in host_metrics (list) - _items = [] - if self.host_metrics: - for _item_host_metrics in self.host_metrics: - if _item_host_metrics: - _items.append(_item_host_metrics.to_dict()) - _dict["hostMetrics"] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceHost from a dict""" + """Create an instance of InstanceNetwork from a dict""" if obj is None: return None @@ -91,12 +90,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "hostMetrics": ( - [InstanceHostMetric.from_dict(_item) for _item in obj["hostMetrics"]] - if obj.get("hostMetrics") is not None - else None + "accessScope": ( + obj.get("accessScope") if obj.get("accessScope") is not None else InstanceNetworkAccessScope.PUBLIC ), - "id": obj.get("id"), + "acl": obj.get("acl"), + "instanceAddress": obj.get("instanceAddress"), + "routerAddress": obj.get("routerAddress"), } ) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_network_access_scope.py b/services/postgresflex/src/stackit/postgresflex/models/instance_network_access_scope.py new file mode 100644 index 000000000..dba22150d --- /dev/null +++ b/services/postgresflex/src/stackit/postgresflex/models/instance_network_access_scope.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + STACKIT PostgreSQL Flex API + + This is the documentation for the STACKIT Postgres Flex service + + The version of the OpenAPI document: 3.0.0 + Contact: support@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +from enum import Enum + +from typing_extensions import Self + + +class InstanceNetworkAccessScope(str, Enum): + """ + The access scope of the instance. It defines if the instance is public or airgapped. + """ + + """ + allowed enum values + """ + PUBLIC = "PUBLIC" + SNA = "SNA" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of InstanceNetworkAccessScope from a JSON string""" + return cls(json.loads(json_str)) diff --git a/services/postgresflex/src/stackit/postgresflex/models/list_storages_response.py b/services/postgresflex/src/stackit/postgresflex/models/instance_network_create.py similarity index 66% rename from services/postgresflex/src/stackit/postgresflex/models/list_storages_response.py rename to services/postgresflex/src/stackit/postgresflex/models/instance_network_create.py index 1a032b614..ccf1afd56 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/list_storages_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/instance_network_create.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -22,17 +22,21 @@ from pydantic_core import to_jsonable_python from typing_extensions import Self -from stackit.postgresflex.models.storage_range import StorageRange +from stackit.postgresflex.models.instance_network_access_scope import ( + InstanceNetworkAccessScope, +) -class ListStoragesResponse(BaseModel): +class InstanceNetworkCreate(BaseModel): """ - ListStoragesResponse + The access configuration of the instance """ # noqa: E501 - storage_classes: Optional[List[StrictStr]] = Field(default=None, alias="storageClasses") - storage_range: Optional[StorageRange] = Field(default=None, alias="storageRange") - __properties: ClassVar[List[str]] = ["storageClasses", "storageRange"] + access_scope: Optional[InstanceNetworkAccessScope] = Field( + default=InstanceNetworkAccessScope.PUBLIC, alias="accessScope" + ) + acl: List[StrictStr] = Field(description="List of IPV4 cidr.") + __properties: ClassVar[List[str]] = ["accessScope", "acl"] model_config = ConfigDict( validate_by_name=True, @@ -51,7 +55,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ListStoragesResponse from a JSON string""" + """Create an instance of InstanceNetworkCreate from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -71,14 +75,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of storage_range - if self.storage_range: - _dict["storageRange"] = self.storage_range.to_dict() return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ListStoragesResponse from a dict""" + """Create an instance of InstanceNetworkCreate from a dict""" if obj is None: return None @@ -87,10 +88,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "storageClasses": obj.get("storageClasses"), - "storageRange": ( - StorageRange.from_dict(obj["storageRange"]) if obj.get("storageRange") is not None else None + "accessScope": ( + obj.get("accessScope") if obj.get("accessScope") is not None else InstanceNetworkAccessScope.PUBLIC ), + "acl": obj.get("acl"), } ) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/update_backup_schedule_payload.py b/services/postgresflex/src/stackit/postgresflex/models/instance_network_opt.py similarity index 78% rename from services/postgresflex/src/stackit/postgresflex/models/update_backup_schedule_payload.py rename to services/postgresflex/src/stackit/postgresflex/models/instance_network_opt.py index a77dbf80d..21b36ca30 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/update_backup_schedule_payload.py +++ b/services/postgresflex/src/stackit/postgresflex/models/instance_network_opt.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -23,13 +23,13 @@ from typing_extensions import Self -class UpdateBackupSchedulePayload(BaseModel): +class InstanceNetworkOpt(BaseModel): """ - UpdateBackupSchedulePayload + The access configuration of the instance """ # noqa: E501 - backup_schedule: StrictStr = Field(alias="backupSchedule") - __properties: ClassVar[List[str]] = ["backupSchedule"] + acl: Optional[List[StrictStr]] = Field(default=None, description="List of IPV4 cidr.") + __properties: ClassVar[List[str]] = ["acl"] model_config = ConfigDict( validate_by_name=True, @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UpdateBackupSchedulePayload from a JSON string""" + """Create an instance of InstanceNetworkOpt from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -72,12 +72,12 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UpdateBackupSchedulePayload from a dict""" + """Create an instance of InstanceNetworkOpt from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"backupSchedule": obj.get("backupSchedule")}) + _obj = cls.model_validate({"acl": obj.get("acl")}) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/list_users_response_item.py b/services/postgresflex/src/stackit/postgresflex/models/instance_network_update.py similarity index 76% rename from services/postgresflex/src/stackit/postgresflex/models/list_users_response_item.py rename to services/postgresflex/src/stackit/postgresflex/models/instance_network_update.py index 8ba333a35..a72042ad3 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/list_users_response_item.py +++ b/services/postgresflex/src/stackit/postgresflex/models/instance_network_update.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,19 +18,18 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from pydantic_core import to_jsonable_python from typing_extensions import Self -class ListUsersResponseItem(BaseModel): +class InstanceNetworkUpdate(BaseModel): """ - ListUsersResponseItem + The access configuration of the instance """ # noqa: E501 - id: Optional[StrictStr] = None - username: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["id", "username"] + acl: List[StrictStr] = Field(description="List of IPV4 cidr.") + __properties: ClassVar[List[str]] = ["acl"] model_config = ConfigDict( validate_by_name=True, @@ -49,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ListUsersResponseItem from a JSON string""" + """Create an instance of InstanceNetworkUpdate from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,12 +72,12 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ListUsersResponseItem from a dict""" + """Create an instance of InstanceNetworkUpdate from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"id": obj.get("id"), "username": obj.get("username")}) + _obj = cls.model_validate({"acl": obj.get("acl")}) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_sort.py b/services/postgresflex/src/stackit/postgresflex/models/instance_sort.py new file mode 100644 index 000000000..bcc496a90 --- /dev/null +++ b/services/postgresflex/src/stackit/postgresflex/models/instance_sort.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + STACKIT PostgreSQL Flex API + + This is the documentation for the STACKIT Postgres Flex service + + The version of the OpenAPI document: 3.0.0 + Contact: support@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +from enum import Enum + +from typing_extensions import Self + + +class InstanceSort(str, Enum): + """ + InstanceSort + """ + + """ + allowed enum values + """ + ID_DOT_DESC = "id.desc" + ID_DOT_ASC = "id.asc" + IS_DELETABLE_DOT_DESC = "is_deletable.desc" + IS_DELETABLE_DOT_ASC = "is_deletable.asc" + NAME_DOT_ASC = "name.asc" + NAME_DOT_DESC = "name.desc" + STATE_DOT_ASC = "state.asc" + STATE_DOT_DESC = "state.desc" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of InstanceSort from a JSON string""" + return cls(json.loads(json_str)) diff --git a/services/postgresflex/src/stackit/postgresflex/models/storage_range.py b/services/postgresflex/src/stackit/postgresflex/models/instance_storage_range.py similarity index 78% rename from services/postgresflex/src/stackit/postgresflex/models/storage_range.py rename to services/postgresflex/src/stackit/postgresflex/models/instance_storage_range.py index f88c3af27..aa8f6e553 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/storage_range.py +++ b/services/postgresflex/src/stackit/postgresflex/models/instance_storage_range.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,18 +18,18 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, StrictInt +from pydantic import BaseModel, ConfigDict, Field, StrictInt from pydantic_core import to_jsonable_python from typing_extensions import Self -class StorageRange(BaseModel): +class InstanceStorageRange(BaseModel): """ - StorageRange + Contains the minimum and maximum storage space. """ # noqa: E501 - max: Optional[StrictInt] = None - min: Optional[StrictInt] = None + max: StrictInt = Field(description="The maximum available amount of storage.") + min: StrictInt = Field(description="The minimum available amount of storage.") __properties: ClassVar[List[str]] = ["max", "min"] model_config = ConfigDict( @@ -49,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of StorageRange from a JSON string""" + """Create an instance of InstanceStorageRange from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of StorageRange from a dict""" + """Create an instance of InstanceStorageRange from a dict""" if obj is None: return None diff --git a/services/postgresflex/src/stackit/postgresflex/models/postgres_database_parameter_response.py b/services/postgresflex/src/stackit/postgresflex/models/list_backup_response.py similarity index 61% rename from services/postgresflex/src/stackit/postgresflex/models/postgres_database_parameter_response.py rename to services/postgresflex/src/stackit/postgresflex/models/list_backup_response.py index 73d7220f4..9c3b90a49 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/postgres_database_parameter_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/list_backup_response.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -22,18 +22,18 @@ from pydantic_core import to_jsonable_python from typing_extensions import Self -from stackit.postgresflex.models.postgres_database_parameter import ( - PostgresDatabaseParameter, -) +from stackit.postgresflex.models.backup_data import BackupData +from stackit.postgresflex.models.pagination import Pagination -class PostgresDatabaseParameterResponse(BaseModel): +class ListBackupResponse(BaseModel): """ - PostgresDatabaseParameterResponse + ListBackupResponse """ # noqa: E501 - parameter: Optional[List[PostgresDatabaseParameter]] = Field(default=None, description="List of the parameter") - __properties: ClassVar[List[str]] = ["parameter"] + backups: List[BackupData] = Field(description="The list containing the information about the backups.") + pagination: Pagination + __properties: ClassVar[List[str]] = ["backups", "pagination"] model_config = ConfigDict( validate_by_name=True, @@ -52,7 +52,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PostgresDatabaseParameterResponse from a JSON string""" + """Create an instance of ListBackupResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -72,18 +72,21 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in parameter (list) + # override the default output from pydantic by calling `to_dict()` of each item in backups (list) _items = [] - if self.parameter: - for _item_parameter in self.parameter: - if _item_parameter: - _items.append(_item_parameter.to_dict()) - _dict["parameter"] = _items + if self.backups: + for _item_backups in self.backups: + if _item_backups: + _items.append(_item_backups.to_dict()) + _dict["backups"] = _items + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict["pagination"] = self.pagination.to_dict() return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PostgresDatabaseParameterResponse from a dict""" + """Create an instance of ListBackupResponse from a dict""" if obj is None: return None @@ -92,11 +95,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "parameter": ( - [PostgresDatabaseParameter.from_dict(_item) for _item in obj["parameter"]] - if obj.get("parameter") is not None + "backups": ( + [BackupData.from_dict(_item) for _item in obj["backups"]] + if obj.get("backups") is not None else None - ) + ), + "pagination": Pagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, } ) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/list_backups_response.py b/services/postgresflex/src/stackit/postgresflex/models/list_backups_response.py deleted file mode 100644 index b3c65fa5d..000000000 --- a/services/postgresflex/src/stackit/postgresflex/models/list_backups_response.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - STACKIT PostgreSQL Flex API - - This is the documentation for the STACKIT postgres service - - The version of the OpenAPI document: 2.0.0 - Contact: support@stackit.cloud - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -from __future__ import annotations - -import json -import pprint -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, StrictInt -from pydantic_core import to_jsonable_python -from typing_extensions import Self - -from stackit.postgresflex.models.backup import Backup - - -class ListBackupsResponse(BaseModel): - """ - ListBackupsResponse - """ # noqa: E501 - - count: Optional[StrictInt] = None - items: Optional[List[Backup]] = None - __properties: ClassVar[List[str]] = ["count", "items"] - - model_config = ConfigDict( - validate_by_name=True, - validate_by_alias=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - return json.dumps(to_jsonable_python(self.to_dict())) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ListBackupsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item_items in self.items: - if _item_items: - _items.append(_item_items.to_dict()) - _dict["items"] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ListBackupsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "count": obj.get("count"), - "items": [Backup.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, - } - ) - return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/api_configuration.py b/services/postgresflex/src/stackit/postgresflex/models/list_collations_response.py similarity index 75% rename from services/postgresflex/src/stackit/postgresflex/models/api_configuration.py rename to services/postgresflex/src/stackit/postgresflex/models/list_collations_response.py index 7b88394e6..72243f38c 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/api_configuration.py +++ b/services/postgresflex/src/stackit/postgresflex/models/list_collations_response.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,19 +18,18 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from pydantic_core import to_jsonable_python from typing_extensions import Self -class ApiConfiguration(BaseModel): +class ListCollationsResponse(BaseModel): """ - ApiConfiguration + ListCollationsResponse """ # noqa: E501 - name: Optional[StrictStr] = None - setting: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["name", "setting"] + collations: List[StrictStr] = Field(description="List of collations available for the instance.") + __properties: ClassVar[List[str]] = ["collations"] model_config = ConfigDict( validate_by_name=True, @@ -49,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApiConfiguration from a JSON string""" + """Create an instance of ListCollationsResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,12 +72,12 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApiConfiguration from a dict""" + """Create an instance of ListCollationsResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"name": obj.get("name"), "setting": obj.get("setting")}) + _obj = cls.model_validate({"collations": obj.get("collations")}) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_list_instance.py b/services/postgresflex/src/stackit/postgresflex/models/list_database.py similarity index 74% rename from services/postgresflex/src/stackit/postgresflex/models/instance_list_instance.py rename to services/postgresflex/src/stackit/postgresflex/models/list_database.py index b382e9a09..6e9535bd2 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/instance_list_instance.py +++ b/services/postgresflex/src/stackit/postgresflex/models/list_database.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,20 +18,20 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from pydantic_core import to_jsonable_python from typing_extensions import Self -class InstanceListInstance(BaseModel): +class ListDatabase(BaseModel): """ - InstanceListInstance + ListDatabase """ # noqa: E501 - id: Optional[StrictStr] = None - name: Optional[StrictStr] = None - status: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["id", "name", "status"] + id: StrictInt = Field(description="The id of the database.") + name: StrictStr = Field(description="The name of the database.") + owner: StrictStr = Field(description="The owner of the database.") + __properties: ClassVar[List[str]] = ["id", "name", "owner"] model_config = ConfigDict( validate_by_name=True, @@ -50,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceListInstance from a JSON string""" + """Create an instance of ListDatabase from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -74,12 +74,12 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceListInstance from a dict""" + """Create an instance of ListDatabase from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"id": obj.get("id"), "name": obj.get("name"), "status": obj.get("status")}) + _obj = cls.model_validate({"id": obj.get("id"), "name": obj.get("name"), "owner": obj.get("owner")}) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_list_databases_response.py b/services/postgresflex/src/stackit/postgresflex/models/list_databases_response.py similarity index 69% rename from services/postgresflex/src/stackit/postgresflex/models/instance_list_databases_response.py rename to services/postgresflex/src/stackit/postgresflex/models/list_databases_response.py index 9c3fd7020..a8896ec76 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/instance_list_databases_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/list_databases_response.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,20 +18,22 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict +from pydantic import BaseModel, ConfigDict, Field from pydantic_core import to_jsonable_python from typing_extensions import Self -from stackit.postgresflex.models.instance_database import InstanceDatabase +from stackit.postgresflex.models.list_database import ListDatabase +from stackit.postgresflex.models.pagination import Pagination -class InstanceListDatabasesResponse(BaseModel): +class ListDatabasesResponse(BaseModel): """ - InstanceListDatabasesResponse + ListDatabasesResponse """ # noqa: E501 - databases: Optional[List[InstanceDatabase]] = None - __properties: ClassVar[List[str]] = ["databases"] + databases: List[ListDatabase] = Field(description="A list containing all databases for the instance.") + pagination: Pagination + __properties: ClassVar[List[str]] = ["databases", "pagination"] model_config = ConfigDict( validate_by_name=True, @@ -50,7 +52,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceListDatabasesResponse from a JSON string""" + """Create an instance of ListDatabasesResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -77,11 +79,14 @@ def to_dict(self) -> Dict[str, Any]: if _item_databases: _items.append(_item_databases.to_dict()) _dict["databases"] = _items + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict["pagination"] = self.pagination.to_dict() return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceListDatabasesResponse from a dict""" + """Create an instance of ListDatabasesResponse from a dict""" if obj is None: return None @@ -91,10 +96,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "databases": ( - [InstanceDatabase.from_dict(_item) for _item in obj["databases"]] + [ListDatabase.from_dict(_item) for _item in obj["databases"]] if obj.get("databases") is not None else None - ) + ), + "pagination": Pagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, } ) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/list_flavors.py b/services/postgresflex/src/stackit/postgresflex/models/list_flavors.py new file mode 100644 index 000000000..208eab6d6 --- /dev/null +++ b/services/postgresflex/src/stackit/postgresflex/models/list_flavors.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + STACKIT PostgreSQL Flex API + + This is the documentation for the STACKIT Postgres Flex service + + The version of the OpenAPI document: 3.0.0 + Contact: support@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic_core import to_jsonable_python +from typing_extensions import Self + +from stackit.postgresflex.models.flavor_storage_classes_storage_class import ( + FlavorStorageClassesStorageClass, +) + + +class ListFlavors(BaseModel): + """ + The flavor of the instance containing the technical features. + """ # noqa: E501 + + cpu: StrictInt = Field(description="The cpu count of the instance.") + description: StrictStr = Field(description="The flavor description.") + id: StrictStr = Field(description="The id of the instance flavor.") + max_gb: StrictInt = Field( + description="maximum storage which can be ordered for the flavor in Gigabyte.", alias="maxGB" + ) + memory: StrictInt = Field(description="The memory of the instance in Gibibyte.") + min_gb: StrictInt = Field(description="minimum storage which is required to order in Gigabyte.", alias="minGB") + node_type: StrictStr = Field( + description="defines the nodeType it can be either single or replica", alias="nodeType" + ) + storage_classes: List[FlavorStorageClassesStorageClass] = Field( + description="maximum storage which can be ordered for the flavor in Gigabyte.", alias="storageClasses" + ) + __properties: ClassVar[List[str]] = [ + "cpu", + "description", + "id", + "maxGB", + "memory", + "minGB", + "nodeType", + "storageClasses", + ] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListFlavors from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in storage_classes (list) + _items = [] + if self.storage_classes: + for _item_storage_classes in self.storage_classes: + if _item_storage_classes: + _items.append(_item_storage_classes.to_dict()) + _dict["storageClasses"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListFlavors from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "cpu": obj.get("cpu"), + "description": obj.get("description"), + "id": obj.get("id"), + "maxGB": obj.get("maxGB"), + "memory": obj.get("memory"), + "minGB": obj.get("minGB"), + "nodeType": obj.get("nodeType"), + "storageClasses": ( + [FlavorStorageClassesStorageClass.from_dict(_item) for _item in obj["storageClasses"]] + if obj.get("storageClasses") is not None + else None + ), + } + ) + return _obj 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 d3c64117e..88bd8805a 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/list_flavors_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/list_flavors_response.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,11 +18,12 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict +from pydantic import BaseModel, ConfigDict, Field from pydantic_core import to_jsonable_python from typing_extensions import Self -from stackit.postgresflex.models.flavor import Flavor +from stackit.postgresflex.models.list_flavors import ListFlavors +from stackit.postgresflex.models.pagination import Pagination class ListFlavorsResponse(BaseModel): @@ -30,8 +31,9 @@ class ListFlavorsResponse(BaseModel): ListFlavorsResponse """ # noqa: E501 - flavors: Optional[List[Flavor]] = None - __properties: ClassVar[List[str]] = ["flavors"] + flavors: List[ListFlavors] = Field(description="List of flavors available for the project.") + pagination: Pagination + __properties: ClassVar[List[str]] = ["flavors", "pagination"] model_config = ConfigDict( validate_by_name=True, @@ -77,6 +79,9 @@ def to_dict(self) -> Dict[str, Any]: if _item_flavors: _items.append(_item_flavors.to_dict()) _dict["flavors"] = _items + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict["pagination"] = self.pagination.to_dict() return _dict @classmethod @@ -91,8 +96,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "flavors": ( - [Flavor.from_dict(_item) for _item in obj["flavors"]] if obj.get("flavors") is not None else None - ) + [ListFlavors.from_dict(_item) for _item in obj["flavors"]] + if obj.get("flavors") is not None + else None + ), + "pagination": Pagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, } ) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/list_instance.py b/services/postgresflex/src/stackit/postgresflex/models/list_instance.py new file mode 100644 index 000000000..063fb36d0 --- /dev/null +++ b/services/postgresflex/src/stackit/postgresflex/models/list_instance.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + STACKIT PostgreSQL Flex API + + This is the documentation for the STACKIT Postgres Flex service + + The version of the OpenAPI document: 3.0.0 + Contact: support@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set +from uuid import UUID + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from pydantic_core import to_jsonable_python +from typing_extensions import Annotated, Self + +from stackit.postgresflex.models.state import State + + +class ListInstance(BaseModel): + """ + ListInstance + """ # noqa: E501 + + id: UUID = Field(description="The ID of the instance.") + is_deletable: StrictBool = Field(description="Whether the instance can be deleted or not.", alias="isDeletable") + name: Annotated[str, Field(min_length=3, strict=True, max_length=63)] = Field( + description="The name of the instance." + ) + state: State + __properties: ClassVar[List[str]] = ["id", "isDeletable", "name", "state"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListInstance from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListInstance from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "id": obj.get("id"), + "isDeletable": obj.get("isDeletable"), + "name": obj.get("name"), + "state": obj.get("state"), + } + ) + return _obj 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 024a3bdf3..ccce58a9d 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/list_instances_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/list_instances_response.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,11 +18,12 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, StrictInt +from pydantic import BaseModel, ConfigDict, Field from pydantic_core import to_jsonable_python from typing_extensions import Self -from stackit.postgresflex.models.instance_list_instance import InstanceListInstance +from stackit.postgresflex.models.list_instance import ListInstance +from stackit.postgresflex.models.pagination import Pagination class ListInstancesResponse(BaseModel): @@ -30,9 +31,9 @@ class ListInstancesResponse(BaseModel): ListInstancesResponse """ # noqa: E501 - count: Optional[StrictInt] = None - items: Optional[List[InstanceListInstance]] = None - __properties: ClassVar[List[str]] = ["count", "items"] + instances: List[ListInstance] = Field(description="List of owned instances and their current state.") + pagination: Pagination + __properties: ClassVar[List[str]] = ["instances", "pagination"] model_config = ConfigDict( validate_by_name=True, @@ -71,13 +72,16 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) + # override the default output from pydantic by calling `to_dict()` of each item in instances (list) _items = [] - if self.items: - for _item_items in self.items: - if _item_items: - _items.append(_item_items.to_dict()) - _dict["items"] = _items + if self.instances: + for _item_instances in self.instances: + if _item_instances: + _items.append(_item_instances.to_dict()) + _dict["instances"] = _items + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict["pagination"] = self.pagination.to_dict() return _dict @classmethod @@ -91,12 +95,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "count": obj.get("count"), - "items": ( - [InstanceListInstance.from_dict(_item) for _item in obj["items"]] - if obj.get("items") is not None + "instances": ( + [ListInstance.from_dict(_item) for _item in obj["instances"]] + if obj.get("instances") is not None else None ), + "pagination": Pagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, } ) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/list_versions_response.py b/services/postgresflex/src/stackit/postgresflex/models/list_roles_response.py similarity index 76% rename from services/postgresflex/src/stackit/postgresflex/models/list_versions_response.py rename to services/postgresflex/src/stackit/postgresflex/models/list_roles_response.py index 863dd8bdd..e1e3a068a 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/list_versions_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/list_roles_response.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,18 +18,18 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from pydantic_core import to_jsonable_python from typing_extensions import Self -class ListVersionsResponse(BaseModel): +class ListRolesResponse(BaseModel): """ - ListVersionsResponse + ListRolesResponse """ # noqa: E501 - versions: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = ["versions"] + roles: List[StrictStr] = Field(description="List of all role names available in the instance") + __properties: ClassVar[List[str]] = ["roles"] model_config = ConfigDict( validate_by_name=True, @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ListVersionsResponse from a JSON string""" + """Create an instance of ListRolesResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -72,12 +72,12 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ListVersionsResponse from a dict""" + """Create an instance of ListRolesResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"versions": obj.get("versions")}) + _obj = cls.model_validate({"roles": obj.get("roles")}) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/api_extension_list.py b/services/postgresflex/src/stackit/postgresflex/models/list_user.py similarity index 75% rename from services/postgresflex/src/stackit/postgresflex/models/api_extension_list.py rename to services/postgresflex/src/stackit/postgresflex/models/list_user.py index e299f18bb..0188d4207 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/api_extension_list.py +++ b/services/postgresflex/src/stackit/postgresflex/models/list_user.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -23,15 +23,15 @@ from typing_extensions import Self -class ApiExtensionList(BaseModel): +class ListUser(BaseModel): """ - ApiExtensionList + ListUser """ # noqa: E501 - id: Optional[StrictInt] = Field(default=None, alias="ID") - description: Optional[StrictStr] = None - name: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["ID", "description", "name"] + id: StrictInt = Field(description="The ID of the user.") + name: StrictStr = Field(description="The name of the user.") + state: StrictStr = Field(description="The current state of the user.") + __properties: ClassVar[List[str]] = ["id", "name", "state"] model_config = ConfigDict( validate_by_name=True, @@ -50,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApiExtensionList from a JSON string""" + """Create an instance of ListUser from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -74,12 +74,12 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApiExtensionList from a dict""" + """Create an instance of ListUser from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"ID": obj.get("ID"), "description": obj.get("description"), "name": obj.get("name")}) + _obj = cls.model_validate({"id": obj.get("id"), "name": obj.get("name"), "state": obj.get("state")}) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/api_extension_config_load_response.py b/services/postgresflex/src/stackit/postgresflex/models/list_user_response.py similarity index 62% rename from services/postgresflex/src/stackit/postgresflex/models/api_extension_config_load_response.py rename to services/postgresflex/src/stackit/postgresflex/models/list_user_response.py index f896ec03e..41abfe70c 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/api_extension_config_load_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/list_user_response.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -22,18 +22,18 @@ from pydantic_core import to_jsonable_python from typing_extensions import Self -from stackit.postgresflex.models.api_configuration import ApiConfiguration +from stackit.postgresflex.models.list_user import ListUser +from stackit.postgresflex.models.pagination import Pagination -class ApiExtensionConfigLoadResponse(BaseModel): +class ListUserResponse(BaseModel): """ - ApiExtensionConfigLoadResponse + ListUserResponse """ # noqa: E501 - configuration: Optional[List[ApiConfiguration]] = Field( - default=None, description="Returns marshalled JSON of the new configuration of whatever extension is called" - ) - __properties: ClassVar[List[str]] = ["configuration"] + pagination: Pagination + users: List[ListUser] = Field(description="List of all users inside an instance") + __properties: ClassVar[List[str]] = ["pagination", "users"] model_config = ConfigDict( validate_by_name=True, @@ -52,7 +52,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApiExtensionConfigLoadResponse from a JSON string""" + """Create an instance of ListUserResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -72,18 +72,21 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in configuration (list) + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict["pagination"] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in users (list) _items = [] - if self.configuration: - for _item_configuration in self.configuration: - if _item_configuration: - _items.append(_item_configuration.to_dict()) - _dict["configuration"] = _items + if self.users: + for _item_users in self.users: + if _item_users: + _items.append(_item_users.to_dict()) + _dict["users"] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApiExtensionConfigLoadResponse from a dict""" + """Create an instance of ListUserResponse from a dict""" if obj is None: return None @@ -92,11 +95,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "configuration": ( - [ApiConfiguration.from_dict(_item) for _item in obj["configuration"]] - if obj.get("configuration") is not None - else None - ) + "pagination": Pagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "users": ( + [ListUser.from_dict(_item) for _item in obj["users"]] if obj.get("users") is not None else None + ), } ) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/list_users_response.py b/services/postgresflex/src/stackit/postgresflex/models/list_users_response.py deleted file mode 100644 index 71833e34c..000000000 --- a/services/postgresflex/src/stackit/postgresflex/models/list_users_response.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding: utf-8 - -""" - STACKIT PostgreSQL Flex API - - This is the documentation for the STACKIT postgres service - - The version of the OpenAPI document: 2.0.0 - Contact: support@stackit.cloud - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -from __future__ import annotations - -import json -import pprint -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, StrictInt -from pydantic_core import to_jsonable_python -from typing_extensions import Self - -from stackit.postgresflex.models.list_users_response_item import ListUsersResponseItem - - -class ListUsersResponse(BaseModel): - """ - ListUsersResponse - """ # noqa: E501 - - count: Optional[StrictInt] = None - items: Optional[List[ListUsersResponseItem]] = None - __properties: ClassVar[List[str]] = ["count", "items"] - - model_config = ConfigDict( - validate_by_name=True, - validate_by_alias=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - return json.dumps(to_jsonable_python(self.to_dict())) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ListUsersResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in items (list) - _items = [] - if self.items: - for _item_items in self.items: - if _item_items: - _items.append(_item_items.to_dict()) - _dict["items"] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ListUsersResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "count": obj.get("count"), - "items": ( - [ListUsersResponseItem.from_dict(_item) for _item in obj["items"]] - if obj.get("items") is not None - else None - ), - } - ) - return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_metrics_response.py b/services/postgresflex/src/stackit/postgresflex/models/list_version_response.py similarity index 68% rename from services/postgresflex/src/stackit/postgresflex/models/instance_metrics_response.py rename to services/postgresflex/src/stackit/postgresflex/models/list_version_response.py index 97a580ac1..43283ca1f 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/instance_metrics_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/list_version_response.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,20 +18,20 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict +from pydantic import BaseModel, ConfigDict, Field from pydantic_core import to_jsonable_python from typing_extensions import Self -from stackit.postgresflex.models.instance_host import InstanceHost +from stackit.postgresflex.models.version import Version -class InstanceMetricsResponse(BaseModel): +class ListVersionResponse(BaseModel): """ - InstanceMetricsResponse + ListVersionResponse """ # noqa: E501 - hosts: Optional[List[InstanceHost]] = None - __properties: ClassVar[List[str]] = ["hosts"] + versions: List[Version] = Field(description="A list containing available postgres versions.") + __properties: ClassVar[List[str]] = ["versions"] model_config = ConfigDict( validate_by_name=True, @@ -50,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceMetricsResponse from a JSON string""" + """Create an instance of ListVersionResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -70,18 +70,18 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in hosts (list) + # override the default output from pydantic by calling `to_dict()` of each item in versions (list) _items = [] - if self.hosts: - for _item_hosts in self.hosts: - if _item_hosts: - _items.append(_item_hosts.to_dict()) - _dict["hosts"] = _items + if self.versions: + for _item_versions in self.versions: + if _item_versions: + _items.append(_item_versions.to_dict()) + _dict["versions"] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceMetricsResponse from a dict""" + """Create an instance of ListVersionResponse from a dict""" if obj is None: return None @@ -90,8 +90,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "hosts": ( - [InstanceHost.from_dict(_item) for _item in obj["hosts"]] if obj.get("hosts") is not None else None + "versions": ( + [Version.from_dict(_item) for _item in obj["versions"]] if obj.get("versions") is not None else None ) } ) diff --git a/services/postgresflex/src/stackit/postgresflex/models/user_response.py b/services/postgresflex/src/stackit/postgresflex/models/pagination.py similarity index 70% rename from services/postgresflex/src/stackit/postgresflex/models/user_response.py rename to services/postgresflex/src/stackit/postgresflex/models/pagination.py index c49c3f68d..eecffb007 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/user_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/pagination.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,22 +18,22 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from pydantic_core import to_jsonable_python from typing_extensions import Self -class UserResponse(BaseModel): +class Pagination(BaseModel): """ - UserResponse + Pagination """ # noqa: E501 - host: Optional[StrictStr] = None - id: Optional[StrictStr] = None - port: Optional[StrictInt] = None - roles: Optional[List[StrictStr]] = None - username: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["host", "id", "port", "roles", "username"] + page: StrictInt + size: StrictInt + sort: StrictStr + total_pages: StrictInt = Field(alias="totalPages") + total_rows: StrictInt = Field(alias="totalRows") + __properties: ClassVar[List[str]] = ["page", "size", "sort", "totalPages", "totalRows"] model_config = ConfigDict( validate_by_name=True, @@ -52,7 +52,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserResponse from a JSON string""" + """Create an instance of Pagination from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -76,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserResponse from a dict""" + """Create an instance of Pagination from a dict""" if obj is None: return None @@ -85,11 +85,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "host": obj.get("host"), - "id": obj.get("id"), - "port": obj.get("port"), - "roles": obj.get("roles"), - "username": obj.get("username"), + "page": obj.get("page"), + "size": obj.get("size"), + "sort": obj.get("sort"), + "totalPages": obj.get("totalPages"), + "totalRows": obj.get("totalRows"), } ) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/partial_update_database_payload.py b/services/postgresflex/src/stackit/postgresflex/models/partial_update_database_payload.py new file mode 100644 index 000000000..df2b69feb --- /dev/null +++ b/services/postgresflex/src/stackit/postgresflex/models/partial_update_database_payload.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + STACKIT PostgreSQL Flex API + + This is the documentation for the STACKIT Postgres Flex service + + The version of the OpenAPI document: 3.0.0 + Contact: support@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic_core import to_jsonable_python +from typing_extensions import Self + + +class PartialUpdateDatabasePayload(BaseModel): + """ + PartialUpdateDatabasePayload + """ # noqa: E501 + + name: Optional[StrictStr] = Field(default=None, description="The name of the database.") + owner: Optional[StrictStr] = Field(default=None, description="The owner of the database.") + __properties: ClassVar[List[str]] = ["name", "owner"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PartialUpdateDatabasePayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PartialUpdateDatabasePayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"name": obj.get("name"), "owner": obj.get("owner")}) + return _obj 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 8a5c1d783..f6a05222e 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 @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,11 +18,11 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from pydantic_core import to_jsonable_python -from typing_extensions import Self +from typing_extensions import Annotated, Self -from stackit.postgresflex.models.acl import ACL +from stackit.postgresflex.models.instance_network_opt import InstanceNetworkOpt from stackit.postgresflex.models.storage_update import StorageUpdate @@ -31,23 +31,37 @@ class PartialUpdateInstancePayload(BaseModel): PartialUpdateInstancePayload """ # noqa: E501 - acl: Optional[ACL] = None - backup_schedule: Optional[StrictStr] = Field(default=None, alias="backupSchedule") - flavor_id: Optional[StrictStr] = Field(default=None, alias="flavorId") - labels: Optional[Dict[str, StrictStr]] = Field(default=None, description="Labels field is not certain/clear") - name: Optional[StrictStr] = None - options: Optional[Dict[str, StrictStr]] = None - replicas: Optional[StrictInt] = None + backup_schedule: Optional[StrictStr] = Field( + default=None, + description="The schedule for when the database backup will be created. Currently, ONLY daily schedules are supported (every 24 hours). The schedule is written as a cron schedule.", + alias="backupSchedule", + ) + flavor_id: Optional[StrictStr] = Field(default=None, description="The id of the instance flavor.", alias="flavorId") + labels: Optional[Dict[str, Optional[StrictStr]]] = Field( + default=None, + description="Key-value pairs, 63 characters max, begin and end with an alphanumerical character, may contain dashes (-), underscores (_), dots (.), and alphanumerics between. Key MUST be at least 1 character. Max 64 labels Regex for keys: ^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$ Regex for values: ^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$ The stackit- prefix is reserved and cannot be used for Keys. ", + ) + name: Optional[Annotated[str, Field(min_length=3, strict=True, max_length=63)]] = Field( + default=None, description="The name of the instance." + ) + network: Optional[InstanceNetworkOpt] = None + retention_days: Optional[Annotated[int, Field(le=365, strict=True, ge=32)]] = Field( + default=None, + description="How long backups are retained. The value can only be between 32 and 90 days.", + alias="retentionDays", + ) storage: Optional[StorageUpdate] = None - version: Optional[StrictStr] = None + version: Optional[StrictStr] = Field( + default=None, + description="The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3#tag/Version) for supported version parameters.", + ) __properties: ClassVar[List[str]] = [ - "acl", "backupSchedule", "flavorId", "labels", "name", - "options", - "replicas", + "network", + "retentionDays", "storage", "version", ] @@ -89,9 +103,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # 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 network + if self.network: + _dict["network"] = self.network.to_dict() # override the default output from pydantic by calling `to_dict()` of storage if self.storage: _dict["storage"] = self.storage.to_dict() @@ -108,13 +122,12 @@ 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, "backupSchedule": obj.get("backupSchedule"), "flavorId": obj.get("flavorId"), "labels": obj.get("labels"), "name": obj.get("name"), - "options": obj.get("options"), - "replicas": obj.get("replicas"), + "network": InstanceNetworkOpt.from_dict(obj["network"]) if obj.get("network") is not None else None, + "retentionDays": obj.get("retentionDays"), "storage": StorageUpdate.from_dict(obj["storage"]) if obj.get("storage") is not None else None, "version": obj.get("version"), } 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 deleted file mode 100644 index 2607e2f3f..000000000 --- a/services/postgresflex/src/stackit/postgresflex/models/partial_update_instance_response.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - STACKIT PostgreSQL Flex API - - This is the documentation for the STACKIT postgres service - - The version of the OpenAPI document: 2.0.0 - Contact: support@stackit.cloud - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -from __future__ import annotations - -import json -import pprint -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict -from pydantic_core import to_jsonable_python -from typing_extensions import Self - -from stackit.postgresflex.models.instance import Instance - - -class PartialUpdateInstanceResponse(BaseModel): - """ - PartialUpdateInstanceResponse - """ # noqa: E501 - - item: Optional[Instance] = None - __properties: ClassVar[List[str]] = ["item"] - - model_config = ConfigDict( - validate_by_name=True, - validate_by_alias=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - return json.dumps(to_jsonable_python(self.to_dict())) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PartialUpdateInstanceResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of item - if self.item: - _dict["item"] = self.item.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PartialUpdateInstanceResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({"item": Instance.from_dict(obj["item"]) if obj.get("item") is not None else None}) - return _obj 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 0ee64813c..6570edfd5 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 @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,9 +18,9 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from pydantic_core import to_jsonable_python -from typing_extensions import Self +from typing_extensions import Annotated, Self class PartialUpdateUserPayload(BaseModel): @@ -28,9 +28,12 @@ class PartialUpdateUserPayload(BaseModel): PartialUpdateUserPayload """ # noqa: E501 - database: Optional[StrictStr] = None - roles: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = ["database", "roles"] + name: Optional[StrictStr] = Field(default=None, description="The name of the user.") + roles: Optional[List[Annotated[str, Field(min_length=1, strict=True, max_length=63)]]] = Field( + default=None, + description="A list containing the user roles for the instance. Please refer to the List Roles endpoint for a list of all available Roles.", + ) + __properties: ClassVar[List[str]] = ["name", "roles"] model_config = ConfigDict( validate_by_name=True, @@ -80,5 +83,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({"database": obj.get("database"), "roles": obj.get("roles")}) + _obj = cls.model_validate({"name": obj.get("name"), "roles": obj.get("roles")}) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/postgres_database_parameter.py b/services/postgresflex/src/stackit/postgresflex/models/postgres_database_parameter.py deleted file mode 100644 index e4f3320cb..000000000 --- a/services/postgresflex/src/stackit/postgresflex/models/postgres_database_parameter.py +++ /dev/null @@ -1,144 +0,0 @@ -# coding: utf-8 - -""" - STACKIT PostgreSQL Flex API - - This is the documentation for the STACKIT postgres service - - The version of the OpenAPI document: 2.0.0 - Contact: support@stackit.cloud - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -from __future__ import annotations - -import json -import pprint -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictBool, - StrictStr, -) -from pydantic_core import to_jsonable_python -from typing_extensions import Self - - -class PostgresDatabaseParameter(BaseModel): - """ - PostgresDatabaseParameter - """ # noqa: E501 - - context: Optional[StrictStr] = Field(default=None, description="Context of the parameter.") - data_type: Optional[StrictStr] = Field( - default=None, - description="Datatype describes the type of data that is used in the Value field.", - alias="dataType", - ) - default_value: Optional[StrictStr] = Field( - default=None, description="DefaultValue for the value field.", alias="defaultValue" - ) - description: Optional[StrictStr] = Field(default=None, description="Description of the parameter.") - edit: Optional[StrictBool] = Field(default=None, description="Edit shows if the user can change this value.") - max_value: Optional[StrictStr] = Field( - default=None, description="MaxValue describes the highest possible value that can be set.", alias="maxValue" - ) - min_value: Optional[StrictStr] = Field( - default=None, description="MinValue describes the lowest possible value that can be set.", alias="minValue" - ) - name: Optional[StrictStr] = Field(default=None, description="Name of the parameter.") - pending_restart: Optional[StrictBool] = Field( - default=None, - description="PendingRestart describes if a parameter change requires a restart of the server.", - alias="pendingRestart", - ) - reset_value: Optional[StrictStr] = Field( - default=None, description="ResetValue for the value field af.ter a reset.", alias="resetValue" - ) - unit: Optional[StrictStr] = Field(default=None, description="Unit if the parameter has a unit if not empty.") - value: Optional[StrictStr] = Field(default=None, description="Value of this parameter.") - __properties: ClassVar[List[str]] = [ - "context", - "dataType", - "defaultValue", - "description", - "edit", - "maxValue", - "minValue", - "name", - "pendingRestart", - "resetValue", - "unit", - "value", - ] - - model_config = ConfigDict( - validate_by_name=True, - validate_by_alias=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - return json.dumps(to_jsonable_python(self.to_dict())) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PostgresDatabaseParameter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PostgresDatabaseParameter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "context": obj.get("context"), - "dataType": obj.get("dataType"), - "defaultValue": obj.get("defaultValue"), - "description": obj.get("description"), - "edit": obj.get("edit"), - "maxValue": obj.get("maxValue"), - "minValue": obj.get("minValue"), - "name": obj.get("name"), - "pendingRestart": obj.get("pendingRestart"), - "resetValue": obj.get("resetValue"), - "unit": obj.get("unit"), - "value": obj.get("value"), - } - ) - return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/get_backup_response.py b/services/postgresflex/src/stackit/postgresflex/models/reset_user_password_response.py similarity index 70% rename from services/postgresflex/src/stackit/postgresflex/models/get_backup_response.py rename to services/postgresflex/src/stackit/postgresflex/models/reset_user_password_response.py index 6b04ae765..f53b7c4d4 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/get_backup_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/reset_user_password_response.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,20 +18,20 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict +from pydantic import BaseModel, ConfigDict, Field, StrictStr from pydantic_core import to_jsonable_python from typing_extensions import Self -from stackit.postgresflex.models.backup import Backup - -class GetBackupResponse(BaseModel): +class ResetUserPasswordResponse(BaseModel): """ - GetBackupResponse + ResetUserPasswordResponse """ # noqa: E501 - item: Optional[Backup] = None - __properties: ClassVar[List[str]] = ["item"] + name: StrictStr = Field(description="The name of the user.") + password: StrictStr = Field(description="The password for the user.") + state: StrictStr = Field(description="The current state of the user.") + __properties: ClassVar[List[str]] = ["name", "password", "state"] model_config = ConfigDict( validate_by_name=True, @@ -50,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GetBackupResponse from a JSON string""" + """Create an instance of ResetUserPasswordResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -70,19 +70,16 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of item - if self.item: - _dict["item"] = self.item.to_dict() return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GetBackupResponse from a dict""" + """Create an instance of ResetUserPasswordResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"item": Backup.from_dict(obj["item"]) if obj.get("item") is not None else None}) + _obj = cls.model_validate({"name": obj.get("name"), "password": obj.get("password"), "state": obj.get("state")}) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/reset_user_response.py b/services/postgresflex/src/stackit/postgresflex/models/reset_user_response.py deleted file mode 100644 index 45359d35b..000000000 --- a/services/postgresflex/src/stackit/postgresflex/models/reset_user_response.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - STACKIT PostgreSQL Flex API - - This is the documentation for the STACKIT postgres service - - The version of the OpenAPI document: 2.0.0 - Contact: support@stackit.cloud - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -from __future__ import annotations - -import json -import pprint -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict -from pydantic_core import to_jsonable_python -from typing_extensions import Self - -from stackit.postgresflex.models.user import User - - -class ResetUserResponse(BaseModel): - """ - ResetUserResponse - """ # noqa: E501 - - item: Optional[User] = None - __properties: ClassVar[List[str]] = ["item"] - - model_config = ConfigDict( - validate_by_name=True, - validate_by_alias=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - return json.dumps(to_jsonable_python(self.to_dict())) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ResetUserResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of item - if self.item: - _dict["item"] = self.item.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ResetUserResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({"item": User.from_dict(obj["item"]) if obj.get("item") is not None else None}) - return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/state.py b/services/postgresflex/src/stackit/postgresflex/models/state.py new file mode 100644 index 000000000..615debd4f --- /dev/null +++ b/services/postgresflex/src/stackit/postgresflex/models/state.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + STACKIT PostgreSQL Flex API + + This is the documentation for the STACKIT Postgres Flex service + + The version of the OpenAPI document: 3.0.0 + Contact: support@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +from enum import Enum + +from typing_extensions import Self + + +class State(str, Enum): + """ + The current state of the instance. + """ + + """ + allowed enum values + """ + READY = "READY" + PENDING = "PENDING" + PROGRESSING = "PROGRESSING" + FAILURE = "FAILURE" + UNKNOWN = "UNKNOWN" + TERMINATING = "TERMINATING" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of State from a JSON string""" + return cls(json.loads(json_str)) diff --git a/services/postgresflex/src/stackit/postgresflex/models/storage.py b/services/postgresflex/src/stackit/postgresflex/models/storage.py index 121d571fc..871067f22 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/storage.py +++ b/services/postgresflex/src/stackit/postgresflex/models/storage.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -25,11 +25,13 @@ class Storage(BaseModel): """ - Storage + The object containing information about the storage size and class. """ # noqa: E501 - var_class: Optional[StrictStr] = Field(default=None, alias="class") - size: Optional[StrictInt] = None + var_class: Optional[StrictStr] = Field( + default=None, description="The storage class for the storage.", alias="class" + ) + size: Optional[StrictInt] = Field(default=None, description="The storage size in Gigabytes.") __properties: ClassVar[List[str]] = ["class", "size"] model_config = ConfigDict( diff --git a/services/postgresflex/src/stackit/postgresflex/models/storage_create.py b/services/postgresflex/src/stackit/postgresflex/models/storage_create.py new file mode 100644 index 000000000..fb6286aa0 --- /dev/null +++ b/services/postgresflex/src/stackit/postgresflex/models/storage_create.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + STACKIT PostgreSQL Flex API + + This is the documentation for the STACKIT Postgres Flex service + + The version of the OpenAPI document: 3.0.0 + Contact: support@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic_core import to_jsonable_python +from typing_extensions import Self + + +class StorageCreate(BaseModel): + """ + The object containing information about the storage size and class. + """ # noqa: E501 + + var_class: Optional[StrictStr] = Field( + default=None, description="The storage class for the storage.", alias="class" + ) + size: StrictInt = Field(description="The storage size in Gigabytes.") + __properties: ClassVar[List[str]] = ["class", "size"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of StorageCreate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of StorageCreate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"class": obj.get("class"), "size": obj.get("size")}) + return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/storage_update.py b/services/postgresflex/src/stackit/postgresflex/models/storage_update.py index 6dc0ff629..f03f3e0c4 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/storage_update.py +++ b/services/postgresflex/src/stackit/postgresflex/models/storage_update.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,23 +18,18 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt from pydantic_core import to_jsonable_python from typing_extensions import Self class StorageUpdate(BaseModel): """ - StorageUpdate + The object containing information about the storage size and class. """ # noqa: E501 - var_class: Optional[StrictStr] = Field( - default=None, - description=" ⚠️ **DEPRECATED AND NON-FUNCTIONAL:** Updating the performance class field is not possible. ", - alias="class", - ) - size: Optional[StrictInt] = None - __properties: ClassVar[List[str]] = ["class", "size"] + size: Optional[StrictInt] = Field(default=None, description="The storage size in Gigabytes.") + __properties: ClassVar[List[str]] = ["size"] model_config = ConfigDict( validate_by_name=True, @@ -84,5 +79,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({"class": obj.get("class"), "size": obj.get("size")}) + _obj = cls.model_validate({"size": obj.get("size")}) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/api_extension_load_response.py b/services/postgresflex/src/stackit/postgresflex/models/update_database_partially_response.py similarity index 73% rename from services/postgresflex/src/stackit/postgresflex/models/api_extension_load_response.py rename to services/postgresflex/src/stackit/postgresflex/models/update_database_partially_response.py index 27dc49566..d66f694d2 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/api_extension_load_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/update_database_partially_response.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -22,16 +22,16 @@ from pydantic_core import to_jsonable_python from typing_extensions import Self -from stackit.postgresflex.models.api_extension_list import ApiExtensionList +from stackit.postgresflex.models.list_database import ListDatabase -class ApiExtensionLoadResponse(BaseModel): +class UpdateDatabasePartiallyResponse(BaseModel): """ - ApiExtensionLoadResponse + UpdateDatabasePartiallyResponse """ # noqa: E501 - extension: Optional[ApiExtensionList] = None - __properties: ClassVar[List[str]] = ["extension"] + database: ListDatabase + __properties: ClassVar[List[str]] = ["database"] model_config = ConfigDict( validate_by_name=True, @@ -50,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApiExtensionLoadResponse from a JSON string""" + """Create an instance of UpdateDatabasePartiallyResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -70,14 +70,14 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of extension - if self.extension: - _dict["extension"] = self.extension.to_dict() + # override the default output from pydantic by calling `to_dict()` of database + if self.database: + _dict["database"] = self.database.to_dict() return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApiExtensionLoadResponse from a dict""" + """Create an instance of UpdateDatabasePartiallyResponse from a dict""" if obj is None: return None @@ -85,6 +85,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate( - {"extension": ApiExtensionList.from_dict(obj["extension"]) if obj.get("extension") is not None else None} + {"database": ListDatabase.from_dict(obj["database"]) if obj.get("database") is not None else None} ) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/extensions_configuration.py b/services/postgresflex/src/stackit/postgresflex/models/update_database_payload.py similarity index 74% rename from services/postgresflex/src/stackit/postgresflex/models/extensions_configuration.py rename to services/postgresflex/src/stackit/postgresflex/models/update_database_payload.py index d61db576b..6f132e253 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/extensions_configuration.py +++ b/services/postgresflex/src/stackit/postgresflex/models/update_database_payload.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,19 +18,19 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from pydantic_core import to_jsonable_python from typing_extensions import Self -class ExtensionsConfiguration(BaseModel): +class UpdateDatabasePayload(BaseModel): """ - ExtensionsConfiguration + UpdateDatabasePayload """ # noqa: E501 - name: Optional[StrictStr] = None - setting: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["name", "setting"] + name: StrictStr = Field(description="The name of the database.") + owner: StrictStr = Field(description="The owner of the database.") + __properties: ClassVar[List[str]] = ["name", "owner"] model_config = ConfigDict( validate_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 ExtensionsConfiguration from a JSON string""" + """Create an instance of UpdateDatabasePayload 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 ExtensionsConfiguration from a dict""" + """Create an instance of UpdateDatabasePayload from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"name": obj.get("name"), "setting": obj.get("setting")}) + _obj = cls.model_validate({"name": obj.get("name"), "owner": obj.get("owner")}) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/api_install_response.py b/services/postgresflex/src/stackit/postgresflex/models/update_database_response.py similarity index 74% rename from services/postgresflex/src/stackit/postgresflex/models/api_install_response.py rename to services/postgresflex/src/stackit/postgresflex/models/update_database_response.py index b4acb41c4..a6c593f82 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/api_install_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/update_database_response.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -22,16 +22,16 @@ from pydantic_core import to_jsonable_python from typing_extensions import Self -from stackit.postgresflex.models.api_extension_list import ApiExtensionList +from stackit.postgresflex.models.list_database import ListDatabase -class ApiInstallResponse(BaseModel): +class UpdateDatabaseResponse(BaseModel): """ - ApiInstallResponse + UpdateDatabaseResponse """ # noqa: E501 - extension: Optional[ApiExtensionList] = None - __properties: ClassVar[List[str]] = ["extension"] + database: ListDatabase + __properties: ClassVar[List[str]] = ["database"] model_config = ConfigDict( validate_by_name=True, @@ -50,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApiInstallResponse from a JSON string""" + """Create an instance of UpdateDatabaseResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -70,14 +70,14 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of extension - if self.extension: - _dict["extension"] = self.extension.to_dict() + # override the default output from pydantic by calling `to_dict()` of database + if self.database: + _dict["database"] = self.database.to_dict() return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApiInstallResponse from a dict""" + """Create an instance of UpdateDatabaseResponse from a dict""" if obj is None: return None @@ -85,6 +85,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate( - {"extension": ApiExtensionList.from_dict(obj["extension"]) if obj.get("extension") is not None else None} + {"database": ListDatabase.from_dict(obj["database"]) if obj.get("database") is not None else None} ) return _obj 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 510959014..68ab586fd 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/update_instance_payload.py +++ b/services/postgresflex/src/stackit/postgresflex/models/update_instance_payload.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,11 +18,11 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from pydantic_core import to_jsonable_python -from typing_extensions import Self +from typing_extensions import Annotated, Self -from stackit.postgresflex.models.acl import ACL +from stackit.postgresflex.models.instance_network_update import InstanceNetworkUpdate from stackit.postgresflex.models.storage_update import StorageUpdate @@ -31,23 +31,34 @@ class UpdateInstancePayload(BaseModel): UpdateInstancePayload """ # noqa: E501 - acl: Optional[ACL] = None - backup_schedule: Optional[StrictStr] = Field(default=None, alias="backupSchedule") - flavor_id: Optional[StrictStr] = Field(default=None, alias="flavorId") - labels: Optional[Dict[str, StrictStr]] = Field(default=None, description="Labels field is not certain/clear") - name: Optional[StrictStr] = None - options: Optional[Dict[str, StrictStr]] = None - replicas: Optional[StrictInt] = None - storage: Optional[StorageUpdate] = None - version: Optional[StrictStr] = None + backup_schedule: StrictStr = Field( + description="The schedule for when the database backup will be created. Currently, ONLY daily schedules are supported (every 24 hours). The schedule is written as a cron schedule.", + alias="backupSchedule", + ) + flavor_id: StrictStr = Field(description="The id of the instance flavor.", alias="flavorId") + labels: Optional[Dict[str, Optional[StrictStr]]] = Field( + default=None, + description="Key-value pairs, 63 characters max, begin and end with an alphanumerical character, may contain dashes (-), underscores (_), dots (.), and alphanumerics between. Key MUST be at least 1 character. Max 64 labels Regex for keys: ^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$ Regex for values: ^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$ The stackit- prefix is reserved and cannot be used for Keys. ", + ) + name: Annotated[str, Field(min_length=3, strict=True, max_length=63)] = Field( + description="The name of the instance." + ) + network: InstanceNetworkUpdate + retention_days: Optional[Annotated[int, Field(le=365, strict=True, ge=32)]] = Field( + description="How long backups are retained. The value can only be between 32 and 90 days.", + alias="retentionDays", + ) + storage: StorageUpdate + version: StrictStr = Field( + description="The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3#tag/Version) for supported version parameters." + ) __properties: ClassVar[List[str]] = [ - "acl", "backupSchedule", "flavorId", "labels", "name", - "options", - "replicas", + "network", + "retentionDays", "storage", "version", ] @@ -89,12 +100,17 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # 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 network + if self.network: + _dict["network"] = self.network.to_dict() # override the default output from pydantic by calling `to_dict()` of storage if self.storage: _dict["storage"] = self.storage.to_dict() + # set to None if retention_days (nullable) is None + # and model_fields_set contains the field + if self.retention_days is None and "retention_days" in self.model_fields_set: + _dict["retentionDays"] = None + return _dict @classmethod @@ -108,13 +124,12 @@ 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, "backupSchedule": obj.get("backupSchedule"), "flavorId": obj.get("flavorId"), "labels": obj.get("labels"), "name": obj.get("name"), - "options": obj.get("options"), - "replicas": obj.get("replicas"), + "network": InstanceNetworkUpdate.from_dict(obj["network"]) if obj.get("network") is not None else None, + "retentionDays": obj.get("retentionDays"), "storage": StorageUpdate.from_dict(obj["storage"]) if obj.get("storage") is not None else None, "version": obj.get("version"), } diff --git a/services/postgresflex/src/stackit/postgresflex/models/api_extension_delete_response.py b/services/postgresflex/src/stackit/postgresflex/models/update_instance_protection_payload.py similarity index 76% rename from services/postgresflex/src/stackit/postgresflex/models/api_extension_delete_response.py rename to services/postgresflex/src/stackit/postgresflex/models/update_instance_protection_payload.py index aaecb8b83..6fac471fc 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/api_extension_delete_response.py +++ b/services/postgresflex/src/stackit/postgresflex/models/update_instance_protection_payload.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -23,13 +23,13 @@ from typing_extensions import Self -class ApiExtensionDeleteResponse(BaseModel): +class UpdateInstanceProtectionPayload(BaseModel): """ - ApiExtensionDeleteResponse + UpdateInstanceProtectionPayload """ # noqa: E501 - is_succeded: Optional[StrictBool] = Field(default=None, alias="isSucceded") - __properties: ClassVar[List[str]] = ["isSucceded"] + is_deletable: StrictBool = Field(description="Protect instance from deletion.", alias="isDeletable") + __properties: ClassVar[List[str]] = ["isDeletable"] model_config = ConfigDict( validate_by_name=True, @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApiExtensionDeleteResponse from a JSON string""" + """Create an instance of UpdateInstanceProtectionPayload from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -72,12 +72,12 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApiExtensionDeleteResponse from a dict""" + """Create an instance of UpdateInstanceProtectionPayload from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"isSucceded": obj.get("isSucceded")}) + _obj = cls.model_validate({"isDeletable": obj.get("isDeletable")}) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/acl.py b/services/postgresflex/src/stackit/postgresflex/models/update_instance_protection_response.py similarity index 74% rename from services/postgresflex/src/stackit/postgresflex/models/acl.py rename to services/postgresflex/src/stackit/postgresflex/models/update_instance_protection_response.py index 775545308..b1a250fa5 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/acl.py +++ b/services/postgresflex/src/stackit/postgresflex/models/update_instance_protection_response.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,18 +18,18 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool from pydantic_core import to_jsonable_python from typing_extensions import Self -class ACL(BaseModel): +class UpdateInstanceProtectionResponse(BaseModel): """ - ACL + UpdateInstanceProtectionResponse """ # noqa: E501 - items: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = ["items"] + is_deletable: StrictBool = Field(description="Protect instance from deletion.", alias="isDeletable") + __properties: ClassVar[List[str]] = ["isDeletable"] model_config = ConfigDict( validate_by_name=True, @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ACL from a JSON string""" + """Create an instance of UpdateInstanceProtectionResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -72,12 +72,12 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ACL from a dict""" + """Create an instance of UpdateInstanceProtectionResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"items": obj.get("items")}) + _obj = cls.model_validate({"isDeletable": obj.get("isDeletable")}) return _obj 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 660abf505..5bed445e6 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/update_user_payload.py +++ b/services/postgresflex/src/stackit/postgresflex/models/update_user_payload.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,9 +18,9 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from pydantic_core import to_jsonable_python -from typing_extensions import Self +from typing_extensions import Annotated, Self class UpdateUserPayload(BaseModel): @@ -28,9 +28,11 @@ class UpdateUserPayload(BaseModel): UpdateUserPayload """ # noqa: E501 - database: Optional[StrictStr] = None - roles: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = ["database", "roles"] + name: Optional[StrictStr] = Field(default=None, description="The name of the user.") + roles: List[Annotated[str, Field(min_length=1, strict=True, max_length=63)]] = Field( + description="A list containing the user roles for the instance. Please refer to the List Roles endpoint for a list of all available Roles." + ) + __properties: ClassVar[List[str]] = ["name", "roles"] model_config = ConfigDict( validate_by_name=True, @@ -80,5 +82,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({"database": obj.get("database"), "roles": obj.get("roles")}) + _obj = cls.model_validate({"name": obj.get("name"), "roles": obj.get("roles")}) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/user.py b/services/postgresflex/src/stackit/postgresflex/models/user.py deleted file mode 100644 index 3691eae89..000000000 --- a/services/postgresflex/src/stackit/postgresflex/models/user.py +++ /dev/null @@ -1,101 +0,0 @@ -# coding: utf-8 - -""" - STACKIT PostgreSQL Flex API - - This is the documentation for the STACKIT postgres service - - The version of the OpenAPI document: 2.0.0 - Contact: support@stackit.cloud - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -from __future__ import annotations - -import json -import pprint -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr -from pydantic_core import to_jsonable_python -from typing_extensions import Self - - -class User(BaseModel): - """ - User - """ # noqa: E501 - - database: Optional[StrictStr] = None - host: Optional[StrictStr] = None - id: Optional[StrictStr] = None - password: Optional[StrictStr] = None - port: Optional[StrictInt] = None - roles: Optional[List[StrictStr]] = None - uri: Optional[StrictStr] = None - username: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["database", "host", "id", "password", "port", "roles", "uri", "username"] - - model_config = ConfigDict( - validate_by_name=True, - validate_by_alias=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - return json.dumps(to_jsonable_python(self.to_dict())) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of User from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of User from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "database": obj.get("database"), - "host": obj.get("host"), - "id": obj.get("id"), - "password": obj.get("password"), - "port": obj.get("port"), - "roles": obj.get("roles"), - "uri": obj.get("uri"), - "username": obj.get("username"), - } - ) - return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/user_sort.py b/services/postgresflex/src/stackit/postgresflex/models/user_sort.py new file mode 100644 index 000000000..5a8a91fae --- /dev/null +++ b/services/postgresflex/src/stackit/postgresflex/models/user_sort.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + STACKIT PostgreSQL Flex API + + This is the documentation for the STACKIT Postgres Flex service + + The version of the OpenAPI document: 3.0.0 + Contact: support@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +from enum import Enum + +from typing_extensions import Self + + +class UserSort(str, Enum): + """ + UserSort + """ + + """ + allowed enum values + """ + ID_DOT_ASC = "id.asc" + ID_DOT_DESC = "id.desc" + NAME_DOT_DESC = "name.desc" + NAME_DOT_ASC = "name.asc" + STATE_DOT_DESC = "state.desc" + STATE_DOT_ASC = "state.asc" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of UserSort from a JSON string""" + return cls(json.loads(json_str)) diff --git a/services/postgresflex/src/stackit/postgresflex/models/instance_host_metric.py b/services/postgresflex/src/stackit/postgresflex/models/validation_error.py similarity index 62% rename from services/postgresflex/src/stackit/postgresflex/models/instance_host_metric.py rename to services/postgresflex/src/stackit/postgresflex/models/validation_error.py index f58c7c8fe..5ad15e399 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/instance_host_metric.py +++ b/services/postgresflex/src/stackit/postgresflex/models/validation_error.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,22 +18,25 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt from pydantic_core import to_jsonable_python from typing_extensions import Self -from stackit.postgresflex.models.instance_data_point import InstanceDataPoint +from stackit.postgresflex.models.validation_error_validation_inner import ( + ValidationErrorValidationInner, +) -class InstanceHostMetric(BaseModel): +class ValidationError(BaseModel): """ - InstanceHostMetric + ValidationError """ # noqa: E501 - datapoints: Optional[List[InstanceDataPoint]] = None - name: Optional[StrictStr] = None - units: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["datapoints", "name", "units"] + code: StrictInt = Field(description="the http error should be always 422 for validationError") + validation: List[ValidationErrorValidationInner] = Field( + description="errors for all fields where the error happened" + ) + __properties: ClassVar[List[str]] = ["code", "validation"] model_config = ConfigDict( validate_by_name=True, @@ -52,7 +55,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceHostMetric from a JSON string""" + """Create an instance of ValidationError from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -72,18 +75,18 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in datapoints (list) + # override the default output from pydantic by calling `to_dict()` of each item in validation (list) _items = [] - if self.datapoints: - for _item_datapoints in self.datapoints: - if _item_datapoints: - _items.append(_item_datapoints.to_dict()) - _dict["datapoints"] = _items + if self.validation: + for _item_validation in self.validation: + if _item_validation: + _items.append(_item_validation.to_dict()) + _dict["validation"] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceHostMetric from a dict""" + """Create an instance of ValidationError from a dict""" if obj is None: return None @@ -92,13 +95,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "datapoints": ( - [InstanceDataPoint.from_dict(_item) for _item in obj["datapoints"]] - if obj.get("datapoints") is not None + "code": obj.get("code"), + "validation": ( + [ValidationErrorValidationInner.from_dict(_item) for _item in obj["validation"]] + if obj.get("validation") is not None else None ), - "name": obj.get("name"), - "units": obj.get("units"), } ) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/validation_error_validation_inner.py b/services/postgresflex/src/stackit/postgresflex/models/validation_error_validation_inner.py new file mode 100644 index 000000000..5f86a745d --- /dev/null +++ b/services/postgresflex/src/stackit/postgresflex/models/validation_error_validation_inner.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + STACKIT PostgreSQL Flex API + + This is the documentation for the STACKIT Postgres Flex service + + The version of the OpenAPI document: 3.0.0 + Contact: support@stackit.cloud + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic_core import to_jsonable_python +from typing_extensions import Self + + +class ValidationErrorValidationInner(BaseModel): + """ + ValidationErrorValidationInner + """ # noqa: E501 + + var_field: StrictStr = Field(alias="field") + message: StrictStr + __properties: ClassVar[List[str]] = ["field", "message"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ValidationErrorValidationInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ValidationErrorValidationInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"field": obj.get("field"), "message": obj.get("message")}) + return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/models/extensions_new_config.py b/services/postgresflex/src/stackit/postgresflex/models/version.py similarity index 62% rename from services/postgresflex/src/stackit/postgresflex/models/extensions_new_config.py rename to services/postgresflex/src/stackit/postgresflex/models/version.py index 61446afe3..be7a9f4c8 100644 --- a/services/postgresflex/src/stackit/postgresflex/models/extensions_new_config.py +++ b/services/postgresflex/src/stackit/postgresflex/models/version.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,20 +18,31 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictStr, +) from pydantic_core import to_jsonable_python from typing_extensions import Self -from stackit.postgresflex.models.extensions_configuration import ExtensionsConfiguration - -class ExtensionsNewConfig(BaseModel): +class Version(BaseModel): """ - ExtensionsNewConfig + The version of the postgres instance and more details. """ # noqa: E501 - configuration: Optional[List[ExtensionsConfiguration]] = None - __properties: ClassVar[List[str]] = ["configuration"] + beta: StrictBool = Field( + description="Flag if the version is a beta version. If set the version may contain bugs and is not fully tested." + ) + deprecated: StrictStr = Field( + description="Timestamp in RFC3339 format which says when the version will no longer be supported by STACKIT." + ) + recommend: StrictBool = Field(description="Flag if the version is recommend by the STACKIT Team.") + version: StrictStr = Field(description="The postgres version used for the instance.") + __properties: ClassVar[List[str]] = ["beta", "deprecated", "recommend", "version"] model_config = ConfigDict( validate_by_name=True, @@ -50,7 +61,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ExtensionsNewConfig from a JSON string""" + """Create an instance of Version from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -70,18 +81,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in configuration (list) - _items = [] - if self.configuration: - for _item_configuration in self.configuration: - if _item_configuration: - _items.append(_item_configuration.to_dict()) - _dict["configuration"] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ExtensionsNewConfig from a dict""" + """Create an instance of Version from a dict""" if obj is None: return None @@ -90,11 +94,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "configuration": ( - [ExtensionsConfiguration.from_dict(_item) for _item in obj["configuration"]] - if obj.get("configuration") is not None - else None - ) + "beta": obj.get("beta"), + "deprecated": obj.get("deprecated"), + "recommend": obj.get("recommend"), + "version": obj.get("version"), } ) return _obj diff --git a/services/postgresflex/src/stackit/postgresflex/rest.py b/services/postgresflex/src/stackit/postgresflex/rest.py index 4f1f4a4ad..a16fb5af7 100644 --- a/services/postgresflex/src/stackit/postgresflex/rest.py +++ b/services/postgresflex/src/stackit/postgresflex/rest.py @@ -3,9 +3,9 @@ """ STACKIT PostgreSQL Flex API - This is the documentation for the STACKIT postgres service + This is the documentation for the STACKIT Postgres Flex service - The version of the OpenAPI document: 2.0.0 + The version of the OpenAPI document: 3.0.0 Contact: support@stackit.cloud Generated by OpenAPI Generator (https://openapi-generator.tech)