diff --git a/services/postgresflex/api_default.go b/services/postgresflex/api_default.go index 7f02889f2..774f48d7e 100644 --- a/services/postgresflex/api_default.go +++ b/services/postgresflex/api_default.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -28,12 +28,12 @@ import ( type DefaultApi interface { /* CloneInstance Clone Instance - Clone an existing instance of a postgres database to a new destination instance + Clone Instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID + @param instanceId The ID of the instance. @return ApiCloneInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -43,9 +43,9 @@ type DefaultApi interface { CloneInstanceExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID + @param instanceId The ID of the instance. @return CloneInstanceResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -53,13 +53,12 @@ type DefaultApi interface { CloneInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) (*CloneInstanceResponse, error) /* CreateDatabase 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 ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID + @param instanceId The ID of the instance. @return ApiCreateDatabaseRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -69,20 +68,20 @@ type DefaultApi interface { CreateDatabaseExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @return InstanceCreateDatabaseResponse + @param instanceId The ID of the instance. + @return CreateDatabaseResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateDatabaseExecute(ctx context.Context, projectId string, region string, instanceId string) (*InstanceCreateDatabaseResponse, error) + CreateDatabaseExecute(ctx context.Context, projectId string, region string, instanceId string) (*CreateDatabaseResponse, error) /* CreateInstance Create Instance - Create a new instance of a postgres database + Create a new instance of a postgres database instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed @return ApiCreateInstanceRequest @@ -93,7 +92,7 @@ type DefaultApi interface { CreateInstanceExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed @return CreateInstanceResponse @@ -102,12 +101,12 @@ type DefaultApi interface { CreateInstanceExecute(ctx context.Context, projectId string, region string) (*CreateInstanceResponse, error) /* CreateUser Create User - Create user for an instance + Create user for an instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID + @param instanceId The ID of the instance. @return ApiCreateUserRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -117,9 +116,9 @@ type DefaultApi interface { CreateUserExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID + @param instanceId The ID of the instance. @return CreateUserResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -127,32 +126,32 @@ type DefaultApi interface { CreateUserExecute(ctx context.Context, projectId string, region string, instanceId string) (*CreateUserResponse, error) /* DeleteDatabase Delete Database - Delete database for an instance + Delete database for an instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @param databaseId Database ID + @param instanceId The ID of the instance. + @param databaseId The ID of the database. @return ApiDeleteDatabaseRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId string) ApiDeleteDatabaseRequest + DeleteDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) ApiDeleteDatabaseRequest /* DeleteDatabaseExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteDatabaseExecute(ctx context.Context, projectId string, region string, instanceId string, databaseId string) error + DeleteDatabaseExecute(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) error /* DeleteInstance Delete Instance - Delete available instance + Delete an available postgres instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID + @param instanceId The ID of the instance. @return ApiDeleteInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -166,78 +165,86 @@ type DefaultApi interface { DeleteInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) error /* DeleteUser Delete User - Delete user for an instance + Delete an user from a specific instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @param userId User ID + @param instanceId The ID of the instance. + @param userId The ID of the user. @return ApiDeleteUserRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiDeleteUserRequest + DeleteUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiDeleteUserRequest /* DeleteUserExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) error + DeleteUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId int64) error /* - ForceDeleteInstance Force delete instance - Forces the deletion of an delayed deleted instance + GetBackup Get specific backup + Get information about a specific backup for an instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @return ApiForceDeleteInstanceRequest + @param instanceId The ID of the instance. + @param backupId The ID of the backup. + @return ApiGetBackupRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ForceDeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiForceDeleteInstanceRequest + GetBackup(ctx context.Context, projectId string, region string, instanceId string, backupId int64) ApiGetBackupRequest /* - ForceDeleteInstanceExecute executes the request + GetBackupExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param backupId The ID of the backup. + @return BackupData // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ForceDeleteInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) error + GetBackupExecute(ctx context.Context, projectId string, region string, instanceId string, backupId int64) (*BackupData, error) /* - GetBackup Get specific backup - Get specific available backup + GetDatabase Get Specific Database + Get information about a specific database in an instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @param backupId Backup ID - @return ApiGetBackupRequest + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return ApiGetDatabaseRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetBackup(ctx context.Context, projectId string, region string, instanceId string, backupId string) ApiGetBackupRequest + GetDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) ApiGetDatabaseRequest /* - GetBackupExecute executes the request + GetDatabaseExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @param backupId Backup ID - @return GetBackupResponse + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return GetDatabaseResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetBackupExecute(ctx context.Context, projectId string, region string, instanceId string, backupId string) (*GetBackupResponse, error) + GetDatabaseExecute(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) (*GetDatabaseResponse, error) /* - GetInstance Get specific instance - Get specific available instances + GetInstance Get Specific Instance + Get information about a specific available instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID + @param instanceId The ID of the instance. @return ApiGetInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -247,49 +254,49 @@ type DefaultApi interface { GetInstanceExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @return InstanceResponse + @param instanceId The ID of the instance. + @return GetInstanceResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) (*InstanceResponse, error) + GetInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) (*GetInstanceResponse, error) /* GetUser Get User - Get specific available user for an instance + Get a specific available user for an instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @param userId User ID + @param instanceId The ID of the instance. + @param userId The ID of the user. @return ApiGetUserRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiGetUserRequest + GetUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiGetUserRequest /* GetUserExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @param userId User ID + @param instanceId The ID of the instance. + @param userId The ID of the user. @return GetUserResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) (*GetUserResponse, error) + GetUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId int64) (*GetUserResponse, error) /* ListBackups List backups - List all backups which are available for a specific instance + List all backups which are available for a specific instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID + @param instanceId The ID of the instance. @return ApiListBackupsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -299,47 +306,47 @@ type DefaultApi interface { ListBackupsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @return ListBackupsResponse + @param instanceId The ID of the instance. + @return ListBackupResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListBackupsExecute(ctx context.Context, projectId string, region string, instanceId string) (*ListBackupsResponse, error) + ListBackupsExecute(ctx context.Context, projectId string, region string, instanceId string) (*ListBackupResponse, error) /* - ListDatabaseParameters List Databases parameter - List available databases parameter + ListCollations Get Collations for an Instance + Get available collations for an instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @return ApiListDatabaseParametersRequest + @param instanceId The ID of the instance. + @return ApiListCollationsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListDatabaseParameters(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabaseParametersRequest + ListCollations(ctx context.Context, projectId string, region string, instanceId string) ApiListCollationsRequest /* - ListDatabaseParametersExecute executes the request + ListCollationsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @return PostgresDatabaseParameterResponse + @param instanceId The ID of the instance. + @return ListCollationsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListDatabaseParametersExecute(ctx context.Context, projectId string, region string, instanceId string) (*PostgresDatabaseParameterResponse, error) + ListCollationsExecute(ctx context.Context, projectId string, region string, instanceId string) (*ListCollationsResponse, error) /* ListDatabases List Databases - List available databases for an instance + List available databases for an instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID + @param instanceId The ID of the instance. @return ApiListDatabasesRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -349,20 +356,20 @@ type DefaultApi interface { ListDatabasesExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @return InstanceListDatabasesResponse + @param instanceId The ID of the instance. + @return ListDatabasesResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListDatabasesExecute(ctx context.Context, projectId string, region string, instanceId string) (*InstanceListDatabasesResponse, error) + ListDatabasesExecute(ctx context.Context, projectId string, region string, instanceId string) (*ListDatabasesResponse, error) /* ListFlavors Get Flavors - Get available flavors for a specific projectID + Get all available flavors for a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed @return ApiListFlavorsRequest @@ -373,7 +380,7 @@ type DefaultApi interface { ListFlavorsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed @return ListFlavorsResponse @@ -382,10 +389,10 @@ type DefaultApi interface { ListFlavorsExecute(ctx context.Context, projectId string, region string) (*ListFlavorsResponse, error) /* ListInstances List Instances - List available instances + List all available instances for your project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed @return ApiListInstancesRequest @@ -396,7 +403,7 @@ type DefaultApi interface { ListInstancesExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed @return ListInstancesResponse @@ -404,113 +411,106 @@ type DefaultApi interface { */ ListInstancesExecute(ctx context.Context, projectId string, region string) (*ListInstancesResponse, error) /* - ListMetrics Get Metric - 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. + ListRoles List Roles + List available roles for an instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The UUID of the project. + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId The UUID of the instance. - @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'max-connections', 'connections' and 'disk-use'. - @return ApiListMetricsRequest + @param instanceId The ID of the instance. + @return ApiListRolesRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListMetrics(ctx context.Context, projectId string, region string, instanceId string, metric string) ApiListMetricsRequest + ListRoles(ctx context.Context, projectId string, region string, instanceId string) ApiListRolesRequest /* - ListMetricsExecute executes the request + ListRolesExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The UUID of the project. + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId The UUID of the instance. - @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'max-connections', 'connections' and 'disk-use'. - @return InstanceMetricsResponse + @param instanceId The ID of the instance. + @return ListRolesResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListMetricsExecute(ctx context.Context, projectId string, region string, instanceId string, metric string) (*InstanceMetricsResponse, error) + ListRolesExecute(ctx context.Context, projectId string, region string, instanceId string) (*ListRolesResponse, error) /* - ListStorages Get Storages - Get available storages for a specific flavor + ListUsers List Users + List available users for an instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param flavorId Flavor ID - @return ApiListStoragesRequest + @param instanceId The ID of the instance. + @return ApiListUsersRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListStorages(ctx context.Context, projectId string, region string, flavorId string) ApiListStoragesRequest + ListUsers(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequest /* - ListStoragesExecute executes the request + ListUsersExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param flavorId Flavor ID - @return ListStoragesResponse + @param instanceId The ID of the instance. + @return ListUserResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListStoragesExecute(ctx context.Context, projectId string, region string, flavorId string) (*ListStoragesResponse, error) + ListUsersExecute(ctx context.Context, projectId string, region string, instanceId string) (*ListUserResponse, error) /* - ListUsers List Users - List available users for an instance + ListVersions Get Versions + Get available postgres versions for the project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @return ApiListUsersRequest + @return ApiListVersionsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListUsers(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequest + ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest /* - ListUsersExecute executes the request + ListVersionsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @return ListUsersResponse + @return ListVersionResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListUsersExecute(ctx context.Context, projectId string, region string, instanceId string) (*ListUsersResponse, error) + ListVersionsExecute(ctx context.Context, projectId string, region string) (*ListVersionResponse, error) /* - ListVersions Get Versions - Get available versions for postgres database + PartialUpdateDatabase Update Database partially + Update a database partially in an instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @return ApiListVersionsRequest + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return ApiPartialUpdateDatabaseRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest + PartialUpdateDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) ApiPartialUpdateDatabaseRequest /* - ListVersionsExecute executes the request - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param region The region which should be addressed - @return ListVersionsResponse + PartialUpdateDatabaseExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListVersionsExecute(ctx context.Context, projectId string, region string) (*ListVersionsResponse, error) + PartialUpdateDatabaseExecute(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) error /* - PartialUpdateInstance Update Instance - Update available instance of a postgres database. Supported Versions are 12, 13, 14, 15 -- only upgrades are allowed! + PartialUpdateInstance Update Instance Partially + Update an available instance of a postgres database. No fields are required. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID + @param instanceId The ID of the instance. @return ApiPartialUpdateInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -519,89 +519,84 @@ type DefaultApi interface { /* PartialUpdateInstanceExecute executes the request - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param region The region which should be addressed - @param instanceId Instance ID - @return PartialUpdateInstanceResponse - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - PartialUpdateInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) (*PartialUpdateInstanceResponse, error) + PartialUpdateInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) error /* - PartialUpdateUser Update User - Update user for an instance. Only the roles are updatable. + PartialUpdateUser Update User Partially + Update an user partially for an instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The ID of the project + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId The ID of the instance - @param userId The ID of the user in the database + @param instanceId The ID of the instance. + @param userId The ID of the user. @return ApiPartialUpdateUserRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - PartialUpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiPartialUpdateUserRequest + PartialUpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiPartialUpdateUserRequest /* PartialUpdateUserExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - PartialUpdateUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) error + PartialUpdateUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId int64) error /* - ResetUser Reset User - Reset user password for a postgres instance + ResetUserPassword Reset User + Reset an user from an specific instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @param userId user ID - @return ApiResetUserRequest + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiResetUserPasswordRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ResetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiResetUserRequest + ResetUserPassword(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiResetUserPasswordRequest /* - ResetUserExecute executes the request + ResetUserPasswordExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @param userId user ID - @return ResetUserResponse + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ResetUserPasswordResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ResetUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) (*ResetUserResponse, error) + ResetUserPasswordExecute(ctx context.Context, projectId string, region string, instanceId string, userId int64) (*ResetUserPasswordResponse, error) /* - UpdateBackupSchedule Update Backup Schedule - Update backup schedule + UpdateDatabase Update Database + Update a database in an instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @return ApiUpdateBackupScheduleRequest + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return ApiUpdateDatabaseRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - UpdateBackupSchedule(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateBackupScheduleRequest + UpdateDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) ApiUpdateDatabaseRequest /* - UpdateBackupScheduleExecute executes the request + UpdateDatabaseExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - UpdateBackupScheduleExecute(ctx context.Context, projectId string, region string, instanceId string) error + UpdateDatabaseExecute(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) error /* UpdateInstance 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 ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID + @param instanceId The ID of the instance. @return ApiUpdateInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -610,40 +605,59 @@ type DefaultApi interface { /* UpdateInstanceExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + UpdateInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) error + /* + UpdateInstanceProtection Toggle Instance Protection + Toggle the deletion protection for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiUpdateInstanceProtectionRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + UpdateInstanceProtection(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceProtectionRequest + /* + UpdateInstanceProtectionExecute executes the request + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @return PartialUpdateInstanceResponse + @param instanceId The ID of the instance. + @return UpdateInstanceProtectionResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - UpdateInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) (*PartialUpdateInstanceResponse, error) + UpdateInstanceProtectionExecute(ctx context.Context, projectId string, region string, instanceId string) (*UpdateInstanceProtectionResponse, error) /* UpdateUser Update User - Update user for an instance. Only the roles are updatable. + Update user for an instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The ID of the project + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId The ID of the instance - @param userId The ID of the user in the database + @param instanceId The ID of the instance. + @param userId The ID of the user. @return ApiUpdateUserRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - UpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiUpdateUserRequest + UpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiUpdateUserRequest /* UpdateUserExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - UpdateUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) error + UpdateUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId int64) error } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCloneInstanceRequest interface { - // Body + // The request body with the parameters for cloning an instance by a point in time into a new instance. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CloneInstancePayload(cloneInstancePayload CloneInstancePayload) ApiCloneInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -652,16 +666,16 @@ type ApiCloneInstanceRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateDatabaseRequest interface { - // body + // The request body containing the information for the new database. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateDatabasePayload(createDatabasePayload CreateDatabasePayload) ApiCreateDatabaseRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*InstanceCreateDatabaseResponse, error) + Execute() (*CreateDatabaseResponse, error) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateInstanceRequest interface { - // Body + // The request body with the parameters for the instance creation. Every parameter is required. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateInstancePayload(createInstancePayload CreateInstancePayload) ApiCreateInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -670,7 +684,7 @@ type ApiCreateInstanceRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateUserRequest interface { - // body + // The request body containing the user details. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateUserPayload(createUserPayload CreateUserPayload) ApiCreateUserRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -696,21 +710,21 @@ type ApiDeleteUserRequest interface { } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiForceDeleteInstanceRequest interface { +type ApiGetBackupRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() error + Execute() (*BackupData, error) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiGetBackupRequest interface { +type ApiGetDatabaseRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*GetBackupResponse, error) + Execute() (*GetDatabaseResponse, error) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetInstanceRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*InstanceResponse, error) + Execute() (*GetInstanceResponse, error) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -721,85 +735,118 @@ type ApiGetUserRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListBackupsRequest interface { + // Number of the page of items list to be returned. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Page(page int64) ApiListBackupsRequest + // Number of items to be returned on each page. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Size(size int64) ApiListBackupsRequest + // Sorting of the backups to be returned on each page. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Sort(sort BackupSort) ApiListBackupsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*ListBackupsResponse, error) + Execute() (*ListBackupResponse, error) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiListDatabaseParametersRequest interface { +type ApiListCollationsRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*PostgresDatabaseParameterResponse, error) + Execute() (*ListCollationsResponse, error) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListDatabasesRequest interface { + // Number of the page of items list to be returned. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*InstanceListDatabasesResponse, error) + Page(page int64) ApiListDatabasesRequest + // Number of items to be returned on each page. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Size(size int64) ApiListDatabasesRequest + // Sorting of the databases to be returned on each page. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Sort(sort DatabaseSort) ApiListDatabasesRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Execute() (*ListDatabasesResponse, error) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListFlavorsRequest interface { + // Number of the page of items list to be returned. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Page(page int64) ApiListFlavorsRequest + // Number of items to be returned on each page. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Size(size int64) ApiListFlavorsRequest + // Sorting of the flavors to be returned on each page. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Sort(sort FlavorSort) ApiListFlavorsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ListFlavorsResponse, error) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListInstancesRequest interface { + // Number of the page of items list to be returned. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*ListInstancesResponse, error) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiListMetricsRequest interface { - // The granularity in ISO8601 e.g. 5 minutes are 'PT5M'. - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Granularity(granularity string) ApiListMetricsRequest - // The period in ISO8601 format e.g. 5 minutes are 'PT5M'. If no period is provided, the standard value of 5 minutes is used. - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Period(period string) ApiListMetricsRequest - // 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. + Page(page int64) ApiListInstancesRequest + // Number of items to be returned on each page. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Start(start string) ApiListMetricsRequest - // The end of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. + Size(size int64) ApiListInstancesRequest + // Sorting of the items to be returned on each page. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - End(end string) ApiListMetricsRequest + Sort(sort InstanceSort) ApiListInstancesRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*InstanceMetricsResponse, error) + Execute() (*ListInstancesResponse, error) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiListStoragesRequest interface { +type ApiListRolesRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*ListStoragesResponse, error) + Execute() (*ListRolesResponse, error) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListUsersRequest interface { + // Number of the page of items list to be returned. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Page(page int64) ApiListUsersRequest + // Number of items to be returned on each page. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Size(size int64) ApiListUsersRequest + // Sorting of the users to be returned on each page. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Sort(sort UserSort) ApiListUsersRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*ListUsersResponse, error) + Execute() (*ListUserResponse, error) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListVersionsRequest interface { - // Instance ID // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - InstanceId(instanceId string) ApiListVersionsRequest + Execute() (*ListVersionResponse, error) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ApiPartialUpdateDatabaseRequest interface { + // The request body containing the information for the database update. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + PartialUpdateDatabasePayload(partialUpdateDatabasePayload PartialUpdateDatabasePayload) ApiPartialUpdateDatabaseRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*ListVersionsResponse, error) + Execute() error } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiPartialUpdateInstanceRequest interface { - // Body + // The request body with the parameters for updating the instance. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead PartialUpdateInstancePayload(partialUpdateInstancePayload PartialUpdateInstancePayload) ApiPartialUpdateInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*PartialUpdateInstanceResponse, error) + Execute() error } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiPartialUpdateUserRequest interface { - // 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 + // 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. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead PartialUpdateUserPayload(partialUpdateUserPayload PartialUpdateUserPayload) ApiPartialUpdateUserRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -807,32 +854,41 @@ type ApiPartialUpdateUserRequest interface { } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiResetUserRequest interface { +type ApiResetUserPasswordRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*ResetUserResponse, error) + Execute() (*ResetUserPasswordResponse, error) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiUpdateBackupScheduleRequest interface { - // Body +type ApiUpdateDatabaseRequest interface { + // The request body containing the information for the database update. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - UpdateBackupSchedulePayload(updateBackupSchedulePayload UpdateBackupSchedulePayload) ApiUpdateBackupScheduleRequest + UpdateDatabasePayload(updateDatabasePayload UpdateDatabasePayload) ApiUpdateDatabaseRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiUpdateInstanceRequest interface { - // Body + // The request body with the parameters for updating the instance // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead UpdateInstancePayload(updateInstancePayload UpdateInstancePayload) ApiUpdateInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*PartialUpdateInstanceResponse, error) + Execute() error +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ApiUpdateInstanceProtectionRequest interface { + // The request body with flag isDeletable. Parameter is required. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + UpdateInstanceProtectionPayload(updateInstanceProtectionPayload UpdateInstanceProtectionPayload) ApiUpdateInstanceProtectionRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Execute() (*UpdateInstanceProtectionResponse, error) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiUpdateUserRequest interface { - // 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 + // The Request body containing the updated infos for the user. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead UpdateUserPayload(updateUserPayload UpdateUserPayload) ApiUpdateUserRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -853,7 +909,7 @@ type CloneInstanceRequest struct { cloneInstancePayload *CloneInstancePayload } -// Body +// The request body with the parameters for cloning an instance by a point in time into a new instance. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CloneInstanceRequest) CloneInstancePayload(cloneInstancePayload CloneInstancePayload) ApiCloneInstanceRequest { r.cloneInstancePayload = &cloneInstancePayload @@ -878,7 +934,7 @@ func (r CloneInstanceRequest) Execute() (*CloneInstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/clone" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/clone" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) @@ -886,9 +942,6 @@ func (r CloneInstanceRequest) Execute() (*CloneInstanceResponse, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.cloneInstancePayload == nil { - return localVarReturnValue, fmt.Errorf("cloneInstancePayload is required and must be specified") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -963,6 +1016,82 @@ func (r CloneInstanceRequest) Execute() (*CloneInstanceResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } return localVarReturnValue, newErr } @@ -985,9 +1114,9 @@ CloneInstance: Clone Instance Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID + @param instanceId The ID of the instance. @return ApiCloneInstanceRequest */ func (a *APIClient) CloneInstance(ctx context.Context, projectId string, region string, instanceId string) ApiCloneInstanceRequest { @@ -1022,7 +1151,7 @@ type CreateDatabaseRequest struct { createDatabasePayload *CreateDatabasePayload } -// body +// The request body containing the information for the new database. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateDatabaseRequest) CreateDatabasePayload(createDatabasePayload CreateDatabasePayload) ApiCreateDatabaseRequest { r.createDatabasePayload = &createDatabasePayload @@ -1030,12 +1159,12 @@ func (r CreateDatabaseRequest) CreateDatabasePayload(createDatabasePayload Creat } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r CreateDatabaseRequest) Execute() (*InstanceCreateDatabaseResponse, error) { +func (r CreateDatabaseRequest) Execute() (*CreateDatabaseResponse, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *InstanceCreateDatabaseResponse + localVarReturnValue *CreateDatabaseResponse ) a := r.apiService client, ok := a.client.(*APIClient) @@ -1047,7 +1176,7 @@ func (r CreateDatabaseRequest) Execute() (*InstanceCreateDatabaseResponse, error return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/databases" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) @@ -1132,6 +1261,82 @@ func (r CreateDatabaseRequest) Execute() (*InstanceCreateDatabaseResponse, error newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } return localVarReturnValue, newErr } @@ -1154,9 +1359,9 @@ CreateDatabase: Create Database Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID + @param instanceId The ID of the instance. @return ApiCreateDatabaseRequest */ func (a *APIClient) CreateDatabase(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequest { @@ -1170,7 +1375,7 @@ func (a *APIClient) CreateDatabase(ctx context.Context, projectId string, region } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) CreateDatabaseExecute(ctx context.Context, projectId string, region string, instanceId string) (*InstanceCreateDatabaseResponse, error) { +func (a *APIClient) CreateDatabaseExecute(ctx context.Context, projectId string, region string, instanceId string) (*CreateDatabaseResponse, error) { r := CreateDatabaseRequest{ apiService: a.defaultApi, ctx: ctx, @@ -1190,7 +1395,7 @@ type CreateInstanceRequest struct { createInstancePayload *CreateInstancePayload } -// Body +// The request body with the parameters for the instance creation. Every parameter is required. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateInstanceRequest) CreateInstancePayload(createInstancePayload CreateInstancePayload) ApiCreateInstanceRequest { r.createInstancePayload = &createInstancePayload @@ -1215,7 +1420,7 @@ func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) @@ -1299,38 +1504,92 @@ func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { newErr.Model = v return localVarReturnValue, newErr } - return localVarReturnValue, newErr - } - - err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -/* -CreateInstance: Create Instance - -Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param region The region which should be addressed - @return ApiCreateInstanceRequest -*/ -func (a *APIClient) CreateInstance(ctx context.Context, projectId string, region string) ApiCreateInstanceRequest { - return CreateInstanceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - region: region, + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateInstance: Create Instance + +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @return ApiCreateInstanceRequest +*/ +func (a *APIClient) CreateInstance(ctx context.Context, projectId string, region string) ApiCreateInstanceRequest { + return CreateInstanceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, } } @@ -1355,7 +1614,7 @@ type CreateUserRequest struct { createUserPayload *CreateUserPayload } -// body +// The request body containing the user details. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateUserRequest) CreateUserPayload(createUserPayload CreateUserPayload) ApiCreateUserRequest { r.createUserPayload = &createUserPayload @@ -1380,7 +1639,7 @@ func (r CreateUserRequest) Execute() (*CreateUserResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) @@ -1465,6 +1724,82 @@ func (r CreateUserRequest) Execute() (*CreateUserResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } return localVarReturnValue, newErr } @@ -1487,9 +1822,9 @@ CreateUser: Create User Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID + @param instanceId The ID of the instance. @return ApiCreateUserRequest */ func (a *APIClient) CreateUser(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequest { @@ -1521,7 +1856,7 @@ type DeleteDatabaseRequest struct { projectId string region string instanceId string - databaseId string + databaseId int64 } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1541,7 +1876,7 @@ func (r DeleteDatabaseRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) @@ -1622,6 +1957,60 @@ func (r DeleteDatabaseRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } return newErr } @@ -1634,13 +2023,13 @@ DeleteDatabase: Delete Database Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @param databaseId Database ID + @param instanceId The ID of the instance. + @param databaseId The ID of the database. @return ApiDeleteDatabaseRequest */ -func (a *APIClient) DeleteDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId string) ApiDeleteDatabaseRequest { +func (a *APIClient) DeleteDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) ApiDeleteDatabaseRequest { return DeleteDatabaseRequest{ apiService: a.defaultApi, ctx: ctx, @@ -1652,7 +2041,7 @@ func (a *APIClient) DeleteDatabase(ctx context.Context, projectId string, region } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DeleteDatabaseExecute(ctx context.Context, projectId string, region string, instanceId string, databaseId string) error { +func (a *APIClient) DeleteDatabaseExecute(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) error { r := DeleteDatabaseRequest{ apiService: a.defaultApi, ctx: ctx, @@ -1690,7 +2079,7 @@ func (r DeleteInstanceRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) @@ -1770,6 +2159,17 @@ func (r DeleteInstanceRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1781,6 +2181,17 @@ func (r DeleteInstanceRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 412 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1790,6 +2201,17 @@ func (r DeleteInstanceRequest) Execute() error { } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return newErr } @@ -1803,9 +2225,9 @@ DeleteInstance: Delete Instance Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID + @param instanceId The ID of the instance. @return ApiDeleteInstanceRequest */ func (a *APIClient) DeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequest { @@ -1837,7 +2259,7 @@ type DeleteUserRequest struct { projectId string region string instanceId string - userId string + userId int64 } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1857,7 +2279,7 @@ func (r DeleteUserRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) @@ -1938,133 +2360,18 @@ func (r DeleteUserRequest) Execute() error { newErr.Model = v return newErr } - return newErr - } - - return nil -} - -/* -DeleteUser: Delete User - -Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param region The region which should be addressed - @param instanceId Instance ID - @param userId User ID - @return ApiDeleteUserRequest -*/ -func (a *APIClient) DeleteUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiDeleteUserRequest { - return DeleteUserRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - region: region, - instanceId: instanceId, - userId: userId, - } -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DeleteUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) error { - r := DeleteUserRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - region: region, - instanceId: instanceId, - userId: userId, - } - return r.Execute() -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ForceDeleteInstanceRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - region string - instanceId string -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r ForceDeleteInstanceRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - a := r.apiService - client, ok := a.client.(*APIClient) - if !ok { - return fmt.Errorf("could not parse client to type APIClient") - } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ForceDeleteInstance") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/force" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr } - if localVarHTTPResponse.StatusCode == 400 { + if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -2075,7 +2382,7 @@ func (r ForceDeleteInstanceRequest) Execute() error { newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 401 { + if localVarHTTPResponse.StatusCode == 409 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -2086,7 +2393,7 @@ func (r ForceDeleteInstanceRequest) Execute() error { newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 406 { + if localVarHTTPResponse.StatusCode == 423 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -2106,6 +2413,17 @@ func (r ForceDeleteInstanceRequest) Execute() error { } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return newErr } @@ -2114,34 +2432,37 @@ func (r ForceDeleteInstanceRequest) Execute() error { } /* -ForceDeleteInstance: Force delete instance +DeleteUser: Delete User Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @return ApiForceDeleteInstanceRequest + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiDeleteUserRequest */ -func (a *APIClient) ForceDeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiForceDeleteInstanceRequest { - return ForceDeleteInstanceRequest{ +func (a *APIClient) DeleteUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiDeleteUserRequest { + return DeleteUserRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, region: region, instanceId: instanceId, + userId: userId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ForceDeleteInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) error { - r := ForceDeleteInstanceRequest{ +func (a *APIClient) DeleteUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId int64) error { + r := DeleteUserRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, region: region, instanceId: instanceId, + userId: userId, } return r.Execute() } @@ -2153,16 +2474,16 @@ type GetBackupRequest struct { projectId string region string instanceId string - backupId string + backupId int64 } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r GetBackupRequest) Execute() (*GetBackupResponse, error) { +func (r GetBackupRequest) Execute() (*BackupData, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetBackupResponse + localVarReturnValue *BackupData ) a := r.apiService client, ok := a.client.(*APIClient) @@ -2174,7 +2495,7 @@ func (r GetBackupRequest) Execute() (*GetBackupResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/{backupId}" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/{backupId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) @@ -2255,6 +2576,60 @@ func (r GetBackupRequest) Execute() (*GetBackupResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } return localVarReturnValue, newErr } @@ -2277,13 +2652,13 @@ GetBackup: Get specific backup Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @param backupId Backup ID + @param instanceId The ID of the instance. + @param backupId The ID of the backup. @return ApiGetBackupRequest */ -func (a *APIClient) GetBackup(ctx context.Context, projectId string, region string, instanceId string, backupId string) ApiGetBackupRequest { +func (a *APIClient) GetBackup(ctx context.Context, projectId string, region string, instanceId string, backupId int64) ApiGetBackupRequest { return GetBackupRequest{ apiService: a.defaultApi, ctx: ctx, @@ -2295,7 +2670,7 @@ func (a *APIClient) GetBackup(ctx context.Context, projectId string, region stri } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetBackupExecute(ctx context.Context, projectId string, region string, instanceId string, backupId string) (*GetBackupResponse, error) { +func (a *APIClient) GetBackupExecute(ctx context.Context, projectId string, region string, instanceId string, backupId int64) (*BackupData, error) { r := GetBackupRequest{ apiService: a.defaultApi, ctx: ctx, @@ -2308,36 +2683,38 @@ func (a *APIClient) GetBackupExecute(ctx context.Context, projectId string, regi } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type GetInstanceRequest struct { +type GetDatabaseRequest struct { ctx context.Context apiService *DefaultApiService projectId string region string instanceId string + databaseId int64 } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r GetInstanceRequest) Execute() (*InstanceResponse, error) { +func (r GetDatabaseRequest) Execute() (*GetDatabaseResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *InstanceResponse + localVarReturnValue *GetDatabaseResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstance") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetDatabase") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"databaseId"+"}", url.PathEscape(ParameterValueToString(r.databaseId, "databaseId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2414,6 +2791,49 @@ func (r GetInstanceRequest) Execute() (*InstanceResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } return localVarReturnValue, newErr } @@ -2431,71 +2851,72 @@ func (r GetInstanceRequest) Execute() (*InstanceResponse, error) { } /* -GetInstance: Get specific instance +GetDatabase: Get Specific Database Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @return ApiGetInstanceRequest + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return ApiGetDatabaseRequest */ -func (a *APIClient) GetInstance(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequest { - return GetInstanceRequest{ +func (a *APIClient) GetDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) ApiGetDatabaseRequest { + return GetDatabaseRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, region: region, instanceId: instanceId, + databaseId: databaseId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) (*InstanceResponse, error) { - r := GetInstanceRequest{ +func (a *APIClient) GetDatabaseExecute(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) (*GetDatabaseResponse, error) { + r := GetDatabaseRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, region: region, instanceId: instanceId, + databaseId: databaseId, } return r.Execute() } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type GetUserRequest struct { +type GetInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string region string instanceId string - userId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r GetUserRequest) Execute() (*GetUserResponse, error) { +func (r GetInstanceRequest) Execute() (*GetInstanceResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetUserResponse + localVarReturnValue *GetInstanceResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetUser") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstance") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(r.userId, "userId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2572,89 +2993,131 @@ func (r GetUserRequest) Execute() (*GetUserResponse, error) { newErr.Model = v return localVarReturnValue, newErr } - return localVarReturnValue, newErr - } - - err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -/* -GetUser: Get User - -Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param region The region which should be addressed - @param instanceId Instance ID - @param userId User ID - @return ApiGetUserRequest -*/ -func (a *APIClient) GetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiGetUserRequest { - return GetUserRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetInstance: Get Specific Instance + +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiGetInstanceRequest +*/ +func (a *APIClient) GetInstance(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequest { + return GetInstanceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, region: region, instanceId: instanceId, - userId: userId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) (*GetUserResponse, error) { - r := GetUserRequest{ +func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) (*GetInstanceResponse, error) { + r := GetInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, region: region, instanceId: instanceId, - userId: userId, } return r.Execute() } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListBackupsRequest struct { +type GetUserRequest struct { ctx context.Context apiService *DefaultApiService projectId string region string instanceId string + userId int64 } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r ListBackupsRequest) Execute() (*ListBackupsResponse, error) { +func (r GetUserRequest) Execute() (*GetUserResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListBackupsResponse + localVarReturnValue *GetUserResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListBackups") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetUser") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(r.userId, "userId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2731,6 +3194,49 @@ func (r ListBackupsRequest) Execute() (*ListBackupsResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } return localVarReturnValue, newErr } @@ -2748,66 +3254,93 @@ func (r ListBackupsRequest) Execute() (*ListBackupsResponse, error) { } /* -ListBackups: List backups +GetUser: Get User Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @return ApiListBackupsRequest + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiGetUserRequest */ -func (a *APIClient) ListBackups(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequest { - return ListBackupsRequest{ +func (a *APIClient) GetUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiGetUserRequest { + return GetUserRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, region: region, instanceId: instanceId, + userId: userId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListBackupsExecute(ctx context.Context, projectId string, region string, instanceId string) (*ListBackupsResponse, error) { - r := ListBackupsRequest{ +func (a *APIClient) GetUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId int64) (*GetUserResponse, error) { + r := GetUserRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, region: region, instanceId: instanceId, + userId: userId, } return r.Execute() } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListDatabaseParametersRequest struct { +type ListBackupsRequest struct { ctx context.Context apiService *DefaultApiService projectId string region string instanceId string + page *int64 + size *int64 + sort *BackupSort +} + +// Number of the page of items list to be returned. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r ListBackupsRequest) Page(page int64) ApiListBackupsRequest { + r.page = &page + return r } +// Number of items to be returned on each page. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r ListDatabaseParametersRequest) Execute() (*PostgresDatabaseParameterResponse, error) { +func (r ListBackupsRequest) Size(size int64) ApiListBackupsRequest { + r.size = &size + return r +} + +// Sorting of the backups to be returned on each page. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r ListBackupsRequest) Sort(sort BackupSort) ApiListBackupsRequest { + r.sort = &sort + return r +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r ListBackupsRequest) Execute() (*ListBackupResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *PostgresDatabaseParameterResponse + localVarReturnValue *ListBackupResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListDatabaseParameters") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListBackups") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/parameter" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/backups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) @@ -2816,6 +3349,15 @@ func (r ListDatabaseParametersRequest) Execute() (*PostgresDatabaseParameterResp localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "") + } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2887,6 +3429,60 @@ func (r ListDatabaseParametersRequest) Execute() (*PostgresDatabaseParameterResp newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } return localVarReturnValue, newErr } @@ -2904,18 +3500,18 @@ func (r ListDatabaseParametersRequest) Execute() (*PostgresDatabaseParameterResp } /* -ListDatabaseParameters: List Databases parameter +ListBackups: List backups Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @return ApiListDatabaseParametersRequest + @param instanceId The ID of the instance. + @return ApiListBackupsRequest */ -func (a *APIClient) ListDatabaseParameters(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabaseParametersRequest { - return ListDatabaseParametersRequest{ +func (a *APIClient) ListBackups(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequest { + return ListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -2925,8 +3521,8 @@ func (a *APIClient) ListDatabaseParameters(ctx context.Context, projectId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListDatabaseParametersExecute(ctx context.Context, projectId string, region string, instanceId string) (*PostgresDatabaseParameterResponse, error) { - r := ListDatabaseParametersRequest{ +func (a *APIClient) ListBackupsExecute(ctx context.Context, projectId string, region string, instanceId string) (*ListBackupResponse, error) { + r := ListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -2937,7 +3533,7 @@ func (a *APIClient) ListDatabaseParametersExecute(ctx context.Context, projectId } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListDatabasesRequest struct { +type ListCollationsRequest struct { ctx context.Context apiService *DefaultApiService projectId string @@ -2946,24 +3542,24 @@ type ListDatabasesRequest struct { } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r ListDatabasesRequest) Execute() (*InstanceListDatabasesResponse, error) { +func (r ListCollationsRequest) Execute() (*ListCollationsResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *InstanceListDatabasesResponse + localVarReturnValue *ListCollationsResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListDatabases") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListCollations") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/collations" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) @@ -3043,6 +3639,60 @@ func (r ListDatabasesRequest) Execute() (*InstanceListDatabasesResponse, error) newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } return localVarReturnValue, newErr } @@ -3060,18 +3710,18 @@ func (r ListDatabasesRequest) Execute() (*InstanceListDatabasesResponse, error) } /* -ListDatabases: List Databases +ListCollations: Get Collations for an Instance Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @return ApiListDatabasesRequest + @param instanceId The ID of the instance. + @return ApiListCollationsRequest */ -func (a *APIClient) ListDatabases(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequest { - return ListDatabasesRequest{ +func (a *APIClient) ListCollations(ctx context.Context, projectId string, region string, instanceId string) ApiListCollationsRequest { + return ListCollationsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -3081,8 +3731,8 @@ func (a *APIClient) ListDatabases(ctx context.Context, projectId string, region } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListDatabasesExecute(ctx context.Context, projectId string, region string, instanceId string) (*InstanceListDatabasesResponse, error) { - r := ListDatabasesRequest{ +func (a *APIClient) ListCollationsExecute(ctx context.Context, projectId string, region string, instanceId string) (*ListCollationsResponse, error) { + r := ListCollationsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -3093,39 +3743,74 @@ func (a *APIClient) ListDatabasesExecute(ctx context.Context, projectId string, } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListFlavorsRequest struct { +type ListDatabasesRequest struct { ctx context.Context apiService *DefaultApiService projectId string region string + instanceId string + page *int64 + size *int64 + sort *DatabaseSort } +// Number of the page of items list to be returned. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r ListFlavorsRequest) Execute() (*ListFlavorsResponse, error) { +func (r ListDatabasesRequest) Page(page int64) ApiListDatabasesRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r ListDatabasesRequest) Size(size int64) ApiListDatabasesRequest { + r.size = &size + return r +} + +// Sorting of the databases to be returned on each page. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r ListDatabasesRequest) Sort(sort DatabaseSort) ApiListDatabasesRequest { + r.sort = &sort + return r +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r ListDatabasesRequest) Execute() (*ListDatabasesResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListFlavorsResponse + localVarReturnValue *ListDatabasesResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListFlavors") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListDatabases") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/flavors" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/databases" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "") + } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -3197,6 +3882,49 @@ func (r ListFlavorsRequest) Execute() (*ListFlavorsResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } return localVarReturnValue, newErr } @@ -3214,62 +3942,89 @@ func (r ListFlavorsRequest) Execute() (*ListFlavorsResponse, error) { } /* -ListFlavors: Get Flavors +ListDatabases: List Databases Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @return ApiListFlavorsRequest + @param instanceId The ID of the instance. + @return ApiListDatabasesRequest */ -func (a *APIClient) ListFlavors(ctx context.Context, projectId string, region string) ApiListFlavorsRequest { - return ListFlavorsRequest{ +func (a *APIClient) ListDatabases(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequest { + return ListDatabasesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, region: region, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListFlavorsExecute(ctx context.Context, projectId string, region string) (*ListFlavorsResponse, error) { - r := ListFlavorsRequest{ +func (a *APIClient) ListDatabasesExecute(ctx context.Context, projectId string, region string, instanceId string) (*ListDatabasesResponse, error) { + r := ListDatabasesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, region: region, + instanceId: instanceId, } return r.Execute() } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListInstancesRequest struct { +type ListFlavorsRequest struct { ctx context.Context apiService *DefaultApiService projectId string region string + page *int64 + size *int64 + sort *FlavorSort } +// Number of the page of items list to be returned. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { +func (r ListFlavorsRequest) Page(page int64) ApiListFlavorsRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r ListFlavorsRequest) Size(size int64) ApiListFlavorsRequest { + r.size = &size + return r +} + +// Sorting of the flavors to be returned on each page. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r ListFlavorsRequest) Sort(sort FlavorSort) ApiListFlavorsRequest { + r.sort = &sort + return r +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r ListFlavorsRequest) Execute() (*ListFlavorsResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListInstancesResponse + localVarReturnValue *ListFlavorsResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListInstances") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListFlavors") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/flavors" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) @@ -3277,6 +4032,15 @@ func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "") + } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -3348,6 +4112,60 @@ func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } return localVarReturnValue, newErr } @@ -3365,17 +4183,17 @@ func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { } /* -ListInstances: List Instances +ListFlavors: Get Flavors Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @return ApiListInstancesRequest + @return ApiListFlavorsRequest */ -func (a *APIClient) ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest { - return ListInstancesRequest{ +func (a *APIClient) ListFlavors(ctx context.Context, projectId string, region string) ApiListFlavorsRequest { + return ListFlavorsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -3384,8 +4202,8 @@ func (a *APIClient) ListInstances(ctx context.Context, projectId string, region } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string, region string) (*ListInstancesResponse, error) { - r := ListInstancesRequest{ +func (a *APIClient) ListFlavorsExecute(ctx context.Context, projectId string, region string) (*ListFlavorsResponse, error) { + r := ListFlavorsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -3395,87 +4213,71 @@ func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string, } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListMetricsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - region string - instanceId string - metric string - granularity *string - period *string - start *string - end *string -} - -// The granularity in ISO8601 e.g. 5 minutes are 'PT5M'. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r ListMetricsRequest) Granularity(granularity string) ApiListMetricsRequest { - r.granularity = &granularity - return r +type ListInstancesRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + page *int64 + size *int64 + sort *InstanceSort } -// The period in ISO8601 format e.g. 5 minutes are 'PT5M'. If no period is provided, the standard value of 5 minutes is used. +// Number of the page of items list to be returned. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r ListMetricsRequest) Period(period string) ApiListMetricsRequest { - r.period = &period +func (r ListInstancesRequest) Page(page int64) ApiListInstancesRequest { + r.page = &page return r } -// 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. +// Number of items to be returned on each page. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r ListMetricsRequest) Start(start string) ApiListMetricsRequest { - r.start = &start +func (r ListInstancesRequest) Size(size int64) ApiListInstancesRequest { + r.size = &size return r } -// The end of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. +// Sorting of the items to be returned on each page. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r ListMetricsRequest) End(end string) ApiListMetricsRequest { - r.end = &end +func (r ListInstancesRequest) Sort(sort InstanceSort) ApiListInstancesRequest { + r.sort = &sort return r } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r ListMetricsRequest) Execute() (*InstanceMetricsResponse, error) { +func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *InstanceMetricsResponse + localVarReturnValue *ListInstancesResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListMetrics") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListInstances") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/metrics/{metric}" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"metric"+"}", url.PathEscape(ParameterValueToString(r.metric, "metric")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.granularity == nil { - return localVarReturnValue, fmt.Errorf("granularity is required and must be specified") - } - parameterAddToHeaderOrQuery(localVarQueryParams, "granularity", r.granularity, "") - if r.period != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "period", r.period, "") + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") } - if r.start != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "start", r.start, "") + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "") } - if r.end != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "end", r.end, "") + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -3548,7 +4350,18 @@ func (r ListMetricsRequest) Execute() (*InstanceMetricsResponse, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 405 { + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -3568,6 +4381,17 @@ func (r ListMetricsRequest) Execute() (*InstanceMetricsResponse, error) { } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -3586,72 +4410,66 @@ func (r ListMetricsRequest) Execute() (*InstanceMetricsResponse, error) { } /* -ListMetrics: Get Metric +ListInstances: List Instances Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The UUID of the project. + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId The UUID of the instance. - @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'max-connections', 'connections' and 'disk-use'. - @return ApiListMetricsRequest + @return ApiListInstancesRequest */ -func (a *APIClient) ListMetrics(ctx context.Context, projectId string, region string, instanceId string, metric string) ApiListMetricsRequest { - return ListMetricsRequest{ +func (a *APIClient) ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest { + return ListInstancesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, region: region, - instanceId: instanceId, - metric: metric, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListMetricsExecute(ctx context.Context, projectId string, region string, instanceId string, metric string) (*InstanceMetricsResponse, error) { - r := ListMetricsRequest{ +func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string, region string) (*ListInstancesResponse, error) { + r := ListInstancesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, region: region, - instanceId: instanceId, - metric: metric, } return r.Execute() } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListStoragesRequest struct { +type ListRolesRequest struct { ctx context.Context apiService *DefaultApiService projectId string region string - flavorId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r ListStoragesRequest) Execute() (*ListStoragesResponse, error) { +func (r ListRolesRequest) Execute() (*ListRolesResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListStoragesResponse + localVarReturnValue *ListRolesResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListStorages") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListRoles") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/storages/{flavorId}" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/roles" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"flavorId"+"}", url.PathEscape(ParameterValueToString(r.flavorId, "flavorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3728,6 +4546,49 @@ func (r ListStoragesRequest) Execute() (*ListStoragesResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } return localVarReturnValue, newErr } @@ -3745,34 +4606,34 @@ func (r ListStoragesRequest) Execute() (*ListStoragesResponse, error) { } /* -ListStorages: Get Storages +ListRoles: List Roles Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param flavorId Flavor ID - @return ApiListStoragesRequest + @param instanceId The ID of the instance. + @return ApiListRolesRequest */ -func (a *APIClient) ListStorages(ctx context.Context, projectId string, region string, flavorId string) ApiListStoragesRequest { - return ListStoragesRequest{ +func (a *APIClient) ListRoles(ctx context.Context, projectId string, region string, instanceId string) ApiListRolesRequest { + return ListRolesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, region: region, - flavorId: flavorId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListStoragesExecute(ctx context.Context, projectId string, region string, flavorId string) (*ListStoragesResponse, error) { - r := ListStoragesRequest{ +func (a *APIClient) ListRolesExecute(ctx context.Context, projectId string, region string, instanceId string) (*ListRolesResponse, error) { + r := ListRolesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, region: region, - flavorId: flavorId, + instanceId: instanceId, } return r.Execute() } @@ -3784,18 +4645,42 @@ type ListUsersRequest struct { projectId string region string instanceId string + page *int64 + size *int64 + sort *UserSort } +// Number of the page of items list to be returned. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r ListUsersRequest) Execute() (*ListUsersResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListUsersResponse - ) - a := r.apiService - client, ok := a.client.(*APIClient) +func (r ListUsersRequest) Page(page int64) ApiListUsersRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r ListUsersRequest) Size(size int64) ApiListUsersRequest { + r.size = &size + return r +} + +// Sorting of the users to be returned on each page. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r ListUsersRequest) Sort(sort UserSort) ApiListUsersRequest { + r.sort = &sort + return r +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r ListUsersRequest) Execute() (*ListUserResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListUserResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } @@ -3804,7 +4689,7 @@ func (r ListUsersRequest) Execute() (*ListUsersResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) @@ -3813,6 +4698,15 @@ func (r ListUsersRequest) Execute() (*ListUsersResponse, error) { localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "") + } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -3884,6 +4778,49 @@ func (r ListUsersRequest) Execute() (*ListUsersResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } return localVarReturnValue, newErr } @@ -3906,9 +4843,9 @@ ListUsers: List Users Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID + @param instanceId The ID of the instance. @return ApiListUsersRequest */ func (a *APIClient) ListUsers(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequest { @@ -3922,7 +4859,7 @@ func (a *APIClient) ListUsers(ctx context.Context, projectId string, region stri } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListUsersExecute(ctx context.Context, projectId string, region string, instanceId string) (*ListUsersResponse, error) { +func (a *APIClient) ListUsersExecute(ctx context.Context, projectId string, region string, instanceId string) (*ListUserResponse, error) { r := ListUsersRequest{ apiService: a.defaultApi, ctx: ctx, @@ -3939,23 +4876,15 @@ type ListVersionsRequest struct { apiService *DefaultApiService projectId string region string - instanceId *string -} - -// Instance ID -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r ListVersionsRequest) InstanceId(instanceId string) ApiListVersionsRequest { - r.instanceId = &instanceId - return r } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r ListVersionsRequest) Execute() (*ListVersionsResponse, error) { +func (r ListVersionsRequest) Execute() (*ListVersionResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListVersionsResponse + localVarReturnValue *ListVersionResponse ) a := r.apiService client, ok := a.client.(*APIClient) @@ -3967,7 +4896,7 @@ func (r ListVersionsRequest) Execute() (*ListVersionsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/versions" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/versions" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) @@ -3975,9 +4904,6 @@ func (r ListVersionsRequest) Execute() (*ListVersionsResponse, error) { localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.instanceId != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "instanceId", r.instanceId, "") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -4049,6 +4975,49 @@ func (r ListVersionsRequest) Execute() (*ListVersionsResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } return localVarReturnValue, newErr } @@ -4071,7 +5040,7 @@ ListVersions: Get Versions Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed @return ApiListVersionsRequest */ @@ -4085,7 +5054,7 @@ func (a *APIClient) ListVersions(ctx context.Context, projectId string, region s } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListVersionsExecute(ctx context.Context, projectId string, region string) (*ListVersionsResponse, error) { +func (a *APIClient) ListVersionsExecute(ctx context.Context, projectId string, region string) (*ListVersionResponse, error) { r := ListVersionsRequest{ apiService: a.defaultApi, ctx: ctx, @@ -4096,50 +5065,51 @@ func (a *APIClient) ListVersionsExecute(ctx context.Context, projectId string, r } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PartialUpdateInstanceRequest struct { +type PartialUpdateDatabaseRequest struct { ctx context.Context apiService *DefaultApiService projectId string region string instanceId string - partialUpdateInstancePayload *PartialUpdateInstancePayload + databaseId int64 + partialUpdateDatabasePayload *PartialUpdateDatabasePayload } -// Body +// The request body containing the information for the database update. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r PartialUpdateInstanceRequest) PartialUpdateInstancePayload(partialUpdateInstancePayload PartialUpdateInstancePayload) ApiPartialUpdateInstanceRequest { - r.partialUpdateInstancePayload = &partialUpdateInstancePayload +func (r PartialUpdateDatabaseRequest) PartialUpdateDatabasePayload(partialUpdateDatabasePayload PartialUpdateDatabasePayload) ApiPartialUpdateDatabaseRequest { + r.partialUpdateDatabasePayload = &partialUpdateDatabasePayload return r } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r PartialUpdateInstanceRequest) Execute() (*PartialUpdateInstanceResponse, error) { +func (r PartialUpdateDatabaseRequest) Execute() error { var ( - localVarHTTPMethod = http.MethodPatch - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *PartialUpdateInstanceResponse + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { - return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + return fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.PartialUpdateInstance") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.PartialUpdateDatabase") if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"databaseId"+"}", url.PathEscape(ParameterValueToString(r.databaseId, "databaseId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.partialUpdateInstancePayload == nil { - return localVarReturnValue, fmt.Errorf("partialUpdateInstancePayload is required and must be specified") + if r.partialUpdateDatabasePayload == nil { + return fmt.Errorf("partialUpdateDatabasePayload is required and must be specified") } // to determine the Content-Type header @@ -4160,10 +5130,10 @@ func (r PartialUpdateInstanceRequest) Execute() (*PartialUpdateInstanceResponse, localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.partialUpdateInstancePayload + localVarPostBody = r.partialUpdateDatabasePayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, err + return err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -4177,14 +5147,14 @@ func (r PartialUpdateInstanceRequest) Execute() (*PartialUpdateInstanceResponse, *contextHTTPResponse = localVarHTTPResponse } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err + return err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, err + return err } if localVarHTTPResponse.StatusCode >= 300 { @@ -4198,92 +5168,149 @@ func (r PartialUpdateInstanceRequest) Execute() (*PartialUpdateInstanceResponse, err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 401 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } - return localVarReturnValue, newErr - } - - err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr } - return localVarReturnValue, newErr + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr } - return localVarReturnValue, nil + return nil } /* -PartialUpdateInstance: Update Instance +PartialUpdateDatabase: Update Database partially Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @return ApiPartialUpdateInstanceRequest + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return ApiPartialUpdateDatabaseRequest */ -func (a *APIClient) PartialUpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiPartialUpdateInstanceRequest { - return PartialUpdateInstanceRequest{ +func (a *APIClient) PartialUpdateDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) ApiPartialUpdateDatabaseRequest { + return PartialUpdateDatabaseRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, region: region, instanceId: instanceId, + databaseId: databaseId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) PartialUpdateInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) (*PartialUpdateInstanceResponse, error) { - r := PartialUpdateInstanceRequest{ +func (a *APIClient) PartialUpdateDatabaseExecute(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) error { + r := PartialUpdateDatabaseRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, region: region, instanceId: instanceId, + databaseId: databaseId, } return r.Execute() } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PartialUpdateUserRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - region string - instanceId string - userId string - partialUpdateUserPayload *PartialUpdateUserPayload +type PartialUpdateInstanceRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + instanceId string + partialUpdateInstancePayload *PartialUpdateInstancePayload } -// 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 +// The request body with the parameters for updating the instance. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r PartialUpdateUserRequest) PartialUpdateUserPayload(partialUpdateUserPayload PartialUpdateUserPayload) ApiPartialUpdateUserRequest { - r.partialUpdateUserPayload = &partialUpdateUserPayload +func (r PartialUpdateInstanceRequest) PartialUpdateInstancePayload(partialUpdateInstancePayload PartialUpdateInstancePayload) ApiPartialUpdateInstanceRequest { + r.partialUpdateInstancePayload = &partialUpdateInstancePayload return r } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r PartialUpdateUserRequest) Execute() error { +func (r PartialUpdateInstanceRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} @@ -4294,20 +5321,22 @@ func (r PartialUpdateUserRequest) Execute() error { if !ok { return fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.PartialUpdateUser") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.PartialUpdateInstance") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(r.userId, "userId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.partialUpdateInstancePayload == nil { + return fmt.Errorf("partialUpdateInstancePayload is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -4327,7 +5356,7 @@ func (r PartialUpdateUserRequest) Execute() error { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.partialUpdateUserPayload + localVarPostBody = r.partialUpdateInstancePayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return err @@ -4382,7 +5411,7 @@ func (r PartialUpdateUserRequest) Execute() error { newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 500 { + if localVarHTTPResponse.StatusCode == 403 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -4391,26 +5420,314 @@ func (r PartialUpdateUserRequest) Execute() error { } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr } - return newErr - } - - return nil -} - -/* -PartialUpdateUser: Update User - -Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 412 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +/* +PartialUpdateInstance: Update Instance Partially + +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiPartialUpdateInstanceRequest +*/ +func (a *APIClient) PartialUpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiPartialUpdateInstanceRequest { + return PartialUpdateInstanceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) PartialUpdateInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) error { + r := PartialUpdateInstanceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } + return r.Execute() +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PartialUpdateUserRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + instanceId string + userId int64 + partialUpdateUserPayload *PartialUpdateUserPayload +} + +// 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. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r PartialUpdateUserRequest) PartialUpdateUserPayload(partialUpdateUserPayload PartialUpdateUserPayload) ApiPartialUpdateUserRequest { + r.partialUpdateUserPayload = &partialUpdateUserPayload + return r +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r PartialUpdateUserRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.PartialUpdateUser") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(ParameterValueToString(r.userId, "userId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.partialUpdateUserPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +/* +PartialUpdateUser: Update User Partially + +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The ID of the project + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId The ID of the instance - @param userId The ID of the user in the database + @param instanceId The ID of the instance. + @param userId The ID of the user. @return ApiPartialUpdateUserRequest */ -func (a *APIClient) PartialUpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiPartialUpdateUserRequest { +func (a *APIClient) PartialUpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiPartialUpdateUserRequest { return PartialUpdateUserRequest{ apiService: a.defaultApi, ctx: ctx, @@ -4422,7 +5739,7 @@ func (a *APIClient) PartialUpdateUser(ctx context.Context, projectId string, reg } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) PartialUpdateUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) error { +func (a *APIClient) PartialUpdateUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId int64) error { r := PartialUpdateUserRequest{ apiService: a.defaultApi, ctx: ctx, @@ -4435,34 +5752,34 @@ func (a *APIClient) PartialUpdateUserExecute(ctx context.Context, projectId stri } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ResetUserRequest struct { +type ResetUserPasswordRequest struct { ctx context.Context apiService *DefaultApiService projectId string region string instanceId string - userId string + userId int64 } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r ResetUserRequest) Execute() (*ResetUserResponse, error) { +func (r ResetUserPasswordRequest) Execute() (*ResetUserPasswordResponse, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ResetUserResponse + localVarReturnValue *ResetUserPasswordResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ResetUser") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ResetUserPassword") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}/reset" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}/reset" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) @@ -4521,120 +5838,392 @@ func (r ResetUserRequest) Execute() (*ResetUserResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v Error + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +ResetUserPassword: Reset User + +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiResetUserPasswordRequest +*/ +func (a *APIClient) ResetUserPassword(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiResetUserPasswordRequest { + return ResetUserPasswordRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) ResetUserPasswordExecute(ctx context.Context, projectId string, region string, instanceId string, userId int64) (*ResetUserPasswordResponse, error) { + r := ResetUserPasswordRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } + return r.Execute() +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UpdateDatabaseRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + instanceId string + databaseId int64 + updateDatabasePayload *UpdateDatabasePayload +} + +// The request body containing the information for the database update. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r UpdateDatabaseRequest) UpdateDatabasePayload(updateDatabasePayload UpdateDatabasePayload) ApiUpdateDatabaseRequest { + r.updateDatabasePayload = &updateDatabasePayload + return r +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r UpdateDatabaseRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateDatabase") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"databaseId"+"}", url.PathEscape(ParameterValueToString(r.databaseId, "databaseId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateDatabasePayload == nil { + return fmt.Errorf("updateDatabasePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateDatabasePayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } - if localVarHTTPResponse.StatusCode == 401 { + if localVarHTTPResponse.StatusCode == 423 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } - if localVarHTTPResponse.StatusCode == 404 { + if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } - if localVarHTTPResponse.StatusCode == 500 { + if localVarHTTPResponse.StatusCode == 503 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } - return localVarReturnValue, newErr - } - - err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr + return newErr } - return localVarReturnValue, nil + return nil } /* -ResetUser: Reset User +UpdateDatabase: Update Database Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @param userId user ID - @return ApiResetUserRequest + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return ApiUpdateDatabaseRequest */ -func (a *APIClient) ResetUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiResetUserRequest { - return ResetUserRequest{ +func (a *APIClient) UpdateDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) ApiUpdateDatabaseRequest { + return UpdateDatabaseRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, region: region, instanceId: instanceId, - userId: userId, + databaseId: databaseId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ResetUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) (*ResetUserResponse, error) { - r := ResetUserRequest{ +func (a *APIClient) UpdateDatabaseExecute(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) error { + r := UpdateDatabaseRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, region: region, instanceId: instanceId, - userId: userId, + databaseId: databaseId, } return r.Execute() } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateBackupScheduleRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - region string - instanceId string - updateBackupSchedulePayload *UpdateBackupSchedulePayload +type UpdateInstanceRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + instanceId string + updateInstancePayload *UpdateInstancePayload } -// Body +// The request body with the parameters for updating the instance // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r UpdateBackupScheduleRequest) UpdateBackupSchedulePayload(updateBackupSchedulePayload UpdateBackupSchedulePayload) ApiUpdateBackupScheduleRequest { - r.updateBackupSchedulePayload = &updateBackupSchedulePayload +func (r UpdateInstanceRequest) UpdateInstancePayload(updateInstancePayload UpdateInstancePayload) ApiUpdateInstanceRequest { + r.updateInstancePayload = &updateInstancePayload return r } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r UpdateBackupScheduleRequest) Execute() error { +func (r UpdateInstanceRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} @@ -4645,12 +6234,12 @@ func (r UpdateBackupScheduleRequest) Execute() error { if !ok { return fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateBackupSchedule") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateInstance") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) @@ -4658,8 +6247,8 @@ func (r UpdateBackupScheduleRequest) Execute() error { localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.updateBackupSchedulePayload == nil { - return fmt.Errorf("updateBackupSchedulePayload is required and must be specified") + if r.updateInstancePayload == nil { + return fmt.Errorf("updateInstancePayload is required and must be specified") } // to determine the Content-Type header @@ -4680,7 +6269,7 @@ func (r UpdateBackupScheduleRequest) Execute() error { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateBackupSchedulePayload + localVarPostBody = r.updateInstancePayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return err @@ -4735,6 +6324,82 @@ func (r UpdateBackupScheduleRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 412 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } return newErr } @@ -4742,18 +6407,18 @@ func (r UpdateBackupScheduleRequest) Execute() error { } /* -UpdateBackupSchedule: Update Backup Schedule +UpdateInstance: Update Instance Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @return ApiUpdateBackupScheduleRequest + @param instanceId The ID of the instance. + @return ApiUpdateInstanceRequest */ -func (a *APIClient) UpdateBackupSchedule(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateBackupScheduleRequest { - return UpdateBackupScheduleRequest{ +func (a *APIClient) UpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequest { + return UpdateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -4763,8 +6428,8 @@ func (a *APIClient) UpdateBackupSchedule(ctx context.Context, projectId string, } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) UpdateBackupScheduleExecute(ctx context.Context, projectId string, region string, instanceId string) error { - r := UpdateBackupScheduleRequest{ +func (a *APIClient) UpdateInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) error { + r := UpdateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -4775,41 +6440,41 @@ func (a *APIClient) UpdateBackupScheduleExecute(ctx context.Context, projectId s } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstanceRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - region string - instanceId string - updateInstancePayload *UpdateInstancePayload +type UpdateInstanceProtectionRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + instanceId string + updateInstanceProtectionPayload *UpdateInstanceProtectionPayload } -// Body +// The request body with flag isDeletable. Parameter is required. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r UpdateInstanceRequest) UpdateInstancePayload(updateInstancePayload UpdateInstancePayload) ApiUpdateInstanceRequest { - r.updateInstancePayload = &updateInstancePayload +func (r UpdateInstanceProtectionRequest) UpdateInstanceProtectionPayload(updateInstanceProtectionPayload UpdateInstanceProtectionPayload) ApiUpdateInstanceProtectionRequest { + r.updateInstanceProtectionPayload = &updateInstanceProtectionPayload return r } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r UpdateInstanceRequest) Execute() (*PartialUpdateInstanceResponse, error) { +func (r UpdateInstanceProtectionRequest) Execute() (*UpdateInstanceProtectionResponse, error) { var ( - localVarHTTPMethod = http.MethodPut + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *PartialUpdateInstanceResponse + localVarReturnValue *UpdateInstanceProtectionResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateInstance") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateInstanceProtection") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/protections" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) @@ -4817,8 +6482,8 @@ func (r UpdateInstanceRequest) Execute() (*PartialUpdateInstanceResponse, error) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.updateInstancePayload == nil { - return localVarReturnValue, fmt.Errorf("updateInstancePayload is required and must be specified") + if r.updateInstanceProtectionPayload == nil { + return localVarReturnValue, fmt.Errorf("updateInstanceProtectionPayload is required and must be specified") } // to determine the Content-Type header @@ -4839,7 +6504,7 @@ func (r UpdateInstanceRequest) Execute() (*PartialUpdateInstanceResponse, error) localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateInstancePayload + localVarPostBody = r.updateInstanceProtectionPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -4894,6 +6559,71 @@ func (r UpdateInstanceRequest) Execute() (*PartialUpdateInstanceResponse, error) newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } return localVarReturnValue, newErr } @@ -4911,18 +6641,18 @@ func (r UpdateInstanceRequest) Execute() (*PartialUpdateInstanceResponse, error) } /* -UpdateInstance: Update Instance +UpdateInstanceProtection: Toggle Instance Protection Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId Instance ID - @return ApiUpdateInstanceRequest + @param instanceId The ID of the instance. + @return ApiUpdateInstanceProtectionRequest */ -func (a *APIClient) UpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequest { - return UpdateInstanceRequest{ +func (a *APIClient) UpdateInstanceProtection(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceProtectionRequest { + return UpdateInstanceProtectionRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -4932,8 +6662,8 @@ func (a *APIClient) UpdateInstance(ctx context.Context, projectId string, region } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) UpdateInstanceExecute(ctx context.Context, projectId string, region string, instanceId string) (*PartialUpdateInstanceResponse, error) { - r := UpdateInstanceRequest{ +func (a *APIClient) UpdateInstanceProtectionExecute(ctx context.Context, projectId string, region string, instanceId string) (*UpdateInstanceProtectionResponse, error) { + r := UpdateInstanceProtectionRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -4950,11 +6680,11 @@ type UpdateUserRequest struct { projectId string region string instanceId string - userId string + userId int64 updateUserPayload *UpdateUserPayload } -// 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 +// The Request body containing the updated infos for the user. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateUserRequest) UpdateUserPayload(updateUserPayload UpdateUserPayload) ApiUpdateUserRequest { r.updateUserPayload = &updateUserPayload @@ -4978,7 +6708,7 @@ func (r UpdateUserRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) @@ -4987,6 +6717,9 @@ func (r UpdateUserRequest) Execute() error { localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.updateUserPayload == nil { + return fmt.Errorf("updateUserPayload is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -5061,6 +6794,50 @@ func (r UpdateUserRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -5070,6 +6847,17 @@ func (r UpdateUserRequest) Execute() error { } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return newErr } @@ -5083,13 +6871,13 @@ UpdateUser: Update User Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The ID of the project + @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId The ID of the instance - @param userId The ID of the user in the database + @param instanceId The ID of the instance. + @param userId The ID of the user. @return ApiUpdateUserRequest */ -func (a *APIClient) UpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId string) ApiUpdateUserRequest { +func (a *APIClient) UpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiUpdateUserRequest { return UpdateUserRequest{ apiService: a.defaultApi, ctx: ctx, @@ -5101,7 +6889,7 @@ func (a *APIClient) UpdateUser(ctx context.Context, projectId string, region str } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) UpdateUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId string) error { +func (a *APIClient) UpdateUserExecute(ctx context.Context, projectId string, region string, instanceId string, userId int64) error { r := UpdateUserRequest{ apiService: a.defaultApi, ctx: ctx, diff --git a/services/postgresflex/client.go b/services/postgresflex/client.go index 9465cdfc9..83675a809 100644 --- a/services/postgresflex/client.go +++ b/services/postgresflex/client.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -43,7 +43,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the STACKIT PostgreSQL Flex API API v2.0.0 +// APIClient manages communication with the STACKIT PostgreSQL Flex API API v3.0.0 // In most cases there should be only one, shared, APIClient. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type APIClient struct { diff --git a/services/postgresflex/configuration.go b/services/postgresflex/configuration.go index 1806a618c..ea413c1f7 100644 --- a/services/postgresflex/configuration.go +++ b/services/postgresflex/configuration.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_api_extension_config_load_response.go b/services/postgresflex/model_api_extension_config_load_response.go deleted file mode 100644 index 2c81066b8..000000000 --- a/services/postgresflex/model_api_extension_config_load_response.go +++ /dev/null @@ -1,152 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package postgresflex - -import ( - "encoding/json" -) - -// checks if the ApiExtensionConfigLoadResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ApiExtensionConfigLoadResponse{} - -/* - types and functions for configuration -*/ - -// isArray -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionConfigLoadResponseGetConfigurationAttributeType = *[]ApiConfiguration - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionConfigLoadResponseGetConfigurationArgType = []ApiConfiguration - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionConfigLoadResponseGetConfigurationRetType = []ApiConfiguration - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getApiExtensionConfigLoadResponseGetConfigurationAttributeTypeOk(arg ApiExtensionConfigLoadResponseGetConfigurationAttributeType) (ret ApiExtensionConfigLoadResponseGetConfigurationRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setApiExtensionConfigLoadResponseGetConfigurationAttributeType(arg *ApiExtensionConfigLoadResponseGetConfigurationAttributeType, val ApiExtensionConfigLoadResponseGetConfigurationRetType) { - *arg = &val -} - -// ApiExtensionConfigLoadResponse struct for ApiExtensionConfigLoadResponse -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionConfigLoadResponse struct { - // Returns marshalled JSON of the new configuration of whatever extension is called - Configuration ApiExtensionConfigLoadResponseGetConfigurationAttributeType `json:"configuration,omitempty"` -} - -// NewApiExtensionConfigLoadResponse instantiates a new ApiExtensionConfigLoadResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewApiExtensionConfigLoadResponse() *ApiExtensionConfigLoadResponse { - this := ApiExtensionConfigLoadResponse{} - return &this -} - -// NewApiExtensionConfigLoadResponseWithDefaults instantiates a new ApiExtensionConfigLoadResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewApiExtensionConfigLoadResponseWithDefaults() *ApiExtensionConfigLoadResponse { - this := ApiExtensionConfigLoadResponse{} - return &this -} - -// GetConfiguration returns the Configuration field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionConfigLoadResponse) GetConfiguration() (res ApiExtensionConfigLoadResponseGetConfigurationRetType) { - res, _ = o.GetConfigurationOk() - return -} - -// GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionConfigLoadResponse) GetConfigurationOk() (ret ApiExtensionConfigLoadResponseGetConfigurationRetType, ok bool) { - return getApiExtensionConfigLoadResponseGetConfigurationAttributeTypeOk(o.Configuration) -} - -// HasConfiguration returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionConfigLoadResponse) HasConfiguration() bool { - _, ok := o.GetConfigurationOk() - return ok -} - -// SetConfiguration gets a reference to the given []ApiConfiguration and assigns it to the Configuration field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionConfigLoadResponse) SetConfiguration(v ApiExtensionConfigLoadResponseGetConfigurationRetType) { - setApiExtensionConfigLoadResponseGetConfigurationAttributeType(&o.Configuration, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o ApiExtensionConfigLoadResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getApiExtensionConfigLoadResponseGetConfigurationAttributeTypeOk(o.Configuration); ok { - toSerialize["Configuration"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableApiExtensionConfigLoadResponse struct { - value *ApiExtensionConfigLoadResponse - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiExtensionConfigLoadResponse) Get() *ApiExtensionConfigLoadResponse { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiExtensionConfigLoadResponse) Set(val *ApiExtensionConfigLoadResponse) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiExtensionConfigLoadResponse) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiExtensionConfigLoadResponse) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableApiExtensionConfigLoadResponse(val *ApiExtensionConfigLoadResponse) *NullableApiExtensionConfigLoadResponse { - return &NullableApiExtensionConfigLoadResponse{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiExtensionConfigLoadResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiExtensionConfigLoadResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/model_api_extension_configure_response.go b/services/postgresflex/model_api_extension_configure_response.go deleted file mode 100644 index 6c5738683..000000000 --- a/services/postgresflex/model_api_extension_configure_response.go +++ /dev/null @@ -1,152 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package postgresflex - -import ( - "encoding/json" -) - -// checks if the ApiExtensionConfigureResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ApiExtensionConfigureResponse{} - -/* - types and functions for configuration -*/ - -// isArray -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionConfigureResponseGetConfigurationAttributeType = *[]ApiConfiguration - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionConfigureResponseGetConfigurationArgType = []ApiConfiguration - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionConfigureResponseGetConfigurationRetType = []ApiConfiguration - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getApiExtensionConfigureResponseGetConfigurationAttributeTypeOk(arg ApiExtensionConfigureResponseGetConfigurationAttributeType) (ret ApiExtensionConfigureResponseGetConfigurationRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setApiExtensionConfigureResponseGetConfigurationAttributeType(arg *ApiExtensionConfigureResponseGetConfigurationAttributeType, val ApiExtensionConfigureResponseGetConfigurationRetType) { - *arg = &val -} - -// ApiExtensionConfigureResponse struct for ApiExtensionConfigureResponse -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionConfigureResponse struct { - // Returns marshalled JSON of the new configuration of whatever extension is called - Configuration ApiExtensionConfigureResponseGetConfigurationAttributeType `json:"configuration,omitempty"` -} - -// NewApiExtensionConfigureResponse instantiates a new ApiExtensionConfigureResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewApiExtensionConfigureResponse() *ApiExtensionConfigureResponse { - this := ApiExtensionConfigureResponse{} - return &this -} - -// NewApiExtensionConfigureResponseWithDefaults instantiates a new ApiExtensionConfigureResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewApiExtensionConfigureResponseWithDefaults() *ApiExtensionConfigureResponse { - this := ApiExtensionConfigureResponse{} - return &this -} - -// GetConfiguration returns the Configuration field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionConfigureResponse) GetConfiguration() (res ApiExtensionConfigureResponseGetConfigurationRetType) { - res, _ = o.GetConfigurationOk() - return -} - -// GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionConfigureResponse) GetConfigurationOk() (ret ApiExtensionConfigureResponseGetConfigurationRetType, ok bool) { - return getApiExtensionConfigureResponseGetConfigurationAttributeTypeOk(o.Configuration) -} - -// HasConfiguration returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionConfigureResponse) HasConfiguration() bool { - _, ok := o.GetConfigurationOk() - return ok -} - -// SetConfiguration gets a reference to the given []ApiConfiguration and assigns it to the Configuration field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionConfigureResponse) SetConfiguration(v ApiExtensionConfigureResponseGetConfigurationRetType) { - setApiExtensionConfigureResponseGetConfigurationAttributeType(&o.Configuration, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o ApiExtensionConfigureResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getApiExtensionConfigureResponseGetConfigurationAttributeTypeOk(o.Configuration); ok { - toSerialize["Configuration"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableApiExtensionConfigureResponse struct { - value *ApiExtensionConfigureResponse - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiExtensionConfigureResponse) Get() *ApiExtensionConfigureResponse { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiExtensionConfigureResponse) Set(val *ApiExtensionConfigureResponse) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiExtensionConfigureResponse) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiExtensionConfigureResponse) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableApiExtensionConfigureResponse(val *ApiExtensionConfigureResponse) *NullableApiExtensionConfigureResponse { - return &NullableApiExtensionConfigureResponse{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiExtensionConfigureResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiExtensionConfigureResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/model_api_extension_delete_response_test.go b/services/postgresflex/model_api_extension_delete_response_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_api_extension_delete_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_api_extension_list_test.go b/services/postgresflex/model_api_extension_list_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_api_extension_list_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_api_extension_load_response.go b/services/postgresflex/model_api_extension_load_response.go deleted file mode 100644 index 1e8ec3dd7..000000000 --- a/services/postgresflex/model_api_extension_load_response.go +++ /dev/null @@ -1,151 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package postgresflex - -import ( - "encoding/json" -) - -// checks if the ApiExtensionLoadResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ApiExtensionLoadResponse{} - -/* - types and functions for extension -*/ - -// isModel -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionLoadResponseGetExtensionAttributeType = *ApiExtensionList - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionLoadResponseGetExtensionArgType = ApiExtensionList - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionLoadResponseGetExtensionRetType = ApiExtensionList - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getApiExtensionLoadResponseGetExtensionAttributeTypeOk(arg ApiExtensionLoadResponseGetExtensionAttributeType) (ret ApiExtensionLoadResponseGetExtensionRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setApiExtensionLoadResponseGetExtensionAttributeType(arg *ApiExtensionLoadResponseGetExtensionAttributeType, val ApiExtensionLoadResponseGetExtensionRetType) { - *arg = &val -} - -// ApiExtensionLoadResponse struct for ApiExtensionLoadResponse -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionLoadResponse struct { - Extension ApiExtensionLoadResponseGetExtensionAttributeType `json:"extension,omitempty"` -} - -// NewApiExtensionLoadResponse instantiates a new ApiExtensionLoadResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewApiExtensionLoadResponse() *ApiExtensionLoadResponse { - this := ApiExtensionLoadResponse{} - return &this -} - -// NewApiExtensionLoadResponseWithDefaults instantiates a new ApiExtensionLoadResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewApiExtensionLoadResponseWithDefaults() *ApiExtensionLoadResponse { - this := ApiExtensionLoadResponse{} - return &this -} - -// GetExtension returns the Extension field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionLoadResponse) GetExtension() (res ApiExtensionLoadResponseGetExtensionRetType) { - res, _ = o.GetExtensionOk() - return -} - -// GetExtensionOk returns a tuple with the Extension field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionLoadResponse) GetExtensionOk() (ret ApiExtensionLoadResponseGetExtensionRetType, ok bool) { - return getApiExtensionLoadResponseGetExtensionAttributeTypeOk(o.Extension) -} - -// HasExtension returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionLoadResponse) HasExtension() bool { - _, ok := o.GetExtensionOk() - return ok -} - -// SetExtension gets a reference to the given ApiExtensionList and assigns it to the Extension field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionLoadResponse) SetExtension(v ApiExtensionLoadResponseGetExtensionRetType) { - setApiExtensionLoadResponseGetExtensionAttributeType(&o.Extension, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o ApiExtensionLoadResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getApiExtensionLoadResponseGetExtensionAttributeTypeOk(o.Extension); ok { - toSerialize["Extension"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableApiExtensionLoadResponse struct { - value *ApiExtensionLoadResponse - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiExtensionLoadResponse) Get() *ApiExtensionLoadResponse { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiExtensionLoadResponse) Set(val *ApiExtensionLoadResponse) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiExtensionLoadResponse) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiExtensionLoadResponse) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableApiExtensionLoadResponse(val *ApiExtensionLoadResponse) *NullableApiExtensionLoadResponse { - return &NullableApiExtensionLoadResponse{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiExtensionLoadResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiExtensionLoadResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/model_api_extension_load_response_test.go b/services/postgresflex/model_api_extension_load_response_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_api_extension_load_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_api_install_response_test.go b/services/postgresflex/model_api_install_response_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_api_install_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_api_installed_list_response.go b/services/postgresflex/model_api_installed_list_response.go deleted file mode 100644 index 4f3bacaea..000000000 --- a/services/postgresflex/model_api_installed_list_response.go +++ /dev/null @@ -1,151 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package postgresflex - -import ( - "encoding/json" -) - -// checks if the ApiInstalledListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ApiInstalledListResponse{} - -/* - types and functions for installed -*/ - -// isArray -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiInstalledListResponseGetInstalledAttributeType = *[]ApiExtensionList - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiInstalledListResponseGetInstalledArgType = []ApiExtensionList - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiInstalledListResponseGetInstalledRetType = []ApiExtensionList - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getApiInstalledListResponseGetInstalledAttributeTypeOk(arg ApiInstalledListResponseGetInstalledAttributeType) (ret ApiInstalledListResponseGetInstalledRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setApiInstalledListResponseGetInstalledAttributeType(arg *ApiInstalledListResponseGetInstalledAttributeType, val ApiInstalledListResponseGetInstalledRetType) { - *arg = &val -} - -// ApiInstalledListResponse struct for ApiInstalledListResponse -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiInstalledListResponse struct { - Installed ApiInstalledListResponseGetInstalledAttributeType `json:"installed,omitempty"` -} - -// NewApiInstalledListResponse instantiates a new ApiInstalledListResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewApiInstalledListResponse() *ApiInstalledListResponse { - this := ApiInstalledListResponse{} - return &this -} - -// NewApiInstalledListResponseWithDefaults instantiates a new ApiInstalledListResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewApiInstalledListResponseWithDefaults() *ApiInstalledListResponse { - this := ApiInstalledListResponse{} - return &this -} - -// GetInstalled returns the Installed field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiInstalledListResponse) GetInstalled() (res ApiInstalledListResponseGetInstalledRetType) { - res, _ = o.GetInstalledOk() - return -} - -// GetInstalledOk returns a tuple with the Installed field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiInstalledListResponse) GetInstalledOk() (ret ApiInstalledListResponseGetInstalledRetType, ok bool) { - return getApiInstalledListResponseGetInstalledAttributeTypeOk(o.Installed) -} - -// HasInstalled returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiInstalledListResponse) HasInstalled() bool { - _, ok := o.GetInstalledOk() - return ok -} - -// SetInstalled gets a reference to the given []ApiExtensionList and assigns it to the Installed field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiInstalledListResponse) SetInstalled(v ApiInstalledListResponseGetInstalledRetType) { - setApiInstalledListResponseGetInstalledAttributeType(&o.Installed, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o ApiInstalledListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getApiInstalledListResponseGetInstalledAttributeTypeOk(o.Installed); ok { - toSerialize["Installed"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableApiInstalledListResponse struct { - value *ApiInstalledListResponse - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiInstalledListResponse) Get() *ApiInstalledListResponse { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiInstalledListResponse) Set(val *ApiInstalledListResponse) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiInstalledListResponse) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiInstalledListResponse) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableApiInstalledListResponse(val *ApiInstalledListResponse) *NullableApiInstalledListResponse { - return &NullableApiInstalledListResponse{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiInstalledListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiInstalledListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/model_api_installed_list_response_test.go b/services/postgresflex/model_api_installed_list_response_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_api_installed_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_backup_data.go b/services/postgresflex/model_backup_data.go new file mode 100644 index 000000000..f1a17b9bf --- /dev/null +++ b/services/postgresflex/model_backup_data.go @@ -0,0 +1,420 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package postgresflex + +import ( + "encoding/json" +) + +// checks if the BackupData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupData{} + +/* + types and functions for completionTime +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BackupDataGetCompletionTimeAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getBackupDataGetCompletionTimeAttributeTypeOk(arg BackupDataGetCompletionTimeAttributeType) (ret BackupDataGetCompletionTimeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setBackupDataGetCompletionTimeAttributeType(arg *BackupDataGetCompletionTimeAttributeType, val BackupDataGetCompletionTimeRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BackupDataGetCompletionTimeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BackupDataGetCompletionTimeRetType = string + +/* + types and functions for id +*/ + +// isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BackupDataGetIdAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BackupDataGetIdArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BackupDataGetIdRetType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getBackupDataGetIdAttributeTypeOk(arg BackupDataGetIdAttributeType) (ret BackupDataGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setBackupDataGetIdAttributeType(arg *BackupDataGetIdAttributeType, val BackupDataGetIdRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BackupDataGetNameAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getBackupDataGetNameAttributeTypeOk(arg BackupDataGetNameAttributeType) (ret BackupDataGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setBackupDataGetNameAttributeType(arg *BackupDataGetNameAttributeType, val BackupDataGetNameRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BackupDataGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BackupDataGetNameRetType = string + +/* + types and functions for retainedUntil +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BackupDataGetRetainedUntilAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getBackupDataGetRetainedUntilAttributeTypeOk(arg BackupDataGetRetainedUntilAttributeType) (ret BackupDataGetRetainedUntilRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setBackupDataGetRetainedUntilAttributeType(arg *BackupDataGetRetainedUntilAttributeType, val BackupDataGetRetainedUntilRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BackupDataGetRetainedUntilArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BackupDataGetRetainedUntilRetType = string + +/* + types and functions for size +*/ + +// isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BackupDataGetSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BackupDataGetSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BackupDataGetSizeRetType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getBackupDataGetSizeAttributeTypeOk(arg BackupDataGetSizeAttributeType) (ret BackupDataGetSizeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setBackupDataGetSizeAttributeType(arg *BackupDataGetSizeAttributeType, val BackupDataGetSizeRetType) { + *arg = &val +} + +/* + types and functions for type +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BackupDataGetTypeAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getBackupDataGetTypeAttributeTypeOk(arg BackupDataGetTypeAttributeType) (ret BackupDataGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setBackupDataGetTypeAttributeType(arg *BackupDataGetTypeAttributeType, val BackupDataGetTypeRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BackupDataGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BackupDataGetTypeRetType = string + +// BackupData struct for BackupData +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BackupData struct { + // The time when the backup was completed in RFC3339 format. + // REQUIRED + CompletionTime BackupDataGetCompletionTimeAttributeType `json:"completionTime" required:"true"` + // The ID of the backup. + // REQUIRED + Id BackupDataGetIdAttributeType `json:"id" required:"true"` + // The name of the backup. + // REQUIRED + Name BackupDataGetNameAttributeType `json:"name" required:"true"` + // The time until the backup will be retained. + // REQUIRED + RetainedUntil BackupDataGetRetainedUntilAttributeType `json:"retainedUntil" required:"true"` + // The size of the backup in bytes. + // REQUIRED + Size BackupDataGetSizeAttributeType `json:"size" required:"true"` + // The type of the backup, which can be automated or manual triggered. + // REQUIRED + Type BackupDataGetTypeAttributeType `json:"type" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _BackupData BackupData + +// NewBackupData instantiates a new BackupData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewBackupData(completionTime BackupDataGetCompletionTimeArgType, id BackupDataGetIdArgType, name BackupDataGetNameArgType, retainedUntil BackupDataGetRetainedUntilArgType, size BackupDataGetSizeArgType, types BackupDataGetTypeArgType) *BackupData { + this := BackupData{} + setBackupDataGetCompletionTimeAttributeType(&this.CompletionTime, completionTime) + setBackupDataGetIdAttributeType(&this.Id, id) + setBackupDataGetNameAttributeType(&this.Name, name) + setBackupDataGetRetainedUntilAttributeType(&this.RetainedUntil, retainedUntil) + setBackupDataGetSizeAttributeType(&this.Size, size) + setBackupDataGetTypeAttributeType(&this.Type, types) + return &this +} + +// NewBackupDataWithDefaults instantiates a new BackupData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewBackupDataWithDefaults() *BackupData { + this := BackupData{} + return &this +} + +// GetCompletionTime returns the CompletionTime field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *BackupData) GetCompletionTime() (ret BackupDataGetCompletionTimeRetType) { + ret, _ = o.GetCompletionTimeOk() + return ret +} + +// GetCompletionTimeOk returns a tuple with the CompletionTime field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *BackupData) GetCompletionTimeOk() (ret BackupDataGetCompletionTimeRetType, ok bool) { + return getBackupDataGetCompletionTimeAttributeTypeOk(o.CompletionTime) +} + +// SetCompletionTime sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *BackupData) SetCompletionTime(v BackupDataGetCompletionTimeRetType) { + setBackupDataGetCompletionTimeAttributeType(&o.CompletionTime, v) +} + +// GetId returns the Id field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *BackupData) GetId() (ret BackupDataGetIdRetType) { + ret, _ = o.GetIdOk() + return ret +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *BackupData) GetIdOk() (ret BackupDataGetIdRetType, ok bool) { + return getBackupDataGetIdAttributeTypeOk(o.Id) +} + +// SetId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *BackupData) SetId(v BackupDataGetIdRetType) { + setBackupDataGetIdAttributeType(&o.Id, v) +} + +// GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *BackupData) GetName() (ret BackupDataGetNameRetType) { + ret, _ = o.GetNameOk() + return ret +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *BackupData) GetNameOk() (ret BackupDataGetNameRetType, ok bool) { + return getBackupDataGetNameAttributeTypeOk(o.Name) +} + +// SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *BackupData) SetName(v BackupDataGetNameRetType) { + setBackupDataGetNameAttributeType(&o.Name, v) +} + +// GetRetainedUntil returns the RetainedUntil field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *BackupData) GetRetainedUntil() (ret BackupDataGetRetainedUntilRetType) { + ret, _ = o.GetRetainedUntilOk() + return ret +} + +// GetRetainedUntilOk returns a tuple with the RetainedUntil field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *BackupData) GetRetainedUntilOk() (ret BackupDataGetRetainedUntilRetType, ok bool) { + return getBackupDataGetRetainedUntilAttributeTypeOk(o.RetainedUntil) +} + +// SetRetainedUntil sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *BackupData) SetRetainedUntil(v BackupDataGetRetainedUntilRetType) { + setBackupDataGetRetainedUntilAttributeType(&o.RetainedUntil, v) +} + +// GetSize returns the Size field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *BackupData) GetSize() (ret BackupDataGetSizeRetType) { + ret, _ = o.GetSizeOk() + return ret +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *BackupData) GetSizeOk() (ret BackupDataGetSizeRetType, ok bool) { + return getBackupDataGetSizeAttributeTypeOk(o.Size) +} + +// SetSize sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *BackupData) SetSize(v BackupDataGetSizeRetType) { + setBackupDataGetSizeAttributeType(&o.Size, v) +} + +// GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *BackupData) GetType() (ret BackupDataGetTypeRetType) { + ret, _ = o.GetTypeOk() + return ret +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *BackupData) GetTypeOk() (ret BackupDataGetTypeRetType, ok bool) { + return getBackupDataGetTypeAttributeTypeOk(o.Type) +} + +// SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *BackupData) SetType(v BackupDataGetTypeRetType) { + setBackupDataGetTypeAttributeType(&o.Type, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o BackupData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getBackupDataGetCompletionTimeAttributeTypeOk(o.CompletionTime); ok { + toSerialize["CompletionTime"] = val + } + if val, ok := getBackupDataGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getBackupDataGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getBackupDataGetRetainedUntilAttributeTypeOk(o.RetainedUntil); ok { + toSerialize["RetainedUntil"] = val + } + if val, ok := getBackupDataGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val + } + if val, ok := getBackupDataGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableBackupData struct { + value *BackupData + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableBackupData) Get() *BackupData { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableBackupData) Set(val *BackupData) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableBackupData) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableBackupData) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableBackupData(val *BackupData) *NullableBackupData { + return &NullableBackupData{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableBackupData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableBackupData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/model_api_extension_config_load_response_test.go b/services/postgresflex/model_backup_data_test.go similarity index 63% rename from services/postgresflex/model_api_extension_config_load_response_test.go rename to services/postgresflex/model_backup_data_test.go index 51f50494d..74a76f10e 100644 --- a/services/postgresflex/model_api_extension_config_load_response_test.go +++ b/services/postgresflex/model_backup_data_test.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_backup_sort.go b/services/postgresflex/model_backup_sort.go new file mode 100644 index 000000000..ed591324e --- /dev/null +++ b/services/postgresflex/model_backup_sort.go @@ -0,0 +1,162 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package postgresflex + +import ( + "encoding/json" + "fmt" +) + +// BackupSort the model 'BackupSort' +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BackupSort string + +// List of backup.sort +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPSORT_COMPLETION_TIME_DESC BackupSort = "completion_time.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPSORT_COMPLETION_TIME_ASC BackupSort = "completion_time.asc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPSORT_END_TIME_DESC BackupSort = "end_time.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPSORT_END_TIME_ASC BackupSort = "end_time.asc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPSORT_NAME_DESC BackupSort = "name.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPSORT_NAME_ASC BackupSort = "name.asc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPSORT_RETAINED_UNTIL_DESC BackupSort = "retained_until.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPSORT_RETAINED_UNTIL_ASC BackupSort = "retained_until.asc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPSORT_SIZE_DESC BackupSort = "size.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPSORT_SIZE_ASC BackupSort = "size.asc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPSORT_TYPE_DESC BackupSort = "type.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPSORT_TYPE_ASC BackupSort = "type.asc" +) + +// All allowed values of BackupSort enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedBackupSortEnumValues = []BackupSort{ + "completion_time.desc", + "completion_time.asc", + "end_time.desc", + "end_time.asc", + "name.desc", + "name.asc", + "retained_until.desc", + "retained_until.asc", + "size.desc", + "size.asc", + "type.desc", + "type.asc", +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *BackupSort) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue string + if value == zeroValue { + return nil + } + enumTypeValue := BackupSort(value) + for _, existing := range AllowedBackupSortEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid BackupSort", value) +} + +// NewBackupSortFromValue returns a pointer to a valid BackupSort +// for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewBackupSortFromValue(v string) (*BackupSort, error) { + ev := BackupSort(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BackupSort: valid values are %v", v, AllowedBackupSortEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v BackupSort) IsValid() bool { + for _, existing := range AllowedBackupSortEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to backup.sort value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v BackupSort) Ptr() *BackupSort { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableBackupSort struct { + value *BackupSort + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableBackupSort) Get() *BackupSort { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableBackupSort) Set(val *BackupSort) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableBackupSort) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableBackupSort) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableBackupSort(val *BackupSort) *NullableBackupSort { + return &NullableBackupSort{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableBackupSort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableBackupSort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/model_acl_test.go b/services/postgresflex/model_backup_sort_test.go similarity index 63% rename from services/postgresflex/model_acl_test.go rename to services/postgresflex/model_backup_sort_test.go index 51f50494d..74a76f10e 100644 --- a/services/postgresflex/model_acl_test.go +++ b/services/postgresflex/model_backup_sort_test.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_backup_test.go b/services/postgresflex/model_backup_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_backup_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_instance_host_metric.go b/services/postgresflex/model_clone_instance_overrides.go similarity index 55% rename from services/postgresflex/model_instance_host_metric.go rename to services/postgresflex/model_clone_instance_overrides.go index b102acf1a..de82248c3 100644 --- a/services/postgresflex/model_instance_host_metric.go +++ b/services/postgresflex/model_clone_instance_overrides.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,25 +15,19 @@ import ( "encoding/json" ) -// checks if the InstanceHostMetric type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &InstanceHostMetric{} +// checks if the CloneInstanceOverrides type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CloneInstanceOverrides{} /* - types and functions for datapoints + types and functions for class */ -// isArray -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceHostMetricGetDatapointsAttributeType = *[]InstanceDataPoint - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceHostMetricGetDatapointsArgType = []InstanceDataPoint - +// isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceHostMetricGetDatapointsRetType = []InstanceDataPoint +type CloneInstanceOverridesGetClassAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceHostMetricGetDatapointsAttributeTypeOk(arg InstanceHostMetricGetDatapointsAttributeType) (ret InstanceHostMetricGetDatapointsRetType, ok bool) { +func getCloneInstanceOverridesGetClassAttributeTypeOk(arg CloneInstanceOverridesGetClassAttributeType) (ret CloneInstanceOverridesGetClassRetType, ok bool) { if arg == nil { return ret, false } @@ -41,20 +35,26 @@ func getInstanceHostMetricGetDatapointsAttributeTypeOk(arg InstanceHostMetricGet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceHostMetricGetDatapointsAttributeType(arg *InstanceHostMetricGetDatapointsAttributeType, val InstanceHostMetricGetDatapointsRetType) { +func setCloneInstanceOverridesGetClassAttributeType(arg *CloneInstanceOverridesGetClassAttributeType, val CloneInstanceOverridesGetClassRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CloneInstanceOverridesGetClassArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CloneInstanceOverridesGetClassRetType = string + /* types and functions for name */ // isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceHostMetricGetNameAttributeType = *string +type CloneInstanceOverridesGetNameAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceHostMetricGetNameAttributeTypeOk(arg InstanceHostMetricGetNameAttributeType) (ret InstanceHostMetricGetNameRetType, ok bool) { +func getCloneInstanceOverridesGetNameAttributeTypeOk(arg CloneInstanceOverridesGetNameAttributeType) (ret CloneInstanceOverridesGetNameRetType, ok bool) { if arg == nil { return ret, false } @@ -62,26 +62,32 @@ func getInstanceHostMetricGetNameAttributeTypeOk(arg InstanceHostMetricGetNameAt } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceHostMetricGetNameAttributeType(arg *InstanceHostMetricGetNameAttributeType, val InstanceHostMetricGetNameRetType) { +func setCloneInstanceOverridesGetNameAttributeType(arg *CloneInstanceOverridesGetNameAttributeType, val CloneInstanceOverridesGetNameRetType) { *arg = &val } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceHostMetricGetNameArgType = string +type CloneInstanceOverridesGetNameArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceHostMetricGetNameRetType = string +type CloneInstanceOverridesGetNameRetType = string /* - types and functions for units + types and functions for size */ -// isNotNullableString +// isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CloneInstanceOverridesGetSizeAttributeType = *int64 + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceHostMetricGetUnitsAttributeType = *string +type CloneInstanceOverridesGetSizeArgType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceHostMetricGetUnitsAttributeTypeOk(arg InstanceHostMetricGetUnitsAttributeType) (ret InstanceHostMetricGetUnitsRetType, ok bool) { +type CloneInstanceOverridesGetSizeRetType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCloneInstanceOverridesGetSizeAttributeTypeOk(arg CloneInstanceOverridesGetSizeAttributeType) (ret CloneInstanceOverridesGetSizeRetType, ok bool) { if arg == nil { return ret, false } @@ -89,73 +95,75 @@ func getInstanceHostMetricGetUnitsAttributeTypeOk(arg InstanceHostMetricGetUnits } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceHostMetricGetUnitsAttributeType(arg *InstanceHostMetricGetUnitsAttributeType, val InstanceHostMetricGetUnitsRetType) { +func setCloneInstanceOverridesGetSizeAttributeType(arg *CloneInstanceOverridesGetSizeAttributeType, val CloneInstanceOverridesGetSizeRetType) { *arg = &val } +// CloneInstanceOverrides struct for CloneInstanceOverrides // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceHostMetricGetUnitsArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceHostMetricGetUnitsRetType = string +type CloneInstanceOverrides struct { + // The storage class for the storage. + Class CloneInstanceOverridesGetClassAttributeType `json:"class,omitempty"` + // The name of the cloned instance. If not provided, the default naming behavior of appending '-clone' to the source instance name is used. + Name CloneInstanceOverridesGetNameAttributeType `json:"name,omitempty"` + // The storage size in Gigabytes. + // REQUIRED + Size CloneInstanceOverridesGetSizeAttributeType `json:"size" required:"true"` +} -// InstanceHostMetric struct for InstanceHostMetric // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceHostMetric struct { - Datapoints InstanceHostMetricGetDatapointsAttributeType `json:"datapoints,omitempty"` - Name InstanceHostMetricGetNameAttributeType `json:"name,omitempty"` - Units InstanceHostMetricGetUnitsAttributeType `json:"units,omitempty"` -} +type _CloneInstanceOverrides CloneInstanceOverrides -// NewInstanceHostMetric instantiates a new InstanceHostMetric object +// NewCloneInstanceOverrides instantiates a new CloneInstanceOverrides object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewInstanceHostMetric() *InstanceHostMetric { - this := InstanceHostMetric{} +func NewCloneInstanceOverrides(size CloneInstanceOverridesGetSizeArgType) *CloneInstanceOverrides { + this := CloneInstanceOverrides{} + setCloneInstanceOverridesGetSizeAttributeType(&this.Size, size) return &this } -// NewInstanceHostMetricWithDefaults instantiates a new InstanceHostMetric object +// NewCloneInstanceOverridesWithDefaults instantiates a new CloneInstanceOverrides object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewInstanceHostMetricWithDefaults() *InstanceHostMetric { - this := InstanceHostMetric{} +func NewCloneInstanceOverridesWithDefaults() *CloneInstanceOverrides { + this := CloneInstanceOverrides{} return &this } -// GetDatapoints returns the Datapoints field value if set, zero value otherwise. +// GetClass returns the Class field value if set, zero value otherwise. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceHostMetric) GetDatapoints() (res InstanceHostMetricGetDatapointsRetType) { - res, _ = o.GetDatapointsOk() +func (o *CloneInstanceOverrides) GetClass() (res CloneInstanceOverridesGetClassRetType) { + res, _ = o.GetClassOk() return } -// GetDatapointsOk returns a tuple with the Datapoints field value if set, nil otherwise +// GetClassOk returns a tuple with the Class field value if set, nil otherwise // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceHostMetric) GetDatapointsOk() (ret InstanceHostMetricGetDatapointsRetType, ok bool) { - return getInstanceHostMetricGetDatapointsAttributeTypeOk(o.Datapoints) +func (o *CloneInstanceOverrides) GetClassOk() (ret CloneInstanceOverridesGetClassRetType, ok bool) { + return getCloneInstanceOverridesGetClassAttributeTypeOk(o.Class) } -// HasDatapoints returns a boolean if a field has been set. +// HasClass returns a boolean if a field has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceHostMetric) HasDatapoints() bool { - _, ok := o.GetDatapointsOk() +func (o *CloneInstanceOverrides) HasClass() bool { + _, ok := o.GetClassOk() return ok } -// SetDatapoints gets a reference to the given []InstanceDataPoint and assigns it to the Datapoints field. +// SetClass gets a reference to the given string and assigns it to the Class field. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceHostMetric) SetDatapoints(v InstanceHostMetricGetDatapointsRetType) { - setInstanceHostMetricGetDatapointsAttributeType(&o.Datapoints, v) +func (o *CloneInstanceOverrides) SetClass(v CloneInstanceOverridesGetClassRetType) { + setCloneInstanceOverridesGetClassAttributeType(&o.Class, v) } // GetName returns the Name field value if set, zero value otherwise. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceHostMetric) GetName() (res InstanceHostMetricGetNameRetType) { +func (o *CloneInstanceOverrides) GetName() (res CloneInstanceOverridesGetNameRetType) { res, _ = o.GetNameOk() return } @@ -163,105 +171,98 @@ func (o *InstanceHostMetric) GetName() (res InstanceHostMetricGetNameRetType) { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceHostMetric) GetNameOk() (ret InstanceHostMetricGetNameRetType, ok bool) { - return getInstanceHostMetricGetNameAttributeTypeOk(o.Name) +func (o *CloneInstanceOverrides) GetNameOk() (ret CloneInstanceOverridesGetNameRetType, ok bool) { + return getCloneInstanceOverridesGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceHostMetric) HasName() bool { +func (o *CloneInstanceOverrides) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceHostMetric) SetName(v InstanceHostMetricGetNameRetType) { - setInstanceHostMetricGetNameAttributeType(&o.Name, v) +func (o *CloneInstanceOverrides) SetName(v CloneInstanceOverridesGetNameRetType) { + setCloneInstanceOverridesGetNameAttributeType(&o.Name, v) } -// GetUnits returns the Units field value if set, zero value otherwise. +// GetSize returns the Size field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceHostMetric) GetUnits() (res InstanceHostMetricGetUnitsRetType) { - res, _ = o.GetUnitsOk() - return +func (o *CloneInstanceOverrides) GetSize() (ret CloneInstanceOverridesGetSizeRetType) { + ret, _ = o.GetSizeOk() + return ret } -// GetUnitsOk returns a tuple with the Units field value if set, nil otherwise +// GetSizeOk returns a tuple with the Size field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceHostMetric) GetUnitsOk() (ret InstanceHostMetricGetUnitsRetType, ok bool) { - return getInstanceHostMetricGetUnitsAttributeTypeOk(o.Units) -} - -// HasUnits returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceHostMetric) HasUnits() bool { - _, ok := o.GetUnitsOk() - return ok +func (o *CloneInstanceOverrides) GetSizeOk() (ret CloneInstanceOverridesGetSizeRetType, ok bool) { + return getCloneInstanceOverridesGetSizeAttributeTypeOk(o.Size) } -// SetUnits gets a reference to the given string and assigns it to the Units field. +// SetSize sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceHostMetric) SetUnits(v InstanceHostMetricGetUnitsRetType) { - setInstanceHostMetricGetUnitsAttributeType(&o.Units, v) +func (o *CloneInstanceOverrides) SetSize(v CloneInstanceOverridesGetSizeRetType) { + setCloneInstanceOverridesGetSizeAttributeType(&o.Size, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o InstanceHostMetric) ToMap() (map[string]interface{}, error) { +func (o CloneInstanceOverrides) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getInstanceHostMetricGetDatapointsAttributeTypeOk(o.Datapoints); ok { - toSerialize["Datapoints"] = val + if val, ok := getCloneInstanceOverridesGetClassAttributeTypeOk(o.Class); ok { + toSerialize["Class"] = val } - if val, ok := getInstanceHostMetricGetNameAttributeTypeOk(o.Name); ok { + if val, ok := getCloneInstanceOverridesGetNameAttributeTypeOk(o.Name); ok { toSerialize["Name"] = val } - if val, ok := getInstanceHostMetricGetUnitsAttributeTypeOk(o.Units); ok { - toSerialize["Units"] = val + if val, ok := getCloneInstanceOverridesGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableInstanceHostMetric struct { - value *InstanceHostMetric +type NullableCloneInstanceOverrides struct { + value *CloneInstanceOverrides isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceHostMetric) Get() *InstanceHostMetric { +func (v NullableCloneInstanceOverrides) Get() *CloneInstanceOverrides { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceHostMetric) Set(val *InstanceHostMetric) { +func (v *NullableCloneInstanceOverrides) Set(val *CloneInstanceOverrides) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceHostMetric) IsSet() bool { +func (v NullableCloneInstanceOverrides) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceHostMetric) Unset() { +func (v *NullableCloneInstanceOverrides) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableInstanceHostMetric(val *InstanceHostMetric) *NullableInstanceHostMetric { - return &NullableInstanceHostMetric{value: val, isSet: true} +func NewNullableCloneInstanceOverrides(val *CloneInstanceOverrides) *NullableCloneInstanceOverrides { + return &NullableCloneInstanceOverrides{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceHostMetric) MarshalJSON() ([]byte, error) { +func (v NullableCloneInstanceOverrides) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceHostMetric) UnmarshalJSON(src []byte) error { +func (v *NullableCloneInstanceOverrides) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_api_extension_configure_response_test.go b/services/postgresflex/model_clone_instance_overrides_test.go similarity index 63% rename from services/postgresflex/model_api_extension_configure_response_test.go rename to services/postgresflex/model_clone_instance_overrides_test.go index 51f50494d..74a76f10e 100644 --- a/services/postgresflex/model_api_extension_configure_response_test.go +++ b/services/postgresflex/model_clone_instance_overrides_test.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_clone_instance_payload.go b/services/postgresflex/model_clone_instance_payload.go index b1f3bf05c..b5671edd4 100644 --- a/services/postgresflex/model_clone_instance_payload.go +++ b/services/postgresflex/model_clone_instance_payload.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -13,54 +13,28 @@ package postgresflex import ( "encoding/json" + "time" ) // checks if the CloneInstancePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CloneInstancePayload{} /* - types and functions for class + types and functions for instanceOverrides */ -// isNotNullableString +// isModel // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CloneInstancePayloadGetClassAttributeType = *string +type CloneInstancePayloadGetInstanceOverridesAttributeType = *CloneInstanceOverrides // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCloneInstancePayloadGetClassAttributeTypeOk(arg CloneInstancePayloadGetClassAttributeType) (ret CloneInstancePayloadGetClassRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} +type CloneInstancePayloadGetInstanceOverridesArgType = CloneInstanceOverrides // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setCloneInstancePayloadGetClassAttributeType(arg *CloneInstancePayloadGetClassAttributeType, val CloneInstancePayloadGetClassRetType) { - *arg = &val -} +type CloneInstancePayloadGetInstanceOverridesRetType = CloneInstanceOverrides // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CloneInstancePayloadGetClassArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CloneInstancePayloadGetClassRetType = string - -/* - types and functions for size -*/ - -// isLong -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CloneInstancePayloadGetSizeAttributeType = *int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CloneInstancePayloadGetSizeArgType = int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CloneInstancePayloadGetSizeRetType = int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCloneInstancePayloadGetSizeAttributeTypeOk(arg CloneInstancePayloadGetSizeAttributeType) (ret CloneInstancePayloadGetSizeRetType, ok bool) { +func getCloneInstancePayloadGetInstanceOverridesAttributeTypeOk(arg CloneInstancePayloadGetInstanceOverridesAttributeType) (ret CloneInstancePayloadGetInstanceOverridesRetType, ok bool) { if arg == nil { return ret, false } @@ -68,20 +42,26 @@ func getCloneInstancePayloadGetSizeAttributeTypeOk(arg CloneInstancePayloadGetSi } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setCloneInstancePayloadGetSizeAttributeType(arg *CloneInstancePayloadGetSizeAttributeType, val CloneInstancePayloadGetSizeRetType) { +func setCloneInstancePayloadGetInstanceOverridesAttributeType(arg *CloneInstancePayloadGetInstanceOverridesAttributeType, val CloneInstancePayloadGetInstanceOverridesRetType) { *arg = &val } /* - types and functions for timestamp + types and functions for pointInTime */ -// isNotNullableString +// isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CloneInstancePayloadGetPointInTimeAttributeType = *time.Time + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CloneInstancePayloadGetTimestampAttributeType = *string +type CloneInstancePayloadGetPointInTimeArgType = time.Time // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCloneInstancePayloadGetTimestampAttributeTypeOk(arg CloneInstancePayloadGetTimestampAttributeType) (ret CloneInstancePayloadGetTimestampRetType, ok bool) { +type CloneInstancePayloadGetPointInTimeRetType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCloneInstancePayloadGetPointInTimeAttributeTypeOk(arg CloneInstancePayloadGetPointInTimeAttributeType) (ret CloneInstancePayloadGetPointInTimeRetType, ok bool) { if arg == nil { return ret, false } @@ -89,32 +69,32 @@ func getCloneInstancePayloadGetTimestampAttributeTypeOk(arg CloneInstancePayload } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setCloneInstancePayloadGetTimestampAttributeType(arg *CloneInstancePayloadGetTimestampAttributeType, val CloneInstancePayloadGetTimestampRetType) { +func setCloneInstancePayloadGetPointInTimeAttributeType(arg *CloneInstancePayloadGetPointInTimeAttributeType, val CloneInstancePayloadGetPointInTimeRetType) { *arg = &val } -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CloneInstancePayloadGetTimestampArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CloneInstancePayloadGetTimestampRetType = string - // CloneInstancePayload struct for CloneInstancePayload // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloneInstancePayload struct { - Class CloneInstancePayloadGetClassAttributeType `json:"class,omitempty"` - Size CloneInstancePayloadGetSizeAttributeType `json:"size,omitempty"` - // The timestamp should be specified in UTC time following the format provided in the example. - Timestamp CloneInstancePayloadGetTimestampAttributeType `json:"timestamp,omitempty"` + // REQUIRED + InstanceOverrides CloneInstancePayloadGetInstanceOverridesAttributeType `json:"instanceOverrides" required:"true"` + // the time for the point in time recovery it will be calculated between first backup and last backup + // REQUIRED + PointInTime CloneInstancePayloadGetPointInTimeAttributeType `json:"pointInTime" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _CloneInstancePayload CloneInstancePayload + // NewCloneInstancePayload instantiates a new CloneInstancePayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewCloneInstancePayload() *CloneInstancePayload { +func NewCloneInstancePayload(instanceOverrides CloneInstancePayloadGetInstanceOverridesArgType, pointInTime CloneInstancePayloadGetPointInTimeArgType) *CloneInstancePayload { this := CloneInstancePayload{} + setCloneInstancePayloadGetInstanceOverridesAttributeType(&this.InstanceOverrides, instanceOverrides) + setCloneInstancePayloadGetPointInTimeAttributeType(&this.PointInTime, pointInTime) return &this } @@ -127,98 +107,54 @@ func NewCloneInstancePayloadWithDefaults() *CloneInstancePayload { return &this } -// GetClass returns the Class field value if set, zero value otherwise. +// GetInstanceOverrides returns the InstanceOverrides field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CloneInstancePayload) GetClass() (res CloneInstancePayloadGetClassRetType) { - res, _ = o.GetClassOk() - return +func (o *CloneInstancePayload) GetInstanceOverrides() (ret CloneInstancePayloadGetInstanceOverridesRetType) { + ret, _ = o.GetInstanceOverridesOk() + return ret } -// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// GetInstanceOverridesOk returns a tuple with the InstanceOverrides field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CloneInstancePayload) GetClassOk() (ret CloneInstancePayloadGetClassRetType, ok bool) { - return getCloneInstancePayloadGetClassAttributeTypeOk(o.Class) +func (o *CloneInstancePayload) GetInstanceOverridesOk() (ret CloneInstancePayloadGetInstanceOverridesRetType, ok bool) { + return getCloneInstancePayloadGetInstanceOverridesAttributeTypeOk(o.InstanceOverrides) } -// HasClass returns a boolean if a field has been set. +// SetInstanceOverrides sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CloneInstancePayload) HasClass() bool { - _, ok := o.GetClassOk() - return ok +func (o *CloneInstancePayload) SetInstanceOverrides(v CloneInstancePayloadGetInstanceOverridesRetType) { + setCloneInstancePayloadGetInstanceOverridesAttributeType(&o.InstanceOverrides, v) } -// SetClass gets a reference to the given string and assigns it to the Class field. +// GetPointInTime returns the PointInTime field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CloneInstancePayload) SetClass(v CloneInstancePayloadGetClassRetType) { - setCloneInstancePayloadGetClassAttributeType(&o.Class, v) +func (o *CloneInstancePayload) GetPointInTime() (ret CloneInstancePayloadGetPointInTimeRetType) { + ret, _ = o.GetPointInTimeOk() + return ret } -// GetSize returns the Size field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CloneInstancePayload) GetSize() (res CloneInstancePayloadGetSizeRetType) { - res, _ = o.GetSizeOk() - return -} - -// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// GetPointInTimeOk returns a tuple with the PointInTime field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CloneInstancePayload) GetSizeOk() (ret CloneInstancePayloadGetSizeRetType, ok bool) { - return getCloneInstancePayloadGetSizeAttributeTypeOk(o.Size) -} - -// HasSize returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CloneInstancePayload) HasSize() bool { - _, ok := o.GetSizeOk() - return ok +func (o *CloneInstancePayload) GetPointInTimeOk() (ret CloneInstancePayloadGetPointInTimeRetType, ok bool) { + return getCloneInstancePayloadGetPointInTimeAttributeTypeOk(o.PointInTime) } -// SetSize gets a reference to the given int64 and assigns it to the Size field. +// SetPointInTime sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CloneInstancePayload) SetSize(v CloneInstancePayloadGetSizeRetType) { - setCloneInstancePayloadGetSizeAttributeType(&o.Size, v) -} - -// GetTimestamp returns the Timestamp field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CloneInstancePayload) GetTimestamp() (res CloneInstancePayloadGetTimestampRetType) { - res, _ = o.GetTimestampOk() - return -} - -// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CloneInstancePayload) GetTimestampOk() (ret CloneInstancePayloadGetTimestampRetType, ok bool) { - return getCloneInstancePayloadGetTimestampAttributeTypeOk(o.Timestamp) -} - -// HasTimestamp returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CloneInstancePayload) HasTimestamp() bool { - _, ok := o.GetTimestampOk() - return ok -} - -// SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CloneInstancePayload) SetTimestamp(v CloneInstancePayloadGetTimestampRetType) { - setCloneInstancePayloadGetTimestampAttributeType(&o.Timestamp, v) +func (o *CloneInstancePayload) SetPointInTime(v CloneInstancePayloadGetPointInTimeRetType) { + setCloneInstancePayloadGetPointInTimeAttributeType(&o.PointInTime, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CloneInstancePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getCloneInstancePayloadGetClassAttributeTypeOk(o.Class); ok { - toSerialize["Class"] = val - } - if val, ok := getCloneInstancePayloadGetSizeAttributeTypeOk(o.Size); ok { - toSerialize["Size"] = val + if val, ok := getCloneInstancePayloadGetInstanceOverridesAttributeTypeOk(o.InstanceOverrides); ok { + toSerialize["InstanceOverrides"] = val } - if val, ok := getCloneInstancePayloadGetTimestampAttributeTypeOk(o.Timestamp); ok { - toSerialize["Timestamp"] = val + if val, ok := getCloneInstancePayloadGetPointInTimeAttributeTypeOk(o.PointInTime); ok { + toSerialize["PointInTime"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_clone_instance_payload_test.go b/services/postgresflex/model_clone_instance_payload_test.go index 51f50494d..74a76f10e 100644 --- a/services/postgresflex/model_clone_instance_payload_test.go +++ b/services/postgresflex/model_clone_instance_payload_test.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_clone_instance_response.go b/services/postgresflex/model_clone_instance_response.go index 317811079..758d9c523 100644 --- a/services/postgresflex/model_clone_instance_response.go +++ b/services/postgresflex/model_clone_instance_response.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,15 +19,15 @@ import ( var _ MappedNullable = &CloneInstanceResponse{} /* - types and functions for instanceId + types and functions for id */ // isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CloneInstanceResponseGetInstanceIdAttributeType = *string +type CloneInstanceResponseGetIdAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCloneInstanceResponseGetInstanceIdAttributeTypeOk(arg CloneInstanceResponseGetInstanceIdAttributeType) (ret CloneInstanceResponseGetInstanceIdRetType, ok bool) { +func getCloneInstanceResponseGetIdAttributeTypeOk(arg CloneInstanceResponseGetIdAttributeType) (ret CloneInstanceResponseGetIdRetType, ok bool) { if arg == nil { return ret, false } @@ -35,29 +35,35 @@ func getCloneInstanceResponseGetInstanceIdAttributeTypeOk(arg CloneInstanceRespo } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setCloneInstanceResponseGetInstanceIdAttributeType(arg *CloneInstanceResponseGetInstanceIdAttributeType, val CloneInstanceResponseGetInstanceIdRetType) { +func setCloneInstanceResponseGetIdAttributeType(arg *CloneInstanceResponseGetIdAttributeType, val CloneInstanceResponseGetIdRetType) { *arg = &val } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CloneInstanceResponseGetInstanceIdArgType = string +type CloneInstanceResponseGetIdArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CloneInstanceResponseGetInstanceIdRetType = string +type CloneInstanceResponseGetIdRetType = string // CloneInstanceResponse struct for CloneInstanceResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloneInstanceResponse struct { - InstanceId CloneInstanceResponseGetInstanceIdAttributeType `json:"instanceId,omitempty"` + // The ID of the instance. + // REQUIRED + Id CloneInstanceResponseGetIdAttributeType `json:"id" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _CloneInstanceResponse CloneInstanceResponse + // NewCloneInstanceResponse instantiates a new CloneInstanceResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewCloneInstanceResponse() *CloneInstanceResponse { +func NewCloneInstanceResponse(id CloneInstanceResponseGetIdArgType) *CloneInstanceResponse { this := CloneInstanceResponse{} + setCloneInstanceResponseGetIdAttributeType(&this.Id, id) return &this } @@ -70,38 +76,31 @@ func NewCloneInstanceResponseWithDefaults() *CloneInstanceResponse { return &this } -// GetInstanceId returns the InstanceId field value if set, zero value otherwise. +// GetId returns the Id field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CloneInstanceResponse) GetInstanceId() (res CloneInstanceResponseGetInstanceIdRetType) { - res, _ = o.GetInstanceIdOk() - return +func (o *CloneInstanceResponse) GetId() (ret CloneInstanceResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } -// GetInstanceIdOk returns a tuple with the InstanceId field value if set, nil otherwise +// GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CloneInstanceResponse) GetInstanceIdOk() (ret CloneInstanceResponseGetInstanceIdRetType, ok bool) { - return getCloneInstanceResponseGetInstanceIdAttributeTypeOk(o.InstanceId) -} - -// HasInstanceId returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CloneInstanceResponse) HasInstanceId() bool { - _, ok := o.GetInstanceIdOk() - return ok +func (o *CloneInstanceResponse) GetIdOk() (ret CloneInstanceResponseGetIdRetType, ok bool) { + return getCloneInstanceResponseGetIdAttributeTypeOk(o.Id) } -// SetInstanceId gets a reference to the given string and assigns it to the InstanceId field. +// SetId sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CloneInstanceResponse) SetInstanceId(v CloneInstanceResponseGetInstanceIdRetType) { - setCloneInstanceResponseGetInstanceIdAttributeType(&o.InstanceId, v) +func (o *CloneInstanceResponse) SetId(v CloneInstanceResponseGetIdRetType) { + setCloneInstanceResponseGetIdAttributeType(&o.Id, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CloneInstanceResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getCloneInstanceResponseGetInstanceIdAttributeTypeOk(o.InstanceId); ok { - toSerialize["InstanceId"] = val + if val, ok := getCloneInstanceResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_clone_instance_response_test.go b/services/postgresflex/model_clone_instance_response_test.go index 51f50494d..74a76f10e 100644 --- a/services/postgresflex/model_clone_instance_response_test.go +++ b/services/postgresflex/model_clone_instance_response_test.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_create_database_payload.go b/services/postgresflex/model_create_database_payload.go index 7956b9c71..5ab5f3435 100644 --- a/services/postgresflex/model_create_database_payload.go +++ b/services/postgresflex/model_create_database_payload.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -46,21 +46,15 @@ type CreateDatabasePayloadGetNameArgType = string type CreateDatabasePayloadGetNameRetType = string /* - types and functions for options + types and functions for owner */ -// isContainer -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateDatabasePayloadGetOptionsAttributeType = *map[string]string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateDatabasePayloadGetOptionsArgType = map[string]string - +// isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateDatabasePayloadGetOptionsRetType = map[string]string +type CreateDatabasePayloadGetOwnerAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCreateDatabasePayloadGetOptionsAttributeTypeOk(arg CreateDatabasePayloadGetOptionsAttributeType) (ret CreateDatabasePayloadGetOptionsRetType, ok bool) { +func getCreateDatabasePayloadGetOwnerAttributeTypeOk(arg CreateDatabasePayloadGetOwnerAttributeType) (ret CreateDatabasePayloadGetOwnerRetType, ok bool) { if arg == nil { return ret, false } @@ -68,25 +62,37 @@ func getCreateDatabasePayloadGetOptionsAttributeTypeOk(arg CreateDatabasePayload } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setCreateDatabasePayloadGetOptionsAttributeType(arg *CreateDatabasePayloadGetOptionsAttributeType, val CreateDatabasePayloadGetOptionsRetType) { +func setCreateDatabasePayloadGetOwnerAttributeType(arg *CreateDatabasePayloadGetOwnerAttributeType, val CreateDatabasePayloadGetOwnerRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateDatabasePayloadGetOwnerArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateDatabasePayloadGetOwnerRetType = string + // CreateDatabasePayload struct for CreateDatabasePayload // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDatabasePayload struct { - Name CreateDatabasePayloadGetNameAttributeType `json:"name,omitempty"` - // Database specific options - Options CreateDatabasePayloadGetOptionsAttributeType `json:"options,omitempty"` + // The name of the database. + // REQUIRED + Name CreateDatabasePayloadGetNameAttributeType `json:"name" required:"true"` + // The owner of the database. + Owner CreateDatabasePayloadGetOwnerAttributeType `json:"owner,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _CreateDatabasePayload CreateDatabasePayload + // NewCreateDatabasePayload instantiates a new CreateDatabasePayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewCreateDatabasePayload() *CreateDatabasePayload { +func NewCreateDatabasePayload(name CreateDatabasePayloadGetNameArgType) *CreateDatabasePayload { this := CreateDatabasePayload{} + setCreateDatabasePayloadGetNameAttributeType(&this.Name, name) return &this } @@ -99,58 +105,51 @@ func NewCreateDatabasePayloadWithDefaults() *CreateDatabasePayload { return &this } -// GetName returns the Name field value if set, zero value otherwise. +// GetName returns the Name field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateDatabasePayload) GetName() (res CreateDatabasePayloadGetNameRetType) { - res, _ = o.GetNameOk() - return +func (o *CreateDatabasePayload) GetName() (ret CreateDatabasePayloadGetNameRetType) { + ret, _ = o.GetNameOk() + return ret } -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDatabasePayload) GetNameOk() (ret CreateDatabasePayloadGetNameRetType, ok bool) { return getCreateDatabasePayloadGetNameAttributeTypeOk(o.Name) } -// HasName returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateDatabasePayload) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. +// SetName sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDatabasePayload) SetName(v CreateDatabasePayloadGetNameRetType) { setCreateDatabasePayloadGetNameAttributeType(&o.Name, v) } -// GetOptions returns the Options field value if set, zero value otherwise. +// GetOwner returns the Owner field value if set, zero value otherwise. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateDatabasePayload) GetOptions() (res CreateDatabasePayloadGetOptionsRetType) { - res, _ = o.GetOptionsOk() +func (o *CreateDatabasePayload) GetOwner() (res CreateDatabasePayloadGetOwnerRetType) { + res, _ = o.GetOwnerOk() return } -// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateDatabasePayload) GetOptionsOk() (ret CreateDatabasePayloadGetOptionsRetType, ok bool) { - return getCreateDatabasePayloadGetOptionsAttributeTypeOk(o.Options) +func (o *CreateDatabasePayload) GetOwnerOk() (ret CreateDatabasePayloadGetOwnerRetType, ok bool) { + return getCreateDatabasePayloadGetOwnerAttributeTypeOk(o.Owner) } -// HasOptions returns a boolean if a field has been set. +// HasOwner returns a boolean if a field has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateDatabasePayload) HasOptions() bool { - _, ok := o.GetOptionsOk() +func (o *CreateDatabasePayload) HasOwner() bool { + _, ok := o.GetOwnerOk() return ok } -// SetOptions gets a reference to the given map[string]string and assigns it to the Options field. +// SetOwner gets a reference to the given string and assigns it to the Owner field. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateDatabasePayload) SetOptions(v CreateDatabasePayloadGetOptionsRetType) { - setCreateDatabasePayloadGetOptionsAttributeType(&o.Options, v) +func (o *CreateDatabasePayload) SetOwner(v CreateDatabasePayloadGetOwnerRetType) { + setCreateDatabasePayloadGetOwnerAttributeType(&o.Owner, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -159,8 +158,8 @@ func (o CreateDatabasePayload) ToMap() (map[string]interface{}, error) { if val, ok := getCreateDatabasePayloadGetNameAttributeTypeOk(o.Name); ok { toSerialize["Name"] = val } - if val, ok := getCreateDatabasePayloadGetOptionsAttributeTypeOk(o.Options); ok { - toSerialize["Options"] = val + if val, ok := getCreateDatabasePayloadGetOwnerAttributeTypeOk(o.Owner); ok { + toSerialize["Owner"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_create_database_payload_test.go b/services/postgresflex/model_create_database_payload_test.go index 51f50494d..74a76f10e 100644 --- a/services/postgresflex/model_create_database_payload_test.go +++ b/services/postgresflex/model_create_database_payload_test.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_instance_response.go b/services/postgresflex/model_create_database_response.go similarity index 57% rename from services/postgresflex/model_instance_response.go rename to services/postgresflex/model_create_database_response.go index 39aa53cb7..40d56a234 100644 --- a/services/postgresflex/model_instance_response.go +++ b/services/postgresflex/model_create_database_response.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,25 +15,25 @@ import ( "encoding/json" ) -// checks if the InstanceResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &InstanceResponse{} +// checks if the CreateDatabaseResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateDatabaseResponse{} /* - types and functions for item + types and functions for id */ -// isModel +// isLong // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceResponseGetItemAttributeType = *Instance +type CreateDatabaseResponseGetIdAttributeType = *int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceResponseGetItemArgType = Instance +type CreateDatabaseResponseGetIdArgType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceResponseGetItemRetType = Instance +type CreateDatabaseResponseGetIdRetType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceResponseGetItemAttributeTypeOk(arg InstanceResponseGetItemAttributeType) (ret InstanceResponseGetItemRetType, ok bool) { +func getCreateDatabaseResponseGetIdAttributeTypeOk(arg CreateDatabaseResponseGetIdAttributeType) (ret CreateDatabaseResponseGetIdRetType, ok bool) { if arg == nil { return ret, false } @@ -41,111 +41,110 @@ func getInstanceResponseGetItemAttributeTypeOk(arg InstanceResponseGetItemAttrib } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceResponseGetItemAttributeType(arg *InstanceResponseGetItemAttributeType, val InstanceResponseGetItemRetType) { +func setCreateDatabaseResponseGetIdAttributeType(arg *CreateDatabaseResponseGetIdAttributeType, val CreateDatabaseResponseGetIdRetType) { *arg = &val } -// InstanceResponse struct for InstanceResponse +// CreateDatabaseResponse struct for CreateDatabaseResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceResponse struct { - Item InstanceResponseGetItemAttributeType `json:"item,omitempty"` +type CreateDatabaseResponse struct { + // The id of the database. + // REQUIRED + Id CreateDatabaseResponseGetIdAttributeType `json:"id" required:"true"` } -// NewInstanceResponse instantiates a new InstanceResponse object +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _CreateDatabaseResponse CreateDatabaseResponse + +// NewCreateDatabaseResponse instantiates a new CreateDatabaseResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewInstanceResponse() *InstanceResponse { - this := InstanceResponse{} +func NewCreateDatabaseResponse(id CreateDatabaseResponseGetIdArgType) *CreateDatabaseResponse { + this := CreateDatabaseResponse{} + setCreateDatabaseResponseGetIdAttributeType(&this.Id, id) return &this } -// NewInstanceResponseWithDefaults instantiates a new InstanceResponse object +// NewCreateDatabaseResponseWithDefaults instantiates a new CreateDatabaseResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewInstanceResponseWithDefaults() *InstanceResponse { - this := InstanceResponse{} +func NewCreateDatabaseResponseWithDefaults() *CreateDatabaseResponse { + this := CreateDatabaseResponse{} return &this } -// GetItem returns the Item field value if set, zero value otherwise. +// GetId returns the Id field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceResponse) GetItem() (res InstanceResponseGetItemRetType) { - res, _ = o.GetItemOk() - return +func (o *CreateDatabaseResponse) GetId() (ret CreateDatabaseResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } -// GetItemOk returns a tuple with the Item field value if set, nil otherwise +// GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceResponse) GetItemOk() (ret InstanceResponseGetItemRetType, ok bool) { - return getInstanceResponseGetItemAttributeTypeOk(o.Item) -} - -// HasItem returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceResponse) HasItem() bool { - _, ok := o.GetItemOk() - return ok +func (o *CreateDatabaseResponse) GetIdOk() (ret CreateDatabaseResponseGetIdRetType, ok bool) { + return getCreateDatabaseResponseGetIdAttributeTypeOk(o.Id) } -// SetItem gets a reference to the given Instance and assigns it to the Item field. +// SetId sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceResponse) SetItem(v InstanceResponseGetItemRetType) { - setInstanceResponseGetItemAttributeType(&o.Item, v) +func (o *CreateDatabaseResponse) SetId(v CreateDatabaseResponseGetIdRetType) { + setCreateDatabaseResponseGetIdAttributeType(&o.Id, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o InstanceResponse) ToMap() (map[string]interface{}, error) { +func (o CreateDatabaseResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getInstanceResponseGetItemAttributeTypeOk(o.Item); ok { - toSerialize["Item"] = val + if val, ok := getCreateDatabaseResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableInstanceResponse struct { - value *InstanceResponse +type NullableCreateDatabaseResponse struct { + value *CreateDatabaseResponse isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceResponse) Get() *InstanceResponse { +func (v NullableCreateDatabaseResponse) Get() *CreateDatabaseResponse { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceResponse) Set(val *InstanceResponse) { +func (v *NullableCreateDatabaseResponse) Set(val *CreateDatabaseResponse) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceResponse) IsSet() bool { +func (v NullableCreateDatabaseResponse) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceResponse) Unset() { +func (v *NullableCreateDatabaseResponse) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableInstanceResponse(val *InstanceResponse) *NullableInstanceResponse { - return &NullableInstanceResponse{value: val, isSet: true} +func NewNullableCreateDatabaseResponse(val *CreateDatabaseResponse) *NullableCreateDatabaseResponse { + return &NullableCreateDatabaseResponse{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceResponse) MarshalJSON() ([]byte, error) { +func (v NullableCreateDatabaseResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceResponse) UnmarshalJSON(src []byte) error { +func (v *NullableCreateDatabaseResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_api_configuration_test.go b/services/postgresflex/model_create_database_response_test.go similarity index 63% rename from services/postgresflex/model_api_configuration_test.go rename to services/postgresflex/model_create_database_response_test.go index 51f50494d..74a76f10e 100644 --- a/services/postgresflex/model_api_configuration_test.go +++ b/services/postgresflex/model_create_database_response_test.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_create_instance_payload.go b/services/postgresflex/model_create_instance_payload.go index 67ec299f8..725f3af94 100644 --- a/services/postgresflex/model_create_instance_payload.go +++ b/services/postgresflex/model_create_instance_payload.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,21 +19,15 @@ import ( var _ MappedNullable = &CreateInstancePayload{} /* - types and functions for acl + types and functions for backupSchedule */ -// isModel -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetAclAttributeType = *ACL - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetAclArgType = ACL - +// isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetAclRetType = ACL +type CreateInstancePayloadGetBackupScheduleAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCreateInstancePayloadGetAclAttributeTypeOk(arg CreateInstancePayloadGetAclAttributeType) (ret CreateInstancePayloadGetAclRetType, ok bool) { +func getCreateInstancePayloadGetBackupScheduleAttributeTypeOk(arg CreateInstancePayloadGetBackupScheduleAttributeType) (ret CreateInstancePayloadGetBackupScheduleRetType, ok bool) { if arg == nil { return ret, false } @@ -41,20 +35,32 @@ func getCreateInstancePayloadGetAclAttributeTypeOk(arg CreateInstancePayloadGetA } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setCreateInstancePayloadGetAclAttributeType(arg *CreateInstancePayloadGetAclAttributeType, val CreateInstancePayloadGetAclRetType) { +func setCreateInstancePayloadGetBackupScheduleAttributeType(arg *CreateInstancePayloadGetBackupScheduleAttributeType, val CreateInstancePayloadGetBackupScheduleRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateInstancePayloadGetBackupScheduleArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateInstancePayloadGetBackupScheduleRetType = string + /* - types and functions for backupSchedule + types and functions for encryption */ -// isNotNullableString +// isModel // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetBackupScheduleAttributeType = *string +type CreateInstancePayloadGetEncryptionAttributeType = *InstanceEncryption // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCreateInstancePayloadGetBackupScheduleAttributeTypeOk(arg CreateInstancePayloadGetBackupScheduleAttributeType) (ret CreateInstancePayloadGetBackupScheduleRetType, ok bool) { +type CreateInstancePayloadGetEncryptionArgType = InstanceEncryption + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateInstancePayloadGetEncryptionRetType = InstanceEncryption + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateInstancePayloadGetEncryptionAttributeTypeOk(arg CreateInstancePayloadGetEncryptionAttributeType) (ret CreateInstancePayloadGetEncryptionRetType, ok bool) { if arg == nil { return ret, false } @@ -62,16 +68,10 @@ func getCreateInstancePayloadGetBackupScheduleAttributeTypeOk(arg CreateInstance } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setCreateInstancePayloadGetBackupScheduleAttributeType(arg *CreateInstancePayloadGetBackupScheduleAttributeType, val CreateInstancePayloadGetBackupScheduleRetType) { +func setCreateInstancePayloadGetEncryptionAttributeType(arg *CreateInstancePayloadGetEncryptionAttributeType, val CreateInstancePayloadGetEncryptionRetType) { *arg = &val } -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetBackupScheduleArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetBackupScheduleRetType = string - /* types and functions for flavorId */ @@ -154,21 +154,21 @@ type CreateInstancePayloadGetNameArgType = string type CreateInstancePayloadGetNameRetType = string /* - types and functions for options + types and functions for network */ -// isContainer +// isModel // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetOptionsAttributeType = *map[string]string +type CreateInstancePayloadGetNetworkAttributeType = *InstanceNetworkCreate // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetOptionsArgType = map[string]string +type CreateInstancePayloadGetNetworkArgType = InstanceNetworkCreate // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetOptionsRetType = map[string]string +type CreateInstancePayloadGetNetworkRetType = InstanceNetworkCreate // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCreateInstancePayloadGetOptionsAttributeTypeOk(arg CreateInstancePayloadGetOptionsAttributeType) (ret CreateInstancePayloadGetOptionsRetType, ok bool) { +func getCreateInstancePayloadGetNetworkAttributeTypeOk(arg CreateInstancePayloadGetNetworkAttributeType) (ret CreateInstancePayloadGetNetworkRetType, ok bool) { if arg == nil { return ret, false } @@ -176,35 +176,35 @@ func getCreateInstancePayloadGetOptionsAttributeTypeOk(arg CreateInstancePayload } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setCreateInstancePayloadGetOptionsAttributeType(arg *CreateInstancePayloadGetOptionsAttributeType, val CreateInstancePayloadGetOptionsRetType) { +func setCreateInstancePayloadGetNetworkAttributeType(arg *CreateInstancePayloadGetNetworkAttributeType, val CreateInstancePayloadGetNetworkRetType) { *arg = &val } /* - types and functions for replicas + types and functions for retentionDays */ // isInteger // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetReplicasAttributeType = *int64 +type CreateInstancePayloadGetRetentionDaysAttributeType = *int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetReplicasArgType = int64 +type CreateInstancePayloadGetRetentionDaysArgType = *int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetReplicasRetType = int64 +type CreateInstancePayloadGetRetentionDaysRetType = *int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCreateInstancePayloadGetReplicasAttributeTypeOk(arg CreateInstancePayloadGetReplicasAttributeType) (ret CreateInstancePayloadGetReplicasRetType, ok bool) { +func getCreateInstancePayloadGetRetentionDaysAttributeTypeOk(arg CreateInstancePayloadGetRetentionDaysAttributeType) (ret CreateInstancePayloadGetRetentionDaysRetType, ok bool) { if arg == nil { - return ret, false + return nil, false } - return *arg, true + return arg, true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setCreateInstancePayloadGetReplicasAttributeType(arg *CreateInstancePayloadGetReplicasAttributeType, val CreateInstancePayloadGetReplicasRetType) { - *arg = &val +func setCreateInstancePayloadGetRetentionDaysAttributeType(arg *CreateInstancePayloadGetRetentionDaysAttributeType, val CreateInstancePayloadGetRetentionDaysRetType) { + *arg = val } /* @@ -213,13 +213,13 @@ func setCreateInstancePayloadGetReplicasAttributeType(arg *CreateInstancePayload // isModel // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetStorageAttributeType = *Storage +type CreateInstancePayloadGetStorageAttributeType = *StorageCreate // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetStorageArgType = Storage +type CreateInstancePayloadGetStorageArgType = StorageCreate // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetStorageRetType = Storage +type CreateInstancePayloadGetStorageRetType = StorageCreate // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateInstancePayloadGetStorageAttributeTypeOk(arg CreateInstancePayloadGetStorageAttributeType) (ret CreateInstancePayloadGetStorageRetType, ok bool) { @@ -264,23 +264,27 @@ type CreateInstancePayloadGetVersionRetType = string // CreateInstancePayload struct for CreateInstancePayload // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayload struct { - // REQUIRED - Acl CreateInstancePayloadGetAclAttributeType `json:"acl" required:"true"` + // 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. // REQUIRED BackupSchedule CreateInstancePayloadGetBackupScheduleAttributeType `json:"backupSchedule" required:"true"` + Encryption CreateInstancePayloadGetEncryptionAttributeType `json:"encryption,omitempty"` + // The id of the instance flavor. // REQUIRED FlavorId CreateInstancePayloadGetFlavorIdAttributeType `json:"flavorId" required:"true"` - // Labels field is not certain/clear + // 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. Labels CreateInstancePayloadGetLabelsAttributeType `json:"labels,omitempty"` + // The name of the instance. // REQUIRED Name CreateInstancePayloadGetNameAttributeType `json:"name" required:"true"` // REQUIRED - Options CreateInstancePayloadGetOptionsAttributeType `json:"options" required:"true"` + Network CreateInstancePayloadGetNetworkAttributeType `json:"network" required:"true"` + // How long backups are retained. The value can only be between 32 and 90 days. // Can be cast to int32 without loss of precision. // REQUIRED - Replicas CreateInstancePayloadGetReplicasAttributeType `json:"replicas" required:"true"` + RetentionDays CreateInstancePayloadGetRetentionDaysAttributeType `json:"retentionDays" required:"true"` // REQUIRED Storage CreateInstancePayloadGetStorageAttributeType `json:"storage" required:"true"` + // The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3#tag/Version) for supported version parameters. // REQUIRED Version CreateInstancePayloadGetVersionAttributeType `json:"version" required:"true"` } @@ -293,14 +297,13 @@ type _CreateInstancePayload CreateInstancePayload // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewCreateInstancePayload(acl CreateInstancePayloadGetAclArgType, backupSchedule CreateInstancePayloadGetBackupScheduleArgType, flavorId CreateInstancePayloadGetFlavorIdArgType, name CreateInstancePayloadGetNameArgType, options CreateInstancePayloadGetOptionsArgType, replicas CreateInstancePayloadGetReplicasArgType, storage CreateInstancePayloadGetStorageArgType, version CreateInstancePayloadGetVersionArgType) *CreateInstancePayload { +func NewCreateInstancePayload(backupSchedule CreateInstancePayloadGetBackupScheduleArgType, flavorId CreateInstancePayloadGetFlavorIdArgType, name CreateInstancePayloadGetNameArgType, network CreateInstancePayloadGetNetworkArgType, retentionDays CreateInstancePayloadGetRetentionDaysArgType, storage CreateInstancePayloadGetStorageArgType, version CreateInstancePayloadGetVersionArgType) *CreateInstancePayload { this := CreateInstancePayload{} - setCreateInstancePayloadGetAclAttributeType(&this.Acl, acl) setCreateInstancePayloadGetBackupScheduleAttributeType(&this.BackupSchedule, backupSchedule) setCreateInstancePayloadGetFlavorIdAttributeType(&this.FlavorId, flavorId) setCreateInstancePayloadGetNameAttributeType(&this.Name, name) - setCreateInstancePayloadGetOptionsAttributeType(&this.Options, options) - setCreateInstancePayloadGetReplicasAttributeType(&this.Replicas, replicas) + setCreateInstancePayloadGetNetworkAttributeType(&this.Network, network) + setCreateInstancePayloadGetRetentionDaysAttributeType(&this.RetentionDays, retentionDays) setCreateInstancePayloadGetStorageAttributeType(&this.Storage, storage) setCreateInstancePayloadGetVersionAttributeType(&this.Version, version) return &this @@ -315,44 +318,51 @@ func NewCreateInstancePayloadWithDefaults() *CreateInstancePayload { return &this } -// GetAcl returns the Acl field value +// GetBackupSchedule returns the BackupSchedule field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstancePayload) GetAcl() (ret CreateInstancePayloadGetAclRetType) { - ret, _ = o.GetAclOk() +func (o *CreateInstancePayload) GetBackupSchedule() (ret CreateInstancePayloadGetBackupScheduleRetType) { + ret, _ = o.GetBackupScheduleOk() return ret } -// GetAclOk returns a tuple with the Acl field value +// GetBackupScheduleOk returns a tuple with the BackupSchedule field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstancePayload) GetAclOk() (ret CreateInstancePayloadGetAclRetType, ok bool) { - return getCreateInstancePayloadGetAclAttributeTypeOk(o.Acl) +func (o *CreateInstancePayload) GetBackupScheduleOk() (ret CreateInstancePayloadGetBackupScheduleRetType, ok bool) { + return getCreateInstancePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule) } -// SetAcl sets field value +// SetBackupSchedule sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstancePayload) SetAcl(v CreateInstancePayloadGetAclRetType) { - setCreateInstancePayloadGetAclAttributeType(&o.Acl, v) +func (o *CreateInstancePayload) SetBackupSchedule(v CreateInstancePayloadGetBackupScheduleRetType) { + setCreateInstancePayloadGetBackupScheduleAttributeType(&o.BackupSchedule, v) } -// GetBackupSchedule returns the BackupSchedule field value +// GetEncryption returns the Encryption field value if set, zero value otherwise. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstancePayload) GetBackupSchedule() (ret CreateInstancePayloadGetBackupScheduleRetType) { - ret, _ = o.GetBackupScheduleOk() - return ret +func (o *CreateInstancePayload) GetEncryption() (res CreateInstancePayloadGetEncryptionRetType) { + res, _ = o.GetEncryptionOk() + return } -// GetBackupScheduleOk returns a tuple with the BackupSchedule field value +// GetEncryptionOk returns a tuple with the Encryption field value if set, nil otherwise // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstancePayload) GetBackupScheduleOk() (ret CreateInstancePayloadGetBackupScheduleRetType, ok bool) { - return getCreateInstancePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule) +func (o *CreateInstancePayload) GetEncryptionOk() (ret CreateInstancePayloadGetEncryptionRetType, ok bool) { + return getCreateInstancePayloadGetEncryptionAttributeTypeOk(o.Encryption) } -// SetBackupSchedule sets field value +// HasEncryption returns a boolean if a field has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstancePayload) SetBackupSchedule(v CreateInstancePayloadGetBackupScheduleRetType) { - setCreateInstancePayloadGetBackupScheduleAttributeType(&o.BackupSchedule, v) +func (o *CreateInstancePayload) HasEncryption() bool { + _, ok := o.GetEncryptionOk() + return ok +} + +// SetEncryption gets a reference to the given InstanceEncryption and assigns it to the Encryption field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateInstancePayload) SetEncryption(v CreateInstancePayloadGetEncryptionRetType) { + setCreateInstancePayloadGetEncryptionAttributeType(&o.Encryption, v) } // GetFlavorId returns the FlavorId field value @@ -422,44 +432,46 @@ func (o *CreateInstancePayload) SetName(v CreateInstancePayloadGetNameRetType) { setCreateInstancePayloadGetNameAttributeType(&o.Name, v) } -// GetOptions returns the Options field value +// GetNetwork returns the Network field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstancePayload) GetOptions() (ret CreateInstancePayloadGetOptionsRetType) { - ret, _ = o.GetOptionsOk() +func (o *CreateInstancePayload) GetNetwork() (ret CreateInstancePayloadGetNetworkRetType) { + ret, _ = o.GetNetworkOk() return ret } -// GetOptionsOk returns a tuple with the Options field value +// GetNetworkOk returns a tuple with the Network field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstancePayload) GetOptionsOk() (ret CreateInstancePayloadGetOptionsRetType, ok bool) { - return getCreateInstancePayloadGetOptionsAttributeTypeOk(o.Options) +func (o *CreateInstancePayload) GetNetworkOk() (ret CreateInstancePayloadGetNetworkRetType, ok bool) { + return getCreateInstancePayloadGetNetworkAttributeTypeOk(o.Network) } -// SetOptions sets field value +// SetNetwork sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstancePayload) SetOptions(v CreateInstancePayloadGetOptionsRetType) { - setCreateInstancePayloadGetOptionsAttributeType(&o.Options, v) +func (o *CreateInstancePayload) SetNetwork(v CreateInstancePayloadGetNetworkRetType) { + setCreateInstancePayloadGetNetworkAttributeType(&o.Network, v) } -// GetReplicas returns the Replicas field value +// GetRetentionDays returns the RetentionDays field value +// If the value is explicit nil, the zero value for int32 will be returned // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstancePayload) GetReplicas() (ret CreateInstancePayloadGetReplicasRetType) { - ret, _ = o.GetReplicasOk() +func (o *CreateInstancePayload) GetRetentionDays() (ret CreateInstancePayloadGetRetentionDaysRetType) { + ret, _ = o.GetRetentionDaysOk() return ret } -// GetReplicasOk returns a tuple with the Replicas field value +// GetRetentionDaysOk returns a tuple with the RetentionDays field value // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstancePayload) GetReplicasOk() (ret CreateInstancePayloadGetReplicasRetType, ok bool) { - return getCreateInstancePayloadGetReplicasAttributeTypeOk(o.Replicas) +func (o *CreateInstancePayload) GetRetentionDaysOk() (ret CreateInstancePayloadGetRetentionDaysRetType, ok bool) { + return getCreateInstancePayloadGetRetentionDaysAttributeTypeOk(o.RetentionDays) } -// SetReplicas sets field value +// SetRetentionDays sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstancePayload) SetReplicas(v CreateInstancePayloadGetReplicasRetType) { - setCreateInstancePayloadGetReplicasAttributeType(&o.Replicas, v) +func (o *CreateInstancePayload) SetRetentionDays(v CreateInstancePayloadGetRetentionDaysRetType) { + setCreateInstancePayloadGetRetentionDaysAttributeType(&o.RetentionDays, v) } // GetStorage returns the Storage field value @@ -505,12 +517,12 @@ func (o *CreateInstancePayload) SetVersion(v CreateInstancePayloadGetVersionRetT // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateInstancePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getCreateInstancePayloadGetAclAttributeTypeOk(o.Acl); ok { - toSerialize["Acl"] = val - } if val, ok := getCreateInstancePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule); ok { toSerialize["BackupSchedule"] = val } + if val, ok := getCreateInstancePayloadGetEncryptionAttributeTypeOk(o.Encryption); ok { + toSerialize["Encryption"] = val + } if val, ok := getCreateInstancePayloadGetFlavorIdAttributeTypeOk(o.FlavorId); ok { toSerialize["FlavorId"] = val } @@ -520,11 +532,11 @@ func (o CreateInstancePayload) ToMap() (map[string]interface{}, error) { if val, ok := getCreateInstancePayloadGetNameAttributeTypeOk(o.Name); ok { toSerialize["Name"] = val } - if val, ok := getCreateInstancePayloadGetOptionsAttributeTypeOk(o.Options); ok { - toSerialize["Options"] = val + if val, ok := getCreateInstancePayloadGetNetworkAttributeTypeOk(o.Network); ok { + toSerialize["Network"] = val } - if val, ok := getCreateInstancePayloadGetReplicasAttributeTypeOk(o.Replicas); ok { - toSerialize["Replicas"] = val + if val, ok := getCreateInstancePayloadGetRetentionDaysAttributeTypeOk(o.RetentionDays); ok { + toSerialize["RetentionDays"] = val } if val, ok := getCreateInstancePayloadGetStorageAttributeTypeOk(o.Storage); ok { toSerialize["Storage"] = val diff --git a/services/postgresflex/model_create_instance_payload_test.go b/services/postgresflex/model_create_instance_payload_test.go index 51f50494d..74a76f10e 100644 --- a/services/postgresflex/model_create_instance_payload_test.go +++ b/services/postgresflex/model_create_instance_payload_test.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_create_instance_response.go b/services/postgresflex/model_create_instance_response.go index 0237cc054..405ec8e30 100644 --- a/services/postgresflex/model_create_instance_response.go +++ b/services/postgresflex/model_create_instance_response.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -48,16 +48,22 @@ type CreateInstanceResponseGetIdRetType = string // CreateInstanceResponse struct for CreateInstanceResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstanceResponse struct { - Id CreateInstanceResponseGetIdAttributeType `json:"id,omitempty"` + // The ID of the instance. + // REQUIRED + Id CreateInstanceResponseGetIdAttributeType `json:"id" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _CreateInstanceResponse CreateInstanceResponse + // NewCreateInstanceResponse instantiates a new CreateInstanceResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewCreateInstanceResponse() *CreateInstanceResponse { +func NewCreateInstanceResponse(id CreateInstanceResponseGetIdArgType) *CreateInstanceResponse { this := CreateInstanceResponse{} + setCreateInstanceResponseGetIdAttributeType(&this.Id, id) return &this } @@ -70,28 +76,21 @@ func NewCreateInstanceResponseWithDefaults() *CreateInstanceResponse { return &this } -// GetId returns the Id field value if set, zero value otherwise. +// GetId returns the Id field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstanceResponse) GetId() (res CreateInstanceResponseGetIdRetType) { - res, _ = o.GetIdOk() - return +func (o *CreateInstanceResponse) GetId() (ret CreateInstanceResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } -// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstanceResponse) GetIdOk() (ret CreateInstanceResponseGetIdRetType, ok bool) { return getCreateInstanceResponseGetIdAttributeTypeOk(o.Id) } -// HasId returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstanceResponse) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. +// SetId sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstanceResponse) SetId(v CreateInstanceResponseGetIdRetType) { setCreateInstanceResponseGetIdAttributeType(&o.Id, v) diff --git a/services/postgresflex/model_create_instance_response_test.go b/services/postgresflex/model_create_instance_response_test.go index 51f50494d..74a76f10e 100644 --- a/services/postgresflex/model_create_instance_response_test.go +++ b/services/postgresflex/model_create_instance_response_test.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_create_user_payload.go b/services/postgresflex/model_create_user_payload.go index 06f461801..c94ad7829 100644 --- a/services/postgresflex/model_create_user_payload.go +++ b/services/postgresflex/model_create_user_payload.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,21 +19,15 @@ import ( var _ MappedNullable = &CreateUserPayload{} /* - types and functions for roles + types and functions for name */ -// isArray -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateUserPayloadGetRolesAttributeType = *[]string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateUserPayloadGetRolesArgType = []string - +// isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateUserPayloadGetRolesRetType = []string +type CreateUserPayloadGetNameAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCreateUserPayloadGetRolesAttributeTypeOk(arg CreateUserPayloadGetRolesAttributeType) (ret CreateUserPayloadGetRolesRetType, ok bool) { +func getCreateUserPayloadGetNameAttributeTypeOk(arg CreateUserPayloadGetNameAttributeType) (ret CreateUserPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false } @@ -41,20 +35,32 @@ func getCreateUserPayloadGetRolesAttributeTypeOk(arg CreateUserPayloadGetRolesAt } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setCreateUserPayloadGetRolesAttributeType(arg *CreateUserPayloadGetRolesAttributeType, val CreateUserPayloadGetRolesRetType) { +func setCreateUserPayloadGetNameAttributeType(arg *CreateUserPayloadGetNameAttributeType, val CreateUserPayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserPayloadGetNameRetType = string + /* - types and functions for username + types and functions for roles */ -// isNotNullableString +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserPayloadGetRolesAttributeType = *[]string + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateUserPayloadGetUsernameAttributeType = *string +type CreateUserPayloadGetRolesArgType = []string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCreateUserPayloadGetUsernameAttributeTypeOk(arg CreateUserPayloadGetUsernameAttributeType) (ret CreateUserPayloadGetUsernameRetType, ok bool) { +type CreateUserPayloadGetRolesRetType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateUserPayloadGetRolesAttributeTypeOk(arg CreateUserPayloadGetRolesAttributeType) (ret CreateUserPayloadGetRolesRetType, ok bool) { if arg == nil { return ret, false } @@ -62,30 +68,31 @@ func getCreateUserPayloadGetUsernameAttributeTypeOk(arg CreateUserPayloadGetUser } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setCreateUserPayloadGetUsernameAttributeType(arg *CreateUserPayloadGetUsernameAttributeType, val CreateUserPayloadGetUsernameRetType) { +func setCreateUserPayloadGetRolesAttributeType(arg *CreateUserPayloadGetRolesAttributeType, val CreateUserPayloadGetRolesRetType) { *arg = &val } -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateUserPayloadGetUsernameArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateUserPayloadGetUsernameRetType = string - // CreateUserPayload struct for CreateUserPayload // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateUserPayload struct { - Roles CreateUserPayloadGetRolesAttributeType `json:"roles,omitempty"` - Username CreateUserPayloadGetUsernameAttributeType `json:"username,omitempty"` + // The name of the user. + // REQUIRED + Name CreateUserPayloadGetNameAttributeType `json:"name" required:"true"` + // A list containing the user roles for the instance. Please refer to the List Roles endpoint for a list of all available Roles. + Roles CreateUserPayloadGetRolesAttributeType `json:"roles,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _CreateUserPayload CreateUserPayload + // NewCreateUserPayload instantiates a new CreateUserPayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewCreateUserPayload() *CreateUserPayload { +func NewCreateUserPayload(name CreateUserPayloadGetNameArgType) *CreateUserPayload { this := CreateUserPayload{} + setCreateUserPayloadGetNameAttributeType(&this.Name, name) return &this } @@ -98,6 +105,26 @@ func NewCreateUserPayloadWithDefaults() *CreateUserPayload { return &this } +// GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateUserPayload) GetName() (ret CreateUserPayloadGetNameRetType) { + ret, _ = o.GetNameOk() + return ret +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateUserPayload) GetNameOk() (ret CreateUserPayloadGetNameRetType, ok bool) { + return getCreateUserPayloadGetNameAttributeTypeOk(o.Name) +} + +// SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateUserPayload) SetName(v CreateUserPayloadGetNameRetType) { + setCreateUserPayloadGetNameAttributeType(&o.Name, v) +} + // GetRoles returns the Roles field value if set, zero value otherwise. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateUserPayload) GetRoles() (res CreateUserPayloadGetRolesRetType) { @@ -125,42 +152,15 @@ func (o *CreateUserPayload) SetRoles(v CreateUserPayloadGetRolesRetType) { setCreateUserPayloadGetRolesAttributeType(&o.Roles, v) } -// GetUsername returns the Username field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateUserPayload) GetUsername() (res CreateUserPayloadGetUsernameRetType) { - res, _ = o.GetUsernameOk() - return -} - -// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateUserPayload) GetUsernameOk() (ret CreateUserPayloadGetUsernameRetType, ok bool) { - return getCreateUserPayloadGetUsernameAttributeTypeOk(o.Username) -} - -// HasUsername returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateUserPayload) HasUsername() bool { - _, ok := o.GetUsernameOk() - return ok -} - -// SetUsername gets a reference to the given string and assigns it to the Username field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateUserPayload) SetUsername(v CreateUserPayloadGetUsernameRetType) { - setCreateUserPayloadGetUsernameAttributeType(&o.Username, v) -} - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateUserPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if val, ok := getCreateUserPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } if val, ok := getCreateUserPayloadGetRolesAttributeTypeOk(o.Roles); ok { toSerialize["Roles"] = val } - if val, ok := getCreateUserPayloadGetUsernameAttributeTypeOk(o.Username); ok { - toSerialize["Username"] = val - } return toSerialize, nil } diff --git a/services/postgresflex/model_create_user_payload_test.go b/services/postgresflex/model_create_user_payload_test.go index 51f50494d..74a76f10e 100644 --- a/services/postgresflex/model_create_user_payload_test.go +++ b/services/postgresflex/model_create_user_payload_test.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_create_user_response.go b/services/postgresflex/model_create_user_response.go index b6483e0ff..8ee82726d 100644 --- a/services/postgresflex/model_create_user_response.go +++ b/services/postgresflex/model_create_user_response.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,21 +19,21 @@ import ( var _ MappedNullable = &CreateUserResponse{} /* - types and functions for item + types and functions for id */ -// isModel +// isLong // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateUserResponseGetItemAttributeType = *User +type CreateUserResponseGetIdAttributeType = *int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateUserResponseGetItemArgType = User +type CreateUserResponseGetIdArgType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateUserResponseGetItemRetType = User +type CreateUserResponseGetIdRetType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCreateUserResponseGetItemAttributeTypeOk(arg CreateUserResponseGetItemAttributeType) (ret CreateUserResponseGetItemRetType, ok bool) { +func getCreateUserResponseGetIdAttributeTypeOk(arg CreateUserResponseGetIdAttributeType) (ret CreateUserResponseGetIdRetType, ok bool) { if arg == nil { return ret, false } @@ -41,23 +41,122 @@ func getCreateUserResponseGetItemAttributeTypeOk(arg CreateUserResponseGetItemAt } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setCreateUserResponseGetItemAttributeType(arg *CreateUserResponseGetItemAttributeType, val CreateUserResponseGetItemRetType) { +func setCreateUserResponseGetIdAttributeType(arg *CreateUserResponseGetIdAttributeType, val CreateUserResponseGetIdRetType) { *arg = &val } +/* + types and functions for name +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserResponseGetNameAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateUserResponseGetNameAttributeTypeOk(arg CreateUserResponseGetNameAttributeType) (ret CreateUserResponseGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCreateUserResponseGetNameAttributeType(arg *CreateUserResponseGetNameAttributeType, val CreateUserResponseGetNameRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserResponseGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserResponseGetNameRetType = string + +/* + types and functions for password +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserResponseGetPasswordAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateUserResponseGetPasswordAttributeTypeOk(arg CreateUserResponseGetPasswordAttributeType) (ret CreateUserResponseGetPasswordRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCreateUserResponseGetPasswordAttributeType(arg *CreateUserResponseGetPasswordAttributeType, val CreateUserResponseGetPasswordRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserResponseGetPasswordArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserResponseGetPasswordRetType = string + +/* + types and functions for state +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserResponseGetStateAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateUserResponseGetStateAttributeTypeOk(arg CreateUserResponseGetStateAttributeType) (ret CreateUserResponseGetStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCreateUserResponseGetStateAttributeType(arg *CreateUserResponseGetStateAttributeType, val CreateUserResponseGetStateRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserResponseGetStateArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateUserResponseGetStateRetType = string + // CreateUserResponse struct for CreateUserResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateUserResponse struct { - Item CreateUserResponseGetItemAttributeType `json:"item,omitempty"` + // The ID of the user. + // REQUIRED + Id CreateUserResponseGetIdAttributeType `json:"id" required:"true"` + // The name of the user. + // REQUIRED + Name CreateUserResponseGetNameAttributeType `json:"name" required:"true"` + // The password for the user. + // REQUIRED + Password CreateUserResponseGetPasswordAttributeType `json:"password" required:"true"` + // The current state of the user. + // REQUIRED + State CreateUserResponseGetStateAttributeType `json:"state" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _CreateUserResponse CreateUserResponse + // NewCreateUserResponse instantiates a new CreateUserResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewCreateUserResponse() *CreateUserResponse { +func NewCreateUserResponse(id CreateUserResponseGetIdArgType, name CreateUserResponseGetNameArgType, password CreateUserResponseGetPasswordArgType, state CreateUserResponseGetStateArgType) *CreateUserResponse { this := CreateUserResponse{} + setCreateUserResponseGetIdAttributeType(&this.Id, id) + setCreateUserResponseGetNameAttributeType(&this.Name, name) + setCreateUserResponseGetPasswordAttributeType(&this.Password, password) + setCreateUserResponseGetStateAttributeType(&this.State, state) return &this } @@ -70,38 +169,100 @@ func NewCreateUserResponseWithDefaults() *CreateUserResponse { return &this } -// GetItem returns the Item field value if set, zero value otherwise. +// GetId returns the Id field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateUserResponse) GetId() (ret CreateUserResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateUserResponse) GetIdOk() (ret CreateUserResponseGetIdRetType, ok bool) { + return getCreateUserResponseGetIdAttributeTypeOk(o.Id) +} + +// SetId sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateUserResponse) GetItem() (res CreateUserResponseGetItemRetType) { - res, _ = o.GetItemOk() - return +func (o *CreateUserResponse) SetId(v CreateUserResponseGetIdRetType) { + setCreateUserResponseGetIdAttributeType(&o.Id, v) } -// GetItemOk returns a tuple with the Item field value if set, nil otherwise +// GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateUserResponse) GetName() (ret CreateUserResponseGetNameRetType) { + ret, _ = o.GetNameOk() + return ret +} + +// GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateUserResponse) GetItemOk() (ret CreateUserResponseGetItemRetType, ok bool) { - return getCreateUserResponseGetItemAttributeTypeOk(o.Item) +func (o *CreateUserResponse) GetNameOk() (ret CreateUserResponseGetNameRetType, ok bool) { + return getCreateUserResponseGetNameAttributeTypeOk(o.Name) +} + +// SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateUserResponse) SetName(v CreateUserResponseGetNameRetType) { + setCreateUserResponseGetNameAttributeType(&o.Name, v) } -// HasItem returns a boolean if a field has been set. +// GetPassword returns the Password field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateUserResponse) HasItem() bool { - _, ok := o.GetItemOk() - return ok +func (o *CreateUserResponse) GetPassword() (ret CreateUserResponseGetPasswordRetType) { + ret, _ = o.GetPasswordOk() + return ret } -// SetItem gets a reference to the given User and assigns it to the Item field. +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateUserResponse) GetPasswordOk() (ret CreateUserResponseGetPasswordRetType, ok bool) { + return getCreateUserResponseGetPasswordAttributeTypeOk(o.Password) +} + +// SetPassword sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateUserResponse) SetItem(v CreateUserResponseGetItemRetType) { - setCreateUserResponseGetItemAttributeType(&o.Item, v) +func (o *CreateUserResponse) SetPassword(v CreateUserResponseGetPasswordRetType) { + setCreateUserResponseGetPasswordAttributeType(&o.Password, v) +} + +// GetState returns the State field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateUserResponse) GetState() (ret CreateUserResponseGetStateRetType) { + ret, _ = o.GetStateOk() + return ret +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateUserResponse) GetStateOk() (ret CreateUserResponseGetStateRetType, ok bool) { + return getCreateUserResponseGetStateAttributeTypeOk(o.State) +} + +// SetState sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateUserResponse) SetState(v CreateUserResponseGetStateRetType) { + setCreateUserResponseGetStateAttributeType(&o.State, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateUserResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getCreateUserResponseGetItemAttributeTypeOk(o.Item); ok { - toSerialize["Item"] = val + if val, ok := getCreateUserResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getCreateUserResponseGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getCreateUserResponseGetPasswordAttributeTypeOk(o.Password); ok { + toSerialize["Password"] = val + } + if val, ok := getCreateUserResponseGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_create_user_response_test.go b/services/postgresflex/model_create_user_response_test.go index 51f50494d..74a76f10e 100644 --- a/services/postgresflex/model_create_user_response_test.go +++ b/services/postgresflex/model_create_user_response_test.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_instance_host.go b/services/postgresflex/model_database_roles.go similarity index 54% rename from services/postgresflex/model_instance_host.go rename to services/postgresflex/model_database_roles.go index d6e0077fb..ebb7720a0 100644 --- a/services/postgresflex/model_instance_host.go +++ b/services/postgresflex/model_database_roles.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,25 +15,19 @@ import ( "encoding/json" ) -// checks if the InstanceHost type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &InstanceHost{} +// checks if the DatabaseRoles type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DatabaseRoles{} /* - types and functions for hostMetrics + types and functions for name */ -// isArray -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceHostGetHostMetricsAttributeType = *[]InstanceHostMetric - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceHostGetHostMetricsArgType = []InstanceHostMetric - +// isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceHostGetHostMetricsRetType = []InstanceHostMetric +type DatabaseRolesGetNameAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceHostGetHostMetricsAttributeTypeOk(arg InstanceHostGetHostMetricsAttributeType) (ret InstanceHostGetHostMetricsRetType, ok bool) { +func getDatabaseRolesGetNameAttributeTypeOk(arg DatabaseRolesGetNameAttributeType) (ret DatabaseRolesGetNameRetType, ok bool) { if arg == nil { return ret, false } @@ -41,20 +35,32 @@ func getInstanceHostGetHostMetricsAttributeTypeOk(arg InstanceHostGetHostMetrics } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceHostGetHostMetricsAttributeType(arg *InstanceHostGetHostMetricsAttributeType, val InstanceHostGetHostMetricsRetType) { +func setDatabaseRolesGetNameAttributeType(arg *DatabaseRolesGetNameAttributeType, val DatabaseRolesGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type DatabaseRolesGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type DatabaseRolesGetNameRetType = string + /* - types and functions for id + types and functions for roles */ -// isNotNullableString +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type DatabaseRolesGetRolesAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type DatabaseRolesGetRolesArgType = []string + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceHostGetIdAttributeType = *string +type DatabaseRolesGetRolesRetType = []string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceHostGetIdAttributeTypeOk(arg InstanceHostGetIdAttributeType) (ret InstanceHostGetIdRetType, ok bool) { +func getDatabaseRolesGetRolesAttributeTypeOk(arg DatabaseRolesGetRolesAttributeType) (ret DatabaseRolesGetRolesRetType, ok bool) { if arg == nil { return ret, false } @@ -62,148 +68,137 @@ func getInstanceHostGetIdAttributeTypeOk(arg InstanceHostGetIdAttributeType) (re } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceHostGetIdAttributeType(arg *InstanceHostGetIdAttributeType, val InstanceHostGetIdRetType) { +func setDatabaseRolesGetRolesAttributeType(arg *DatabaseRolesGetRolesAttributeType, val DatabaseRolesGetRolesRetType) { *arg = &val } +// DatabaseRoles The name and the roles for a database for a user. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceHostGetIdArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceHostGetIdRetType = string +type DatabaseRoles struct { + // The name of the database. + // REQUIRED + Name DatabaseRolesGetNameAttributeType `json:"name" required:"true"` + // The name and the roles for a database + // REQUIRED + Roles DatabaseRolesGetRolesAttributeType `json:"roles" required:"true"` +} -// InstanceHost struct for InstanceHost // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceHost struct { - HostMetrics InstanceHostGetHostMetricsAttributeType `json:"hostMetrics,omitempty"` - Id InstanceHostGetIdAttributeType `json:"id,omitempty"` -} +type _DatabaseRoles DatabaseRoles -// NewInstanceHost instantiates a new InstanceHost object +// NewDatabaseRoles instantiates a new DatabaseRoles object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewInstanceHost() *InstanceHost { - this := InstanceHost{} +func NewDatabaseRoles(name DatabaseRolesGetNameArgType, roles DatabaseRolesGetRolesArgType) *DatabaseRoles { + this := DatabaseRoles{} + setDatabaseRolesGetNameAttributeType(&this.Name, name) + setDatabaseRolesGetRolesAttributeType(&this.Roles, roles) return &this } -// NewInstanceHostWithDefaults instantiates a new InstanceHost object +// NewDatabaseRolesWithDefaults instantiates a new DatabaseRoles object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewInstanceHostWithDefaults() *InstanceHost { - this := InstanceHost{} +func NewDatabaseRolesWithDefaults() *DatabaseRoles { + this := DatabaseRoles{} return &this } -// GetHostMetrics returns the HostMetrics field value if set, zero value otherwise. +// GetName returns the Name field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceHost) GetHostMetrics() (res InstanceHostGetHostMetricsRetType) { - res, _ = o.GetHostMetricsOk() - return +func (o *DatabaseRoles) GetName() (ret DatabaseRolesGetNameRetType) { + ret, _ = o.GetNameOk() + return ret } -// GetHostMetricsOk returns a tuple with the HostMetrics field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceHost) GetHostMetricsOk() (ret InstanceHostGetHostMetricsRetType, ok bool) { - return getInstanceHostGetHostMetricsAttributeTypeOk(o.HostMetrics) +func (o *DatabaseRoles) GetNameOk() (ret DatabaseRolesGetNameRetType, ok bool) { + return getDatabaseRolesGetNameAttributeTypeOk(o.Name) } -// HasHostMetrics returns a boolean if a field has been set. +// SetName sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceHost) HasHostMetrics() bool { - _, ok := o.GetHostMetricsOk() - return ok +func (o *DatabaseRoles) SetName(v DatabaseRolesGetNameRetType) { + setDatabaseRolesGetNameAttributeType(&o.Name, v) } -// SetHostMetrics gets a reference to the given []InstanceHostMetric and assigns it to the HostMetrics field. +// GetRoles returns the Roles field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceHost) SetHostMetrics(v InstanceHostGetHostMetricsRetType) { - setInstanceHostGetHostMetricsAttributeType(&o.HostMetrics, v) +func (o *DatabaseRoles) GetRoles() (ret DatabaseRolesGetRolesRetType) { + ret, _ = o.GetRolesOk() + return ret } -// GetId returns the Id field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceHost) GetId() (res InstanceHostGetIdRetType) { - res, _ = o.GetIdOk() - return -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// GetRolesOk returns a tuple with the Roles field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceHost) GetIdOk() (ret InstanceHostGetIdRetType, ok bool) { - return getInstanceHostGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceHost) HasId() bool { - _, ok := o.GetIdOk() - return ok +func (o *DatabaseRoles) GetRolesOk() (ret DatabaseRolesGetRolesRetType, ok bool) { + return getDatabaseRolesGetRolesAttributeTypeOk(o.Roles) } -// SetId gets a reference to the given string and assigns it to the Id field. +// SetRoles sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceHost) SetId(v InstanceHostGetIdRetType) { - setInstanceHostGetIdAttributeType(&o.Id, v) +func (o *DatabaseRoles) SetRoles(v DatabaseRolesGetRolesRetType) { + setDatabaseRolesGetRolesAttributeType(&o.Roles, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o InstanceHost) ToMap() (map[string]interface{}, error) { +func (o DatabaseRoles) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getInstanceHostGetHostMetricsAttributeTypeOk(o.HostMetrics); ok { - toSerialize["HostMetrics"] = val + if val, ok := getDatabaseRolesGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if val, ok := getInstanceHostGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val + if val, ok := getDatabaseRolesGetRolesAttributeTypeOk(o.Roles); ok { + toSerialize["Roles"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableInstanceHost struct { - value *InstanceHost +type NullableDatabaseRoles struct { + value *DatabaseRoles isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceHost) Get() *InstanceHost { +func (v NullableDatabaseRoles) Get() *DatabaseRoles { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceHost) Set(val *InstanceHost) { +func (v *NullableDatabaseRoles) Set(val *DatabaseRoles) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceHost) IsSet() bool { +func (v NullableDatabaseRoles) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceHost) Unset() { +func (v *NullableDatabaseRoles) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableInstanceHost(val *InstanceHost) *NullableInstanceHost { - return &NullableInstanceHost{value: val, isSet: true} +func NewNullableDatabaseRoles(val *DatabaseRoles) *NullableDatabaseRoles { + return &NullableDatabaseRoles{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceHost) MarshalJSON() ([]byte, error) { +func (v NullableDatabaseRoles) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceHost) UnmarshalJSON(src []byte) error { +func (v *NullableDatabaseRoles) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_database_roles_test.go b/services/postgresflex/model_database_roles_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_database_roles_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_database_sort.go b/services/postgresflex/model_database_sort.go new file mode 100644 index 000000000..d576f4e6f --- /dev/null +++ b/services/postgresflex/model_database_sort.go @@ -0,0 +1,150 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package postgresflex + +import ( + "encoding/json" + "fmt" +) + +// DatabaseSort the model 'DatabaseSort' +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type DatabaseSort string + +// List of database.sort +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + DATABASESORT_CREATED_AT_DESC DatabaseSort = "created_at.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + DATABASESORT_CREATED_AT_ASC DatabaseSort = "created_at.asc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + DATABASESORT_DATABASE_ID_DESC DatabaseSort = "database_id.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + DATABASESORT_DATABASE_ID_ASC DatabaseSort = "database_id.asc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + DATABASESORT_DATABASE_NAME_DESC DatabaseSort = "database_name.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + DATABASESORT_DATABASE_NAME_ASC DatabaseSort = "database_name.asc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + DATABASESORT_DATABASE_OWNER_DESC DatabaseSort = "database_owner.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + DATABASESORT_DATABASE_OWNER_ASC DatabaseSort = "database_owner.asc" +) + +// All allowed values of DatabaseSort enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedDatabaseSortEnumValues = []DatabaseSort{ + "created_at.desc", + "created_at.asc", + "database_id.desc", + "database_id.asc", + "database_name.desc", + "database_name.asc", + "database_owner.desc", + "database_owner.asc", +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *DatabaseSort) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue string + if value == zeroValue { + return nil + } + enumTypeValue := DatabaseSort(value) + for _, existing := range AllowedDatabaseSortEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DatabaseSort", value) +} + +// NewDatabaseSortFromValue returns a pointer to a valid DatabaseSort +// for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewDatabaseSortFromValue(v string) (*DatabaseSort, error) { + ev := DatabaseSort(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DatabaseSort: valid values are %v", v, AllowedDatabaseSortEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v DatabaseSort) IsValid() bool { + for _, existing := range AllowedDatabaseSortEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to database.sort value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v DatabaseSort) Ptr() *DatabaseSort { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableDatabaseSort struct { + value *DatabaseSort + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableDatabaseSort) Get() *DatabaseSort { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableDatabaseSort) Set(val *DatabaseSort) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableDatabaseSort) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableDatabaseSort) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableDatabaseSort(val *DatabaseSort) *NullableDatabaseSort { + return &NullableDatabaseSort{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableDatabaseSort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableDatabaseSort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/model_database_sort_test.go b/services/postgresflex/model_database_sort_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_database_sort_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_error.go b/services/postgresflex/model_error.go index 5ced0f96c..c03fd5a15 100644 --- a/services/postgresflex/model_error.go +++ b/services/postgresflex/model_error.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -46,21 +46,15 @@ func setErrorGetCodeAttributeType(arg *ErrorGetCodeAttributeType, val ErrorGetCo } /* - types and functions for fields + types and functions for message */ -// isContainer -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ErrorGetFieldsAttributeType = *map[string][]string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ErrorGetFieldsArgType = map[string][]string - +// isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ErrorGetFieldsRetType = map[string][]string +type ErrorGetMessageAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getErrorGetFieldsAttributeTypeOk(arg ErrorGetFieldsAttributeType) (ret ErrorGetFieldsRetType, ok bool) { +func getErrorGetMessageAttributeTypeOk(arg ErrorGetMessageAttributeType) (ret ErrorGetMessageRetType, ok bool) { if arg == nil { return ret, false } @@ -68,20 +62,26 @@ func getErrorGetFieldsAttributeTypeOk(arg ErrorGetFieldsAttributeType) (ret Erro } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setErrorGetFieldsAttributeType(arg *ErrorGetFieldsAttributeType, val ErrorGetFieldsRetType) { +func setErrorGetMessageAttributeType(arg *ErrorGetMessageAttributeType, val ErrorGetMessageRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ErrorGetMessageArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ErrorGetMessageRetType = string + /* - types and functions for message + types and functions for traceId */ // isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ErrorGetMessageAttributeType = *string +type ErrorGetTraceIdAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getErrorGetMessageAttributeTypeOk(arg ErrorGetMessageAttributeType) (ret ErrorGetMessageRetType, ok bool) { +func getErrorGetTraceIdAttributeTypeOk(arg ErrorGetTraceIdAttributeType) (ret ErrorGetTraceIdRetType, ok bool) { if arg == nil { return ret, false } @@ -89,15 +89,15 @@ func getErrorGetMessageAttributeTypeOk(arg ErrorGetMessageAttributeType) (ret Er } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setErrorGetMessageAttributeType(arg *ErrorGetMessageAttributeType, val ErrorGetMessageRetType) { +func setErrorGetTraceIdAttributeType(arg *ErrorGetTraceIdAttributeType, val ErrorGetTraceIdRetType) { *arg = &val } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ErrorGetMessageArgType = string +type ErrorGetTraceIdArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ErrorGetMessageRetType = string +type ErrorGetTraceIdRetType = string /* types and functions for type @@ -129,20 +129,35 @@ type ErrorGetTypeRetType = string // Error struct for Error // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Error struct { + // The http error code of the error. // Can be cast to int32 without loss of precision. - Code ErrorGetCodeAttributeType `json:"code,omitempty"` - Fields ErrorGetFieldsAttributeType `json:"fields,omitempty"` - Message ErrorGetMessageAttributeType `json:"message,omitempty"` - Type ErrorGetTypeAttributeType `json:"type,omitempty"` + // REQUIRED + Code ErrorGetCodeAttributeType `json:"code" required:"true"` + // More detailed information about the error. + // REQUIRED + Message ErrorGetMessageAttributeType `json:"message" required:"true"` + // The trace id of the request. + // REQUIRED + TraceId ErrorGetTraceIdAttributeType `json:"traceId" required:"true"` + // Describes in which state the api was when the error happened. + // REQUIRED + Type ErrorGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _Error Error + // NewError instantiates a new Error object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewError() *Error { +func NewError(code ErrorGetCodeArgType, message ErrorGetMessageArgType, traceId ErrorGetTraceIdArgType, types ErrorGetTypeArgType) *Error { this := Error{} + setErrorGetCodeAttributeType(&this.Code, code) + setErrorGetMessageAttributeType(&this.Message, message) + setErrorGetTraceIdAttributeType(&this.TraceId, traceId) + setErrorGetTypeAttributeType(&this.Type, types) return &this } @@ -155,109 +170,81 @@ func NewErrorWithDefaults() *Error { return &this } -// GetCode returns the Code field value if set, zero value otherwise. +// GetCode returns the Code field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Error) GetCode() (res ErrorGetCodeRetType) { - res, _ = o.GetCodeOk() - return +func (o *Error) GetCode() (ret ErrorGetCodeRetType) { + ret, _ = o.GetCodeOk() + return ret } -// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// GetCodeOk returns a tuple with the Code field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Error) GetCodeOk() (ret ErrorGetCodeRetType, ok bool) { return getErrorGetCodeAttributeTypeOk(o.Code) } -// HasCode returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Error) HasCode() bool { - _, ok := o.GetCodeOk() - return ok -} - -// SetCode gets a reference to the given int64 and assigns it to the Code field. +// SetCode sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Error) SetCode(v ErrorGetCodeRetType) { setErrorGetCodeAttributeType(&o.Code, v) } -// GetFields returns the Fields field value if set, zero value otherwise. +// GetMessage returns the Message field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Error) GetFields() (res ErrorGetFieldsRetType) { - res, _ = o.GetFieldsOk() - return +func (o *Error) GetMessage() (ret ErrorGetMessageRetType) { + ret, _ = o.GetMessageOk() + return ret } -// GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise +// GetMessageOk returns a tuple with the Message field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Error) GetFieldsOk() (ret ErrorGetFieldsRetType, ok bool) { - return getErrorGetFieldsAttributeTypeOk(o.Fields) -} - -// HasFields returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Error) HasFields() bool { - _, ok := o.GetFieldsOk() - return ok +func (o *Error) GetMessageOk() (ret ErrorGetMessageRetType, ok bool) { + return getErrorGetMessageAttributeTypeOk(o.Message) } -// SetFields gets a reference to the given map[string][]string and assigns it to the Fields field. +// SetMessage sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Error) SetFields(v ErrorGetFieldsRetType) { - setErrorGetFieldsAttributeType(&o.Fields, v) +func (o *Error) SetMessage(v ErrorGetMessageRetType) { + setErrorGetMessageAttributeType(&o.Message, v) } -// GetMessage returns the Message field value if set, zero value otherwise. +// GetTraceId returns the TraceId field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Error) GetMessage() (res ErrorGetMessageRetType) { - res, _ = o.GetMessageOk() - return +func (o *Error) GetTraceId() (ret ErrorGetTraceIdRetType) { + ret, _ = o.GetTraceIdOk() + return ret } -// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// GetTraceIdOk returns a tuple with the TraceId field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Error) GetMessageOk() (ret ErrorGetMessageRetType, ok bool) { - return getErrorGetMessageAttributeTypeOk(o.Message) -} - -// HasMessage returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Error) HasMessage() bool { - _, ok := o.GetMessageOk() - return ok +func (o *Error) GetTraceIdOk() (ret ErrorGetTraceIdRetType, ok bool) { + return getErrorGetTraceIdAttributeTypeOk(o.TraceId) } -// SetMessage gets a reference to the given string and assigns it to the Message field. +// SetTraceId sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Error) SetMessage(v ErrorGetMessageRetType) { - setErrorGetMessageAttributeType(&o.Message, v) +func (o *Error) SetTraceId(v ErrorGetTraceIdRetType) { + setErrorGetTraceIdAttributeType(&o.TraceId, v) } -// GetType returns the Type field value if set, zero value otherwise. +// GetType returns the Type field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Error) GetType() (res ErrorGetTypeRetType) { - res, _ = o.GetTypeOk() - return +func (o *Error) GetType() (ret ErrorGetTypeRetType) { + ret, _ = o.GetTypeOk() + return ret } -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Error) GetTypeOk() (ret ErrorGetTypeRetType, ok bool) { return getErrorGetTypeAttributeTypeOk(o.Type) } -// HasType returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Error) HasType() bool { - _, ok := o.GetTypeOk() - return ok -} - -// SetType gets a reference to the given string and assigns it to the Type field. +// SetType sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Error) SetType(v ErrorGetTypeRetType) { setErrorGetTypeAttributeType(&o.Type, v) @@ -269,12 +256,12 @@ func (o Error) ToMap() (map[string]interface{}, error) { if val, ok := getErrorGetCodeAttributeTypeOk(o.Code); ok { toSerialize["Code"] = val } - if val, ok := getErrorGetFieldsAttributeTypeOk(o.Fields); ok { - toSerialize["Fields"] = val - } if val, ok := getErrorGetMessageAttributeTypeOk(o.Message); ok { toSerialize["Message"] = val } + if val, ok := getErrorGetTraceIdAttributeTypeOk(o.TraceId); ok { + toSerialize["TraceId"] = val + } if val, ok := getErrorGetTypeAttributeTypeOk(o.Type); ok { toSerialize["Type"] = val } diff --git a/services/postgresflex/model_error_test.go b/services/postgresflex/model_error_test.go index 51f50494d..74a76f10e 100644 --- a/services/postgresflex/model_error_test.go +++ b/services/postgresflex/model_error_test.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_extensions_configuration_test.go b/services/postgresflex/model_extensions_configuration_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_extensions_configuration_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_extensions_extension_list_response_test.go b/services/postgresflex/model_extensions_extension_list_response_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_extensions_extension_list_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_extensions_new_config.go b/services/postgresflex/model_extensions_new_config.go deleted file mode 100644 index 42fadb517..000000000 --- a/services/postgresflex/model_extensions_new_config.go +++ /dev/null @@ -1,151 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package postgresflex - -import ( - "encoding/json" -) - -// checks if the ExtensionsNewConfig type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ExtensionsNewConfig{} - -/* - types and functions for configuration -*/ - -// isArray -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ExtensionsNewConfigGetConfigurationAttributeType = *[]ExtensionsConfiguration - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ExtensionsNewConfigGetConfigurationArgType = []ExtensionsConfiguration - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ExtensionsNewConfigGetConfigurationRetType = []ExtensionsConfiguration - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getExtensionsNewConfigGetConfigurationAttributeTypeOk(arg ExtensionsNewConfigGetConfigurationAttributeType) (ret ExtensionsNewConfigGetConfigurationRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setExtensionsNewConfigGetConfigurationAttributeType(arg *ExtensionsNewConfigGetConfigurationAttributeType, val ExtensionsNewConfigGetConfigurationRetType) { - *arg = &val -} - -// ExtensionsNewConfig struct for ExtensionsNewConfig -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ExtensionsNewConfig struct { - Configuration ExtensionsNewConfigGetConfigurationAttributeType `json:"configuration,omitempty"` -} - -// NewExtensionsNewConfig instantiates a new ExtensionsNewConfig object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewExtensionsNewConfig() *ExtensionsNewConfig { - this := ExtensionsNewConfig{} - return &this -} - -// NewExtensionsNewConfigWithDefaults instantiates a new ExtensionsNewConfig object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewExtensionsNewConfigWithDefaults() *ExtensionsNewConfig { - this := ExtensionsNewConfig{} - return &this -} - -// GetConfiguration returns the Configuration field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ExtensionsNewConfig) GetConfiguration() (res ExtensionsNewConfigGetConfigurationRetType) { - res, _ = o.GetConfigurationOk() - return -} - -// GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ExtensionsNewConfig) GetConfigurationOk() (ret ExtensionsNewConfigGetConfigurationRetType, ok bool) { - return getExtensionsNewConfigGetConfigurationAttributeTypeOk(o.Configuration) -} - -// HasConfiguration returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ExtensionsNewConfig) HasConfiguration() bool { - _, ok := o.GetConfigurationOk() - return ok -} - -// SetConfiguration gets a reference to the given []ExtensionsConfiguration and assigns it to the Configuration field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ExtensionsNewConfig) SetConfiguration(v ExtensionsNewConfigGetConfigurationRetType) { - setExtensionsNewConfigGetConfigurationAttributeType(&o.Configuration, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o ExtensionsNewConfig) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getExtensionsNewConfigGetConfigurationAttributeTypeOk(o.Configuration); ok { - toSerialize["Configuration"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableExtensionsNewConfig struct { - value *ExtensionsNewConfig - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableExtensionsNewConfig) Get() *ExtensionsNewConfig { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableExtensionsNewConfig) Set(val *ExtensionsNewConfig) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableExtensionsNewConfig) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableExtensionsNewConfig) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableExtensionsNewConfig(val *ExtensionsNewConfig) *NullableExtensionsNewConfig { - return &NullableExtensionsNewConfig{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableExtensionsNewConfig) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableExtensionsNewConfig) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/model_extensions_new_config_test.go b/services/postgresflex/model_extensions_new_config_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_extensions_new_config_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_flavor_sort.go b/services/postgresflex/model_flavor_sort.go new file mode 100644 index 000000000..994d0bf46 --- /dev/null +++ b/services/postgresflex/model_flavor_sort.go @@ -0,0 +1,174 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package postgresflex + +import ( + "encoding/json" + "fmt" +) + +// FlavorSort the model 'FlavorSort' +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type FlavorSort string + +// List of flavor.sort +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FLAVORSORT_CPU_DESC FlavorSort = "cpu.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FLAVORSORT_CPU_ASC FlavorSort = "cpu.asc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FLAVORSORT_FLAVOR_DESCRIPTION_ASC FlavorSort = "flavor_description.asc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FLAVORSORT_FLAVOR_DESCRIPTION_DESC FlavorSort = "flavor_description.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FLAVORSORT_ID_DESC FlavorSort = "id.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FLAVORSORT_ID_ASC FlavorSort = "id.asc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FLAVORSORT_SIZE_MAX_DESC FlavorSort = "size_max.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FLAVORSORT_SIZE_MAX_ASC FlavorSort = "size_max.asc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FLAVORSORT_RAM_DESC FlavorSort = "ram.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FLAVORSORT_RAM_ASC FlavorSort = "ram.asc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FLAVORSORT_SIZE_MIN_DESC FlavorSort = "size_min.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FLAVORSORT_SIZE_MIN_ASC FlavorSort = "size_min.asc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FLAVORSORT_STORAGE_CLASS_ASC FlavorSort = "storage_class.asc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FLAVORSORT_STORAGE_CLASS_DESC FlavorSort = "storage_class.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FLAVORSORT_NODE_TYPE_ASC FlavorSort = "node_type.asc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FLAVORSORT_NODE_TYPE_DESC FlavorSort = "node_type.desc" +) + +// All allowed values of FlavorSort enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedFlavorSortEnumValues = []FlavorSort{ + "cpu.desc", + "cpu.asc", + "flavor_description.asc", + "flavor_description.desc", + "id.desc", + "id.asc", + "size_max.desc", + "size_max.asc", + "ram.desc", + "ram.asc", + "size_min.desc", + "size_min.asc", + "storage_class.asc", + "storage_class.desc", + "node_type.asc", + "node_type.desc", +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *FlavorSort) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue string + if value == zeroValue { + return nil + } + enumTypeValue := FlavorSort(value) + for _, existing := range AllowedFlavorSortEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FlavorSort", value) +} + +// NewFlavorSortFromValue returns a pointer to a valid FlavorSort +// for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewFlavorSortFromValue(v string) (*FlavorSort, error) { + ev := FlavorSort(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FlavorSort: valid values are %v", v, AllowedFlavorSortEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v FlavorSort) IsValid() bool { + for _, existing := range AllowedFlavorSortEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to flavor.sort value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v FlavorSort) Ptr() *FlavorSort { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableFlavorSort struct { + value *FlavorSort + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableFlavorSort) Get() *FlavorSort { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableFlavorSort) Set(val *FlavorSort) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableFlavorSort) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableFlavorSort) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableFlavorSort(val *FlavorSort) *NullableFlavorSort { + return &NullableFlavorSort{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableFlavorSort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableFlavorSort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/model_flavor_sort_test.go b/services/postgresflex/model_flavor_sort_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_flavor_sort_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_flavor_storage_classes_storage_class.go b/services/postgresflex/model_flavor_storage_classes_storage_class.go new file mode 100644 index 000000000..3465243ff --- /dev/null +++ b/services/postgresflex/model_flavor_storage_classes_storage_class.go @@ -0,0 +1,257 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package postgresflex + +import ( + "encoding/json" +) + +// checks if the FlavorStorageClassesStorageClass type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FlavorStorageClassesStorageClass{} + +/* + types and functions for class +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type FlavorStorageClassesStorageClassGetClassAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getFlavorStorageClassesStorageClassGetClassAttributeTypeOk(arg FlavorStorageClassesStorageClassGetClassAttributeType) (ret FlavorStorageClassesStorageClassGetClassRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setFlavorStorageClassesStorageClassGetClassAttributeType(arg *FlavorStorageClassesStorageClassGetClassAttributeType, val FlavorStorageClassesStorageClassGetClassRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type FlavorStorageClassesStorageClassGetClassArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type FlavorStorageClassesStorageClassGetClassRetType = string + +/* + types and functions for maxIoPerSec +*/ + +// isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type FlavorStorageClassesStorageClassGetMaxIoPerSecAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type FlavorStorageClassesStorageClassGetMaxIoPerSecArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type FlavorStorageClassesStorageClassGetMaxIoPerSecRetType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getFlavorStorageClassesStorageClassGetMaxIoPerSecAttributeTypeOk(arg FlavorStorageClassesStorageClassGetMaxIoPerSecAttributeType) (ret FlavorStorageClassesStorageClassGetMaxIoPerSecRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setFlavorStorageClassesStorageClassGetMaxIoPerSecAttributeType(arg *FlavorStorageClassesStorageClassGetMaxIoPerSecAttributeType, val FlavorStorageClassesStorageClassGetMaxIoPerSecRetType) { + *arg = &val +} + +/* + types and functions for maxThroughInMb +*/ + +// isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type FlavorStorageClassesStorageClassGetMaxThroughInMbAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type FlavorStorageClassesStorageClassGetMaxThroughInMbArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type FlavorStorageClassesStorageClassGetMaxThroughInMbRetType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getFlavorStorageClassesStorageClassGetMaxThroughInMbAttributeTypeOk(arg FlavorStorageClassesStorageClassGetMaxThroughInMbAttributeType) (ret FlavorStorageClassesStorageClassGetMaxThroughInMbRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setFlavorStorageClassesStorageClassGetMaxThroughInMbAttributeType(arg *FlavorStorageClassesStorageClassGetMaxThroughInMbAttributeType, val FlavorStorageClassesStorageClassGetMaxThroughInMbRetType) { + *arg = &val +} + +// FlavorStorageClassesStorageClass a storageClass defines how efficient the storage can work +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type FlavorStorageClassesStorageClass struct { + // REQUIRED + Class FlavorStorageClassesStorageClassGetClassAttributeType `json:"class" required:"true"` + // Can be cast to int32 without loss of precision. + // REQUIRED + MaxIoPerSec FlavorStorageClassesStorageClassGetMaxIoPerSecAttributeType `json:"maxIoPerSec" required:"true"` + // Can be cast to int32 without loss of precision. + // REQUIRED + MaxThroughInMb FlavorStorageClassesStorageClassGetMaxThroughInMbAttributeType `json:"maxThroughInMb" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _FlavorStorageClassesStorageClass FlavorStorageClassesStorageClass + +// NewFlavorStorageClassesStorageClass instantiates a new FlavorStorageClassesStorageClass object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewFlavorStorageClassesStorageClass(class FlavorStorageClassesStorageClassGetClassArgType, maxIoPerSec FlavorStorageClassesStorageClassGetMaxIoPerSecArgType, maxThroughInMb FlavorStorageClassesStorageClassGetMaxThroughInMbArgType) *FlavorStorageClassesStorageClass { + this := FlavorStorageClassesStorageClass{} + setFlavorStorageClassesStorageClassGetClassAttributeType(&this.Class, class) + setFlavorStorageClassesStorageClassGetMaxIoPerSecAttributeType(&this.MaxIoPerSec, maxIoPerSec) + setFlavorStorageClassesStorageClassGetMaxThroughInMbAttributeType(&this.MaxThroughInMb, maxThroughInMb) + return &this +} + +// NewFlavorStorageClassesStorageClassWithDefaults instantiates a new FlavorStorageClassesStorageClass object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewFlavorStorageClassesStorageClassWithDefaults() *FlavorStorageClassesStorageClass { + this := FlavorStorageClassesStorageClass{} + return &this +} + +// GetClass returns the Class field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FlavorStorageClassesStorageClass) GetClass() (ret FlavorStorageClassesStorageClassGetClassRetType) { + ret, _ = o.GetClassOk() + return ret +} + +// GetClassOk returns a tuple with the Class field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FlavorStorageClassesStorageClass) GetClassOk() (ret FlavorStorageClassesStorageClassGetClassRetType, ok bool) { + return getFlavorStorageClassesStorageClassGetClassAttributeTypeOk(o.Class) +} + +// SetClass sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FlavorStorageClassesStorageClass) SetClass(v FlavorStorageClassesStorageClassGetClassRetType) { + setFlavorStorageClassesStorageClassGetClassAttributeType(&o.Class, v) +} + +// GetMaxIoPerSec returns the MaxIoPerSec field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FlavorStorageClassesStorageClass) GetMaxIoPerSec() (ret FlavorStorageClassesStorageClassGetMaxIoPerSecRetType) { + ret, _ = o.GetMaxIoPerSecOk() + return ret +} + +// GetMaxIoPerSecOk returns a tuple with the MaxIoPerSec field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FlavorStorageClassesStorageClass) GetMaxIoPerSecOk() (ret FlavorStorageClassesStorageClassGetMaxIoPerSecRetType, ok bool) { + return getFlavorStorageClassesStorageClassGetMaxIoPerSecAttributeTypeOk(o.MaxIoPerSec) +} + +// SetMaxIoPerSec sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FlavorStorageClassesStorageClass) SetMaxIoPerSec(v FlavorStorageClassesStorageClassGetMaxIoPerSecRetType) { + setFlavorStorageClassesStorageClassGetMaxIoPerSecAttributeType(&o.MaxIoPerSec, v) +} + +// GetMaxThroughInMb returns the MaxThroughInMb field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FlavorStorageClassesStorageClass) GetMaxThroughInMb() (ret FlavorStorageClassesStorageClassGetMaxThroughInMbRetType) { + ret, _ = o.GetMaxThroughInMbOk() + return ret +} + +// GetMaxThroughInMbOk returns a tuple with the MaxThroughInMb field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FlavorStorageClassesStorageClass) GetMaxThroughInMbOk() (ret FlavorStorageClassesStorageClassGetMaxThroughInMbRetType, ok bool) { + return getFlavorStorageClassesStorageClassGetMaxThroughInMbAttributeTypeOk(o.MaxThroughInMb) +} + +// SetMaxThroughInMb sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FlavorStorageClassesStorageClass) SetMaxThroughInMb(v FlavorStorageClassesStorageClassGetMaxThroughInMbRetType) { + setFlavorStorageClassesStorageClassGetMaxThroughInMbAttributeType(&o.MaxThroughInMb, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o FlavorStorageClassesStorageClass) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getFlavorStorageClassesStorageClassGetClassAttributeTypeOk(o.Class); ok { + toSerialize["Class"] = val + } + if val, ok := getFlavorStorageClassesStorageClassGetMaxIoPerSecAttributeTypeOk(o.MaxIoPerSec); ok { + toSerialize["MaxIoPerSec"] = val + } + if val, ok := getFlavorStorageClassesStorageClassGetMaxThroughInMbAttributeTypeOk(o.MaxThroughInMb); ok { + toSerialize["MaxThroughInMb"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableFlavorStorageClassesStorageClass struct { + value *FlavorStorageClassesStorageClass + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableFlavorStorageClassesStorageClass) Get() *FlavorStorageClassesStorageClass { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableFlavorStorageClassesStorageClass) Set(val *FlavorStorageClassesStorageClass) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableFlavorStorageClassesStorageClass) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableFlavorStorageClassesStorageClass) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableFlavorStorageClassesStorageClass(val *FlavorStorageClassesStorageClass) *NullableFlavorStorageClassesStorageClass { + return &NullableFlavorStorageClassesStorageClass{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableFlavorStorageClassesStorageClass) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableFlavorStorageClassesStorageClass) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/model_flavor_storage_classes_storage_class_test.go b/services/postgresflex/model_flavor_storage_classes_storage_class_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_flavor_storage_classes_storage_class_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_flavor_test.go b/services/postgresflex/model_flavor_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_flavor_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_get_backup_response_test.go b/services/postgresflex/model_get_backup_response_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_get_backup_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_instance_list_instance.go b/services/postgresflex/model_get_database_response.go similarity index 51% rename from services/postgresflex/model_instance_list_instance.go rename to services/postgresflex/model_get_database_response.go index 66aa2e44e..25fd8d8d5 100644 --- a/services/postgresflex/model_instance_list_instance.go +++ b/services/postgresflex/model_get_database_response.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,19 +15,25 @@ import ( "encoding/json" ) -// checks if the InstanceListInstance type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &InstanceListInstance{} +// checks if the GetDatabaseResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetDatabaseResponse{} /* types and functions for id */ -// isNotNullableString +// isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetDatabaseResponseGetIdAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetDatabaseResponseGetIdArgType = int64 + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceListInstanceGetIdAttributeType = *string +type GetDatabaseResponseGetIdRetType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceListInstanceGetIdAttributeTypeOk(arg InstanceListInstanceGetIdAttributeType) (ret InstanceListInstanceGetIdRetType, ok bool) { +func getGetDatabaseResponseGetIdAttributeTypeOk(arg GetDatabaseResponseGetIdAttributeType) (ret GetDatabaseResponseGetIdRetType, ok bool) { if arg == nil { return ret, false } @@ -35,26 +41,20 @@ func getInstanceListInstanceGetIdAttributeTypeOk(arg InstanceListInstanceGetIdAt } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceListInstanceGetIdAttributeType(arg *InstanceListInstanceGetIdAttributeType, val InstanceListInstanceGetIdRetType) { +func setGetDatabaseResponseGetIdAttributeType(arg *GetDatabaseResponseGetIdAttributeType, val GetDatabaseResponseGetIdRetType) { *arg = &val } -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceListInstanceGetIdArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceListInstanceGetIdRetType = string - /* types and functions for name */ // isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceListInstanceGetNameAttributeType = *string +type GetDatabaseResponseGetNameAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceListInstanceGetNameAttributeTypeOk(arg InstanceListInstanceGetNameAttributeType) (ret InstanceListInstanceGetNameRetType, ok bool) { +func getGetDatabaseResponseGetNameAttributeTypeOk(arg GetDatabaseResponseGetNameAttributeType) (ret GetDatabaseResponseGetNameRetType, ok bool) { if arg == nil { return ret, false } @@ -62,26 +62,26 @@ func getInstanceListInstanceGetNameAttributeTypeOk(arg InstanceListInstanceGetNa } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceListInstanceGetNameAttributeType(arg *InstanceListInstanceGetNameAttributeType, val InstanceListInstanceGetNameRetType) { +func setGetDatabaseResponseGetNameAttributeType(arg *GetDatabaseResponseGetNameAttributeType, val GetDatabaseResponseGetNameRetType) { *arg = &val } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceListInstanceGetNameArgType = string +type GetDatabaseResponseGetNameArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceListInstanceGetNameRetType = string +type GetDatabaseResponseGetNameRetType = string /* - types and functions for status + types and functions for owner */ // isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceListInstanceGetStatusAttributeType = *string +type GetDatabaseResponseGetOwnerAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceListInstanceGetStatusAttributeTypeOk(arg InstanceListInstanceGetStatusAttributeType) (ret InstanceListInstanceGetStatusRetType, ok bool) { +func getGetDatabaseResponseGetOwnerAttributeTypeOk(arg GetDatabaseResponseGetOwnerAttributeType) (ret GetDatabaseResponseGetOwnerRetType, ok bool) { if arg == nil { return ret, false } @@ -89,179 +89,170 @@ func getInstanceListInstanceGetStatusAttributeTypeOk(arg InstanceListInstanceGet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceListInstanceGetStatusAttributeType(arg *InstanceListInstanceGetStatusAttributeType, val InstanceListInstanceGetStatusRetType) { +func setGetDatabaseResponseGetOwnerAttributeType(arg *GetDatabaseResponseGetOwnerAttributeType, val GetDatabaseResponseGetOwnerRetType) { *arg = &val } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceListInstanceGetStatusArgType = string +type GetDatabaseResponseGetOwnerArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceListInstanceGetStatusRetType = string +type GetDatabaseResponseGetOwnerRetType = string -// InstanceListInstance struct for InstanceListInstance +// GetDatabaseResponse struct for GetDatabaseResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceListInstance struct { - Id InstanceListInstanceGetIdAttributeType `json:"id,omitempty"` - Name InstanceListInstanceGetNameAttributeType `json:"name,omitempty"` - Status InstanceListInstanceGetStatusAttributeType `json:"status,omitempty"` +type GetDatabaseResponse struct { + // The id of the database. + // REQUIRED + Id GetDatabaseResponseGetIdAttributeType `json:"id" required:"true"` + // The name of the database. + // REQUIRED + Name GetDatabaseResponseGetNameAttributeType `json:"name" required:"true"` + // The owner of the database. + // REQUIRED + Owner GetDatabaseResponseGetOwnerAttributeType `json:"owner" required:"true"` } -// NewInstanceListInstance instantiates a new InstanceListInstance object +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _GetDatabaseResponse GetDatabaseResponse + +// NewGetDatabaseResponse instantiates a new GetDatabaseResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewInstanceListInstance() *InstanceListInstance { - this := InstanceListInstance{} +func NewGetDatabaseResponse(id GetDatabaseResponseGetIdArgType, name GetDatabaseResponseGetNameArgType, owner GetDatabaseResponseGetOwnerArgType) *GetDatabaseResponse { + this := GetDatabaseResponse{} + setGetDatabaseResponseGetIdAttributeType(&this.Id, id) + setGetDatabaseResponseGetNameAttributeType(&this.Name, name) + setGetDatabaseResponseGetOwnerAttributeType(&this.Owner, owner) return &this } -// NewInstanceListInstanceWithDefaults instantiates a new InstanceListInstance object +// NewGetDatabaseResponseWithDefaults instantiates a new GetDatabaseResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewInstanceListInstanceWithDefaults() *InstanceListInstance { - this := InstanceListInstance{} +func NewGetDatabaseResponseWithDefaults() *GetDatabaseResponse { + this := GetDatabaseResponse{} return &this } -// GetId returns the Id field value if set, zero value otherwise. +// GetId returns the Id field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceListInstance) GetId() (res InstanceListInstanceGetIdRetType) { - res, _ = o.GetIdOk() - return +func (o *GetDatabaseResponse) GetId() (ret GetDatabaseResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } -// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceListInstance) GetIdOk() (ret InstanceListInstanceGetIdRetType, ok bool) { - return getInstanceListInstanceGetIdAttributeTypeOk(o.Id) +func (o *GetDatabaseResponse) GetIdOk() (ret GetDatabaseResponseGetIdRetType, ok bool) { + return getGetDatabaseResponseGetIdAttributeTypeOk(o.Id) } -// HasId returns a boolean if a field has been set. +// SetId sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceListInstance) HasId() bool { - _, ok := o.GetIdOk() - return ok +func (o *GetDatabaseResponse) SetId(v GetDatabaseResponseGetIdRetType) { + setGetDatabaseResponseGetIdAttributeType(&o.Id, v) } -// SetId gets a reference to the given string and assigns it to the Id field. +// GetName returns the Name field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceListInstance) SetId(v InstanceListInstanceGetIdRetType) { - setInstanceListInstanceGetIdAttributeType(&o.Id, v) +func (o *GetDatabaseResponse) GetName() (ret GetDatabaseResponseGetNameRetType) { + ret, _ = o.GetNameOk() + return ret } -// GetName returns the Name field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceListInstance) GetName() (res InstanceListInstanceGetNameRetType) { - res, _ = o.GetNameOk() - return -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceListInstance) GetNameOk() (ret InstanceListInstanceGetNameRetType, ok bool) { - return getInstanceListInstanceGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceListInstance) HasName() bool { - _, ok := o.GetNameOk() - return ok +func (o *GetDatabaseResponse) GetNameOk() (ret GetDatabaseResponseGetNameRetType, ok bool) { + return getGetDatabaseResponseGetNameAttributeTypeOk(o.Name) } -// SetName gets a reference to the given string and assigns it to the Name field. +// SetName sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceListInstance) SetName(v InstanceListInstanceGetNameRetType) { - setInstanceListInstanceGetNameAttributeType(&o.Name, v) +func (o *GetDatabaseResponse) SetName(v GetDatabaseResponseGetNameRetType) { + setGetDatabaseResponseGetNameAttributeType(&o.Name, v) } -// GetStatus returns the Status field value if set, zero value otherwise. +// GetOwner returns the Owner field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceListInstance) GetStatus() (res InstanceListInstanceGetStatusRetType) { - res, _ = o.GetStatusOk() - return +func (o *GetDatabaseResponse) GetOwner() (ret GetDatabaseResponseGetOwnerRetType) { + ret, _ = o.GetOwnerOk() + return ret } -// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// GetOwnerOk returns a tuple with the Owner field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceListInstance) GetStatusOk() (ret InstanceListInstanceGetStatusRetType, ok bool) { - return getInstanceListInstanceGetStatusAttributeTypeOk(o.Status) -} - -// HasStatus returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceListInstance) HasStatus() bool { - _, ok := o.GetStatusOk() - return ok +func (o *GetDatabaseResponse) GetOwnerOk() (ret GetDatabaseResponseGetOwnerRetType, ok bool) { + return getGetDatabaseResponseGetOwnerAttributeTypeOk(o.Owner) } -// SetStatus gets a reference to the given string and assigns it to the Status field. +// SetOwner sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceListInstance) SetStatus(v InstanceListInstanceGetStatusRetType) { - setInstanceListInstanceGetStatusAttributeType(&o.Status, v) +func (o *GetDatabaseResponse) SetOwner(v GetDatabaseResponseGetOwnerRetType) { + setGetDatabaseResponseGetOwnerAttributeType(&o.Owner, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o InstanceListInstance) ToMap() (map[string]interface{}, error) { +func (o GetDatabaseResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getInstanceListInstanceGetIdAttributeTypeOk(o.Id); ok { + if val, ok := getGetDatabaseResponseGetIdAttributeTypeOk(o.Id); ok { toSerialize["Id"] = val } - if val, ok := getInstanceListInstanceGetNameAttributeTypeOk(o.Name); ok { + if val, ok := getGetDatabaseResponseGetNameAttributeTypeOk(o.Name); ok { toSerialize["Name"] = val } - if val, ok := getInstanceListInstanceGetStatusAttributeTypeOk(o.Status); ok { - toSerialize["Status"] = val + if val, ok := getGetDatabaseResponseGetOwnerAttributeTypeOk(o.Owner); ok { + toSerialize["Owner"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableInstanceListInstance struct { - value *InstanceListInstance +type NullableGetDatabaseResponse struct { + value *GetDatabaseResponse isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceListInstance) Get() *InstanceListInstance { +func (v NullableGetDatabaseResponse) Get() *GetDatabaseResponse { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceListInstance) Set(val *InstanceListInstance) { +func (v *NullableGetDatabaseResponse) Set(val *GetDatabaseResponse) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceListInstance) IsSet() bool { +func (v NullableGetDatabaseResponse) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceListInstance) Unset() { +func (v *NullableGetDatabaseResponse) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableInstanceListInstance(val *InstanceListInstance) *NullableInstanceListInstance { - return &NullableInstanceListInstance{value: val, isSet: true} +func NewNullableGetDatabaseResponse(val *GetDatabaseResponse) *NullableGetDatabaseResponse { + return &NullableGetDatabaseResponse{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceListInstance) MarshalJSON() ([]byte, error) { +func (v NullableGetDatabaseResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceListInstance) UnmarshalJSON(src []byte) error { +func (v *NullableGetDatabaseResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_get_database_response_test.go b/services/postgresflex/model_get_database_response_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_get_database_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_get_instance_response.go b/services/postgresflex/model_get_instance_response.go new file mode 100644 index 000000000..f6a21a843 --- /dev/null +++ b/services/postgresflex/model_get_instance_response.go @@ -0,0 +1,865 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package postgresflex + +import ( + "encoding/json" +) + +// checks if the GetInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetInstanceResponse{} + +/* + types and functions for acl +*/ + +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetAclAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetAclArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetAclRetType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetInstanceResponseGetAclAttributeTypeOk(arg GetInstanceResponseGetAclAttributeType) (ret GetInstanceResponseGetAclRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetInstanceResponseGetAclAttributeType(arg *GetInstanceResponseGetAclAttributeType, val GetInstanceResponseGetAclRetType) { + *arg = &val +} + +/* + types and functions for backupSchedule +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetBackupScheduleAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetInstanceResponseGetBackupScheduleAttributeTypeOk(arg GetInstanceResponseGetBackupScheduleAttributeType) (ret GetInstanceResponseGetBackupScheduleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetInstanceResponseGetBackupScheduleAttributeType(arg *GetInstanceResponseGetBackupScheduleAttributeType, val GetInstanceResponseGetBackupScheduleRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetBackupScheduleArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetBackupScheduleRetType = string + +/* + types and functions for connectionInfo +*/ + +// isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetConnectionInfoAttributeType = *InstanceConnectionInfo + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetConnectionInfoArgType = InstanceConnectionInfo + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetConnectionInfoRetType = InstanceConnectionInfo + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetInstanceResponseGetConnectionInfoAttributeTypeOk(arg GetInstanceResponseGetConnectionInfoAttributeType) (ret GetInstanceResponseGetConnectionInfoRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetInstanceResponseGetConnectionInfoAttributeType(arg *GetInstanceResponseGetConnectionInfoAttributeType, val GetInstanceResponseGetConnectionInfoRetType) { + *arg = &val +} + +/* + types and functions for encryption +*/ + +// isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetEncryptionAttributeType = *InstanceEncryption + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetEncryptionArgType = InstanceEncryption + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetEncryptionRetType = InstanceEncryption + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetInstanceResponseGetEncryptionAttributeTypeOk(arg GetInstanceResponseGetEncryptionAttributeType) (ret GetInstanceResponseGetEncryptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetInstanceResponseGetEncryptionAttributeType(arg *GetInstanceResponseGetEncryptionAttributeType, val GetInstanceResponseGetEncryptionRetType) { + *arg = &val +} + +/* + types and functions for flavorId +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetFlavorIdAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetInstanceResponseGetFlavorIdAttributeTypeOk(arg GetInstanceResponseGetFlavorIdAttributeType) (ret GetInstanceResponseGetFlavorIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetInstanceResponseGetFlavorIdAttributeType(arg *GetInstanceResponseGetFlavorIdAttributeType, val GetInstanceResponseGetFlavorIdRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetFlavorIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetFlavorIdRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetIdAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetInstanceResponseGetIdAttributeTypeOk(arg GetInstanceResponseGetIdAttributeType) (ret GetInstanceResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetInstanceResponseGetIdAttributeType(arg *GetInstanceResponseGetIdAttributeType, val GetInstanceResponseGetIdRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetIdRetType = string + +/* + types and functions for isDeletable +*/ + +// isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponsegetIsDeletableAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponsegetIsDeletableArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponsegetIsDeletableRetType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetInstanceResponsegetIsDeletableAttributeTypeOk(arg GetInstanceResponsegetIsDeletableAttributeType) (ret GetInstanceResponsegetIsDeletableRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetInstanceResponsegetIsDeletableAttributeType(arg *GetInstanceResponsegetIsDeletableAttributeType, val GetInstanceResponsegetIsDeletableRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetLabelsAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetLabelsArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetLabelsRetType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetInstanceResponseGetLabelsAttributeTypeOk(arg GetInstanceResponseGetLabelsAttributeType) (ret GetInstanceResponseGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetInstanceResponseGetLabelsAttributeType(arg *GetInstanceResponseGetLabelsAttributeType, val GetInstanceResponseGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetNameAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetInstanceResponseGetNameAttributeTypeOk(arg GetInstanceResponseGetNameAttributeType) (ret GetInstanceResponseGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetInstanceResponseGetNameAttributeType(arg *GetInstanceResponseGetNameAttributeType, val GetInstanceResponseGetNameRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetNameRetType = string + +/* + types and functions for network +*/ + +// isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetNetworkAttributeType = *InstanceNetwork + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetNetworkArgType = InstanceNetwork + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetNetworkRetType = InstanceNetwork + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetInstanceResponseGetNetworkAttributeTypeOk(arg GetInstanceResponseGetNetworkAttributeType) (ret GetInstanceResponseGetNetworkRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetInstanceResponseGetNetworkAttributeType(arg *GetInstanceResponseGetNetworkAttributeType, val GetInstanceResponseGetNetworkRetType) { + *arg = &val +} + +/* + types and functions for retentionDays +*/ + +// isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetRetentionDaysAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetRetentionDaysArgType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetRetentionDaysRetType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetInstanceResponseGetRetentionDaysAttributeTypeOk(arg GetInstanceResponseGetRetentionDaysAttributeType) (ret GetInstanceResponseGetRetentionDaysRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetInstanceResponseGetRetentionDaysAttributeType(arg *GetInstanceResponseGetRetentionDaysAttributeType, val GetInstanceResponseGetRetentionDaysRetType) { + *arg = val +} + +/* + types and functions for state +*/ + +// isEnumRef +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetStateAttributeType = *State + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetStateArgType = State + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetStateRetType = State + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetInstanceResponseGetStateAttributeTypeOk(arg GetInstanceResponseGetStateAttributeType) (ret GetInstanceResponseGetStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetInstanceResponseGetStateAttributeType(arg *GetInstanceResponseGetStateAttributeType, val GetInstanceResponseGetStateRetType) { + *arg = &val +} + +/* + types and functions for storage +*/ + +// isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetStorageAttributeType = *Storage + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetStorageArgType = Storage + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetStorageRetType = Storage + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetInstanceResponseGetStorageAttributeTypeOk(arg GetInstanceResponseGetStorageAttributeType) (ret GetInstanceResponseGetStorageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetInstanceResponseGetStorageAttributeType(arg *GetInstanceResponseGetStorageAttributeType, val GetInstanceResponseGetStorageRetType) { + *arg = &val +} + +/* + types and functions for version +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetVersionAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetInstanceResponseGetVersionAttributeTypeOk(arg GetInstanceResponseGetVersionAttributeType) (ret GetInstanceResponseGetVersionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetInstanceResponseGetVersionAttributeType(arg *GetInstanceResponseGetVersionAttributeType, val GetInstanceResponseGetVersionRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetVersionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponseGetVersionRetType = string + +// GetInstanceResponse struct for GetInstanceResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceResponse struct { + // List of IPV4 cidr. + Acl GetInstanceResponseGetAclAttributeType `json:"acl,omitempty"` + // 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. + // REQUIRED + BackupSchedule GetInstanceResponseGetBackupScheduleAttributeType `json:"backupSchedule" required:"true"` + // REQUIRED + ConnectionInfo GetInstanceResponseGetConnectionInfoAttributeType `json:"connectionInfo" required:"true"` + Encryption GetInstanceResponseGetEncryptionAttributeType `json:"encryption,omitempty"` + // The id of the instance flavor. + // REQUIRED + FlavorId GetInstanceResponseGetFlavorIdAttributeType `json:"flavorId" required:"true"` + // The ID of the instance. + // REQUIRED + Id GetInstanceResponseGetIdAttributeType `json:"id" required:"true"` + // Whether the instance can be deleted or not. + // REQUIRED + IsDeletable GetInstanceResponsegetIsDeletableAttributeType `json:"isDeletable" required:"true"` + // 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. + Labels GetInstanceResponseGetLabelsAttributeType `json:"labels,omitempty"` + // The name of the instance. + // REQUIRED + Name GetInstanceResponseGetNameAttributeType `json:"name" required:"true"` + // REQUIRED + Network GetInstanceResponseGetNetworkAttributeType `json:"network" required:"true"` + // How long backups are retained. The value can only be between 32 and 90 days. + // Can be cast to int32 without loss of precision. + // REQUIRED + RetentionDays GetInstanceResponseGetRetentionDaysAttributeType `json:"retentionDays" required:"true"` + // REQUIRED + State GetInstanceResponseGetStateAttributeType `json:"state" required:"true"` + // REQUIRED + Storage GetInstanceResponseGetStorageAttributeType `json:"storage" required:"true"` + // The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3#tag/Version) for supported version parameters. + // REQUIRED + Version GetInstanceResponseGetVersionAttributeType `json:"version" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _GetInstanceResponse GetInstanceResponse + +// NewGetInstanceResponse instantiates a new GetInstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewGetInstanceResponse(backupSchedule GetInstanceResponseGetBackupScheduleArgType, connectionInfo GetInstanceResponseGetConnectionInfoArgType, flavorId GetInstanceResponseGetFlavorIdArgType, id GetInstanceResponseGetIdArgType, isDeletable GetInstanceResponsegetIsDeletableArgType, name GetInstanceResponseGetNameArgType, network GetInstanceResponseGetNetworkArgType, retentionDays GetInstanceResponseGetRetentionDaysArgType, state GetInstanceResponseGetStateArgType, storage GetInstanceResponseGetStorageArgType, version GetInstanceResponseGetVersionArgType) *GetInstanceResponse { + this := GetInstanceResponse{} + setGetInstanceResponseGetBackupScheduleAttributeType(&this.BackupSchedule, backupSchedule) + setGetInstanceResponseGetConnectionInfoAttributeType(&this.ConnectionInfo, connectionInfo) + setGetInstanceResponseGetFlavorIdAttributeType(&this.FlavorId, flavorId) + setGetInstanceResponseGetIdAttributeType(&this.Id, id) + setGetInstanceResponsegetIsDeletableAttributeType(&this.IsDeletable, isDeletable) + setGetInstanceResponseGetNameAttributeType(&this.Name, name) + setGetInstanceResponseGetNetworkAttributeType(&this.Network, network) + setGetInstanceResponseGetRetentionDaysAttributeType(&this.RetentionDays, retentionDays) + setGetInstanceResponseGetStateAttributeType(&this.State, state) + setGetInstanceResponseGetStorageAttributeType(&this.Storage, storage) + setGetInstanceResponseGetVersionAttributeType(&this.Version, version) + return &this +} + +// NewGetInstanceResponseWithDefaults instantiates a new GetInstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewGetInstanceResponseWithDefaults() *GetInstanceResponse { + this := GetInstanceResponse{} + return &this +} + +// GetAcl returns the Acl field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetAcl() (res GetInstanceResponseGetAclRetType) { + res, _ = o.GetAclOk() + return +} + +// GetAclOk returns a tuple with the Acl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetAclOk() (ret GetInstanceResponseGetAclRetType, ok bool) { + return getGetInstanceResponseGetAclAttributeTypeOk(o.Acl) +} + +// HasAcl returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) HasAcl() bool { + _, ok := o.GetAclOk() + return ok +} + +// SetAcl gets a reference to the given []string and assigns it to the Acl field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) SetAcl(v GetInstanceResponseGetAclRetType) { + setGetInstanceResponseGetAclAttributeType(&o.Acl, v) +} + +// GetBackupSchedule returns the BackupSchedule field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetBackupSchedule() (ret GetInstanceResponseGetBackupScheduleRetType) { + ret, _ = o.GetBackupScheduleOk() + return ret +} + +// GetBackupScheduleOk returns a tuple with the BackupSchedule field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetBackupScheduleOk() (ret GetInstanceResponseGetBackupScheduleRetType, ok bool) { + return getGetInstanceResponseGetBackupScheduleAttributeTypeOk(o.BackupSchedule) +} + +// SetBackupSchedule sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) SetBackupSchedule(v GetInstanceResponseGetBackupScheduleRetType) { + setGetInstanceResponseGetBackupScheduleAttributeType(&o.BackupSchedule, v) +} + +// GetConnectionInfo returns the ConnectionInfo field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetConnectionInfo() (ret GetInstanceResponseGetConnectionInfoRetType) { + ret, _ = o.GetConnectionInfoOk() + return ret +} + +// GetConnectionInfoOk returns a tuple with the ConnectionInfo field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetConnectionInfoOk() (ret GetInstanceResponseGetConnectionInfoRetType, ok bool) { + return getGetInstanceResponseGetConnectionInfoAttributeTypeOk(o.ConnectionInfo) +} + +// SetConnectionInfo sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) SetConnectionInfo(v GetInstanceResponseGetConnectionInfoRetType) { + setGetInstanceResponseGetConnectionInfoAttributeType(&o.ConnectionInfo, v) +} + +// GetEncryption returns the Encryption field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetEncryption() (res GetInstanceResponseGetEncryptionRetType) { + res, _ = o.GetEncryptionOk() + return +} + +// GetEncryptionOk returns a tuple with the Encryption field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetEncryptionOk() (ret GetInstanceResponseGetEncryptionRetType, ok bool) { + return getGetInstanceResponseGetEncryptionAttributeTypeOk(o.Encryption) +} + +// HasEncryption returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) HasEncryption() bool { + _, ok := o.GetEncryptionOk() + return ok +} + +// SetEncryption gets a reference to the given InstanceEncryption and assigns it to the Encryption field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) SetEncryption(v GetInstanceResponseGetEncryptionRetType) { + setGetInstanceResponseGetEncryptionAttributeType(&o.Encryption, v) +} + +// GetFlavorId returns the FlavorId field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetFlavorId() (ret GetInstanceResponseGetFlavorIdRetType) { + ret, _ = o.GetFlavorIdOk() + return ret +} + +// GetFlavorIdOk returns a tuple with the FlavorId field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetFlavorIdOk() (ret GetInstanceResponseGetFlavorIdRetType, ok bool) { + return getGetInstanceResponseGetFlavorIdAttributeTypeOk(o.FlavorId) +} + +// SetFlavorId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) SetFlavorId(v GetInstanceResponseGetFlavorIdRetType) { + setGetInstanceResponseGetFlavorIdAttributeType(&o.FlavorId, v) +} + +// GetId returns the Id field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetId() (ret GetInstanceResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetIdOk() (ret GetInstanceResponseGetIdRetType, ok bool) { + return getGetInstanceResponseGetIdAttributeTypeOk(o.Id) +} + +// SetId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) SetId(v GetInstanceResponseGetIdRetType) { + setGetInstanceResponseGetIdAttributeType(&o.Id, v) +} + +// GetIsDeletable returns the IsDeletable field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetIsDeletable() (ret GetInstanceResponsegetIsDeletableRetType) { + ret, _ = o.GetIsDeletableOk() + return ret +} + +// GetIsDeletableOk returns a tuple with the IsDeletable field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetIsDeletableOk() (ret GetInstanceResponsegetIsDeletableRetType, ok bool) { + return getGetInstanceResponsegetIsDeletableAttributeTypeOk(o.IsDeletable) +} + +// SetIsDeletable sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) SetIsDeletable(v GetInstanceResponsegetIsDeletableRetType) { + setGetInstanceResponsegetIsDeletableAttributeType(&o.IsDeletable, v) +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetLabels() (res GetInstanceResponseGetLabelsRetType) { + res, _ = o.GetLabelsOk() + return +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetLabelsOk() (ret GetInstanceResponseGetLabelsRetType, ok bool) { + return getGetInstanceResponseGetLabelsAttributeTypeOk(o.Labels) +} + +// HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) HasLabels() bool { + _, ok := o.GetLabelsOk() + return ok +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) SetLabels(v GetInstanceResponseGetLabelsRetType) { + setGetInstanceResponseGetLabelsAttributeType(&o.Labels, v) +} + +// GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetName() (ret GetInstanceResponseGetNameRetType) { + ret, _ = o.GetNameOk() + return ret +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetNameOk() (ret GetInstanceResponseGetNameRetType, ok bool) { + return getGetInstanceResponseGetNameAttributeTypeOk(o.Name) +} + +// SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) SetName(v GetInstanceResponseGetNameRetType) { + setGetInstanceResponseGetNameAttributeType(&o.Name, v) +} + +// GetNetwork returns the Network field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetNetwork() (ret GetInstanceResponseGetNetworkRetType) { + ret, _ = o.GetNetworkOk() + return ret +} + +// GetNetworkOk returns a tuple with the Network field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetNetworkOk() (ret GetInstanceResponseGetNetworkRetType, ok bool) { + return getGetInstanceResponseGetNetworkAttributeTypeOk(o.Network) +} + +// SetNetwork sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) SetNetwork(v GetInstanceResponseGetNetworkRetType) { + setGetInstanceResponseGetNetworkAttributeType(&o.Network, v) +} + +// GetRetentionDays returns the RetentionDays field value +// If the value is explicit nil, the zero value for int32 will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetRetentionDays() (ret GetInstanceResponseGetRetentionDaysRetType) { + ret, _ = o.GetRetentionDaysOk() + return ret +} + +// GetRetentionDaysOk returns a tuple with the RetentionDays field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetRetentionDaysOk() (ret GetInstanceResponseGetRetentionDaysRetType, ok bool) { + return getGetInstanceResponseGetRetentionDaysAttributeTypeOk(o.RetentionDays) +} + +// SetRetentionDays sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) SetRetentionDays(v GetInstanceResponseGetRetentionDaysRetType) { + setGetInstanceResponseGetRetentionDaysAttributeType(&o.RetentionDays, v) +} + +// GetState returns the State field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetState() (ret GetInstanceResponseGetStateRetType) { + ret, _ = o.GetStateOk() + return ret +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetStateOk() (ret GetInstanceResponseGetStateRetType, ok bool) { + return getGetInstanceResponseGetStateAttributeTypeOk(o.State) +} + +// SetState sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) SetState(v GetInstanceResponseGetStateRetType) { + setGetInstanceResponseGetStateAttributeType(&o.State, v) +} + +// GetStorage returns the Storage field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetStorage() (ret GetInstanceResponseGetStorageRetType) { + ret, _ = o.GetStorageOk() + return ret +} + +// GetStorageOk returns a tuple with the Storage field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetStorageOk() (ret GetInstanceResponseGetStorageRetType, ok bool) { + return getGetInstanceResponseGetStorageAttributeTypeOk(o.Storage) +} + +// SetStorage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) SetStorage(v GetInstanceResponseGetStorageRetType) { + setGetInstanceResponseGetStorageAttributeType(&o.Storage, v) +} + +// GetVersion returns the Version field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetVersion() (ret GetInstanceResponseGetVersionRetType) { + ret, _ = o.GetVersionOk() + return ret +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) GetVersionOk() (ret GetInstanceResponseGetVersionRetType, ok bool) { + return getGetInstanceResponseGetVersionAttributeTypeOk(o.Version) +} + +// SetVersion sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetInstanceResponse) SetVersion(v GetInstanceResponseGetVersionRetType) { + setGetInstanceResponseGetVersionAttributeType(&o.Version, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o GetInstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getGetInstanceResponseGetAclAttributeTypeOk(o.Acl); ok { + toSerialize["Acl"] = val + } + if val, ok := getGetInstanceResponseGetBackupScheduleAttributeTypeOk(o.BackupSchedule); ok { + toSerialize["BackupSchedule"] = val + } + if val, ok := getGetInstanceResponseGetConnectionInfoAttributeTypeOk(o.ConnectionInfo); ok { + toSerialize["ConnectionInfo"] = val + } + if val, ok := getGetInstanceResponseGetEncryptionAttributeTypeOk(o.Encryption); ok { + toSerialize["Encryption"] = val + } + if val, ok := getGetInstanceResponseGetFlavorIdAttributeTypeOk(o.FlavorId); ok { + toSerialize["FlavorId"] = val + } + if val, ok := getGetInstanceResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getGetInstanceResponsegetIsDeletableAttributeTypeOk(o.IsDeletable); ok { + toSerialize["IsDeletable"] = val + } + if val, ok := getGetInstanceResponseGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getGetInstanceResponseGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getGetInstanceResponseGetNetworkAttributeTypeOk(o.Network); ok { + toSerialize["Network"] = val + } + if val, ok := getGetInstanceResponseGetRetentionDaysAttributeTypeOk(o.RetentionDays); ok { + toSerialize["RetentionDays"] = val + } + if val, ok := getGetInstanceResponseGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val + } + if val, ok := getGetInstanceResponseGetStorageAttributeTypeOk(o.Storage); ok { + toSerialize["Storage"] = val + } + if val, ok := getGetInstanceResponseGetVersionAttributeTypeOk(o.Version); ok { + toSerialize["Version"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableGetInstanceResponse struct { + value *GetInstanceResponse + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableGetInstanceResponse) Get() *GetInstanceResponse { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableGetInstanceResponse) Set(val *GetInstanceResponse) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableGetInstanceResponse) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableGetInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableGetInstanceResponse(val *GetInstanceResponse) *NullableGetInstanceResponse { + return &NullableGetInstanceResponse{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableGetInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableGetInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/model_get_instance_response_test.go b/services/postgresflex/model_get_instance_response_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_get_instance_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_get_user_response.go b/services/postgresflex/model_get_user_response.go index 19db657d0..197ad96e7 100644 --- a/services/postgresflex/model_get_user_response.go +++ b/services/postgresflex/model_get_user_response.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,21 +19,21 @@ import ( var _ MappedNullable = &GetUserResponse{} /* - types and functions for item + types and functions for id */ -// isModel +// isLong // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type GetUserResponseGetItemAttributeType = *UserResponse +type GetUserResponseGetIdAttributeType = *int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type GetUserResponseGetItemArgType = UserResponse +type GetUserResponseGetIdArgType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type GetUserResponseGetItemRetType = UserResponse +type GetUserResponseGetIdRetType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getGetUserResponseGetItemAttributeTypeOk(arg GetUserResponseGetItemAttributeType) (ret GetUserResponseGetItemRetType, ok bool) { +func getGetUserResponseGetIdAttributeTypeOk(arg GetUserResponseGetIdAttributeType) (ret GetUserResponseGetIdRetType, ok bool) { if arg == nil { return ret, false } @@ -41,23 +41,122 @@ func getGetUserResponseGetItemAttributeTypeOk(arg GetUserResponseGetItemAttribut } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setGetUserResponseGetItemAttributeType(arg *GetUserResponseGetItemAttributeType, val GetUserResponseGetItemRetType) { +func setGetUserResponseGetIdAttributeType(arg *GetUserResponseGetIdAttributeType, val GetUserResponseGetIdRetType) { *arg = &val } +/* + types and functions for name +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetUserResponseGetNameAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetUserResponseGetNameAttributeTypeOk(arg GetUserResponseGetNameAttributeType) (ret GetUserResponseGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetUserResponseGetNameAttributeType(arg *GetUserResponseGetNameAttributeType, val GetUserResponseGetNameRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetUserResponseGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetUserResponseGetNameRetType = string + +/* + types and functions for roles +*/ + +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetUserResponseGetRolesAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetUserResponseGetRolesArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetUserResponseGetRolesRetType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetUserResponseGetRolesAttributeTypeOk(arg GetUserResponseGetRolesAttributeType) (ret GetUserResponseGetRolesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetUserResponseGetRolesAttributeType(arg *GetUserResponseGetRolesAttributeType, val GetUserResponseGetRolesRetType) { + *arg = &val +} + +/* + types and functions for state +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetUserResponseGetStateAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetUserResponseGetStateAttributeTypeOk(arg GetUserResponseGetStateAttributeType) (ret GetUserResponseGetStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetUserResponseGetStateAttributeType(arg *GetUserResponseGetStateAttributeType, val GetUserResponseGetStateRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetUserResponseGetStateArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetUserResponseGetStateRetType = string + // GetUserResponse struct for GetUserResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetUserResponse struct { - Item GetUserResponseGetItemAttributeType `json:"item,omitempty"` + // The ID of the user. + // REQUIRED + Id GetUserResponseGetIdAttributeType `json:"id" required:"true"` + // The name of the user. + // REQUIRED + Name GetUserResponseGetNameAttributeType `json:"name" required:"true"` + // A list of user roles. + // REQUIRED + Roles GetUserResponseGetRolesAttributeType `json:"roles" required:"true"` + // The current state of the user. + // REQUIRED + State GetUserResponseGetStateAttributeType `json:"state" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _GetUserResponse GetUserResponse + // NewGetUserResponse instantiates a new GetUserResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewGetUserResponse() *GetUserResponse { +func NewGetUserResponse(id GetUserResponseGetIdArgType, name GetUserResponseGetNameArgType, roles GetUserResponseGetRolesArgType, state GetUserResponseGetStateArgType) *GetUserResponse { this := GetUserResponse{} + setGetUserResponseGetIdAttributeType(&this.Id, id) + setGetUserResponseGetNameAttributeType(&this.Name, name) + setGetUserResponseGetRolesAttributeType(&this.Roles, roles) + setGetUserResponseGetStateAttributeType(&this.State, state) return &this } @@ -70,38 +169,100 @@ func NewGetUserResponseWithDefaults() *GetUserResponse { return &this } -// GetItem returns the Item field value if set, zero value otherwise. +// GetId returns the Id field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetUserResponse) GetId() (ret GetUserResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetUserResponse) GetIdOk() (ret GetUserResponseGetIdRetType, ok bool) { + return getGetUserResponseGetIdAttributeTypeOk(o.Id) +} + +// SetId sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *GetUserResponse) GetItem() (res GetUserResponseGetItemRetType) { - res, _ = o.GetItemOk() - return +func (o *GetUserResponse) SetId(v GetUserResponseGetIdRetType) { + setGetUserResponseGetIdAttributeType(&o.Id, v) } -// GetItemOk returns a tuple with the Item field value if set, nil otherwise +// GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetUserResponse) GetName() (ret GetUserResponseGetNameRetType) { + ret, _ = o.GetNameOk() + return ret +} + +// GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *GetUserResponse) GetItemOk() (ret GetUserResponseGetItemRetType, ok bool) { - return getGetUserResponseGetItemAttributeTypeOk(o.Item) +func (o *GetUserResponse) GetNameOk() (ret GetUserResponseGetNameRetType, ok bool) { + return getGetUserResponseGetNameAttributeTypeOk(o.Name) +} + +// SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetUserResponse) SetName(v GetUserResponseGetNameRetType) { + setGetUserResponseGetNameAttributeType(&o.Name, v) } -// HasItem returns a boolean if a field has been set. +// GetRoles returns the Roles field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *GetUserResponse) HasItem() bool { - _, ok := o.GetItemOk() - return ok +func (o *GetUserResponse) GetRoles() (ret GetUserResponseGetRolesRetType) { + ret, _ = o.GetRolesOk() + return ret } -// SetItem gets a reference to the given UserResponse and assigns it to the Item field. +// GetRolesOk returns a tuple with the Roles field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetUserResponse) GetRolesOk() (ret GetUserResponseGetRolesRetType, ok bool) { + return getGetUserResponseGetRolesAttributeTypeOk(o.Roles) +} + +// SetRoles sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *GetUserResponse) SetItem(v GetUserResponseGetItemRetType) { - setGetUserResponseGetItemAttributeType(&o.Item, v) +func (o *GetUserResponse) SetRoles(v GetUserResponseGetRolesRetType) { + setGetUserResponseGetRolesAttributeType(&o.Roles, v) +} + +// GetState returns the State field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetUserResponse) GetState() (ret GetUserResponseGetStateRetType) { + ret, _ = o.GetStateOk() + return ret +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetUserResponse) GetStateOk() (ret GetUserResponseGetStateRetType, ok bool) { + return getGetUserResponseGetStateAttributeTypeOk(o.State) +} + +// SetState sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetUserResponse) SetState(v GetUserResponseGetStateRetType) { + setGetUserResponseGetStateAttributeType(&o.State, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GetUserResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getGetUserResponseGetItemAttributeTypeOk(o.Item); ok { - toSerialize["Item"] = val + if val, ok := getGetUserResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getGetUserResponseGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getGetUserResponseGetRolesAttributeTypeOk(o.Roles); ok { + toSerialize["Roles"] = val + } + if val, ok := getGetUserResponseGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_get_user_response_test.go b/services/postgresflex/model_get_user_response_test.go index 51f50494d..74a76f10e 100644 --- a/services/postgresflex/model_get_user_response_test.go +++ b/services/postgresflex/model_get_user_response_test.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_instance.go b/services/postgresflex/model_instance.go deleted file mode 100644 index a1ceddbfe..000000000 --- a/services/postgresflex/model_instance.go +++ /dev/null @@ -1,674 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package postgresflex - -import ( - "encoding/json" -) - -// checks if the Instance type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Instance{} - -/* - types and functions for acl -*/ - -// isModel -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetAclAttributeType = *ACL - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetAclArgType = ACL - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetAclRetType = ACL - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceGetAclAttributeTypeOk(arg InstanceGetAclAttributeType) (ret InstanceGetAclRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceGetAclAttributeType(arg *InstanceGetAclAttributeType, val InstanceGetAclRetType) { - *arg = &val -} - -/* - types and functions for backupSchedule -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetBackupScheduleAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceGetBackupScheduleAttributeTypeOk(arg InstanceGetBackupScheduleAttributeType) (ret InstanceGetBackupScheduleRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceGetBackupScheduleAttributeType(arg *InstanceGetBackupScheduleAttributeType, val InstanceGetBackupScheduleRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetBackupScheduleArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetBackupScheduleRetType = string - -/* - types and functions for flavor -*/ - -// isModel -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetFlavorAttributeType = *Flavor - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetFlavorArgType = Flavor - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetFlavorRetType = Flavor - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceGetFlavorAttributeTypeOk(arg InstanceGetFlavorAttributeType) (ret InstanceGetFlavorRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceGetFlavorAttributeType(arg *InstanceGetFlavorAttributeType, val InstanceGetFlavorRetType) { - *arg = &val -} - -/* - types and functions for id -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetIdAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceGetIdAttributeTypeOk(arg InstanceGetIdAttributeType) (ret InstanceGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceGetIdAttributeType(arg *InstanceGetIdAttributeType, val InstanceGetIdRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetIdArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetIdRetType = string - -/* - types and functions for name -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetNameAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceGetNameAttributeTypeOk(arg InstanceGetNameAttributeType) (ret InstanceGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceGetNameAttributeType(arg *InstanceGetNameAttributeType, val InstanceGetNameRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetNameArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetNameRetType = string - -/* - types and functions for options -*/ - -// isContainer -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetOptionsAttributeType = *map[string]string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetOptionsArgType = map[string]string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetOptionsRetType = map[string]string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceGetOptionsAttributeTypeOk(arg InstanceGetOptionsAttributeType) (ret InstanceGetOptionsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceGetOptionsAttributeType(arg *InstanceGetOptionsAttributeType, val InstanceGetOptionsRetType) { - *arg = &val -} - -/* - types and functions for replicas -*/ - -// isInteger -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetReplicasAttributeType = *int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetReplicasArgType = int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetReplicasRetType = int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceGetReplicasAttributeTypeOk(arg InstanceGetReplicasAttributeType) (ret InstanceGetReplicasRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceGetReplicasAttributeType(arg *InstanceGetReplicasAttributeType, val InstanceGetReplicasRetType) { - *arg = &val -} - -/* - types and functions for status -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetStatusAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceGetStatusAttributeTypeOk(arg InstanceGetStatusAttributeType) (ret InstanceGetStatusRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceGetStatusAttributeType(arg *InstanceGetStatusAttributeType, val InstanceGetStatusRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetStatusArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetStatusRetType = string - -/* - types and functions for storage -*/ - -// isModel -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetStorageAttributeType = *Storage - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetStorageArgType = Storage - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetStorageRetType = Storage - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceGetStorageAttributeTypeOk(arg InstanceGetStorageAttributeType) (ret InstanceGetStorageRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceGetStorageAttributeType(arg *InstanceGetStorageAttributeType, val InstanceGetStorageRetType) { - *arg = &val -} - -/* - types and functions for version -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetVersionAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceGetVersionAttributeTypeOk(arg InstanceGetVersionAttributeType) (ret InstanceGetVersionRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceGetVersionAttributeType(arg *InstanceGetVersionAttributeType, val InstanceGetVersionRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetVersionArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetVersionRetType = string - -// Instance struct for Instance -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type Instance struct { - Acl InstanceGetAclAttributeType `json:"acl,omitempty"` - BackupSchedule InstanceGetBackupScheduleAttributeType `json:"backupSchedule,omitempty"` - Flavor InstanceGetFlavorAttributeType `json:"flavor,omitempty"` - Id InstanceGetIdAttributeType `json:"id,omitempty"` - Name InstanceGetNameAttributeType `json:"name,omitempty"` - Options InstanceGetOptionsAttributeType `json:"options,omitempty"` - // Can be cast to int32 without loss of precision. - Replicas InstanceGetReplicasAttributeType `json:"replicas,omitempty"` - Status InstanceGetStatusAttributeType `json:"status,omitempty"` - Storage InstanceGetStorageAttributeType `json:"storage,omitempty"` - Version InstanceGetVersionAttributeType `json:"version,omitempty"` -} - -// NewInstance instantiates a new Instance object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewInstance() *Instance { - this := Instance{} - return &this -} - -// NewInstanceWithDefaults instantiates a new Instance object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewInstanceWithDefaults() *Instance { - this := Instance{} - return &this -} - -// GetAcl returns the Acl field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetAcl() (res InstanceGetAclRetType) { - res, _ = o.GetAclOk() - return -} - -// GetAclOk returns a tuple with the Acl field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetAclOk() (ret InstanceGetAclRetType, ok bool) { - return getInstanceGetAclAttributeTypeOk(o.Acl) -} - -// HasAcl returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) HasAcl() bool { - _, ok := o.GetAclOk() - return ok -} - -// SetAcl gets a reference to the given ACL and assigns it to the Acl field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) SetAcl(v InstanceGetAclRetType) { - setInstanceGetAclAttributeType(&o.Acl, v) -} - -// GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetBackupSchedule() (res InstanceGetBackupScheduleRetType) { - res, _ = o.GetBackupScheduleOk() - return -} - -// GetBackupScheduleOk returns a tuple with the BackupSchedule field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetBackupScheduleOk() (ret InstanceGetBackupScheduleRetType, ok bool) { - return getInstanceGetBackupScheduleAttributeTypeOk(o.BackupSchedule) -} - -// HasBackupSchedule returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) HasBackupSchedule() bool { - _, ok := o.GetBackupScheduleOk() - return ok -} - -// SetBackupSchedule gets a reference to the given string and assigns it to the BackupSchedule field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) SetBackupSchedule(v InstanceGetBackupScheduleRetType) { - setInstanceGetBackupScheduleAttributeType(&o.BackupSchedule, v) -} - -// GetFlavor returns the Flavor field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetFlavor() (res InstanceGetFlavorRetType) { - res, _ = o.GetFlavorOk() - return -} - -// GetFlavorOk returns a tuple with the Flavor field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetFlavorOk() (ret InstanceGetFlavorRetType, ok bool) { - return getInstanceGetFlavorAttributeTypeOk(o.Flavor) -} - -// HasFlavor returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) HasFlavor() bool { - _, ok := o.GetFlavorOk() - return ok -} - -// SetFlavor gets a reference to the given Flavor and assigns it to the Flavor field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) SetFlavor(v InstanceGetFlavorRetType) { - setInstanceGetFlavorAttributeType(&o.Flavor, v) -} - -// GetId returns the Id field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetId() (res InstanceGetIdRetType) { - res, _ = o.GetIdOk() - return -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetIdOk() (ret InstanceGetIdRetType, ok bool) { - return getInstanceGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) SetId(v InstanceGetIdRetType) { - setInstanceGetIdAttributeType(&o.Id, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetName() (res InstanceGetNameRetType) { - res, _ = o.GetNameOk() - return -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetNameOk() (ret InstanceGetNameRetType, ok bool) { - return getInstanceGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) SetName(v InstanceGetNameRetType) { - setInstanceGetNameAttributeType(&o.Name, v) -} - -// GetOptions returns the Options field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetOptions() (res InstanceGetOptionsRetType) { - res, _ = o.GetOptionsOk() - return -} - -// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetOptionsOk() (ret InstanceGetOptionsRetType, ok bool) { - return getInstanceGetOptionsAttributeTypeOk(o.Options) -} - -// HasOptions returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) HasOptions() bool { - _, ok := o.GetOptionsOk() - return ok -} - -// SetOptions gets a reference to the given map[string]string and assigns it to the Options field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) SetOptions(v InstanceGetOptionsRetType) { - setInstanceGetOptionsAttributeType(&o.Options, v) -} - -// GetReplicas returns the Replicas field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetReplicas() (res InstanceGetReplicasRetType) { - res, _ = o.GetReplicasOk() - return -} - -// GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetReplicasOk() (ret InstanceGetReplicasRetType, ok bool) { - return getInstanceGetReplicasAttributeTypeOk(o.Replicas) -} - -// HasReplicas returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) HasReplicas() bool { - _, ok := o.GetReplicasOk() - return ok -} - -// SetReplicas gets a reference to the given int64 and assigns it to the Replicas field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) SetReplicas(v InstanceGetReplicasRetType) { - setInstanceGetReplicasAttributeType(&o.Replicas, v) -} - -// GetStatus returns the Status field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetStatus() (res InstanceGetStatusRetType) { - res, _ = o.GetStatusOk() - return -} - -// GetStatusOk returns a tuple with the Status field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetStatusOk() (ret InstanceGetStatusRetType, ok bool) { - return getInstanceGetStatusAttributeTypeOk(o.Status) -} - -// HasStatus returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) HasStatus() bool { - _, ok := o.GetStatusOk() - return ok -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) SetStatus(v InstanceGetStatusRetType) { - setInstanceGetStatusAttributeType(&o.Status, v) -} - -// GetStorage returns the Storage field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetStorage() (res InstanceGetStorageRetType) { - res, _ = o.GetStorageOk() - return -} - -// GetStorageOk returns a tuple with the Storage field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetStorageOk() (ret InstanceGetStorageRetType, ok bool) { - return getInstanceGetStorageAttributeTypeOk(o.Storage) -} - -// HasStorage returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) HasStorage() bool { - _, ok := o.GetStorageOk() - return ok -} - -// SetStorage gets a reference to the given Storage and assigns it to the Storage field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) SetStorage(v InstanceGetStorageRetType) { - setInstanceGetStorageAttributeType(&o.Storage, v) -} - -// GetVersion returns the Version field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetVersion() (res InstanceGetVersionRetType) { - res, _ = o.GetVersionOk() - return -} - -// GetVersionOk returns a tuple with the Version field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetVersionOk() (ret InstanceGetVersionRetType, ok bool) { - return getInstanceGetVersionAttributeTypeOk(o.Version) -} - -// HasVersion returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) HasVersion() bool { - _, ok := o.GetVersionOk() - return ok -} - -// SetVersion gets a reference to the given string and assigns it to the Version field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) SetVersion(v InstanceGetVersionRetType) { - setInstanceGetVersionAttributeType(&o.Version, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o Instance) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getInstanceGetAclAttributeTypeOk(o.Acl); ok { - toSerialize["Acl"] = val - } - if val, ok := getInstanceGetBackupScheduleAttributeTypeOk(o.BackupSchedule); ok { - toSerialize["BackupSchedule"] = val - } - if val, ok := getInstanceGetFlavorAttributeTypeOk(o.Flavor); ok { - toSerialize["Flavor"] = val - } - if val, ok := getInstanceGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getInstanceGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getInstanceGetOptionsAttributeTypeOk(o.Options); ok { - toSerialize["Options"] = val - } - if val, ok := getInstanceGetReplicasAttributeTypeOk(o.Replicas); ok { - toSerialize["Replicas"] = val - } - if val, ok := getInstanceGetStatusAttributeTypeOk(o.Status); ok { - toSerialize["Status"] = val - } - if val, ok := getInstanceGetStorageAttributeTypeOk(o.Storage); ok { - toSerialize["Storage"] = val - } - if val, ok := getInstanceGetVersionAttributeTypeOk(o.Version); ok { - toSerialize["Version"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableInstance struct { - value *Instance - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstance) Get() *Instance { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstance) Set(val *Instance) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstance) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstance) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableInstance(val *Instance) *NullableInstance { - return &NullableInstance{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstance) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstance) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/model_api_install_response.go b/services/postgresflex/model_instance_connection_info.go similarity index 55% rename from services/postgresflex/model_api_install_response.go rename to services/postgresflex/model_instance_connection_info.go index c4ff3fd5b..ffe11e31c 100644 --- a/services/postgresflex/model_api_install_response.go +++ b/services/postgresflex/model_instance_connection_info.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,25 +15,25 @@ import ( "encoding/json" ) -// checks if the ApiInstallResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ApiInstallResponse{} +// checks if the InstanceConnectionInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceConnectionInfo{} /* - types and functions for extension + types and functions for write */ // isModel // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiInstallResponseGetExtensionAttributeType = *ApiExtensionList +type InstanceConnectionInfoGetWriteAttributeType = *InstanceConnectionInfoWrite // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiInstallResponseGetExtensionArgType = ApiExtensionList +type InstanceConnectionInfoGetWriteArgType = InstanceConnectionInfoWrite // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiInstallResponseGetExtensionRetType = ApiExtensionList +type InstanceConnectionInfoGetWriteRetType = InstanceConnectionInfoWrite // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getApiInstallResponseGetExtensionAttributeTypeOk(arg ApiInstallResponseGetExtensionAttributeType) (ret ApiInstallResponseGetExtensionRetType, ok bool) { +func getInstanceConnectionInfoGetWriteAttributeTypeOk(arg InstanceConnectionInfoGetWriteAttributeType) (ret InstanceConnectionInfoGetWriteRetType, ok bool) { if arg == nil { return ret, false } @@ -41,111 +41,109 @@ func getApiInstallResponseGetExtensionAttributeTypeOk(arg ApiInstallResponseGetE } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setApiInstallResponseGetExtensionAttributeType(arg *ApiInstallResponseGetExtensionAttributeType, val ApiInstallResponseGetExtensionRetType) { +func setInstanceConnectionInfoGetWriteAttributeType(arg *InstanceConnectionInfoGetWriteAttributeType, val InstanceConnectionInfoGetWriteRetType) { *arg = &val } -// ApiInstallResponse struct for ApiInstallResponse +// InstanceConnectionInfo The connection information of the instance // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiInstallResponse struct { - Extension ApiInstallResponseGetExtensionAttributeType `json:"extension,omitempty"` +type InstanceConnectionInfo struct { + // REQUIRED + Write InstanceConnectionInfoGetWriteAttributeType `json:"write" required:"true"` } -// NewApiInstallResponse instantiates a new ApiInstallResponse object +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _InstanceConnectionInfo InstanceConnectionInfo + +// NewInstanceConnectionInfo instantiates a new InstanceConnectionInfo object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewApiInstallResponse() *ApiInstallResponse { - this := ApiInstallResponse{} +func NewInstanceConnectionInfo(write InstanceConnectionInfoGetWriteArgType) *InstanceConnectionInfo { + this := InstanceConnectionInfo{} + setInstanceConnectionInfoGetWriteAttributeType(&this.Write, write) return &this } -// NewApiInstallResponseWithDefaults instantiates a new ApiInstallResponse object +// NewInstanceConnectionInfoWithDefaults instantiates a new InstanceConnectionInfo object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewApiInstallResponseWithDefaults() *ApiInstallResponse { - this := ApiInstallResponse{} +func NewInstanceConnectionInfoWithDefaults() *InstanceConnectionInfo { + this := InstanceConnectionInfo{} return &this } -// GetExtension returns the Extension field value if set, zero value otherwise. +// GetWrite returns the Write field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiInstallResponse) GetExtension() (res ApiInstallResponseGetExtensionRetType) { - res, _ = o.GetExtensionOk() - return +func (o *InstanceConnectionInfo) GetWrite() (ret InstanceConnectionInfoGetWriteRetType) { + ret, _ = o.GetWriteOk() + return ret } -// GetExtensionOk returns a tuple with the Extension field value if set, nil otherwise +// GetWriteOk returns a tuple with the Write field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiInstallResponse) GetExtensionOk() (ret ApiInstallResponseGetExtensionRetType, ok bool) { - return getApiInstallResponseGetExtensionAttributeTypeOk(o.Extension) -} - -// HasExtension returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiInstallResponse) HasExtension() bool { - _, ok := o.GetExtensionOk() - return ok +func (o *InstanceConnectionInfo) GetWriteOk() (ret InstanceConnectionInfoGetWriteRetType, ok bool) { + return getInstanceConnectionInfoGetWriteAttributeTypeOk(o.Write) } -// SetExtension gets a reference to the given ApiExtensionList and assigns it to the Extension field. +// SetWrite sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiInstallResponse) SetExtension(v ApiInstallResponseGetExtensionRetType) { - setApiInstallResponseGetExtensionAttributeType(&o.Extension, v) +func (o *InstanceConnectionInfo) SetWrite(v InstanceConnectionInfoGetWriteRetType) { + setInstanceConnectionInfoGetWriteAttributeType(&o.Write, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o ApiInstallResponse) ToMap() (map[string]interface{}, error) { +func (o InstanceConnectionInfo) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getApiInstallResponseGetExtensionAttributeTypeOk(o.Extension); ok { - toSerialize["Extension"] = val + if val, ok := getInstanceConnectionInfoGetWriteAttributeTypeOk(o.Write); ok { + toSerialize["Write"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableApiInstallResponse struct { - value *ApiInstallResponse +type NullableInstanceConnectionInfo struct { + value *InstanceConnectionInfo isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiInstallResponse) Get() *ApiInstallResponse { +func (v NullableInstanceConnectionInfo) Get() *InstanceConnectionInfo { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiInstallResponse) Set(val *ApiInstallResponse) { +func (v *NullableInstanceConnectionInfo) Set(val *InstanceConnectionInfo) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiInstallResponse) IsSet() bool { +func (v NullableInstanceConnectionInfo) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiInstallResponse) Unset() { +func (v *NullableInstanceConnectionInfo) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableApiInstallResponse(val *ApiInstallResponse) *NullableApiInstallResponse { - return &NullableApiInstallResponse{value: val, isSet: true} +func NewNullableInstanceConnectionInfo(val *InstanceConnectionInfo) *NullableInstanceConnectionInfo { + return &NullableInstanceConnectionInfo{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiInstallResponse) MarshalJSON() ([]byte, error) { +func (v NullableInstanceConnectionInfo) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiInstallResponse) UnmarshalJSON(src []byte) error { +func (v *NullableInstanceConnectionInfo) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_instance_connection_info_test.go b/services/postgresflex/model_instance_connection_info_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_instance_connection_info_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_instance_data_point.go b/services/postgresflex/model_instance_connection_info_write.go similarity index 50% rename from services/postgresflex/model_instance_data_point.go rename to services/postgresflex/model_instance_connection_info_write.go index 3293ad855..885e74937 100644 --- a/services/postgresflex/model_instance_data_point.go +++ b/services/postgresflex/model_instance_connection_info_write.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,19 +15,19 @@ import ( "encoding/json" ) -// checks if the InstanceDataPoint type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &InstanceDataPoint{} +// checks if the InstanceConnectionInfoWrite type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceConnectionInfoWrite{} /* - types and functions for timestamp + types and functions for host */ // isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceDataPointGetTimestampAttributeType = *string +type InstanceConnectionInfoWriteGetHostAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceDataPointGetTimestampAttributeTypeOk(arg InstanceDataPointGetTimestampAttributeType) (ret InstanceDataPointGetTimestampRetType, ok bool) { +func getInstanceConnectionInfoWriteGetHostAttributeTypeOk(arg InstanceConnectionInfoWriteGetHostAttributeType) (ret InstanceConnectionInfoWriteGetHostRetType, ok bool) { if arg == nil { return ret, false } @@ -35,32 +35,32 @@ func getInstanceDataPointGetTimestampAttributeTypeOk(arg InstanceDataPointGetTim } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceDataPointGetTimestampAttributeType(arg *InstanceDataPointGetTimestampAttributeType, val InstanceDataPointGetTimestampRetType) { +func setInstanceConnectionInfoWriteGetHostAttributeType(arg *InstanceConnectionInfoWriteGetHostAttributeType, val InstanceConnectionInfoWriteGetHostRetType) { *arg = &val } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceDataPointGetTimestampArgType = string +type InstanceConnectionInfoWriteGetHostArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceDataPointGetTimestampRetType = string +type InstanceConnectionInfoWriteGetHostRetType = string /* - types and functions for value + types and functions for port */ -// isNumber +// isInteger // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceDataPointGetValueAttributeType = *float64 +type InstanceConnectionInfoWriteGetPortAttributeType = *int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceDataPointGetValueArgType = float64 +type InstanceConnectionInfoWriteGetPortArgType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceDataPointGetValueRetType = float64 +type InstanceConnectionInfoWriteGetPortRetType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceDataPointGetValueAttributeTypeOk(arg InstanceDataPointGetValueAttributeType) (ret InstanceDataPointGetValueRetType, ok bool) { +func getInstanceConnectionInfoWriteGetPortAttributeTypeOk(arg InstanceConnectionInfoWriteGetPortAttributeType) (ret InstanceConnectionInfoWriteGetPortRetType, ok bool) { if arg == nil { return ret, false } @@ -68,142 +68,138 @@ func getInstanceDataPointGetValueAttributeTypeOk(arg InstanceDataPointGetValueAt } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceDataPointGetValueAttributeType(arg *InstanceDataPointGetValueAttributeType, val InstanceDataPointGetValueRetType) { +func setInstanceConnectionInfoWriteGetPortAttributeType(arg *InstanceConnectionInfoWriteGetPortAttributeType, val InstanceConnectionInfoWriteGetPortRetType) { *arg = &val } -// InstanceDataPoint struct for InstanceDataPoint +// InstanceConnectionInfoWrite The DNS name and port in the instance overview // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceDataPoint struct { - Timestamp InstanceDataPointGetTimestampAttributeType `json:"timestamp,omitempty"` - Value InstanceDataPointGetValueAttributeType `json:"value,omitempty"` +type InstanceConnectionInfoWrite struct { + // The host of the instance. + // REQUIRED + Host InstanceConnectionInfoWriteGetHostAttributeType `json:"host" required:"true"` + // The port of the instance. + // Can be cast to int32 without loss of precision. + // REQUIRED + Port InstanceConnectionInfoWriteGetPortAttributeType `json:"port" required:"true"` } -// NewInstanceDataPoint instantiates a new InstanceDataPoint object +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _InstanceConnectionInfoWrite InstanceConnectionInfoWrite + +// NewInstanceConnectionInfoWrite instantiates a new InstanceConnectionInfoWrite object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewInstanceDataPoint() *InstanceDataPoint { - this := InstanceDataPoint{} +func NewInstanceConnectionInfoWrite(host InstanceConnectionInfoWriteGetHostArgType, port InstanceConnectionInfoWriteGetPortArgType) *InstanceConnectionInfoWrite { + this := InstanceConnectionInfoWrite{} + setInstanceConnectionInfoWriteGetHostAttributeType(&this.Host, host) + setInstanceConnectionInfoWriteGetPortAttributeType(&this.Port, port) return &this } -// NewInstanceDataPointWithDefaults instantiates a new InstanceDataPoint object +// NewInstanceConnectionInfoWriteWithDefaults instantiates a new InstanceConnectionInfoWrite object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewInstanceDataPointWithDefaults() *InstanceDataPoint { - this := InstanceDataPoint{} +func NewInstanceConnectionInfoWriteWithDefaults() *InstanceConnectionInfoWrite { + this := InstanceConnectionInfoWrite{} return &this } -// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +// GetHost returns the Host field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceDataPoint) GetTimestamp() (res InstanceDataPointGetTimestampRetType) { - res, _ = o.GetTimestampOk() - return +func (o *InstanceConnectionInfoWrite) GetHost() (ret InstanceConnectionInfoWriteGetHostRetType) { + ret, _ = o.GetHostOk() + return ret } -// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// GetHostOk returns a tuple with the Host field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceDataPoint) GetTimestampOk() (ret InstanceDataPointGetTimestampRetType, ok bool) { - return getInstanceDataPointGetTimestampAttributeTypeOk(o.Timestamp) -} - -// HasTimestamp returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceDataPoint) HasTimestamp() bool { - _, ok := o.GetTimestampOk() - return ok +func (o *InstanceConnectionInfoWrite) GetHostOk() (ret InstanceConnectionInfoWriteGetHostRetType, ok bool) { + return getInstanceConnectionInfoWriteGetHostAttributeTypeOk(o.Host) } -// SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. +// SetHost sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceDataPoint) SetTimestamp(v InstanceDataPointGetTimestampRetType) { - setInstanceDataPointGetTimestampAttributeType(&o.Timestamp, v) +func (o *InstanceConnectionInfoWrite) SetHost(v InstanceConnectionInfoWriteGetHostRetType) { + setInstanceConnectionInfoWriteGetHostAttributeType(&o.Host, v) } -// GetValue returns the Value field value if set, zero value otherwise. +// GetPort returns the Port field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceDataPoint) GetValue() (res InstanceDataPointGetValueRetType) { - res, _ = o.GetValueOk() - return +func (o *InstanceConnectionInfoWrite) GetPort() (ret InstanceConnectionInfoWriteGetPortRetType) { + ret, _ = o.GetPortOk() + return ret } -// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// GetPortOk returns a tuple with the Port field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceDataPoint) GetValueOk() (ret InstanceDataPointGetValueRetType, ok bool) { - return getInstanceDataPointGetValueAttributeTypeOk(o.Value) -} - -// HasValue returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceDataPoint) HasValue() bool { - _, ok := o.GetValueOk() - return ok +func (o *InstanceConnectionInfoWrite) GetPortOk() (ret InstanceConnectionInfoWriteGetPortRetType, ok bool) { + return getInstanceConnectionInfoWriteGetPortAttributeTypeOk(o.Port) } -// SetValue gets a reference to the given float64 and assigns it to the Value field. +// SetPort sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceDataPoint) SetValue(v InstanceDataPointGetValueRetType) { - setInstanceDataPointGetValueAttributeType(&o.Value, v) +func (o *InstanceConnectionInfoWrite) SetPort(v InstanceConnectionInfoWriteGetPortRetType) { + setInstanceConnectionInfoWriteGetPortAttributeType(&o.Port, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o InstanceDataPoint) ToMap() (map[string]interface{}, error) { +func (o InstanceConnectionInfoWrite) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getInstanceDataPointGetTimestampAttributeTypeOk(o.Timestamp); ok { - toSerialize["Timestamp"] = val + if val, ok := getInstanceConnectionInfoWriteGetHostAttributeTypeOk(o.Host); ok { + toSerialize["Host"] = val } - if val, ok := getInstanceDataPointGetValueAttributeTypeOk(o.Value); ok { - toSerialize["Value"] = val + if val, ok := getInstanceConnectionInfoWriteGetPortAttributeTypeOk(o.Port); ok { + toSerialize["Port"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableInstanceDataPoint struct { - value *InstanceDataPoint +type NullableInstanceConnectionInfoWrite struct { + value *InstanceConnectionInfoWrite isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceDataPoint) Get() *InstanceDataPoint { +func (v NullableInstanceConnectionInfoWrite) Get() *InstanceConnectionInfoWrite { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceDataPoint) Set(val *InstanceDataPoint) { +func (v *NullableInstanceConnectionInfoWrite) Set(val *InstanceConnectionInfoWrite) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceDataPoint) IsSet() bool { +func (v NullableInstanceConnectionInfoWrite) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceDataPoint) Unset() { +func (v *NullableInstanceConnectionInfoWrite) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableInstanceDataPoint(val *InstanceDataPoint) *NullableInstanceDataPoint { - return &NullableInstanceDataPoint{value: val, isSet: true} +func NewNullableInstanceConnectionInfoWrite(val *InstanceConnectionInfoWrite) *NullableInstanceConnectionInfoWrite { + return &NullableInstanceConnectionInfoWrite{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceDataPoint) MarshalJSON() ([]byte, error) { +func (v NullableInstanceConnectionInfoWrite) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceDataPoint) UnmarshalJSON(src []byte) error { +func (v *NullableInstanceConnectionInfoWrite) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_instance_connection_info_write_test.go b/services/postgresflex/model_instance_connection_info_write_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_instance_connection_info_write_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_instance_create_database_response.go b/services/postgresflex/model_instance_create_database_response.go deleted file mode 100644 index 93b2bc650..000000000 --- a/services/postgresflex/model_instance_create_database_response.go +++ /dev/null @@ -1,151 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package postgresflex - -import ( - "encoding/json" -) - -// checks if the InstanceCreateDatabaseResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &InstanceCreateDatabaseResponse{} - -/* - types and functions for id -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceCreateDatabaseResponseGetIdAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceCreateDatabaseResponseGetIdAttributeTypeOk(arg InstanceCreateDatabaseResponseGetIdAttributeType) (ret InstanceCreateDatabaseResponseGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceCreateDatabaseResponseGetIdAttributeType(arg *InstanceCreateDatabaseResponseGetIdAttributeType, val InstanceCreateDatabaseResponseGetIdRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceCreateDatabaseResponseGetIdArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceCreateDatabaseResponseGetIdRetType = string - -// InstanceCreateDatabaseResponse struct for InstanceCreateDatabaseResponse -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceCreateDatabaseResponse struct { - Id InstanceCreateDatabaseResponseGetIdAttributeType `json:"id,omitempty"` -} - -// NewInstanceCreateDatabaseResponse instantiates a new InstanceCreateDatabaseResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewInstanceCreateDatabaseResponse() *InstanceCreateDatabaseResponse { - this := InstanceCreateDatabaseResponse{} - return &this -} - -// NewInstanceCreateDatabaseResponseWithDefaults instantiates a new InstanceCreateDatabaseResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewInstanceCreateDatabaseResponseWithDefaults() *InstanceCreateDatabaseResponse { - this := InstanceCreateDatabaseResponse{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceCreateDatabaseResponse) GetId() (res InstanceCreateDatabaseResponseGetIdRetType) { - res, _ = o.GetIdOk() - return -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceCreateDatabaseResponse) GetIdOk() (ret InstanceCreateDatabaseResponseGetIdRetType, ok bool) { - return getInstanceCreateDatabaseResponseGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceCreateDatabaseResponse) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceCreateDatabaseResponse) SetId(v InstanceCreateDatabaseResponseGetIdRetType) { - setInstanceCreateDatabaseResponseGetIdAttributeType(&o.Id, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o InstanceCreateDatabaseResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getInstanceCreateDatabaseResponseGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableInstanceCreateDatabaseResponse struct { - value *InstanceCreateDatabaseResponse - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceCreateDatabaseResponse) Get() *InstanceCreateDatabaseResponse { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceCreateDatabaseResponse) Set(val *InstanceCreateDatabaseResponse) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceCreateDatabaseResponse) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceCreateDatabaseResponse) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableInstanceCreateDatabaseResponse(val *InstanceCreateDatabaseResponse) *NullableInstanceCreateDatabaseResponse { - return &NullableInstanceCreateDatabaseResponse{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceCreateDatabaseResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceCreateDatabaseResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/model_instance_create_database_response_test.go b/services/postgresflex/model_instance_create_database_response_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_instance_create_database_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_instance_data_point_test.go b/services/postgresflex/model_instance_data_point_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_instance_data_point_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_instance_database_test.go b/services/postgresflex/model_instance_database_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_instance_database_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_instance_encryption.go b/services/postgresflex/model_instance_encryption.go new file mode 100644 index 000000000..42c705b81 --- /dev/null +++ b/services/postgresflex/model_instance_encryption.go @@ -0,0 +1,311 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package postgresflex + +import ( + "encoding/json" +) + +// checks if the InstanceEncryption type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceEncryption{} + +/* + types and functions for kekKeyId +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceEncryptionGetKekKeyIdAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getInstanceEncryptionGetKekKeyIdAttributeTypeOk(arg InstanceEncryptionGetKekKeyIdAttributeType) (ret InstanceEncryptionGetKekKeyIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setInstanceEncryptionGetKekKeyIdAttributeType(arg *InstanceEncryptionGetKekKeyIdAttributeType, val InstanceEncryptionGetKekKeyIdRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceEncryptionGetKekKeyIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceEncryptionGetKekKeyIdRetType = string + +/* + types and functions for kekKeyRingId +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceEncryptionGetKekKeyRingIdAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getInstanceEncryptionGetKekKeyRingIdAttributeTypeOk(arg InstanceEncryptionGetKekKeyRingIdAttributeType) (ret InstanceEncryptionGetKekKeyRingIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setInstanceEncryptionGetKekKeyRingIdAttributeType(arg *InstanceEncryptionGetKekKeyRingIdAttributeType, val InstanceEncryptionGetKekKeyRingIdRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceEncryptionGetKekKeyRingIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceEncryptionGetKekKeyRingIdRetType = string + +/* + types and functions for kekKeyVersion +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceEncryptionGetKekKeyVersionAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getInstanceEncryptionGetKekKeyVersionAttributeTypeOk(arg InstanceEncryptionGetKekKeyVersionAttributeType) (ret InstanceEncryptionGetKekKeyVersionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setInstanceEncryptionGetKekKeyVersionAttributeType(arg *InstanceEncryptionGetKekKeyVersionAttributeType, val InstanceEncryptionGetKekKeyVersionRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceEncryptionGetKekKeyVersionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceEncryptionGetKekKeyVersionRetType = string + +/* + types and functions for serviceAccount +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceEncryptionGetServiceAccountAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getInstanceEncryptionGetServiceAccountAttributeTypeOk(arg InstanceEncryptionGetServiceAccountAttributeType) (ret InstanceEncryptionGetServiceAccountRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setInstanceEncryptionGetServiceAccountAttributeType(arg *InstanceEncryptionGetServiceAccountAttributeType, val InstanceEncryptionGetServiceAccountRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceEncryptionGetServiceAccountArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceEncryptionGetServiceAccountRetType = string + +// InstanceEncryption 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. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceEncryption struct { + // The encryption-key key identifier + // REQUIRED + KekKeyId InstanceEncryptionGetKekKeyIdAttributeType `json:"kekKeyId" required:"true"` + // The encryption-key keyring identifier + // REQUIRED + KekKeyRingId InstanceEncryptionGetKekKeyRingIdAttributeType `json:"kekKeyRingId" required:"true"` + // The encryption-key version + // REQUIRED + KekKeyVersion InstanceEncryptionGetKekKeyVersionAttributeType `json:"kekKeyVersion" required:"true"` + // REQUIRED + ServiceAccount InstanceEncryptionGetServiceAccountAttributeType `json:"serviceAccount" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _InstanceEncryption InstanceEncryption + +// NewInstanceEncryption instantiates a new InstanceEncryption object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewInstanceEncryption(kekKeyId InstanceEncryptionGetKekKeyIdArgType, kekKeyRingId InstanceEncryptionGetKekKeyRingIdArgType, kekKeyVersion InstanceEncryptionGetKekKeyVersionArgType, serviceAccount InstanceEncryptionGetServiceAccountArgType) *InstanceEncryption { + this := InstanceEncryption{} + setInstanceEncryptionGetKekKeyIdAttributeType(&this.KekKeyId, kekKeyId) + setInstanceEncryptionGetKekKeyRingIdAttributeType(&this.KekKeyRingId, kekKeyRingId) + setInstanceEncryptionGetKekKeyVersionAttributeType(&this.KekKeyVersion, kekKeyVersion) + setInstanceEncryptionGetServiceAccountAttributeType(&this.ServiceAccount, serviceAccount) + return &this +} + +// NewInstanceEncryptionWithDefaults instantiates a new InstanceEncryption object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewInstanceEncryptionWithDefaults() *InstanceEncryption { + this := InstanceEncryption{} + return &this +} + +// GetKekKeyId returns the KekKeyId field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceEncryption) GetKekKeyId() (ret InstanceEncryptionGetKekKeyIdRetType) { + ret, _ = o.GetKekKeyIdOk() + return ret +} + +// GetKekKeyIdOk returns a tuple with the KekKeyId field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceEncryption) GetKekKeyIdOk() (ret InstanceEncryptionGetKekKeyIdRetType, ok bool) { + return getInstanceEncryptionGetKekKeyIdAttributeTypeOk(o.KekKeyId) +} + +// SetKekKeyId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceEncryption) SetKekKeyId(v InstanceEncryptionGetKekKeyIdRetType) { + setInstanceEncryptionGetKekKeyIdAttributeType(&o.KekKeyId, v) +} + +// GetKekKeyRingId returns the KekKeyRingId field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceEncryption) GetKekKeyRingId() (ret InstanceEncryptionGetKekKeyRingIdRetType) { + ret, _ = o.GetKekKeyRingIdOk() + return ret +} + +// GetKekKeyRingIdOk returns a tuple with the KekKeyRingId field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceEncryption) GetKekKeyRingIdOk() (ret InstanceEncryptionGetKekKeyRingIdRetType, ok bool) { + return getInstanceEncryptionGetKekKeyRingIdAttributeTypeOk(o.KekKeyRingId) +} + +// SetKekKeyRingId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceEncryption) SetKekKeyRingId(v InstanceEncryptionGetKekKeyRingIdRetType) { + setInstanceEncryptionGetKekKeyRingIdAttributeType(&o.KekKeyRingId, v) +} + +// GetKekKeyVersion returns the KekKeyVersion field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceEncryption) GetKekKeyVersion() (ret InstanceEncryptionGetKekKeyVersionRetType) { + ret, _ = o.GetKekKeyVersionOk() + return ret +} + +// GetKekKeyVersionOk returns a tuple with the KekKeyVersion field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceEncryption) GetKekKeyVersionOk() (ret InstanceEncryptionGetKekKeyVersionRetType, ok bool) { + return getInstanceEncryptionGetKekKeyVersionAttributeTypeOk(o.KekKeyVersion) +} + +// SetKekKeyVersion sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceEncryption) SetKekKeyVersion(v InstanceEncryptionGetKekKeyVersionRetType) { + setInstanceEncryptionGetKekKeyVersionAttributeType(&o.KekKeyVersion, v) +} + +// GetServiceAccount returns the ServiceAccount field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceEncryption) GetServiceAccount() (ret InstanceEncryptionGetServiceAccountRetType) { + ret, _ = o.GetServiceAccountOk() + return ret +} + +// GetServiceAccountOk returns a tuple with the ServiceAccount field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceEncryption) GetServiceAccountOk() (ret InstanceEncryptionGetServiceAccountRetType, ok bool) { + return getInstanceEncryptionGetServiceAccountAttributeTypeOk(o.ServiceAccount) +} + +// SetServiceAccount sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceEncryption) SetServiceAccount(v InstanceEncryptionGetServiceAccountRetType) { + setInstanceEncryptionGetServiceAccountAttributeType(&o.ServiceAccount, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o InstanceEncryption) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getInstanceEncryptionGetKekKeyIdAttributeTypeOk(o.KekKeyId); ok { + toSerialize["KekKeyId"] = val + } + if val, ok := getInstanceEncryptionGetKekKeyRingIdAttributeTypeOk(o.KekKeyRingId); ok { + toSerialize["KekKeyRingId"] = val + } + if val, ok := getInstanceEncryptionGetKekKeyVersionAttributeTypeOk(o.KekKeyVersion); ok { + toSerialize["KekKeyVersion"] = val + } + if val, ok := getInstanceEncryptionGetServiceAccountAttributeTypeOk(o.ServiceAccount); ok { + toSerialize["ServiceAccount"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableInstanceEncryption struct { + value *InstanceEncryption + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableInstanceEncryption) Get() *InstanceEncryption { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableInstanceEncryption) Set(val *InstanceEncryption) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableInstanceEncryption) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableInstanceEncryption) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableInstanceEncryption(val *InstanceEncryption) *NullableInstanceEncryption { + return &NullableInstanceEncryption{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableInstanceEncryption) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableInstanceEncryption) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/model_instance_encryption_test.go b/services/postgresflex/model_instance_encryption_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_instance_encryption_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_instance_host_metric_test.go b/services/postgresflex/model_instance_host_metric_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_instance_host_metric_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_instance_host_test.go b/services/postgresflex/model_instance_host_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_instance_host_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_instance_list_databases_response.go b/services/postgresflex/model_instance_list_databases_response.go deleted file mode 100644 index 78117830a..000000000 --- a/services/postgresflex/model_instance_list_databases_response.go +++ /dev/null @@ -1,151 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package postgresflex - -import ( - "encoding/json" -) - -// checks if the InstanceListDatabasesResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &InstanceListDatabasesResponse{} - -/* - types and functions for databases -*/ - -// isArray -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceListDatabasesResponseGetDatabasesAttributeType = *[]InstanceDatabase - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceListDatabasesResponseGetDatabasesArgType = []InstanceDatabase - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceListDatabasesResponseGetDatabasesRetType = []InstanceDatabase - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceListDatabasesResponseGetDatabasesAttributeTypeOk(arg InstanceListDatabasesResponseGetDatabasesAttributeType) (ret InstanceListDatabasesResponseGetDatabasesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceListDatabasesResponseGetDatabasesAttributeType(arg *InstanceListDatabasesResponseGetDatabasesAttributeType, val InstanceListDatabasesResponseGetDatabasesRetType) { - *arg = &val -} - -// InstanceListDatabasesResponse struct for InstanceListDatabasesResponse -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceListDatabasesResponse struct { - Databases InstanceListDatabasesResponseGetDatabasesAttributeType `json:"databases,omitempty"` -} - -// NewInstanceListDatabasesResponse instantiates a new InstanceListDatabasesResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewInstanceListDatabasesResponse() *InstanceListDatabasesResponse { - this := InstanceListDatabasesResponse{} - return &this -} - -// NewInstanceListDatabasesResponseWithDefaults instantiates a new InstanceListDatabasesResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewInstanceListDatabasesResponseWithDefaults() *InstanceListDatabasesResponse { - this := InstanceListDatabasesResponse{} - return &this -} - -// GetDatabases returns the Databases field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceListDatabasesResponse) GetDatabases() (res InstanceListDatabasesResponseGetDatabasesRetType) { - res, _ = o.GetDatabasesOk() - return -} - -// GetDatabasesOk returns a tuple with the Databases field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceListDatabasesResponse) GetDatabasesOk() (ret InstanceListDatabasesResponseGetDatabasesRetType, ok bool) { - return getInstanceListDatabasesResponseGetDatabasesAttributeTypeOk(o.Databases) -} - -// HasDatabases returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceListDatabasesResponse) HasDatabases() bool { - _, ok := o.GetDatabasesOk() - return ok -} - -// SetDatabases gets a reference to the given []InstanceDatabase and assigns it to the Databases field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceListDatabasesResponse) SetDatabases(v InstanceListDatabasesResponseGetDatabasesRetType) { - setInstanceListDatabasesResponseGetDatabasesAttributeType(&o.Databases, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o InstanceListDatabasesResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getInstanceListDatabasesResponseGetDatabasesAttributeTypeOk(o.Databases); ok { - toSerialize["Databases"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableInstanceListDatabasesResponse struct { - value *InstanceListDatabasesResponse - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceListDatabasesResponse) Get() *InstanceListDatabasesResponse { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceListDatabasesResponse) Set(val *InstanceListDatabasesResponse) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceListDatabasesResponse) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceListDatabasesResponse) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableInstanceListDatabasesResponse(val *InstanceListDatabasesResponse) *NullableInstanceListDatabasesResponse { - return &NullableInstanceListDatabasesResponse{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceListDatabasesResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceListDatabasesResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/model_instance_list_databases_response_test.go b/services/postgresflex/model_instance_list_databases_response_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_instance_list_databases_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_instance_list_instance_test.go b/services/postgresflex/model_instance_list_instance_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_instance_list_instance_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_instance_metrics_response_test.go b/services/postgresflex/model_instance_metrics_response_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_instance_metrics_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_instance_network.go b/services/postgresflex/model_instance_network.go new file mode 100644 index 000000000..d3e7ae16a --- /dev/null +++ b/services/postgresflex/model_instance_network.go @@ -0,0 +1,326 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package postgresflex + +import ( + "encoding/json" +) + +// checks if the InstanceNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceNetwork{} + +/* + types and functions for accessScope +*/ + +// isEnumRef +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceNetworkGetAccessScopeAttributeType = *InstanceNetworkAccessScope + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceNetworkGetAccessScopeArgType = InstanceNetworkAccessScope + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceNetworkGetAccessScopeRetType = InstanceNetworkAccessScope + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getInstanceNetworkGetAccessScopeAttributeTypeOk(arg InstanceNetworkGetAccessScopeAttributeType) (ret InstanceNetworkGetAccessScopeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setInstanceNetworkGetAccessScopeAttributeType(arg *InstanceNetworkGetAccessScopeAttributeType, val InstanceNetworkGetAccessScopeRetType) { + *arg = &val +} + +/* + types and functions for acl +*/ + +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceNetworkGetAclAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceNetworkGetAclArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceNetworkGetAclRetType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getInstanceNetworkGetAclAttributeTypeOk(arg InstanceNetworkGetAclAttributeType) (ret InstanceNetworkGetAclRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setInstanceNetworkGetAclAttributeType(arg *InstanceNetworkGetAclAttributeType, val InstanceNetworkGetAclRetType) { + *arg = &val +} + +/* + types and functions for instanceAddress +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceNetworkGetInstanceAddressAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getInstanceNetworkGetInstanceAddressAttributeTypeOk(arg InstanceNetworkGetInstanceAddressAttributeType) (ret InstanceNetworkGetInstanceAddressRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setInstanceNetworkGetInstanceAddressAttributeType(arg *InstanceNetworkGetInstanceAddressAttributeType, val InstanceNetworkGetInstanceAddressRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceNetworkGetInstanceAddressArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceNetworkGetInstanceAddressRetType = string + +/* + types and functions for routerAddress +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceNetworkGetRouterAddressAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getInstanceNetworkGetRouterAddressAttributeTypeOk(arg InstanceNetworkGetRouterAddressAttributeType) (ret InstanceNetworkGetRouterAddressRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setInstanceNetworkGetRouterAddressAttributeType(arg *InstanceNetworkGetRouterAddressAttributeType, val InstanceNetworkGetRouterAddressRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceNetworkGetRouterAddressArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceNetworkGetRouterAddressRetType = string + +// InstanceNetwork The access configuration of the instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceNetwork struct { + AccessScope InstanceNetworkGetAccessScopeAttributeType `json:"accessScope,omitempty"` + // List of IPV4 cidr. + // REQUIRED + Acl InstanceNetworkGetAclAttributeType `json:"acl" required:"true"` + InstanceAddress InstanceNetworkGetInstanceAddressAttributeType `json:"instanceAddress,omitempty"` + RouterAddress InstanceNetworkGetRouterAddressAttributeType `json:"routerAddress,omitempty"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _InstanceNetwork InstanceNetwork + +// NewInstanceNetwork instantiates a new InstanceNetwork object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewInstanceNetwork(acl InstanceNetworkGetAclArgType) *InstanceNetwork { + this := InstanceNetwork{} + setInstanceNetworkGetAclAttributeType(&this.Acl, acl) + return &this +} + +// NewInstanceNetworkWithDefaults instantiates a new InstanceNetwork object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewInstanceNetworkWithDefaults() *InstanceNetwork { + this := InstanceNetwork{} + var accessScope InstanceNetworkAccessScope = INSTANCENETWORKACCESSSCOPE_PUBLIC + this.AccessScope = &accessScope + return &this +} + +// GetAccessScope returns the AccessScope field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceNetwork) GetAccessScope() (res InstanceNetworkGetAccessScopeRetType) { + res, _ = o.GetAccessScopeOk() + return +} + +// GetAccessScopeOk returns a tuple with the AccessScope field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceNetwork) GetAccessScopeOk() (ret InstanceNetworkGetAccessScopeRetType, ok bool) { + return getInstanceNetworkGetAccessScopeAttributeTypeOk(o.AccessScope) +} + +// HasAccessScope returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceNetwork) HasAccessScope() bool { + _, ok := o.GetAccessScopeOk() + return ok +} + +// SetAccessScope gets a reference to the given InstanceNetworkAccessScope and assigns it to the AccessScope field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceNetwork) SetAccessScope(v InstanceNetworkGetAccessScopeRetType) { + setInstanceNetworkGetAccessScopeAttributeType(&o.AccessScope, v) +} + +// GetAcl returns the Acl field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceNetwork) GetAcl() (ret InstanceNetworkGetAclRetType) { + ret, _ = o.GetAclOk() + return ret +} + +// GetAclOk returns a tuple with the Acl field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceNetwork) GetAclOk() (ret InstanceNetworkGetAclRetType, ok bool) { + return getInstanceNetworkGetAclAttributeTypeOk(o.Acl) +} + +// SetAcl sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceNetwork) SetAcl(v InstanceNetworkGetAclRetType) { + setInstanceNetworkGetAclAttributeType(&o.Acl, v) +} + +// GetInstanceAddress returns the InstanceAddress field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceNetwork) GetInstanceAddress() (res InstanceNetworkGetInstanceAddressRetType) { + res, _ = o.GetInstanceAddressOk() + return +} + +// GetInstanceAddressOk returns a tuple with the InstanceAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceNetwork) GetInstanceAddressOk() (ret InstanceNetworkGetInstanceAddressRetType, ok bool) { + return getInstanceNetworkGetInstanceAddressAttributeTypeOk(o.InstanceAddress) +} + +// HasInstanceAddress returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceNetwork) HasInstanceAddress() bool { + _, ok := o.GetInstanceAddressOk() + return ok +} + +// SetInstanceAddress gets a reference to the given string and assigns it to the InstanceAddress field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceNetwork) SetInstanceAddress(v InstanceNetworkGetInstanceAddressRetType) { + setInstanceNetworkGetInstanceAddressAttributeType(&o.InstanceAddress, v) +} + +// GetRouterAddress returns the RouterAddress field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceNetwork) GetRouterAddress() (res InstanceNetworkGetRouterAddressRetType) { + res, _ = o.GetRouterAddressOk() + return +} + +// GetRouterAddressOk returns a tuple with the RouterAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceNetwork) GetRouterAddressOk() (ret InstanceNetworkGetRouterAddressRetType, ok bool) { + return getInstanceNetworkGetRouterAddressAttributeTypeOk(o.RouterAddress) +} + +// HasRouterAddress returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceNetwork) HasRouterAddress() bool { + _, ok := o.GetRouterAddressOk() + return ok +} + +// SetRouterAddress gets a reference to the given string and assigns it to the RouterAddress field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceNetwork) SetRouterAddress(v InstanceNetworkGetRouterAddressRetType) { + setInstanceNetworkGetRouterAddressAttributeType(&o.RouterAddress, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o InstanceNetwork) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getInstanceNetworkGetAccessScopeAttributeTypeOk(o.AccessScope); ok { + toSerialize["AccessScope"] = val + } + if val, ok := getInstanceNetworkGetAclAttributeTypeOk(o.Acl); ok { + toSerialize["Acl"] = val + } + if val, ok := getInstanceNetworkGetInstanceAddressAttributeTypeOk(o.InstanceAddress); ok { + toSerialize["InstanceAddress"] = val + } + if val, ok := getInstanceNetworkGetRouterAddressAttributeTypeOk(o.RouterAddress); ok { + toSerialize["RouterAddress"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableInstanceNetwork struct { + value *InstanceNetwork + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableInstanceNetwork) Get() *InstanceNetwork { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableInstanceNetwork) Set(val *InstanceNetwork) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableInstanceNetwork) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableInstanceNetwork) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableInstanceNetwork(val *InstanceNetwork) *NullableInstanceNetwork { + return &NullableInstanceNetwork{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableInstanceNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableInstanceNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/model_instance_network_access_scope.go b/services/postgresflex/model_instance_network_access_scope.go new file mode 100644 index 000000000..6efaedf2e --- /dev/null +++ b/services/postgresflex/model_instance_network_access_scope.go @@ -0,0 +1,132 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package postgresflex + +import ( + "encoding/json" + "fmt" +) + +// InstanceNetworkAccessScope The access scope of the instance. It defines if the instance is public or airgapped. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceNetworkAccessScope string + +// List of instance.network.accessScope +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + INSTANCENETWORKACCESSSCOPE_PUBLIC InstanceNetworkAccessScope = "PUBLIC" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + INSTANCENETWORKACCESSSCOPE_SNA InstanceNetworkAccessScope = "SNA" +) + +// All allowed values of InstanceNetworkAccessScope enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedInstanceNetworkAccessScopeEnumValues = []InstanceNetworkAccessScope{ + "PUBLIC", + "SNA", +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *InstanceNetworkAccessScope) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue string + if value == zeroValue { + return nil + } + enumTypeValue := InstanceNetworkAccessScope(value) + for _, existing := range AllowedInstanceNetworkAccessScopeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InstanceNetworkAccessScope", value) +} + +// NewInstanceNetworkAccessScopeFromValue returns a pointer to a valid InstanceNetworkAccessScope +// for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewInstanceNetworkAccessScopeFromValue(v string) (*InstanceNetworkAccessScope, error) { + ev := InstanceNetworkAccessScope(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceNetworkAccessScope: valid values are %v", v, AllowedInstanceNetworkAccessScopeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v InstanceNetworkAccessScope) IsValid() bool { + for _, existing := range AllowedInstanceNetworkAccessScopeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to instance.network.accessScope value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v InstanceNetworkAccessScope) Ptr() *InstanceNetworkAccessScope { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableInstanceNetworkAccessScope struct { + value *InstanceNetworkAccessScope + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableInstanceNetworkAccessScope) Get() *InstanceNetworkAccessScope { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableInstanceNetworkAccessScope) Set(val *InstanceNetworkAccessScope) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableInstanceNetworkAccessScope) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableInstanceNetworkAccessScope) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableInstanceNetworkAccessScope(val *InstanceNetworkAccessScope) *NullableInstanceNetworkAccessScope { + return &NullableInstanceNetworkAccessScope{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableInstanceNetworkAccessScope) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableInstanceNetworkAccessScope) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/model_instance_network_access_scope_test.go b/services/postgresflex/model_instance_network_access_scope_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_instance_network_access_scope_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_list_users_response_item.go b/services/postgresflex/model_instance_network_create.go similarity index 51% rename from services/postgresflex/model_list_users_response_item.go rename to services/postgresflex/model_instance_network_create.go index 57dcc0292..3e4557c30 100644 --- a/services/postgresflex/model_list_users_response_item.go +++ b/services/postgresflex/model_instance_network_create.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,19 +15,25 @@ import ( "encoding/json" ) -// checks if the ListUsersResponseItem type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListUsersResponseItem{} +// checks if the InstanceNetworkCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceNetworkCreate{} /* - types and functions for id + types and functions for accessScope */ -// isNotNullableString +// isEnumRef // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListUsersResponseItemGetIdAttributeType = *string +type InstanceNetworkCreateGetAccessScopeAttributeType = *InstanceNetworkAccessScope // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getListUsersResponseItemGetIdAttributeTypeOk(arg ListUsersResponseItemGetIdAttributeType) (ret ListUsersResponseItemGetIdRetType, ok bool) { +type InstanceNetworkCreateGetAccessScopeArgType = InstanceNetworkAccessScope + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceNetworkCreateGetAccessScopeRetType = InstanceNetworkAccessScope + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getInstanceNetworkCreateGetAccessScopeAttributeTypeOk(arg InstanceNetworkCreateGetAccessScopeAttributeType) (ret InstanceNetworkCreateGetAccessScopeRetType, ok bool) { if arg == nil { return ret, false } @@ -35,26 +41,26 @@ func getListUsersResponseItemGetIdAttributeTypeOk(arg ListUsersResponseItemGetId } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setListUsersResponseItemGetIdAttributeType(arg *ListUsersResponseItemGetIdAttributeType, val ListUsersResponseItemGetIdRetType) { +func setInstanceNetworkCreateGetAccessScopeAttributeType(arg *InstanceNetworkCreateGetAccessScopeAttributeType, val InstanceNetworkCreateGetAccessScopeRetType) { *arg = &val } -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListUsersResponseItemGetIdArgType = string +/* + types and functions for acl +*/ +// isArray // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListUsersResponseItemGetIdRetType = string +type InstanceNetworkCreateGetAclAttributeType = *[]string -/* - types and functions for username -*/ +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceNetworkCreateGetAclArgType = []string -// isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListUsersResponseItemGetUsernameAttributeType = *string +type InstanceNetworkCreateGetAclRetType = []string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getListUsersResponseItemGetUsernameAttributeTypeOk(arg ListUsersResponseItemGetUsernameAttributeType) (ret ListUsersResponseItemGetUsernameRetType, ok bool) { +func getInstanceNetworkCreateGetAclAttributeTypeOk(arg InstanceNetworkCreateGetAclAttributeType) (ret InstanceNetworkCreateGetAclRetType, ok bool) { if arg == nil { return ret, false } @@ -62,148 +68,143 @@ func getListUsersResponseItemGetUsernameAttributeTypeOk(arg ListUsersResponseIte } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setListUsersResponseItemGetUsernameAttributeType(arg *ListUsersResponseItemGetUsernameAttributeType, val ListUsersResponseItemGetUsernameRetType) { +func setInstanceNetworkCreateGetAclAttributeType(arg *InstanceNetworkCreateGetAclAttributeType, val InstanceNetworkCreateGetAclRetType) { *arg = &val } +// InstanceNetworkCreate The access configuration of the instance // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListUsersResponseItemGetUsernameArgType = string +type InstanceNetworkCreate struct { + AccessScope InstanceNetworkCreateGetAccessScopeAttributeType `json:"accessScope,omitempty"` + // List of IPV4 cidr. + // REQUIRED + Acl InstanceNetworkCreateGetAclAttributeType `json:"acl" required:"true"` +} // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListUsersResponseItemGetUsernameRetType = string +type _InstanceNetworkCreate InstanceNetworkCreate -// ListUsersResponseItem struct for ListUsersResponseItem -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListUsersResponseItem struct { - Id ListUsersResponseItemGetIdAttributeType `json:"id,omitempty"` - Username ListUsersResponseItemGetUsernameAttributeType `json:"username,omitempty"` -} - -// NewListUsersResponseItem instantiates a new ListUsersResponseItem object +// NewInstanceNetworkCreate instantiates a new InstanceNetworkCreate object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewListUsersResponseItem() *ListUsersResponseItem { - this := ListUsersResponseItem{} +func NewInstanceNetworkCreate(acl InstanceNetworkCreateGetAclArgType) *InstanceNetworkCreate { + this := InstanceNetworkCreate{} + setInstanceNetworkCreateGetAclAttributeType(&this.Acl, acl) return &this } -// NewListUsersResponseItemWithDefaults instantiates a new ListUsersResponseItem object +// NewInstanceNetworkCreateWithDefaults instantiates a new InstanceNetworkCreate object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewListUsersResponseItemWithDefaults() *ListUsersResponseItem { - this := ListUsersResponseItem{} +func NewInstanceNetworkCreateWithDefaults() *InstanceNetworkCreate { + this := InstanceNetworkCreate{} + var accessScope InstanceNetworkAccessScope = INSTANCENETWORKACCESSSCOPE_PUBLIC + this.AccessScope = &accessScope return &this } -// GetId returns the Id field value if set, zero value otherwise. +// GetAccessScope returns the AccessScope field value if set, zero value otherwise. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListUsersResponseItem) GetId() (res ListUsersResponseItemGetIdRetType) { - res, _ = o.GetIdOk() +func (o *InstanceNetworkCreate) GetAccessScope() (res InstanceNetworkCreateGetAccessScopeRetType) { + res, _ = o.GetAccessScopeOk() return } -// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// GetAccessScopeOk returns a tuple with the AccessScope field value if set, nil otherwise // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListUsersResponseItem) GetIdOk() (ret ListUsersResponseItemGetIdRetType, ok bool) { - return getListUsersResponseItemGetIdAttributeTypeOk(o.Id) +func (o *InstanceNetworkCreate) GetAccessScopeOk() (ret InstanceNetworkCreateGetAccessScopeRetType, ok bool) { + return getInstanceNetworkCreateGetAccessScopeAttributeTypeOk(o.AccessScope) } -// HasId returns a boolean if a field has been set. +// HasAccessScope returns a boolean if a field has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListUsersResponseItem) HasId() bool { - _, ok := o.GetIdOk() +func (o *InstanceNetworkCreate) HasAccessScope() bool { + _, ok := o.GetAccessScopeOk() return ok } -// SetId gets a reference to the given string and assigns it to the Id field. +// SetAccessScope gets a reference to the given InstanceNetworkAccessScope and assigns it to the AccessScope field. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListUsersResponseItem) SetId(v ListUsersResponseItemGetIdRetType) { - setListUsersResponseItemGetIdAttributeType(&o.Id, v) +func (o *InstanceNetworkCreate) SetAccessScope(v InstanceNetworkCreateGetAccessScopeRetType) { + setInstanceNetworkCreateGetAccessScopeAttributeType(&o.AccessScope, v) } -// GetUsername returns the Username field value if set, zero value otherwise. +// GetAcl returns the Acl field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListUsersResponseItem) GetUsername() (res ListUsersResponseItemGetUsernameRetType) { - res, _ = o.GetUsernameOk() - return +func (o *InstanceNetworkCreate) GetAcl() (ret InstanceNetworkCreateGetAclRetType) { + ret, _ = o.GetAclOk() + return ret } -// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// GetAclOk returns a tuple with the Acl field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListUsersResponseItem) GetUsernameOk() (ret ListUsersResponseItemGetUsernameRetType, ok bool) { - return getListUsersResponseItemGetUsernameAttributeTypeOk(o.Username) -} - -// HasUsername returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListUsersResponseItem) HasUsername() bool { - _, ok := o.GetUsernameOk() - return ok +func (o *InstanceNetworkCreate) GetAclOk() (ret InstanceNetworkCreateGetAclRetType, ok bool) { + return getInstanceNetworkCreateGetAclAttributeTypeOk(o.Acl) } -// SetUsername gets a reference to the given string and assigns it to the Username field. +// SetAcl sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListUsersResponseItem) SetUsername(v ListUsersResponseItemGetUsernameRetType) { - setListUsersResponseItemGetUsernameAttributeType(&o.Username, v) +func (o *InstanceNetworkCreate) SetAcl(v InstanceNetworkCreateGetAclRetType) { + setInstanceNetworkCreateGetAclAttributeType(&o.Acl, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o ListUsersResponseItem) ToMap() (map[string]interface{}, error) { +func (o InstanceNetworkCreate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getListUsersResponseItemGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val + if val, ok := getInstanceNetworkCreateGetAccessScopeAttributeTypeOk(o.AccessScope); ok { + toSerialize["AccessScope"] = val } - if val, ok := getListUsersResponseItemGetUsernameAttributeTypeOk(o.Username); ok { - toSerialize["Username"] = val + if val, ok := getInstanceNetworkCreateGetAclAttributeTypeOk(o.Acl); ok { + toSerialize["Acl"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableListUsersResponseItem struct { - value *ListUsersResponseItem +type NullableInstanceNetworkCreate struct { + value *InstanceNetworkCreate isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableListUsersResponseItem) Get() *ListUsersResponseItem { +func (v NullableInstanceNetworkCreate) Get() *InstanceNetworkCreate { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableListUsersResponseItem) Set(val *ListUsersResponseItem) { +func (v *NullableInstanceNetworkCreate) Set(val *InstanceNetworkCreate) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableListUsersResponseItem) IsSet() bool { +func (v NullableInstanceNetworkCreate) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableListUsersResponseItem) Unset() { +func (v *NullableInstanceNetworkCreate) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableListUsersResponseItem(val *ListUsersResponseItem) *NullableListUsersResponseItem { - return &NullableListUsersResponseItem{value: val, isSet: true} +func NewNullableInstanceNetworkCreate(val *InstanceNetworkCreate) *NullableInstanceNetworkCreate { + return &NullableInstanceNetworkCreate{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableListUsersResponseItem) MarshalJSON() ([]byte, error) { +func (v NullableInstanceNetworkCreate) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableListUsersResponseItem) UnmarshalJSON(src []byte) error { +func (v *NullableInstanceNetworkCreate) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_instance_network_create_test.go b/services/postgresflex/model_instance_network_create_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_instance_network_create_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_reset_user_response.go b/services/postgresflex/model_instance_network_opt.go similarity index 58% rename from services/postgresflex/model_reset_user_response.go rename to services/postgresflex/model_instance_network_opt.go index 685905cfa..52a20034c 100644 --- a/services/postgresflex/model_reset_user_response.go +++ b/services/postgresflex/model_instance_network_opt.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,25 +15,25 @@ import ( "encoding/json" ) -// checks if the ResetUserResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ResetUserResponse{} +// checks if the InstanceNetworkOpt type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceNetworkOpt{} /* - types and functions for item + types and functions for acl */ -// isModel +// isArray // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ResetUserResponseGetItemAttributeType = *User +type InstanceNetworkOptGetAclAttributeType = *[]string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ResetUserResponseGetItemArgType = User +type InstanceNetworkOptGetAclArgType = []string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ResetUserResponseGetItemRetType = User +type InstanceNetworkOptGetAclRetType = []string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getResetUserResponseGetItemAttributeTypeOk(arg ResetUserResponseGetItemAttributeType) (ret ResetUserResponseGetItemRetType, ok bool) { +func getInstanceNetworkOptGetAclAttributeTypeOk(arg InstanceNetworkOptGetAclAttributeType) (ret InstanceNetworkOptGetAclRetType, ok bool) { if arg == nil { return ret, false } @@ -41,111 +41,112 @@ func getResetUserResponseGetItemAttributeTypeOk(arg ResetUserResponseGetItemAttr } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setResetUserResponseGetItemAttributeType(arg *ResetUserResponseGetItemAttributeType, val ResetUserResponseGetItemRetType) { +func setInstanceNetworkOptGetAclAttributeType(arg *InstanceNetworkOptGetAclAttributeType, val InstanceNetworkOptGetAclRetType) { *arg = &val } -// ResetUserResponse struct for ResetUserResponse +// InstanceNetworkOpt The access configuration of the instance // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ResetUserResponse struct { - Item ResetUserResponseGetItemAttributeType `json:"item,omitempty"` +type InstanceNetworkOpt struct { + // List of IPV4 cidr. + Acl InstanceNetworkOptGetAclAttributeType `json:"acl,omitempty"` } -// NewResetUserResponse instantiates a new ResetUserResponse object +// NewInstanceNetworkOpt instantiates a new InstanceNetworkOpt object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewResetUserResponse() *ResetUserResponse { - this := ResetUserResponse{} +func NewInstanceNetworkOpt() *InstanceNetworkOpt { + this := InstanceNetworkOpt{} return &this } -// NewResetUserResponseWithDefaults instantiates a new ResetUserResponse object +// NewInstanceNetworkOptWithDefaults instantiates a new InstanceNetworkOpt object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewResetUserResponseWithDefaults() *ResetUserResponse { - this := ResetUserResponse{} +func NewInstanceNetworkOptWithDefaults() *InstanceNetworkOpt { + this := InstanceNetworkOpt{} return &this } -// GetItem returns the Item field value if set, zero value otherwise. +// GetAcl returns the Acl field value if set, zero value otherwise. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ResetUserResponse) GetItem() (res ResetUserResponseGetItemRetType) { - res, _ = o.GetItemOk() +func (o *InstanceNetworkOpt) GetAcl() (res InstanceNetworkOptGetAclRetType) { + res, _ = o.GetAclOk() return } -// GetItemOk returns a tuple with the Item field value if set, nil otherwise +// GetAclOk returns a tuple with the Acl field value if set, nil otherwise // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ResetUserResponse) GetItemOk() (ret ResetUserResponseGetItemRetType, ok bool) { - return getResetUserResponseGetItemAttributeTypeOk(o.Item) +func (o *InstanceNetworkOpt) GetAclOk() (ret InstanceNetworkOptGetAclRetType, ok bool) { + return getInstanceNetworkOptGetAclAttributeTypeOk(o.Acl) } -// HasItem returns a boolean if a field has been set. +// HasAcl returns a boolean if a field has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ResetUserResponse) HasItem() bool { - _, ok := o.GetItemOk() +func (o *InstanceNetworkOpt) HasAcl() bool { + _, ok := o.GetAclOk() return ok } -// SetItem gets a reference to the given User and assigns it to the Item field. +// SetAcl gets a reference to the given []string and assigns it to the Acl field. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ResetUserResponse) SetItem(v ResetUserResponseGetItemRetType) { - setResetUserResponseGetItemAttributeType(&o.Item, v) +func (o *InstanceNetworkOpt) SetAcl(v InstanceNetworkOptGetAclRetType) { + setInstanceNetworkOptGetAclAttributeType(&o.Acl, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o ResetUserResponse) ToMap() (map[string]interface{}, error) { +func (o InstanceNetworkOpt) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getResetUserResponseGetItemAttributeTypeOk(o.Item); ok { - toSerialize["Item"] = val + if val, ok := getInstanceNetworkOptGetAclAttributeTypeOk(o.Acl); ok { + toSerialize["Acl"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableResetUserResponse struct { - value *ResetUserResponse +type NullableInstanceNetworkOpt struct { + value *InstanceNetworkOpt isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableResetUserResponse) Get() *ResetUserResponse { +func (v NullableInstanceNetworkOpt) Get() *InstanceNetworkOpt { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableResetUserResponse) Set(val *ResetUserResponse) { +func (v *NullableInstanceNetworkOpt) Set(val *InstanceNetworkOpt) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableResetUserResponse) IsSet() bool { +func (v NullableInstanceNetworkOpt) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableResetUserResponse) Unset() { +func (v *NullableInstanceNetworkOpt) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableResetUserResponse(val *ResetUserResponse) *NullableResetUserResponse { - return &NullableResetUserResponse{value: val, isSet: true} +func NewNullableInstanceNetworkOpt(val *InstanceNetworkOpt) *NullableInstanceNetworkOpt { + return &NullableInstanceNetworkOpt{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableResetUserResponse) MarshalJSON() ([]byte, error) { +func (v NullableInstanceNetworkOpt) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableResetUserResponse) UnmarshalJSON(src []byte) error { +func (v *NullableInstanceNetworkOpt) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_instance_network_opt_test.go b/services/postgresflex/model_instance_network_opt_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_instance_network_opt_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_instance_network_test.go b/services/postgresflex/model_instance_network_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_instance_network_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_acl.go b/services/postgresflex/model_instance_network_update.go similarity index 57% rename from services/postgresflex/model_acl.go rename to services/postgresflex/model_instance_network_update.go index 0967fe2a2..bfdc5c9be 100644 --- a/services/postgresflex/model_acl.go +++ b/services/postgresflex/model_instance_network_update.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,25 +15,25 @@ import ( "encoding/json" ) -// checks if the ACL type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ACL{} +// checks if the InstanceNetworkUpdate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceNetworkUpdate{} /* - types and functions for items + types and functions for acl */ // isArray // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ACLGetItemsAttributeType = *[]string +type InstanceNetworkUpdateGetAclAttributeType = *[]string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ACLGetItemsArgType = []string +type InstanceNetworkUpdateGetAclArgType = []string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ACLGetItemsRetType = []string +type InstanceNetworkUpdateGetAclRetType = []string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getACLGetItemsAttributeTypeOk(arg ACLGetItemsAttributeType) (ret ACLGetItemsRetType, ok bool) { +func getInstanceNetworkUpdateGetAclAttributeTypeOk(arg InstanceNetworkUpdateGetAclAttributeType) (ret InstanceNetworkUpdateGetAclRetType, ok bool) { if arg == nil { return ret, false } @@ -41,111 +41,110 @@ func getACLGetItemsAttributeTypeOk(arg ACLGetItemsAttributeType) (ret ACLGetItem } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setACLGetItemsAttributeType(arg *ACLGetItemsAttributeType, val ACLGetItemsRetType) { +func setInstanceNetworkUpdateGetAclAttributeType(arg *InstanceNetworkUpdateGetAclAttributeType, val InstanceNetworkUpdateGetAclRetType) { *arg = &val } -// ACL struct for ACL +// InstanceNetworkUpdate The access configuration of the instance // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ACL struct { - Items ACLGetItemsAttributeType `json:"items,omitempty"` +type InstanceNetworkUpdate struct { + // List of IPV4 cidr. + // REQUIRED + Acl InstanceNetworkUpdateGetAclAttributeType `json:"acl" required:"true"` } -// NewACL instantiates a new ACL object +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _InstanceNetworkUpdate InstanceNetworkUpdate + +// NewInstanceNetworkUpdate instantiates a new InstanceNetworkUpdate object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewACL() *ACL { - this := ACL{} +func NewInstanceNetworkUpdate(acl InstanceNetworkUpdateGetAclArgType) *InstanceNetworkUpdate { + this := InstanceNetworkUpdate{} + setInstanceNetworkUpdateGetAclAttributeType(&this.Acl, acl) return &this } -// NewACLWithDefaults instantiates a new ACL object +// NewInstanceNetworkUpdateWithDefaults instantiates a new InstanceNetworkUpdate object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewACLWithDefaults() *ACL { - this := ACL{} +func NewInstanceNetworkUpdateWithDefaults() *InstanceNetworkUpdate { + this := InstanceNetworkUpdate{} return &this } -// GetItems returns the Items field value if set, zero value otherwise. +// GetAcl returns the Acl field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ACL) GetItems() (res ACLGetItemsRetType) { - res, _ = o.GetItemsOk() - return +func (o *InstanceNetworkUpdate) GetAcl() (ret InstanceNetworkUpdateGetAclRetType) { + ret, _ = o.GetAclOk() + return ret } -// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// GetAclOk returns a tuple with the Acl field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ACL) GetItemsOk() (ret ACLGetItemsRetType, ok bool) { - return getACLGetItemsAttributeTypeOk(o.Items) -} - -// HasItems returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ACL) HasItems() bool { - _, ok := o.GetItemsOk() - return ok +func (o *InstanceNetworkUpdate) GetAclOk() (ret InstanceNetworkUpdateGetAclRetType, ok bool) { + return getInstanceNetworkUpdateGetAclAttributeTypeOk(o.Acl) } -// SetItems gets a reference to the given []string and assigns it to the Items field. +// SetAcl sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ACL) SetItems(v ACLGetItemsRetType) { - setACLGetItemsAttributeType(&o.Items, v) +func (o *InstanceNetworkUpdate) SetAcl(v InstanceNetworkUpdateGetAclRetType) { + setInstanceNetworkUpdateGetAclAttributeType(&o.Acl, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o ACL) ToMap() (map[string]interface{}, error) { +func (o InstanceNetworkUpdate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getACLGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val + if val, ok := getInstanceNetworkUpdateGetAclAttributeTypeOk(o.Acl); ok { + toSerialize["Acl"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableACL struct { - value *ACL +type NullableInstanceNetworkUpdate struct { + value *InstanceNetworkUpdate isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableACL) Get() *ACL { +func (v NullableInstanceNetworkUpdate) Get() *InstanceNetworkUpdate { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableACL) Set(val *ACL) { +func (v *NullableInstanceNetworkUpdate) Set(val *InstanceNetworkUpdate) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableACL) IsSet() bool { +func (v NullableInstanceNetworkUpdate) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableACL) Unset() { +func (v *NullableInstanceNetworkUpdate) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableACL(val *ACL) *NullableACL { - return &NullableACL{value: val, isSet: true} +func NewNullableInstanceNetworkUpdate(val *InstanceNetworkUpdate) *NullableInstanceNetworkUpdate { + return &NullableInstanceNetworkUpdate{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableACL) MarshalJSON() ([]byte, error) { +func (v NullableInstanceNetworkUpdate) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableACL) UnmarshalJSON(src []byte) error { +func (v *NullableInstanceNetworkUpdate) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_instance_network_update_test.go b/services/postgresflex/model_instance_network_update_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_instance_network_update_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_instance_response_test.go b/services/postgresflex/model_instance_response_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_instance_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_instance_sort.go b/services/postgresflex/model_instance_sort.go new file mode 100644 index 000000000..df06a1f20 --- /dev/null +++ b/services/postgresflex/model_instance_sort.go @@ -0,0 +1,150 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package postgresflex + +import ( + "encoding/json" + "fmt" +) + +// InstanceSort the model 'InstanceSort' +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceSort string + +// List of instance.sort +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + INSTANCESORT_ID_DESC InstanceSort = "id.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + INSTANCESORT_ID_ASC InstanceSort = "id.asc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + INSTANCESORT_IS_DELETABLE_DESC InstanceSort = "is_deletable.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + INSTANCESORT_IS_DELETABLE_ASC InstanceSort = "is_deletable.asc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + INSTANCESORT_NAME_ASC InstanceSort = "name.asc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + INSTANCESORT_NAME_DESC InstanceSort = "name.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + INSTANCESORT_STATE_ASC InstanceSort = "state.asc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + INSTANCESORT_STATE_DESC InstanceSort = "state.desc" +) + +// All allowed values of InstanceSort enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedInstanceSortEnumValues = []InstanceSort{ + "id.desc", + "id.asc", + "is_deletable.desc", + "is_deletable.asc", + "name.asc", + "name.desc", + "state.asc", + "state.desc", +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *InstanceSort) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue string + if value == zeroValue { + return nil + } + enumTypeValue := InstanceSort(value) + for _, existing := range AllowedInstanceSortEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InstanceSort", value) +} + +// NewInstanceSortFromValue returns a pointer to a valid InstanceSort +// for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewInstanceSortFromValue(v string) (*InstanceSort, error) { + ev := InstanceSort(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceSort: valid values are %v", v, AllowedInstanceSortEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v InstanceSort) IsValid() bool { + for _, existing := range AllowedInstanceSortEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to instance.sort value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v InstanceSort) Ptr() *InstanceSort { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableInstanceSort struct { + value *InstanceSort + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableInstanceSort) Get() *InstanceSort { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableInstanceSort) Set(val *InstanceSort) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableInstanceSort) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableInstanceSort) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableInstanceSort(val *InstanceSort) *NullableInstanceSort { + return &NullableInstanceSort{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableInstanceSort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableInstanceSort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/model_instance_sort_test.go b/services/postgresflex/model_instance_sort_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_instance_sort_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_instance_storage_range.go b/services/postgresflex/model_instance_storage_range.go new file mode 100644 index 000000000..627e72d55 --- /dev/null +++ b/services/postgresflex/model_instance_storage_range.go @@ -0,0 +1,206 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package postgresflex + +import ( + "encoding/json" +) + +// checks if the InstanceStorageRange type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceStorageRange{} + +/* + types and functions for max +*/ + +// isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceStorageRangeGetMaxAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceStorageRangeGetMaxArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceStorageRangeGetMaxRetType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getInstanceStorageRangeGetMaxAttributeTypeOk(arg InstanceStorageRangeGetMaxAttributeType) (ret InstanceStorageRangeGetMaxRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setInstanceStorageRangeGetMaxAttributeType(arg *InstanceStorageRangeGetMaxAttributeType, val InstanceStorageRangeGetMaxRetType) { + *arg = &val +} + +/* + types and functions for min +*/ + +// isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceStorageRangeGetMinAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceStorageRangeGetMinArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceStorageRangeGetMinRetType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getInstanceStorageRangeGetMinAttributeTypeOk(arg InstanceStorageRangeGetMinAttributeType) (ret InstanceStorageRangeGetMinRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setInstanceStorageRangeGetMinAttributeType(arg *InstanceStorageRangeGetMinAttributeType, val InstanceStorageRangeGetMinRetType) { + *arg = &val +} + +// InstanceStorageRange Contains the minimum and maximum storage space. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceStorageRange struct { + // The maximum available amount of storage. + // Can be cast to int32 without loss of precision. + // REQUIRED + Max InstanceStorageRangeGetMaxAttributeType `json:"max" required:"true"` + // The minimum available amount of storage. + // Can be cast to int32 without loss of precision. + // REQUIRED + Min InstanceStorageRangeGetMinAttributeType `json:"min" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _InstanceStorageRange InstanceStorageRange + +// NewInstanceStorageRange instantiates a new InstanceStorageRange object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewInstanceStorageRange(max InstanceStorageRangeGetMaxArgType, min InstanceStorageRangeGetMinArgType) *InstanceStorageRange { + this := InstanceStorageRange{} + setInstanceStorageRangeGetMaxAttributeType(&this.Max, max) + setInstanceStorageRangeGetMinAttributeType(&this.Min, min) + return &this +} + +// NewInstanceStorageRangeWithDefaults instantiates a new InstanceStorageRange object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewInstanceStorageRangeWithDefaults() *InstanceStorageRange { + this := InstanceStorageRange{} + return &this +} + +// GetMax returns the Max field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceStorageRange) GetMax() (ret InstanceStorageRangeGetMaxRetType) { + ret, _ = o.GetMaxOk() + return ret +} + +// GetMaxOk returns a tuple with the Max field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceStorageRange) GetMaxOk() (ret InstanceStorageRangeGetMaxRetType, ok bool) { + return getInstanceStorageRangeGetMaxAttributeTypeOk(o.Max) +} + +// SetMax sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceStorageRange) SetMax(v InstanceStorageRangeGetMaxRetType) { + setInstanceStorageRangeGetMaxAttributeType(&o.Max, v) +} + +// GetMin returns the Min field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceStorageRange) GetMin() (ret InstanceStorageRangeGetMinRetType) { + ret, _ = o.GetMinOk() + return ret +} + +// GetMinOk returns a tuple with the Min field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceStorageRange) GetMinOk() (ret InstanceStorageRangeGetMinRetType, ok bool) { + return getInstanceStorageRangeGetMinAttributeTypeOk(o.Min) +} + +// SetMin sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InstanceStorageRange) SetMin(v InstanceStorageRangeGetMinRetType) { + setInstanceStorageRangeGetMinAttributeType(&o.Min, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o InstanceStorageRange) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getInstanceStorageRangeGetMaxAttributeTypeOk(o.Max); ok { + toSerialize["Max"] = val + } + if val, ok := getInstanceStorageRangeGetMinAttributeTypeOk(o.Min); ok { + toSerialize["Min"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableInstanceStorageRange struct { + value *InstanceStorageRange + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableInstanceStorageRange) Get() *InstanceStorageRange { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableInstanceStorageRange) Set(val *InstanceStorageRange) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableInstanceStorageRange) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableInstanceStorageRange) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableInstanceStorageRange(val *InstanceStorageRange) *NullableInstanceStorageRange { + return &NullableInstanceStorageRange{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableInstanceStorageRange) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableInstanceStorageRange) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/model_instance_storage_range_test.go b/services/postgresflex/model_instance_storage_range_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_instance_storage_range_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_instance_test.go b/services/postgresflex/model_instance_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_instance_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_list_backup_response.go b/services/postgresflex/model_list_backup_response.go new file mode 100644 index 000000000..6af12f0c1 --- /dev/null +++ b/services/postgresflex/model_list_backup_response.go @@ -0,0 +1,203 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package postgresflex + +import ( + "encoding/json" +) + +// checks if the ListBackupResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListBackupResponse{} + +/* + types and functions for backups +*/ + +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListBackupResponseGetBackupsAttributeType = *[]BackupData + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListBackupResponseGetBackupsArgType = []BackupData + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListBackupResponseGetBackupsRetType = []BackupData + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getListBackupResponseGetBackupsAttributeTypeOk(arg ListBackupResponseGetBackupsAttributeType) (ret ListBackupResponseGetBackupsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setListBackupResponseGetBackupsAttributeType(arg *ListBackupResponseGetBackupsAttributeType, val ListBackupResponseGetBackupsRetType) { + *arg = &val +} + +/* + types and functions for pagination +*/ + +// isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListBackupResponseGetPaginationAttributeType = *Pagination + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListBackupResponseGetPaginationArgType = Pagination + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListBackupResponseGetPaginationRetType = Pagination + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getListBackupResponseGetPaginationAttributeTypeOk(arg ListBackupResponseGetPaginationAttributeType) (ret ListBackupResponseGetPaginationRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setListBackupResponseGetPaginationAttributeType(arg *ListBackupResponseGetPaginationAttributeType, val ListBackupResponseGetPaginationRetType) { + *arg = &val +} + +// ListBackupResponse struct for ListBackupResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListBackupResponse struct { + // The list containing the information about the backups. + // REQUIRED + Backups ListBackupResponseGetBackupsAttributeType `json:"backups" required:"true"` + // REQUIRED + Pagination ListBackupResponseGetPaginationAttributeType `json:"pagination" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _ListBackupResponse ListBackupResponse + +// NewListBackupResponse instantiates a new ListBackupResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewListBackupResponse(backups ListBackupResponseGetBackupsArgType, pagination ListBackupResponseGetPaginationArgType) *ListBackupResponse { + this := ListBackupResponse{} + setListBackupResponseGetBackupsAttributeType(&this.Backups, backups) + setListBackupResponseGetPaginationAttributeType(&this.Pagination, pagination) + return &this +} + +// NewListBackupResponseWithDefaults instantiates a new ListBackupResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewListBackupResponseWithDefaults() *ListBackupResponse { + this := ListBackupResponse{} + return &this +} + +// GetBackups returns the Backups field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ListBackupResponse) GetBackups() (ret ListBackupResponseGetBackupsRetType) { + ret, _ = o.GetBackupsOk() + return ret +} + +// GetBackupsOk returns a tuple with the Backups field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ListBackupResponse) GetBackupsOk() (ret ListBackupResponseGetBackupsRetType, ok bool) { + return getListBackupResponseGetBackupsAttributeTypeOk(o.Backups) +} + +// SetBackups sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ListBackupResponse) SetBackups(v ListBackupResponseGetBackupsRetType) { + setListBackupResponseGetBackupsAttributeType(&o.Backups, v) +} + +// GetPagination returns the Pagination field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ListBackupResponse) GetPagination() (ret ListBackupResponseGetPaginationRetType) { + ret, _ = o.GetPaginationOk() + return ret +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ListBackupResponse) GetPaginationOk() (ret ListBackupResponseGetPaginationRetType, ok bool) { + return getListBackupResponseGetPaginationAttributeTypeOk(o.Pagination) +} + +// SetPagination sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ListBackupResponse) SetPagination(v ListBackupResponseGetPaginationRetType) { + setListBackupResponseGetPaginationAttributeType(&o.Pagination, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o ListBackupResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getListBackupResponseGetBackupsAttributeTypeOk(o.Backups); ok { + toSerialize["Backups"] = val + } + if val, ok := getListBackupResponseGetPaginationAttributeTypeOk(o.Pagination); ok { + toSerialize["Pagination"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableListBackupResponse struct { + value *ListBackupResponse + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableListBackupResponse) Get() *ListBackupResponse { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableListBackupResponse) Set(val *ListBackupResponse) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableListBackupResponse) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableListBackupResponse) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableListBackupResponse(val *ListBackupResponse) *NullableListBackupResponse { + return &NullableListBackupResponse{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableListBackupResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableListBackupResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/model_list_backup_response_test.go b/services/postgresflex/model_list_backup_response_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_list_backup_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_list_backups_response_test.go b/services/postgresflex/model_list_backups_response_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_list_backups_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_instance_metrics_response.go b/services/postgresflex/model_list_collations_response.go similarity index 54% rename from services/postgresflex/model_instance_metrics_response.go rename to services/postgresflex/model_list_collations_response.go index eb02743ed..88c7db249 100644 --- a/services/postgresflex/model_instance_metrics_response.go +++ b/services/postgresflex/model_list_collations_response.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,25 +15,25 @@ import ( "encoding/json" ) -// checks if the InstanceMetricsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &InstanceMetricsResponse{} +// checks if the ListCollationsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCollationsResponse{} /* - types and functions for hosts + types and functions for collations */ // isArray // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceMetricsResponseGetHostsAttributeType = *[]InstanceHost +type ListCollationsResponseGetCollationsAttributeType = *[]string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceMetricsResponseGetHostsArgType = []InstanceHost +type ListCollationsResponseGetCollationsArgType = []string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceMetricsResponseGetHostsRetType = []InstanceHost +type ListCollationsResponseGetCollationsRetType = []string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceMetricsResponseGetHostsAttributeTypeOk(arg InstanceMetricsResponseGetHostsAttributeType) (ret InstanceMetricsResponseGetHostsRetType, ok bool) { +func getListCollationsResponseGetCollationsAttributeTypeOk(arg ListCollationsResponseGetCollationsAttributeType) (ret ListCollationsResponseGetCollationsRetType, ok bool) { if arg == nil { return ret, false } @@ -41,111 +41,110 @@ func getInstanceMetricsResponseGetHostsAttributeTypeOk(arg InstanceMetricsRespon } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceMetricsResponseGetHostsAttributeType(arg *InstanceMetricsResponseGetHostsAttributeType, val InstanceMetricsResponseGetHostsRetType) { +func setListCollationsResponseGetCollationsAttributeType(arg *ListCollationsResponseGetCollationsAttributeType, val ListCollationsResponseGetCollationsRetType) { *arg = &val } -// InstanceMetricsResponse struct for InstanceMetricsResponse +// ListCollationsResponse struct for ListCollationsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceMetricsResponse struct { - Hosts InstanceMetricsResponseGetHostsAttributeType `json:"hosts,omitempty"` +type ListCollationsResponse struct { + // List of collations available for the instance. + // REQUIRED + Collations ListCollationsResponseGetCollationsAttributeType `json:"collations" required:"true"` } -// NewInstanceMetricsResponse instantiates a new InstanceMetricsResponse object +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _ListCollationsResponse ListCollationsResponse + +// NewListCollationsResponse instantiates a new ListCollationsResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewInstanceMetricsResponse() *InstanceMetricsResponse { - this := InstanceMetricsResponse{} +func NewListCollationsResponse(collations ListCollationsResponseGetCollationsArgType) *ListCollationsResponse { + this := ListCollationsResponse{} + setListCollationsResponseGetCollationsAttributeType(&this.Collations, collations) return &this } -// NewInstanceMetricsResponseWithDefaults instantiates a new InstanceMetricsResponse object +// NewListCollationsResponseWithDefaults instantiates a new ListCollationsResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewInstanceMetricsResponseWithDefaults() *InstanceMetricsResponse { - this := InstanceMetricsResponse{} +func NewListCollationsResponseWithDefaults() *ListCollationsResponse { + this := ListCollationsResponse{} return &this } -// GetHosts returns the Hosts field value if set, zero value otherwise. +// GetCollations returns the Collations field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceMetricsResponse) GetHosts() (res InstanceMetricsResponseGetHostsRetType) { - res, _ = o.GetHostsOk() - return +func (o *ListCollationsResponse) GetCollations() (ret ListCollationsResponseGetCollationsRetType) { + ret, _ = o.GetCollationsOk() + return ret } -// GetHostsOk returns a tuple with the Hosts field value if set, nil otherwise +// GetCollationsOk returns a tuple with the Collations field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceMetricsResponse) GetHostsOk() (ret InstanceMetricsResponseGetHostsRetType, ok bool) { - return getInstanceMetricsResponseGetHostsAttributeTypeOk(o.Hosts) -} - -// HasHosts returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceMetricsResponse) HasHosts() bool { - _, ok := o.GetHostsOk() - return ok +func (o *ListCollationsResponse) GetCollationsOk() (ret ListCollationsResponseGetCollationsRetType, ok bool) { + return getListCollationsResponseGetCollationsAttributeTypeOk(o.Collations) } -// SetHosts gets a reference to the given []InstanceHost and assigns it to the Hosts field. +// SetCollations sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceMetricsResponse) SetHosts(v InstanceMetricsResponseGetHostsRetType) { - setInstanceMetricsResponseGetHostsAttributeType(&o.Hosts, v) +func (o *ListCollationsResponse) SetCollations(v ListCollationsResponseGetCollationsRetType) { + setListCollationsResponseGetCollationsAttributeType(&o.Collations, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o InstanceMetricsResponse) ToMap() (map[string]interface{}, error) { +func (o ListCollationsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getInstanceMetricsResponseGetHostsAttributeTypeOk(o.Hosts); ok { - toSerialize["Hosts"] = val + if val, ok := getListCollationsResponseGetCollationsAttributeTypeOk(o.Collations); ok { + toSerialize["Collations"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableInstanceMetricsResponse struct { - value *InstanceMetricsResponse +type NullableListCollationsResponse struct { + value *ListCollationsResponse isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceMetricsResponse) Get() *InstanceMetricsResponse { +func (v NullableListCollationsResponse) Get() *ListCollationsResponse { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceMetricsResponse) Set(val *InstanceMetricsResponse) { +func (v *NullableListCollationsResponse) Set(val *ListCollationsResponse) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceMetricsResponse) IsSet() bool { +func (v NullableListCollationsResponse) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceMetricsResponse) Unset() { +func (v *NullableListCollationsResponse) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableInstanceMetricsResponse(val *InstanceMetricsResponse) *NullableInstanceMetricsResponse { - return &NullableInstanceMetricsResponse{value: val, isSet: true} +func NewNullableListCollationsResponse(val *ListCollationsResponse) *NullableListCollationsResponse { + return &NullableListCollationsResponse{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceMetricsResponse) MarshalJSON() ([]byte, error) { +func (v NullableListCollationsResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceMetricsResponse) UnmarshalJSON(src []byte) error { +func (v *NullableListCollationsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_list_collations_response_test.go b/services/postgresflex/model_list_collations_response_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_list_collations_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_instance_database.go b/services/postgresflex/model_list_database.go similarity index 52% rename from services/postgresflex/model_instance_database.go rename to services/postgresflex/model_list_database.go index 5e50ee2f1..70d4594f7 100644 --- a/services/postgresflex/model_instance_database.go +++ b/services/postgresflex/model_list_database.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,19 +15,25 @@ import ( "encoding/json" ) -// checks if the InstanceDatabase type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &InstanceDatabase{} +// checks if the ListDatabase type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListDatabase{} /* types and functions for id */ -// isNotNullableString +// isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListDatabaseGetIdAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListDatabaseGetIdArgType = int64 + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceDatabaseGetIdAttributeType = *string +type ListDatabaseGetIdRetType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceDatabaseGetIdAttributeTypeOk(arg InstanceDatabaseGetIdAttributeType) (ret InstanceDatabaseGetIdRetType, ok bool) { +func getListDatabaseGetIdAttributeTypeOk(arg ListDatabaseGetIdAttributeType) (ret ListDatabaseGetIdRetType, ok bool) { if arg == nil { return ret, false } @@ -35,26 +41,20 @@ func getInstanceDatabaseGetIdAttributeTypeOk(arg InstanceDatabaseGetIdAttributeT } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceDatabaseGetIdAttributeType(arg *InstanceDatabaseGetIdAttributeType, val InstanceDatabaseGetIdRetType) { +func setListDatabaseGetIdAttributeType(arg *ListDatabaseGetIdAttributeType, val ListDatabaseGetIdRetType) { *arg = &val } -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceDatabaseGetIdArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceDatabaseGetIdRetType = string - /* types and functions for name */ // isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceDatabaseGetNameAttributeType = *string +type ListDatabaseGetNameAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceDatabaseGetNameAttributeTypeOk(arg InstanceDatabaseGetNameAttributeType) (ret InstanceDatabaseGetNameRetType, ok bool) { +func getListDatabaseGetNameAttributeTypeOk(arg ListDatabaseGetNameAttributeType) (ret ListDatabaseGetNameRetType, ok bool) { if arg == nil { return ret, false } @@ -62,32 +62,26 @@ func getInstanceDatabaseGetNameAttributeTypeOk(arg InstanceDatabaseGetNameAttrib } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceDatabaseGetNameAttributeType(arg *InstanceDatabaseGetNameAttributeType, val InstanceDatabaseGetNameRetType) { +func setListDatabaseGetNameAttributeType(arg *ListDatabaseGetNameAttributeType, val ListDatabaseGetNameRetType) { *arg = &val } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceDatabaseGetNameArgType = string +type ListDatabaseGetNameArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceDatabaseGetNameRetType = string +type ListDatabaseGetNameRetType = string /* - types and functions for options + types and functions for owner */ -// isFreeform -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceDatabaseGetOptionsAttributeType = *map[string]interface{} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceDatabaseGetOptionsArgType = map[string]interface{} - +// isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceDatabaseGetOptionsRetType = map[string]interface{} +type ListDatabaseGetOwnerAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceDatabaseGetOptionsAttributeTypeOk(arg InstanceDatabaseGetOptionsAttributeType) (ret InstanceDatabaseGetOptionsRetType, ok bool) { +func getListDatabaseGetOwnerAttributeTypeOk(arg ListDatabaseGetOwnerAttributeType) (ret ListDatabaseGetOwnerRetType, ok bool) { if arg == nil { return ret, false } @@ -95,174 +89,170 @@ func getInstanceDatabaseGetOptionsAttributeTypeOk(arg InstanceDatabaseGetOptions } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setInstanceDatabaseGetOptionsAttributeType(arg *InstanceDatabaseGetOptionsAttributeType, val InstanceDatabaseGetOptionsRetType) { +func setListDatabaseGetOwnerAttributeType(arg *ListDatabaseGetOwnerAttributeType, val ListDatabaseGetOwnerRetType) { *arg = &val } -// InstanceDatabase struct for InstanceDatabase // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceDatabase struct { - Id InstanceDatabaseGetIdAttributeType `json:"id,omitempty"` - Name InstanceDatabaseGetNameAttributeType `json:"name,omitempty"` - // Database specific options - Options InstanceDatabaseGetOptionsAttributeType `json:"options,omitempty"` +type ListDatabaseGetOwnerArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListDatabaseGetOwnerRetType = string + +// ListDatabase struct for ListDatabase +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListDatabase struct { + // The id of the database. + // REQUIRED + Id ListDatabaseGetIdAttributeType `json:"id" required:"true"` + // The name of the database. + // REQUIRED + Name ListDatabaseGetNameAttributeType `json:"name" required:"true"` + // The owner of the database. + // REQUIRED + Owner ListDatabaseGetOwnerAttributeType `json:"owner" required:"true"` } -// NewInstanceDatabase instantiates a new InstanceDatabase object +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _ListDatabase ListDatabase + +// NewListDatabase instantiates a new ListDatabase object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewInstanceDatabase() *InstanceDatabase { - this := InstanceDatabase{} +func NewListDatabase(id ListDatabaseGetIdArgType, name ListDatabaseGetNameArgType, owner ListDatabaseGetOwnerArgType) *ListDatabase { + this := ListDatabase{} + setListDatabaseGetIdAttributeType(&this.Id, id) + setListDatabaseGetNameAttributeType(&this.Name, name) + setListDatabaseGetOwnerAttributeType(&this.Owner, owner) return &this } -// NewInstanceDatabaseWithDefaults instantiates a new InstanceDatabase object +// NewListDatabaseWithDefaults instantiates a new ListDatabase object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewInstanceDatabaseWithDefaults() *InstanceDatabase { - this := InstanceDatabase{} +func NewListDatabaseWithDefaults() *ListDatabase { + this := ListDatabase{} return &this } -// GetId returns the Id field value if set, zero value otherwise. +// GetId returns the Id field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceDatabase) GetId() (res InstanceDatabaseGetIdRetType) { - res, _ = o.GetIdOk() - return +func (o *ListDatabase) GetId() (ret ListDatabaseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } -// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceDatabase) GetIdOk() (ret InstanceDatabaseGetIdRetType, ok bool) { - return getInstanceDatabaseGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceDatabase) HasId() bool { - _, ok := o.GetIdOk() - return ok +func (o *ListDatabase) GetIdOk() (ret ListDatabaseGetIdRetType, ok bool) { + return getListDatabaseGetIdAttributeTypeOk(o.Id) } -// SetId gets a reference to the given string and assigns it to the Id field. +// SetId sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceDatabase) SetId(v InstanceDatabaseGetIdRetType) { - setInstanceDatabaseGetIdAttributeType(&o.Id, v) +func (o *ListDatabase) SetId(v ListDatabaseGetIdRetType) { + setListDatabaseGetIdAttributeType(&o.Id, v) } -// GetName returns the Name field value if set, zero value otherwise. +// GetName returns the Name field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceDatabase) GetName() (res InstanceDatabaseGetNameRetType) { - res, _ = o.GetNameOk() - return +func (o *ListDatabase) GetName() (ret ListDatabaseGetNameRetType) { + ret, _ = o.GetNameOk() + return ret } -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceDatabase) GetNameOk() (ret InstanceDatabaseGetNameRetType, ok bool) { - return getInstanceDatabaseGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceDatabase) HasName() bool { - _, ok := o.GetNameOk() - return ok +func (o *ListDatabase) GetNameOk() (ret ListDatabaseGetNameRetType, ok bool) { + return getListDatabaseGetNameAttributeTypeOk(o.Name) } -// SetName gets a reference to the given string and assigns it to the Name field. +// SetName sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceDatabase) SetName(v InstanceDatabaseGetNameRetType) { - setInstanceDatabaseGetNameAttributeType(&o.Name, v) +func (o *ListDatabase) SetName(v ListDatabaseGetNameRetType) { + setListDatabaseGetNameAttributeType(&o.Name, v) } -// GetOptions returns the Options field value if set, zero value otherwise. +// GetOwner returns the Owner field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceDatabase) GetOptions() (res InstanceDatabaseGetOptionsRetType) { - res, _ = o.GetOptionsOk() - return +func (o *ListDatabase) GetOwner() (ret ListDatabaseGetOwnerRetType) { + ret, _ = o.GetOwnerOk() + return ret } -// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// GetOwnerOk returns a tuple with the Owner field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceDatabase) GetOptionsOk() (ret InstanceDatabaseGetOptionsRetType, ok bool) { - return getInstanceDatabaseGetOptionsAttributeTypeOk(o.Options) -} - -// HasOptions returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceDatabase) HasOptions() bool { - _, ok := o.GetOptionsOk() - return ok +func (o *ListDatabase) GetOwnerOk() (ret ListDatabaseGetOwnerRetType, ok bool) { + return getListDatabaseGetOwnerAttributeTypeOk(o.Owner) } -// SetOptions gets a reference to the given map[string]interface{} and assigns it to the Options field. +// SetOwner sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceDatabase) SetOptions(v InstanceDatabaseGetOptionsRetType) { - setInstanceDatabaseGetOptionsAttributeType(&o.Options, v) +func (o *ListDatabase) SetOwner(v ListDatabaseGetOwnerRetType) { + setListDatabaseGetOwnerAttributeType(&o.Owner, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o InstanceDatabase) ToMap() (map[string]interface{}, error) { +func (o ListDatabase) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getInstanceDatabaseGetIdAttributeTypeOk(o.Id); ok { + if val, ok := getListDatabaseGetIdAttributeTypeOk(o.Id); ok { toSerialize["Id"] = val } - if val, ok := getInstanceDatabaseGetNameAttributeTypeOk(o.Name); ok { + if val, ok := getListDatabaseGetNameAttributeTypeOk(o.Name); ok { toSerialize["Name"] = val } - if val, ok := getInstanceDatabaseGetOptionsAttributeTypeOk(o.Options); ok { - toSerialize["Options"] = val + if val, ok := getListDatabaseGetOwnerAttributeTypeOk(o.Owner); ok { + toSerialize["Owner"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableInstanceDatabase struct { - value *InstanceDatabase +type NullableListDatabase struct { + value *ListDatabase isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceDatabase) Get() *InstanceDatabase { +func (v NullableListDatabase) Get() *ListDatabase { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceDatabase) Set(val *InstanceDatabase) { +func (v *NullableListDatabase) Set(val *ListDatabase) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceDatabase) IsSet() bool { +func (v NullableListDatabase) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceDatabase) Unset() { +func (v *NullableListDatabase) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableInstanceDatabase(val *InstanceDatabase) *NullableInstanceDatabase { - return &NullableInstanceDatabase{value: val, isSet: true} +func NewNullableListDatabase(val *ListDatabase) *NullableListDatabase { + return &NullableListDatabase{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceDatabase) MarshalJSON() ([]byte, error) { +func (v NullableListDatabase) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceDatabase) UnmarshalJSON(src []byte) error { +func (v *NullableListDatabase) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_list_database_test.go b/services/postgresflex/model_list_database_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_list_database_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_list_backups_response.go b/services/postgresflex/model_list_databases_response.go similarity index 51% rename from services/postgresflex/model_list_backups_response.go rename to services/postgresflex/model_list_databases_response.go index 28b2aba27..9579527bd 100644 --- a/services/postgresflex/model_list_backups_response.go +++ b/services/postgresflex/model_list_databases_response.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,25 +15,25 @@ import ( "encoding/json" ) -// checks if the ListBackupsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListBackupsResponse{} +// checks if the ListDatabasesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListDatabasesResponse{} /* - types and functions for count + types and functions for databases */ -// isLong +// isArray // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListBackupsResponseGetCountAttributeType = *int64 +type ListDatabasesResponseGetDatabasesAttributeType = *[]ListDatabase // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListBackupsResponseGetCountArgType = int64 +type ListDatabasesResponseGetDatabasesArgType = []ListDatabase // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListBackupsResponseGetCountRetType = int64 +type ListDatabasesResponseGetDatabasesRetType = []ListDatabase // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getListBackupsResponseGetCountAttributeTypeOk(arg ListBackupsResponseGetCountAttributeType) (ret ListBackupsResponseGetCountRetType, ok bool) { +func getListDatabasesResponseGetDatabasesAttributeTypeOk(arg ListDatabasesResponseGetDatabasesAttributeType) (ret ListDatabasesResponseGetDatabasesRetType, ok bool) { if arg == nil { return ret, false } @@ -41,26 +41,26 @@ func getListBackupsResponseGetCountAttributeTypeOk(arg ListBackupsResponseGetCou } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setListBackupsResponseGetCountAttributeType(arg *ListBackupsResponseGetCountAttributeType, val ListBackupsResponseGetCountRetType) { +func setListDatabasesResponseGetDatabasesAttributeType(arg *ListDatabasesResponseGetDatabasesAttributeType, val ListDatabasesResponseGetDatabasesRetType) { *arg = &val } /* - types and functions for items + types and functions for pagination */ -// isArray +// isModel // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListBackupsResponseGetItemsAttributeType = *[]Backup +type ListDatabasesResponseGetPaginationAttributeType = *Pagination // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListBackupsResponseGetItemsArgType = []Backup +type ListDatabasesResponseGetPaginationArgType = Pagination // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListBackupsResponseGetItemsRetType = []Backup +type ListDatabasesResponseGetPaginationRetType = Pagination // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getListBackupsResponseGetItemsAttributeTypeOk(arg ListBackupsResponseGetItemsAttributeType) (ret ListBackupsResponseGetItemsRetType, ok bool) { +func getListDatabasesResponseGetPaginationAttributeTypeOk(arg ListDatabasesResponseGetPaginationAttributeType) (ret ListDatabasesResponseGetPaginationRetType, ok bool) { if arg == nil { return ret, false } @@ -68,142 +68,136 @@ func getListBackupsResponseGetItemsAttributeTypeOk(arg ListBackupsResponseGetIte } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setListBackupsResponseGetItemsAttributeType(arg *ListBackupsResponseGetItemsAttributeType, val ListBackupsResponseGetItemsRetType) { +func setListDatabasesResponseGetPaginationAttributeType(arg *ListDatabasesResponseGetPaginationAttributeType, val ListDatabasesResponseGetPaginationRetType) { *arg = &val } -// ListBackupsResponse struct for ListBackupsResponse +// ListDatabasesResponse struct for ListDatabasesResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListBackupsResponse struct { - Count ListBackupsResponseGetCountAttributeType `json:"count,omitempty"` - Items ListBackupsResponseGetItemsAttributeType `json:"items,omitempty"` +type ListDatabasesResponse struct { + // A list containing all databases for the instance. + // REQUIRED + Databases ListDatabasesResponseGetDatabasesAttributeType `json:"databases" required:"true"` + // REQUIRED + Pagination ListDatabasesResponseGetPaginationAttributeType `json:"pagination" required:"true"` } -// NewListBackupsResponse instantiates a new ListBackupsResponse object +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _ListDatabasesResponse ListDatabasesResponse + +// NewListDatabasesResponse instantiates a new ListDatabasesResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewListBackupsResponse() *ListBackupsResponse { - this := ListBackupsResponse{} +func NewListDatabasesResponse(databases ListDatabasesResponseGetDatabasesArgType, pagination ListDatabasesResponseGetPaginationArgType) *ListDatabasesResponse { + this := ListDatabasesResponse{} + setListDatabasesResponseGetDatabasesAttributeType(&this.Databases, databases) + setListDatabasesResponseGetPaginationAttributeType(&this.Pagination, pagination) return &this } -// NewListBackupsResponseWithDefaults instantiates a new ListBackupsResponse object +// NewListDatabasesResponseWithDefaults instantiates a new ListDatabasesResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewListBackupsResponseWithDefaults() *ListBackupsResponse { - this := ListBackupsResponse{} +func NewListDatabasesResponseWithDefaults() *ListDatabasesResponse { + this := ListDatabasesResponse{} return &this } -// GetCount returns the Count field value if set, zero value otherwise. +// GetDatabases returns the Databases field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListBackupsResponse) GetCount() (res ListBackupsResponseGetCountRetType) { - res, _ = o.GetCountOk() - return +func (o *ListDatabasesResponse) GetDatabases() (ret ListDatabasesResponseGetDatabasesRetType) { + ret, _ = o.GetDatabasesOk() + return ret } -// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// GetDatabasesOk returns a tuple with the Databases field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListBackupsResponse) GetCountOk() (ret ListBackupsResponseGetCountRetType, ok bool) { - return getListBackupsResponseGetCountAttributeTypeOk(o.Count) -} - -// HasCount returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListBackupsResponse) HasCount() bool { - _, ok := o.GetCountOk() - return ok +func (o *ListDatabasesResponse) GetDatabasesOk() (ret ListDatabasesResponseGetDatabasesRetType, ok bool) { + return getListDatabasesResponseGetDatabasesAttributeTypeOk(o.Databases) } -// SetCount gets a reference to the given int64 and assigns it to the Count field. +// SetDatabases sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListBackupsResponse) SetCount(v ListBackupsResponseGetCountRetType) { - setListBackupsResponseGetCountAttributeType(&o.Count, v) +func (o *ListDatabasesResponse) SetDatabases(v ListDatabasesResponseGetDatabasesRetType) { + setListDatabasesResponseGetDatabasesAttributeType(&o.Databases, v) } -// GetItems returns the Items field value if set, zero value otherwise. +// GetPagination returns the Pagination field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListBackupsResponse) GetItems() (res ListBackupsResponseGetItemsRetType) { - res, _ = o.GetItemsOk() - return +func (o *ListDatabasesResponse) GetPagination() (ret ListDatabasesResponseGetPaginationRetType) { + ret, _ = o.GetPaginationOk() + return ret } -// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// GetPaginationOk returns a tuple with the Pagination field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListBackupsResponse) GetItemsOk() (ret ListBackupsResponseGetItemsRetType, ok bool) { - return getListBackupsResponseGetItemsAttributeTypeOk(o.Items) -} - -// HasItems returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListBackupsResponse) HasItems() bool { - _, ok := o.GetItemsOk() - return ok +func (o *ListDatabasesResponse) GetPaginationOk() (ret ListDatabasesResponseGetPaginationRetType, ok bool) { + return getListDatabasesResponseGetPaginationAttributeTypeOk(o.Pagination) } -// SetItems gets a reference to the given []Backup and assigns it to the Items field. +// SetPagination sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListBackupsResponse) SetItems(v ListBackupsResponseGetItemsRetType) { - setListBackupsResponseGetItemsAttributeType(&o.Items, v) +func (o *ListDatabasesResponse) SetPagination(v ListDatabasesResponseGetPaginationRetType) { + setListDatabasesResponseGetPaginationAttributeType(&o.Pagination, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o ListBackupsResponse) ToMap() (map[string]interface{}, error) { +func (o ListDatabasesResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getListBackupsResponseGetCountAttributeTypeOk(o.Count); ok { - toSerialize["Count"] = val + if val, ok := getListDatabasesResponseGetDatabasesAttributeTypeOk(o.Databases); ok { + toSerialize["Databases"] = val } - if val, ok := getListBackupsResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val + if val, ok := getListDatabasesResponseGetPaginationAttributeTypeOk(o.Pagination); ok { + toSerialize["Pagination"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableListBackupsResponse struct { - value *ListBackupsResponse +type NullableListDatabasesResponse struct { + value *ListDatabasesResponse isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableListBackupsResponse) Get() *ListBackupsResponse { +func (v NullableListDatabasesResponse) Get() *ListDatabasesResponse { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableListBackupsResponse) Set(val *ListBackupsResponse) { +func (v *NullableListDatabasesResponse) Set(val *ListDatabasesResponse) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableListBackupsResponse) IsSet() bool { +func (v NullableListDatabasesResponse) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableListBackupsResponse) Unset() { +func (v *NullableListDatabasesResponse) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableListBackupsResponse(val *ListBackupsResponse) *NullableListBackupsResponse { - return &NullableListBackupsResponse{value: val, isSet: true} +func NewNullableListDatabasesResponse(val *ListDatabasesResponse) *NullableListDatabasesResponse { + return &NullableListDatabasesResponse{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableListBackupsResponse) MarshalJSON() ([]byte, error) { +func (v NullableListDatabasesResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableListBackupsResponse) UnmarshalJSON(src []byte) error { +func (v *NullableListDatabasesResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_list_databases_response_test.go b/services/postgresflex/model_list_databases_response_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_list_databases_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_backup.go b/services/postgresflex/model_list_flavors.go similarity index 50% rename from services/postgresflex/model_backup.go rename to services/postgresflex/model_list_flavors.go index 18fa82168..d47d7a25d 100644 --- a/services/postgresflex/model_backup.go +++ b/services/postgresflex/model_list_flavors.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,19 +15,25 @@ import ( "encoding/json" ) -// checks if the Backup type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Backup{} +// checks if the ListFlavors type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListFlavors{} /* - types and functions for endTime + types and functions for cpu */ -// isNotNullableString +// isLong // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetEndTimeAttributeType = *string +type ListFlavorsGetCpuAttributeType = *int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getBackupGetEndTimeAttributeTypeOk(arg BackupGetEndTimeAttributeType) (ret BackupGetEndTimeRetType, ok bool) { +type ListFlavorsGetCpuArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListFlavorsGetCpuRetType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getListFlavorsGetCpuAttributeTypeOk(arg ListFlavorsGetCpuAttributeType) (ret ListFlavorsGetCpuRetType, ok bool) { if arg == nil { return ret, false } @@ -35,26 +41,20 @@ func getBackupGetEndTimeAttributeTypeOk(arg BackupGetEndTimeAttributeType) (ret } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setBackupGetEndTimeAttributeType(arg *BackupGetEndTimeAttributeType, val BackupGetEndTimeRetType) { +func setListFlavorsGetCpuAttributeType(arg *ListFlavorsGetCpuAttributeType, val ListFlavorsGetCpuRetType) { *arg = &val } -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetEndTimeArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetEndTimeRetType = string - /* - types and functions for error + types and functions for description */ // isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetErrorAttributeType = *string +type ListFlavorsGetDescriptionAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getBackupGetErrorAttributeTypeOk(arg BackupGetErrorAttributeType) (ret BackupGetErrorRetType, ok bool) { +func getListFlavorsGetDescriptionAttributeTypeOk(arg ListFlavorsGetDescriptionAttributeType) (ret ListFlavorsGetDescriptionRetType, ok bool) { if arg == nil { return ret, false } @@ -62,15 +62,15 @@ func getBackupGetErrorAttributeTypeOk(arg BackupGetErrorAttributeType) (ret Back } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setBackupGetErrorAttributeType(arg *BackupGetErrorAttributeType, val BackupGetErrorRetType) { +func setListFlavorsGetDescriptionAttributeType(arg *ListFlavorsGetDescriptionAttributeType, val ListFlavorsGetDescriptionRetType) { *arg = &val } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetErrorArgType = string +type ListFlavorsGetDescriptionArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetErrorRetType = string +type ListFlavorsGetDescriptionRetType = string /* types and functions for id @@ -78,10 +78,10 @@ type BackupGetErrorRetType = string // isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetIdAttributeType = *string +type ListFlavorsGetIdAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getBackupGetIdAttributeTypeOk(arg BackupGetIdAttributeType) (ret BackupGetIdRetType, ok bool) { +func getListFlavorsGetIdAttributeTypeOk(arg ListFlavorsGetIdAttributeType) (ret ListFlavorsGetIdRetType, ok bool) { if arg == nil { return ret, false } @@ -89,32 +89,32 @@ func getBackupGetIdAttributeTypeOk(arg BackupGetIdAttributeType) (ret BackupGetI } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setBackupGetIdAttributeType(arg *BackupGetIdAttributeType, val BackupGetIdRetType) { +func setListFlavorsGetIdAttributeType(arg *ListFlavorsGetIdAttributeType, val ListFlavorsGetIdRetType) { *arg = &val } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetIdArgType = string +type ListFlavorsGetIdArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetIdRetType = string +type ListFlavorsGetIdRetType = string /* - types and functions for labels + types and functions for maxGB */ -// isArray +// isInteger // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetLabelsAttributeType = *[]string +type ListFlavorsGetMaxGBAttributeType = *int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetLabelsArgType = []string +type ListFlavorsGetMaxGBArgType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetLabelsRetType = []string +type ListFlavorsGetMaxGBRetType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getBackupGetLabelsAttributeTypeOk(arg BackupGetLabelsAttributeType) (ret BackupGetLabelsRetType, ok bool) { +func getListFlavorsGetMaxGBAttributeTypeOk(arg ListFlavorsGetMaxGBAttributeType) (ret ListFlavorsGetMaxGBRetType, ok bool) { if arg == nil { return ret, false } @@ -122,20 +122,26 @@ func getBackupGetLabelsAttributeTypeOk(arg BackupGetLabelsAttributeType) (ret Ba } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setBackupGetLabelsAttributeType(arg *BackupGetLabelsAttributeType, val BackupGetLabelsRetType) { +func setListFlavorsGetMaxGBAttributeType(arg *ListFlavorsGetMaxGBAttributeType, val ListFlavorsGetMaxGBRetType) { *arg = &val } /* - types and functions for name + types and functions for memory */ -// isNotNullableString +// isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListFlavorsGetMemoryAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListFlavorsGetMemoryArgType = int64 + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetNameAttributeType = *string +type ListFlavorsGetMemoryRetType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getBackupGetNameAttributeTypeOk(arg BackupGetNameAttributeType) (ret BackupGetNameRetType, ok bool) { +func getListFlavorsGetMemoryAttributeTypeOk(arg ListFlavorsGetMemoryAttributeType) (ret ListFlavorsGetMemoryRetType, ok bool) { if arg == nil { return ret, false } @@ -143,32 +149,26 @@ func getBackupGetNameAttributeTypeOk(arg BackupGetNameAttributeType) (ret Backup } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setBackupGetNameAttributeType(arg *BackupGetNameAttributeType, val BackupGetNameRetType) { +func setListFlavorsGetMemoryAttributeType(arg *ListFlavorsGetMemoryAttributeType, val ListFlavorsGetMemoryRetType) { *arg = &val } -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetNameArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetNameRetType = string - /* - types and functions for options + types and functions for minGB */ -// isContainer +// isInteger // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetOptionsAttributeType = *map[string]string +type ListFlavorsGetMinGBAttributeType = *int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetOptionsArgType = map[string]string +type ListFlavorsGetMinGBArgType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetOptionsRetType = map[string]string +type ListFlavorsGetMinGBRetType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getBackupGetOptionsAttributeTypeOk(arg BackupGetOptionsAttributeType) (ret BackupGetOptionsRetType, ok bool) { +func getListFlavorsGetMinGBAttributeTypeOk(arg ListFlavorsGetMinGBAttributeType) (ret ListFlavorsGetMinGBRetType, ok bool) { if arg == nil { return ret, false } @@ -176,26 +176,20 @@ func getBackupGetOptionsAttributeTypeOk(arg BackupGetOptionsAttributeType) (ret } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setBackupGetOptionsAttributeType(arg *BackupGetOptionsAttributeType, val BackupGetOptionsRetType) { +func setListFlavorsGetMinGBAttributeType(arg *ListFlavorsGetMinGBAttributeType, val ListFlavorsGetMinGBRetType) { *arg = &val } /* - types and functions for size + types and functions for nodeType */ -// isLong -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetSizeAttributeType = *int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetSizeArgType = int64 - +// isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetSizeRetType = int64 +type ListFlavorsGetNodeTypeAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getBackupGetSizeAttributeTypeOk(arg BackupGetSizeAttributeType) (ret BackupGetSizeRetType, ok bool) { +func getListFlavorsGetNodeTypeAttributeTypeOk(arg ListFlavorsGetNodeTypeAttributeType) (ret ListFlavorsGetNodeTypeRetType, ok bool) { if arg == nil { return ret, false } @@ -203,20 +197,32 @@ func getBackupGetSizeAttributeTypeOk(arg BackupGetSizeAttributeType) (ret Backup } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setBackupGetSizeAttributeType(arg *BackupGetSizeAttributeType, val BackupGetSizeRetType) { +func setListFlavorsGetNodeTypeAttributeType(arg *ListFlavorsGetNodeTypeAttributeType, val ListFlavorsGetNodeTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListFlavorsGetNodeTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListFlavorsGetNodeTypeRetType = string + /* - types and functions for startTime + types and functions for storageClasses */ -// isNotNullableString +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListFlavorsGetStorageClassesAttributeType = *[]FlavorStorageClassesStorageClass + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListFlavorsGetStorageClassesArgType = []FlavorStorageClassesStorageClass + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetStartTimeAttributeType = *string +type ListFlavorsGetStorageClassesRetType = []FlavorStorageClassesStorageClass // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getBackupGetStartTimeAttributeTypeOk(arg BackupGetStartTimeAttributeType) (ret BackupGetStartTimeRetType, ok bool) { +func getListFlavorsGetStorageClassesAttributeTypeOk(arg ListFlavorsGetStorageClassesAttributeType) (ret ListFlavorsGetStorageClassesRetType, ok bool) { if arg == nil { return ret, false } @@ -224,334 +230,301 @@ func getBackupGetStartTimeAttributeTypeOk(arg BackupGetStartTimeAttributeType) ( } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setBackupGetStartTimeAttributeType(arg *BackupGetStartTimeAttributeType, val BackupGetStartTimeRetType) { +func setListFlavorsGetStorageClassesAttributeType(arg *ListFlavorsGetStorageClassesAttributeType, val ListFlavorsGetStorageClassesRetType) { *arg = &val } -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetStartTimeArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BackupGetStartTimeRetType = string - -// Backup struct for Backup -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type Backup struct { - EndTime BackupGetEndTimeAttributeType `json:"endTime,omitempty"` - Error BackupGetErrorAttributeType `json:"error,omitempty"` - Id BackupGetIdAttributeType `json:"id,omitempty"` - Labels BackupGetLabelsAttributeType `json:"labels,omitempty"` - Name BackupGetNameAttributeType `json:"name,omitempty"` - Options BackupGetOptionsAttributeType `json:"options,omitempty"` - Size BackupGetSizeAttributeType `json:"size,omitempty"` - StartTime BackupGetStartTimeAttributeType `json:"startTime,omitempty"` -} - -// NewBackup instantiates a new Backup object +// ListFlavors The flavor of the instance containing the technical features. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListFlavors struct { + // The cpu count of the instance. + // REQUIRED + Cpu ListFlavorsGetCpuAttributeType `json:"cpu" required:"true"` + // The flavor description. + // REQUIRED + Description ListFlavorsGetDescriptionAttributeType `json:"description" required:"true"` + // The id of the instance flavor. + // REQUIRED + Id ListFlavorsGetIdAttributeType `json:"id" required:"true"` + // maximum storage which can be ordered for the flavor in Gigabyte. + // Can be cast to int32 without loss of precision. + // REQUIRED + MaxGB ListFlavorsGetMaxGBAttributeType `json:"maxGB" required:"true"` + // The memory of the instance in Gibibyte. + // REQUIRED + Memory ListFlavorsGetMemoryAttributeType `json:"memory" required:"true"` + // minimum storage which is required to order in Gigabyte. + // Can be cast to int32 without loss of precision. + // REQUIRED + MinGB ListFlavorsGetMinGBAttributeType `json:"minGB" required:"true"` + // defines the nodeType it can be either single or replica + // REQUIRED + NodeType ListFlavorsGetNodeTypeAttributeType `json:"nodeType" required:"true"` + // maximum storage which can be ordered for the flavor in Gigabyte. + // REQUIRED + StorageClasses ListFlavorsGetStorageClassesAttributeType `json:"storageClasses" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _ListFlavors ListFlavors + +// NewListFlavors instantiates a new ListFlavors object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewBackup() *Backup { - this := Backup{} +func NewListFlavors(cpu ListFlavorsGetCpuArgType, description ListFlavorsGetDescriptionArgType, id ListFlavorsGetIdArgType, maxGB ListFlavorsGetMaxGBArgType, memory ListFlavorsGetMemoryArgType, minGB ListFlavorsGetMinGBArgType, nodeType ListFlavorsGetNodeTypeArgType, storageClasses ListFlavorsGetStorageClassesArgType) *ListFlavors { + this := ListFlavors{} + setListFlavorsGetCpuAttributeType(&this.Cpu, cpu) + setListFlavorsGetDescriptionAttributeType(&this.Description, description) + setListFlavorsGetIdAttributeType(&this.Id, id) + setListFlavorsGetMaxGBAttributeType(&this.MaxGB, maxGB) + setListFlavorsGetMemoryAttributeType(&this.Memory, memory) + setListFlavorsGetMinGBAttributeType(&this.MinGB, minGB) + setListFlavorsGetNodeTypeAttributeType(&this.NodeType, nodeType) + setListFlavorsGetStorageClassesAttributeType(&this.StorageClasses, storageClasses) return &this } -// NewBackupWithDefaults instantiates a new Backup object +// NewListFlavorsWithDefaults instantiates a new ListFlavors object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewBackupWithDefaults() *Backup { - this := Backup{} +func NewListFlavorsWithDefaults() *ListFlavors { + this := ListFlavors{} return &this } -// GetEndTime returns the EndTime field value if set, zero value otherwise. +// GetCpu returns the Cpu field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) GetEndTime() (res BackupGetEndTimeRetType) { - res, _ = o.GetEndTimeOk() - return +func (o *ListFlavors) GetCpu() (ret ListFlavorsGetCpuRetType) { + ret, _ = o.GetCpuOk() + return ret } -// GetEndTimeOk returns a tuple with the EndTime field value if set, nil otherwise +// GetCpuOk returns a tuple with the Cpu field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) GetEndTimeOk() (ret BackupGetEndTimeRetType, ok bool) { - return getBackupGetEndTimeAttributeTypeOk(o.EndTime) -} - -// HasEndTime returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) HasEndTime() bool { - _, ok := o.GetEndTimeOk() - return ok +func (o *ListFlavors) GetCpuOk() (ret ListFlavorsGetCpuRetType, ok bool) { + return getListFlavorsGetCpuAttributeTypeOk(o.Cpu) } -// SetEndTime gets a reference to the given string and assigns it to the EndTime field. +// SetCpu sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) SetEndTime(v BackupGetEndTimeRetType) { - setBackupGetEndTimeAttributeType(&o.EndTime, v) +func (o *ListFlavors) SetCpu(v ListFlavorsGetCpuRetType) { + setListFlavorsGetCpuAttributeType(&o.Cpu, v) } -// GetError returns the Error field value if set, zero value otherwise. +// GetDescription returns the Description field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) GetError() (res BackupGetErrorRetType) { - res, _ = o.GetErrorOk() - return +func (o *ListFlavors) GetDescription() (ret ListFlavorsGetDescriptionRetType) { + ret, _ = o.GetDescriptionOk() + return ret } -// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// GetDescriptionOk returns a tuple with the Description field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) GetErrorOk() (ret BackupGetErrorRetType, ok bool) { - return getBackupGetErrorAttributeTypeOk(o.Error) +func (o *ListFlavors) GetDescriptionOk() (ret ListFlavorsGetDescriptionRetType, ok bool) { + return getListFlavorsGetDescriptionAttributeTypeOk(o.Description) } -// HasError returns a boolean if a field has been set. +// SetDescription sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) HasError() bool { - _, ok := o.GetErrorOk() - return ok +func (o *ListFlavors) SetDescription(v ListFlavorsGetDescriptionRetType) { + setListFlavorsGetDescriptionAttributeType(&o.Description, v) } -// SetError gets a reference to the given string and assigns it to the Error field. +// GetId returns the Id field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) SetError(v BackupGetErrorRetType) { - setBackupGetErrorAttributeType(&o.Error, v) +func (o *ListFlavors) GetId() (ret ListFlavorsGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } -// GetId returns the Id field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) GetId() (res BackupGetIdRetType) { - res, _ = o.GetIdOk() - return -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) GetIdOk() (ret BackupGetIdRetType, ok bool) { - return getBackupGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) HasId() bool { - _, ok := o.GetIdOk() - return ok +func (o *ListFlavors) GetIdOk() (ret ListFlavorsGetIdRetType, ok bool) { + return getListFlavorsGetIdAttributeTypeOk(o.Id) } -// SetId gets a reference to the given string and assigns it to the Id field. +// SetId sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) SetId(v BackupGetIdRetType) { - setBackupGetIdAttributeType(&o.Id, v) +func (o *ListFlavors) SetId(v ListFlavorsGetIdRetType) { + setListFlavorsGetIdAttributeType(&o.Id, v) } -// GetLabels returns the Labels field value if set, zero value otherwise. +// GetMaxGB returns the MaxGB field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) GetLabels() (res BackupGetLabelsRetType) { - res, _ = o.GetLabelsOk() - return +func (o *ListFlavors) GetMaxGB() (ret ListFlavorsGetMaxGBRetType) { + ret, _ = o.GetMaxGBOk() + return ret } -// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// GetMaxGBOk returns a tuple with the MaxGB field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) GetLabelsOk() (ret BackupGetLabelsRetType, ok bool) { - return getBackupGetLabelsAttributeTypeOk(o.Labels) -} - -// HasLabels returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) HasLabels() bool { - _, ok := o.GetLabelsOk() - return ok +func (o *ListFlavors) GetMaxGBOk() (ret ListFlavorsGetMaxGBRetType, ok bool) { + return getListFlavorsGetMaxGBAttributeTypeOk(o.MaxGB) } -// SetLabels gets a reference to the given []string and assigns it to the Labels field. +// SetMaxGB sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) SetLabels(v BackupGetLabelsRetType) { - setBackupGetLabelsAttributeType(&o.Labels, v) +func (o *ListFlavors) SetMaxGB(v ListFlavorsGetMaxGBRetType) { + setListFlavorsGetMaxGBAttributeType(&o.MaxGB, v) } -// GetName returns the Name field value if set, zero value otherwise. +// GetMemory returns the Memory field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) GetName() (res BackupGetNameRetType) { - res, _ = o.GetNameOk() - return +func (o *ListFlavors) GetMemory() (ret ListFlavorsGetMemoryRetType) { + ret, _ = o.GetMemoryOk() + return ret } -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetMemoryOk returns a tuple with the Memory field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) GetNameOk() (ret BackupGetNameRetType, ok bool) { - return getBackupGetNameAttributeTypeOk(o.Name) +func (o *ListFlavors) GetMemoryOk() (ret ListFlavorsGetMemoryRetType, ok bool) { + return getListFlavorsGetMemoryAttributeTypeOk(o.Memory) } -// HasName returns a boolean if a field has been set. +// SetMemory sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) HasName() bool { - _, ok := o.GetNameOk() - return ok +func (o *ListFlavors) SetMemory(v ListFlavorsGetMemoryRetType) { + setListFlavorsGetMemoryAttributeType(&o.Memory, v) } -// SetName gets a reference to the given string and assigns it to the Name field. +// GetMinGB returns the MinGB field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) SetName(v BackupGetNameRetType) { - setBackupGetNameAttributeType(&o.Name, v) +func (o *ListFlavors) GetMinGB() (ret ListFlavorsGetMinGBRetType) { + ret, _ = o.GetMinGBOk() + return ret } -// GetOptions returns the Options field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) GetOptions() (res BackupGetOptionsRetType) { - res, _ = o.GetOptionsOk() - return -} - -// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// GetMinGBOk returns a tuple with the MinGB field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) GetOptionsOk() (ret BackupGetOptionsRetType, ok bool) { - return getBackupGetOptionsAttributeTypeOk(o.Options) +func (o *ListFlavors) GetMinGBOk() (ret ListFlavorsGetMinGBRetType, ok bool) { + return getListFlavorsGetMinGBAttributeTypeOk(o.MinGB) } -// HasOptions returns a boolean if a field has been set. +// SetMinGB sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) HasOptions() bool { - _, ok := o.GetOptionsOk() - return ok +func (o *ListFlavors) SetMinGB(v ListFlavorsGetMinGBRetType) { + setListFlavorsGetMinGBAttributeType(&o.MinGB, v) } -// SetOptions gets a reference to the given map[string]string and assigns it to the Options field. +// GetNodeType returns the NodeType field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) SetOptions(v BackupGetOptionsRetType) { - setBackupGetOptionsAttributeType(&o.Options, v) +func (o *ListFlavors) GetNodeType() (ret ListFlavorsGetNodeTypeRetType) { + ret, _ = o.GetNodeTypeOk() + return ret } -// GetSize returns the Size field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) GetSize() (res BackupGetSizeRetType) { - res, _ = o.GetSizeOk() - return -} - -// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// GetNodeTypeOk returns a tuple with the NodeType field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) GetSizeOk() (ret BackupGetSizeRetType, ok bool) { - return getBackupGetSizeAttributeTypeOk(o.Size) -} - -// HasSize returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) HasSize() bool { - _, ok := o.GetSizeOk() - return ok +func (o *ListFlavors) GetNodeTypeOk() (ret ListFlavorsGetNodeTypeRetType, ok bool) { + return getListFlavorsGetNodeTypeAttributeTypeOk(o.NodeType) } -// SetSize gets a reference to the given int64 and assigns it to the Size field. +// SetNodeType sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) SetSize(v BackupGetSizeRetType) { - setBackupGetSizeAttributeType(&o.Size, v) +func (o *ListFlavors) SetNodeType(v ListFlavorsGetNodeTypeRetType) { + setListFlavorsGetNodeTypeAttributeType(&o.NodeType, v) } -// GetStartTime returns the StartTime field value if set, zero value otherwise. +// GetStorageClasses returns the StorageClasses field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) GetStartTime() (res BackupGetStartTimeRetType) { - res, _ = o.GetStartTimeOk() - return +func (o *ListFlavors) GetStorageClasses() (ret ListFlavorsGetStorageClassesRetType) { + ret, _ = o.GetStorageClassesOk() + return ret } -// GetStartTimeOk returns a tuple with the StartTime field value if set, nil otherwise +// GetStorageClassesOk returns a tuple with the StorageClasses field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) GetStartTimeOk() (ret BackupGetStartTimeRetType, ok bool) { - return getBackupGetStartTimeAttributeTypeOk(o.StartTime) -} - -// HasStartTime returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) HasStartTime() bool { - _, ok := o.GetStartTimeOk() - return ok +func (o *ListFlavors) GetStorageClassesOk() (ret ListFlavorsGetStorageClassesRetType, ok bool) { + return getListFlavorsGetStorageClassesAttributeTypeOk(o.StorageClasses) } -// SetStartTime gets a reference to the given string and assigns it to the StartTime field. +// SetStorageClasses sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Backup) SetStartTime(v BackupGetStartTimeRetType) { - setBackupGetStartTimeAttributeType(&o.StartTime, v) +func (o *ListFlavors) SetStorageClasses(v ListFlavorsGetStorageClassesRetType) { + setListFlavorsGetStorageClassesAttributeType(&o.StorageClasses, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o Backup) ToMap() (map[string]interface{}, error) { +func (o ListFlavors) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getBackupGetEndTimeAttributeTypeOk(o.EndTime); ok { - toSerialize["EndTime"] = val + if val, ok := getListFlavorsGetCpuAttributeTypeOk(o.Cpu); ok { + toSerialize["Cpu"] = val } - if val, ok := getBackupGetErrorAttributeTypeOk(o.Error); ok { - toSerialize["Error"] = val + if val, ok := getListFlavorsGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val } - if val, ok := getBackupGetIdAttributeTypeOk(o.Id); ok { + if val, ok := getListFlavorsGetIdAttributeTypeOk(o.Id); ok { toSerialize["Id"] = val } - if val, ok := getBackupGetLabelsAttributeTypeOk(o.Labels); ok { - toSerialize["Labels"] = val + if val, ok := getListFlavorsGetMaxGBAttributeTypeOk(o.MaxGB); ok { + toSerialize["MaxGB"] = val } - if val, ok := getBackupGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val + if val, ok := getListFlavorsGetMemoryAttributeTypeOk(o.Memory); ok { + toSerialize["Memory"] = val } - if val, ok := getBackupGetOptionsAttributeTypeOk(o.Options); ok { - toSerialize["Options"] = val + if val, ok := getListFlavorsGetMinGBAttributeTypeOk(o.MinGB); ok { + toSerialize["MinGB"] = val } - if val, ok := getBackupGetSizeAttributeTypeOk(o.Size); ok { - toSerialize["Size"] = val + if val, ok := getListFlavorsGetNodeTypeAttributeTypeOk(o.NodeType); ok { + toSerialize["NodeType"] = val } - if val, ok := getBackupGetStartTimeAttributeTypeOk(o.StartTime); ok { - toSerialize["StartTime"] = val + if val, ok := getListFlavorsGetStorageClassesAttributeTypeOk(o.StorageClasses); ok { + toSerialize["StorageClasses"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableBackup struct { - value *Backup +type NullableListFlavors struct { + value *ListFlavors isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableBackup) Get() *Backup { +func (v NullableListFlavors) Get() *ListFlavors { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableBackup) Set(val *Backup) { +func (v *NullableListFlavors) Set(val *ListFlavors) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableBackup) IsSet() bool { +func (v NullableListFlavors) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableBackup) Unset() { +func (v *NullableListFlavors) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableBackup(val *Backup) *NullableBackup { - return &NullableBackup{value: val, isSet: true} +func NewNullableListFlavors(val *ListFlavors) *NullableListFlavors { + return &NullableListFlavors{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableBackup) MarshalJSON() ([]byte, error) { +func (v NullableListFlavors) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableBackup) UnmarshalJSON(src []byte) error { +func (v *NullableListFlavors) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_list_flavors_response.go b/services/postgresflex/model_list_flavors_response.go index 3216c94a1..3ddfd02dc 100644 --- a/services/postgresflex/model_list_flavors_response.go +++ b/services/postgresflex/model_list_flavors_response.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -24,13 +24,13 @@ var _ MappedNullable = &ListFlavorsResponse{} // isArray // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListFlavorsResponseGetFlavorsAttributeType = *[]Flavor +type ListFlavorsResponseGetFlavorsAttributeType = *[]ListFlavors // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListFlavorsResponseGetFlavorsArgType = []Flavor +type ListFlavorsResponseGetFlavorsArgType = []ListFlavors // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListFlavorsResponseGetFlavorsRetType = []Flavor +type ListFlavorsResponseGetFlavorsRetType = []ListFlavors // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListFlavorsResponseGetFlavorsAttributeTypeOk(arg ListFlavorsResponseGetFlavorsAttributeType) (ret ListFlavorsResponseGetFlavorsRetType, ok bool) { @@ -45,19 +45,55 @@ func setListFlavorsResponseGetFlavorsAttributeType(arg *ListFlavorsResponseGetFl *arg = &val } +/* + types and functions for pagination +*/ + +// isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListFlavorsResponseGetPaginationAttributeType = *Pagination + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListFlavorsResponseGetPaginationArgType = Pagination + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListFlavorsResponseGetPaginationRetType = Pagination + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getListFlavorsResponseGetPaginationAttributeTypeOk(arg ListFlavorsResponseGetPaginationAttributeType) (ret ListFlavorsResponseGetPaginationRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setListFlavorsResponseGetPaginationAttributeType(arg *ListFlavorsResponseGetPaginationAttributeType, val ListFlavorsResponseGetPaginationRetType) { + *arg = &val +} + // ListFlavorsResponse struct for ListFlavorsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListFlavorsResponse struct { - Flavors ListFlavorsResponseGetFlavorsAttributeType `json:"flavors,omitempty"` + // List of flavors available for the project. + // REQUIRED + Flavors ListFlavorsResponseGetFlavorsAttributeType `json:"flavors" required:"true"` + // REQUIRED + Pagination ListFlavorsResponseGetPaginationAttributeType `json:"pagination" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _ListFlavorsResponse ListFlavorsResponse + // NewListFlavorsResponse instantiates a new ListFlavorsResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewListFlavorsResponse() *ListFlavorsResponse { +func NewListFlavorsResponse(flavors ListFlavorsResponseGetFlavorsArgType, pagination ListFlavorsResponseGetPaginationArgType) *ListFlavorsResponse { this := ListFlavorsResponse{} + setListFlavorsResponseGetFlavorsAttributeType(&this.Flavors, flavors) + setListFlavorsResponseGetPaginationAttributeType(&this.Pagination, pagination) return &this } @@ -70,31 +106,44 @@ func NewListFlavorsResponseWithDefaults() *ListFlavorsResponse { return &this } -// GetFlavors returns the Flavors field value if set, zero value otherwise. +// GetFlavors returns the Flavors field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListFlavorsResponse) GetFlavors() (res ListFlavorsResponseGetFlavorsRetType) { - res, _ = o.GetFlavorsOk() - return +func (o *ListFlavorsResponse) GetFlavors() (ret ListFlavorsResponseGetFlavorsRetType) { + ret, _ = o.GetFlavorsOk() + return ret } -// GetFlavorsOk returns a tuple with the Flavors field value if set, nil otherwise +// GetFlavorsOk returns a tuple with the Flavors field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListFlavorsResponse) GetFlavorsOk() (ret ListFlavorsResponseGetFlavorsRetType, ok bool) { return getListFlavorsResponseGetFlavorsAttributeTypeOk(o.Flavors) } -// HasFlavors returns a boolean if a field has been set. +// SetFlavors sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListFlavorsResponse) HasFlavors() bool { - _, ok := o.GetFlavorsOk() - return ok +func (o *ListFlavorsResponse) SetFlavors(v ListFlavorsResponseGetFlavorsRetType) { + setListFlavorsResponseGetFlavorsAttributeType(&o.Flavors, v) } -// SetFlavors gets a reference to the given []Flavor and assigns it to the Flavors field. +// GetPagination returns the Pagination field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListFlavorsResponse) SetFlavors(v ListFlavorsResponseGetFlavorsRetType) { - setListFlavorsResponseGetFlavorsAttributeType(&o.Flavors, v) +func (o *ListFlavorsResponse) GetPagination() (ret ListFlavorsResponseGetPaginationRetType) { + ret, _ = o.GetPaginationOk() + return ret +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ListFlavorsResponse) GetPaginationOk() (ret ListFlavorsResponseGetPaginationRetType, ok bool) { + return getListFlavorsResponseGetPaginationAttributeTypeOk(o.Pagination) +} + +// SetPagination sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ListFlavorsResponse) SetPagination(v ListFlavorsResponseGetPaginationRetType) { + setListFlavorsResponseGetPaginationAttributeType(&o.Pagination, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -103,6 +152,9 @@ func (o ListFlavorsResponse) ToMap() (map[string]interface{}, error) { if val, ok := getListFlavorsResponseGetFlavorsAttributeTypeOk(o.Flavors); ok { toSerialize["Flavors"] = val } + if val, ok := getListFlavorsResponseGetPaginationAttributeTypeOk(o.Pagination); ok { + toSerialize["Pagination"] = val + } return toSerialize, nil } diff --git a/services/postgresflex/model_list_flavors_response_test.go b/services/postgresflex/model_list_flavors_response_test.go index 51f50494d..74a76f10e 100644 --- a/services/postgresflex/model_list_flavors_response_test.go +++ b/services/postgresflex/model_list_flavors_response_test.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_list_flavors_test.go b/services/postgresflex/model_list_flavors_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_list_flavors_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_flavor.go b/services/postgresflex/model_list_instance.go similarity index 53% rename from services/postgresflex/model_flavor.go rename to services/postgresflex/model_list_instance.go index 3205aae95..94cf0f162 100644 --- a/services/postgresflex/model_flavor.go +++ b/services/postgresflex/model_list_instance.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,25 +15,19 @@ import ( "encoding/json" ) -// checks if the Flavor type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Flavor{} +// checks if the ListInstance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListInstance{} /* - types and functions for cpu + types and functions for id */ -// isLong -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type FlavorGetCpuAttributeType = *int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type FlavorGetCpuArgType = int64 - +// isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type FlavorGetCpuRetType = int64 +type ListInstanceGetIdAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getFlavorGetCpuAttributeTypeOk(arg FlavorGetCpuAttributeType) (ret FlavorGetCpuRetType, ok bool) { +func getListInstanceGetIdAttributeTypeOk(arg ListInstanceGetIdAttributeType) (ret ListInstanceGetIdRetType, ok bool) { if arg == nil { return ret, false } @@ -41,20 +35,32 @@ func getFlavorGetCpuAttributeTypeOk(arg FlavorGetCpuAttributeType) (ret FlavorGe } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setFlavorGetCpuAttributeType(arg *FlavorGetCpuAttributeType, val FlavorGetCpuRetType) { +func setListInstanceGetIdAttributeType(arg *ListInstanceGetIdAttributeType, val ListInstanceGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListInstanceGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListInstanceGetIdRetType = string + /* - types and functions for description + types and functions for isDeletable */ -// isNotNullableString +// isBoolean // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type FlavorGetDescriptionAttributeType = *string +type ListInstancegetIsDeletableAttributeType = *bool // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getFlavorGetDescriptionAttributeTypeOk(arg FlavorGetDescriptionAttributeType) (ret FlavorGetDescriptionRetType, ok bool) { +type ListInstancegetIsDeletableArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListInstancegetIsDeletableRetType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getListInstancegetIsDeletableAttributeTypeOk(arg ListInstancegetIsDeletableAttributeType) (ret ListInstancegetIsDeletableRetType, ok bool) { if arg == nil { return ret, false } @@ -62,26 +68,20 @@ func getFlavorGetDescriptionAttributeTypeOk(arg FlavorGetDescriptionAttributeTyp } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setFlavorGetDescriptionAttributeType(arg *FlavorGetDescriptionAttributeType, val FlavorGetDescriptionRetType) { +func setListInstancegetIsDeletableAttributeType(arg *ListInstancegetIsDeletableAttributeType, val ListInstancegetIsDeletableRetType) { *arg = &val } -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type FlavorGetDescriptionArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type FlavorGetDescriptionRetType = string - /* - types and functions for id + types and functions for name */ // isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type FlavorGetIdAttributeType = *string +type ListInstanceGetNameAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getFlavorGetIdAttributeTypeOk(arg FlavorGetIdAttributeType) (ret FlavorGetIdRetType, ok bool) { +func getListInstanceGetNameAttributeTypeOk(arg ListInstanceGetNameAttributeType) (ret ListInstanceGetNameRetType, ok bool) { if arg == nil { return ret, false } @@ -89,32 +89,32 @@ func getFlavorGetIdAttributeTypeOk(arg FlavorGetIdAttributeType) (ret FlavorGetI } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setFlavorGetIdAttributeType(arg *FlavorGetIdAttributeType, val FlavorGetIdRetType) { +func setListInstanceGetNameAttributeType(arg *ListInstanceGetNameAttributeType, val ListInstanceGetNameRetType) { *arg = &val } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type FlavorGetIdArgType = string +type ListInstanceGetNameArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type FlavorGetIdRetType = string +type ListInstanceGetNameRetType = string /* - types and functions for memory + types and functions for state */ -// isLong +// isEnumRef // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type FlavorGetMemoryAttributeType = *int64 +type ListInstanceGetStateAttributeType = *State // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type FlavorGetMemoryArgType = int64 +type ListInstanceGetStateArgType = State // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type FlavorGetMemoryRetType = int64 +type ListInstanceGetStateRetType = State // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getFlavorGetMemoryAttributeTypeOk(arg FlavorGetMemoryAttributeType) (ret FlavorGetMemoryRetType, ok bool) { +func getListInstanceGetStateAttributeTypeOk(arg ListInstanceGetStateAttributeType) (ret ListInstanceGetStateRetType, ok bool) { if arg == nil { return ret, false } @@ -122,204 +122,190 @@ func getFlavorGetMemoryAttributeTypeOk(arg FlavorGetMemoryAttributeType) (ret Fl } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setFlavorGetMemoryAttributeType(arg *FlavorGetMemoryAttributeType, val FlavorGetMemoryRetType) { +func setListInstanceGetStateAttributeType(arg *ListInstanceGetStateAttributeType, val ListInstanceGetStateRetType) { *arg = &val } -// Flavor struct for Flavor +// ListInstance struct for ListInstance // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type Flavor struct { - Cpu FlavorGetCpuAttributeType `json:"cpu,omitempty"` - Description FlavorGetDescriptionAttributeType `json:"description,omitempty"` - Id FlavorGetIdAttributeType `json:"id,omitempty"` - Memory FlavorGetMemoryAttributeType `json:"memory,omitempty"` +type ListInstance struct { + // The ID of the instance. + // REQUIRED + Id ListInstanceGetIdAttributeType `json:"id" required:"true"` + // Whether the instance can be deleted or not. + // REQUIRED + IsDeletable ListInstancegetIsDeletableAttributeType `json:"isDeletable" required:"true"` + // The name of the instance. + // REQUIRED + Name ListInstanceGetNameAttributeType `json:"name" required:"true"` + // REQUIRED + State ListInstanceGetStateAttributeType `json:"state" required:"true"` } -// NewFlavor instantiates a new Flavor object +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _ListInstance ListInstance + +// NewListInstance instantiates a new ListInstance object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewFlavor() *Flavor { - this := Flavor{} +func NewListInstance(id ListInstanceGetIdArgType, isDeletable ListInstancegetIsDeletableArgType, name ListInstanceGetNameArgType, state ListInstanceGetStateArgType) *ListInstance { + this := ListInstance{} + setListInstanceGetIdAttributeType(&this.Id, id) + setListInstancegetIsDeletableAttributeType(&this.IsDeletable, isDeletable) + setListInstanceGetNameAttributeType(&this.Name, name) + setListInstanceGetStateAttributeType(&this.State, state) return &this } -// NewFlavorWithDefaults instantiates a new Flavor object +// NewListInstanceWithDefaults instantiates a new ListInstance object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewFlavorWithDefaults() *Flavor { - this := Flavor{} +func NewListInstanceWithDefaults() *ListInstance { + this := ListInstance{} return &this } -// GetCpu returns the Cpu field value if set, zero value otherwise. +// GetId returns the Id field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Flavor) GetCpu() (res FlavorGetCpuRetType) { - res, _ = o.GetCpuOk() - return +func (o *ListInstance) GetId() (ret ListInstanceGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } -// GetCpuOk returns a tuple with the Cpu field value if set, nil otherwise +// GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Flavor) GetCpuOk() (ret FlavorGetCpuRetType, ok bool) { - return getFlavorGetCpuAttributeTypeOk(o.Cpu) +func (o *ListInstance) GetIdOk() (ret ListInstanceGetIdRetType, ok bool) { + return getListInstanceGetIdAttributeTypeOk(o.Id) } -// HasCpu returns a boolean if a field has been set. +// SetId sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Flavor) HasCpu() bool { - _, ok := o.GetCpuOk() - return ok +func (o *ListInstance) SetId(v ListInstanceGetIdRetType) { + setListInstanceGetIdAttributeType(&o.Id, v) } -// SetCpu gets a reference to the given int64 and assigns it to the Cpu field. +// GetIsDeletable returns the IsDeletable field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Flavor) SetCpu(v FlavorGetCpuRetType) { - setFlavorGetCpuAttributeType(&o.Cpu, v) +func (o *ListInstance) GetIsDeletable() (ret ListInstancegetIsDeletableRetType) { + ret, _ = o.GetIsDeletableOk() + return ret } -// GetDescription returns the Description field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Flavor) GetDescription() (res FlavorGetDescriptionRetType) { - res, _ = o.GetDescriptionOk() - return -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// GetIsDeletableOk returns a tuple with the IsDeletable field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Flavor) GetDescriptionOk() (ret FlavorGetDescriptionRetType, ok bool) { - return getFlavorGetDescriptionAttributeTypeOk(o.Description) -} - -// HasDescription returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Flavor) HasDescription() bool { - _, ok := o.GetDescriptionOk() - return ok +func (o *ListInstance) GetIsDeletableOk() (ret ListInstancegetIsDeletableRetType, ok bool) { + return getListInstancegetIsDeletableAttributeTypeOk(o.IsDeletable) } -// SetDescription gets a reference to the given string and assigns it to the Description field. +// SetIsDeletable sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Flavor) SetDescription(v FlavorGetDescriptionRetType) { - setFlavorGetDescriptionAttributeType(&o.Description, v) +func (o *ListInstance) SetIsDeletable(v ListInstancegetIsDeletableRetType) { + setListInstancegetIsDeletableAttributeType(&o.IsDeletable, v) } -// GetId returns the Id field value if set, zero value otherwise. +// GetName returns the Name field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Flavor) GetId() (res FlavorGetIdRetType) { - res, _ = o.GetIdOk() - return +func (o *ListInstance) GetName() (ret ListInstanceGetNameRetType) { + ret, _ = o.GetNameOk() + return ret } -// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Flavor) GetIdOk() (ret FlavorGetIdRetType, ok bool) { - return getFlavorGetIdAttributeTypeOk(o.Id) +func (o *ListInstance) GetNameOk() (ret ListInstanceGetNameRetType, ok bool) { + return getListInstanceGetNameAttributeTypeOk(o.Name) } -// HasId returns a boolean if a field has been set. +// SetName sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Flavor) HasId() bool { - _, ok := o.GetIdOk() - return ok +func (o *ListInstance) SetName(v ListInstanceGetNameRetType) { + setListInstanceGetNameAttributeType(&o.Name, v) } -// SetId gets a reference to the given string and assigns it to the Id field. +// GetState returns the State field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Flavor) SetId(v FlavorGetIdRetType) { - setFlavorGetIdAttributeType(&o.Id, v) +func (o *ListInstance) GetState() (ret ListInstanceGetStateRetType) { + ret, _ = o.GetStateOk() + return ret } -// GetMemory returns the Memory field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Flavor) GetMemory() (res FlavorGetMemoryRetType) { - res, _ = o.GetMemoryOk() - return -} - -// GetMemoryOk returns a tuple with the Memory field value if set, nil otherwise +// GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Flavor) GetMemoryOk() (ret FlavorGetMemoryRetType, ok bool) { - return getFlavorGetMemoryAttributeTypeOk(o.Memory) +func (o *ListInstance) GetStateOk() (ret ListInstanceGetStateRetType, ok bool) { + return getListInstanceGetStateAttributeTypeOk(o.State) } -// HasMemory returns a boolean if a field has been set. +// SetState sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Flavor) HasMemory() bool { - _, ok := o.GetMemoryOk() - return ok +func (o *ListInstance) SetState(v ListInstanceGetStateRetType) { + setListInstanceGetStateAttributeType(&o.State, v) } -// SetMemory gets a reference to the given int64 and assigns it to the Memory field. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Flavor) SetMemory(v FlavorGetMemoryRetType) { - setFlavorGetMemoryAttributeType(&o.Memory, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o Flavor) ToMap() (map[string]interface{}, error) { +func (o ListInstance) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getFlavorGetCpuAttributeTypeOk(o.Cpu); ok { - toSerialize["Cpu"] = val + if val, ok := getListInstanceGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if val, ok := getFlavorGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val + if val, ok := getListInstancegetIsDeletableAttributeTypeOk(o.IsDeletable); ok { + toSerialize["IsDeletable"] = val } - if val, ok := getFlavorGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val + if val, ok := getListInstanceGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if val, ok := getFlavorGetMemoryAttributeTypeOk(o.Memory); ok { - toSerialize["Memory"] = val + if val, ok := getListInstanceGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableFlavor struct { - value *Flavor +type NullableListInstance struct { + value *ListInstance isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableFlavor) Get() *Flavor { +func (v NullableListInstance) Get() *ListInstance { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableFlavor) Set(val *Flavor) { +func (v *NullableListInstance) Set(val *ListInstance) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableFlavor) IsSet() bool { +func (v NullableListInstance) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableFlavor) Unset() { +func (v *NullableListInstance) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableFlavor(val *Flavor) *NullableFlavor { - return &NullableFlavor{value: val, isSet: true} +func NewNullableListInstance(val *ListInstance) *NullableListInstance { + return &NullableListInstance{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableFlavor) MarshalJSON() ([]byte, error) { +func (v NullableListInstance) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableFlavor) UnmarshalJSON(src []byte) error { +func (v *NullableListInstance) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_list_instance_test.go b/services/postgresflex/model_list_instance_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_list_instance_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_list_instances_response.go b/services/postgresflex/model_list_instances_response.go index e0f04a7dc..09038a4a8 100644 --- a/services/postgresflex/model_list_instances_response.go +++ b/services/postgresflex/model_list_instances_response.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,21 +19,21 @@ import ( var _ MappedNullable = &ListInstancesResponse{} /* - types and functions for count + types and functions for instances */ -// isLong +// isArray // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListInstancesResponseGetCountAttributeType = *int64 +type ListInstancesResponseGetInstancesAttributeType = *[]ListInstance // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListInstancesResponseGetCountArgType = int64 +type ListInstancesResponseGetInstancesArgType = []ListInstance // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListInstancesResponseGetCountRetType = int64 +type ListInstancesResponseGetInstancesRetType = []ListInstance // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getListInstancesResponseGetCountAttributeTypeOk(arg ListInstancesResponseGetCountAttributeType) (ret ListInstancesResponseGetCountRetType, ok bool) { +func getListInstancesResponseGetInstancesAttributeTypeOk(arg ListInstancesResponseGetInstancesAttributeType) (ret ListInstancesResponseGetInstancesRetType, ok bool) { if arg == nil { return ret, false } @@ -41,26 +41,26 @@ func getListInstancesResponseGetCountAttributeTypeOk(arg ListInstancesResponseGe } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setListInstancesResponseGetCountAttributeType(arg *ListInstancesResponseGetCountAttributeType, val ListInstancesResponseGetCountRetType) { +func setListInstancesResponseGetInstancesAttributeType(arg *ListInstancesResponseGetInstancesAttributeType, val ListInstancesResponseGetInstancesRetType) { *arg = &val } /* - types and functions for items + types and functions for pagination */ -// isArray +// isModel // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListInstancesResponseGetItemsAttributeType = *[]InstanceListInstance +type ListInstancesResponseGetPaginationAttributeType = *Pagination // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListInstancesResponseGetItemsArgType = []InstanceListInstance +type ListInstancesResponseGetPaginationArgType = Pagination // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListInstancesResponseGetItemsRetType = []InstanceListInstance +type ListInstancesResponseGetPaginationRetType = Pagination // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getListInstancesResponseGetItemsAttributeTypeOk(arg ListInstancesResponseGetItemsAttributeType) (ret ListInstancesResponseGetItemsRetType, ok bool) { +func getListInstancesResponseGetPaginationAttributeTypeOk(arg ListInstancesResponseGetPaginationAttributeType) (ret ListInstancesResponseGetPaginationRetType, ok bool) { if arg == nil { return ret, false } @@ -68,24 +68,32 @@ func getListInstancesResponseGetItemsAttributeTypeOk(arg ListInstancesResponseGe } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setListInstancesResponseGetItemsAttributeType(arg *ListInstancesResponseGetItemsAttributeType, val ListInstancesResponseGetItemsRetType) { +func setListInstancesResponseGetPaginationAttributeType(arg *ListInstancesResponseGetPaginationAttributeType, val ListInstancesResponseGetPaginationRetType) { *arg = &val } // ListInstancesResponse struct for ListInstancesResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListInstancesResponse struct { - Count ListInstancesResponseGetCountAttributeType `json:"count,omitempty"` - Items ListInstancesResponseGetItemsAttributeType `json:"items,omitempty"` + // List of owned instances and their current state. + // REQUIRED + Instances ListInstancesResponseGetInstancesAttributeType `json:"instances" required:"true"` + // REQUIRED + Pagination ListInstancesResponseGetPaginationAttributeType `json:"pagination" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _ListInstancesResponse ListInstancesResponse + // NewListInstancesResponse instantiates a new ListInstancesResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewListInstancesResponse() *ListInstancesResponse { +func NewListInstancesResponse(instances ListInstancesResponseGetInstancesArgType, pagination ListInstancesResponseGetPaginationArgType) *ListInstancesResponse { this := ListInstancesResponse{} + setListInstancesResponseGetInstancesAttributeType(&this.Instances, instances) + setListInstancesResponseGetPaginationAttributeType(&this.Pagination, pagination) return &this } @@ -98,68 +106,54 @@ func NewListInstancesResponseWithDefaults() *ListInstancesResponse { return &this } -// GetCount returns the Count field value if set, zero value otherwise. +// GetInstances returns the Instances field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListInstancesResponse) GetCount() (res ListInstancesResponseGetCountRetType) { - res, _ = o.GetCountOk() - return +func (o *ListInstancesResponse) GetInstances() (ret ListInstancesResponseGetInstancesRetType) { + ret, _ = o.GetInstancesOk() + return ret } -// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// GetInstancesOk returns a tuple with the Instances field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListInstancesResponse) GetCountOk() (ret ListInstancesResponseGetCountRetType, ok bool) { - return getListInstancesResponseGetCountAttributeTypeOk(o.Count) -} - -// HasCount returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListInstancesResponse) HasCount() bool { - _, ok := o.GetCountOk() - return ok +func (o *ListInstancesResponse) GetInstancesOk() (ret ListInstancesResponseGetInstancesRetType, ok bool) { + return getListInstancesResponseGetInstancesAttributeTypeOk(o.Instances) } -// SetCount gets a reference to the given int64 and assigns it to the Count field. +// SetInstances sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListInstancesResponse) SetCount(v ListInstancesResponseGetCountRetType) { - setListInstancesResponseGetCountAttributeType(&o.Count, v) +func (o *ListInstancesResponse) SetInstances(v ListInstancesResponseGetInstancesRetType) { + setListInstancesResponseGetInstancesAttributeType(&o.Instances, v) } -// GetItems returns the Items field value if set, zero value otherwise. +// GetPagination returns the Pagination field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListInstancesResponse) GetItems() (res ListInstancesResponseGetItemsRetType) { - res, _ = o.GetItemsOk() - return +func (o *ListInstancesResponse) GetPagination() (ret ListInstancesResponseGetPaginationRetType) { + ret, _ = o.GetPaginationOk() + return ret } -// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// GetPaginationOk returns a tuple with the Pagination field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListInstancesResponse) GetItemsOk() (ret ListInstancesResponseGetItemsRetType, ok bool) { - return getListInstancesResponseGetItemsAttributeTypeOk(o.Items) -} - -// HasItems returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListInstancesResponse) HasItems() bool { - _, ok := o.GetItemsOk() - return ok +func (o *ListInstancesResponse) GetPaginationOk() (ret ListInstancesResponseGetPaginationRetType, ok bool) { + return getListInstancesResponseGetPaginationAttributeTypeOk(o.Pagination) } -// SetItems gets a reference to the given []InstanceListInstance and assigns it to the Items field. +// SetPagination sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListInstancesResponse) SetItems(v ListInstancesResponseGetItemsRetType) { - setListInstancesResponseGetItemsAttributeType(&o.Items, v) +func (o *ListInstancesResponse) SetPagination(v ListInstancesResponseGetPaginationRetType) { + setListInstancesResponseGetPaginationAttributeType(&o.Pagination, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ListInstancesResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getListInstancesResponseGetCountAttributeTypeOk(o.Count); ok { - toSerialize["Count"] = val + if val, ok := getListInstancesResponseGetInstancesAttributeTypeOk(o.Instances); ok { + toSerialize["Instances"] = val } - if val, ok := getListInstancesResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val + if val, ok := getListInstancesResponseGetPaginationAttributeTypeOk(o.Pagination); ok { + toSerialize["Pagination"] = val } return toSerialize, nil } diff --git a/services/postgresflex/model_list_instances_response_test.go b/services/postgresflex/model_list_instances_response_test.go index 51f50494d..74a76f10e 100644 --- a/services/postgresflex/model_list_instances_response_test.go +++ b/services/postgresflex/model_list_instances_response_test.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_get_backup_response.go b/services/postgresflex/model_list_roles_response.go similarity index 58% rename from services/postgresflex/model_get_backup_response.go rename to services/postgresflex/model_list_roles_response.go index 2c5751b0c..393364e17 100644 --- a/services/postgresflex/model_get_backup_response.go +++ b/services/postgresflex/model_list_roles_response.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,25 +15,25 @@ import ( "encoding/json" ) -// checks if the GetBackupResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetBackupResponse{} +// checks if the ListRolesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListRolesResponse{} /* - types and functions for item + types and functions for roles */ -// isModel +// isArray // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type GetBackupResponseGetItemAttributeType = *Backup +type ListRolesResponseGetRolesAttributeType = *[]string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type GetBackupResponseGetItemArgType = Backup +type ListRolesResponseGetRolesArgType = []string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type GetBackupResponseGetItemRetType = Backup +type ListRolesResponseGetRolesRetType = []string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getGetBackupResponseGetItemAttributeTypeOk(arg GetBackupResponseGetItemAttributeType) (ret GetBackupResponseGetItemRetType, ok bool) { +func getListRolesResponseGetRolesAttributeTypeOk(arg ListRolesResponseGetRolesAttributeType) (ret ListRolesResponseGetRolesRetType, ok bool) { if arg == nil { return ret, false } @@ -41,111 +41,110 @@ func getGetBackupResponseGetItemAttributeTypeOk(arg GetBackupResponseGetItemAttr } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setGetBackupResponseGetItemAttributeType(arg *GetBackupResponseGetItemAttributeType, val GetBackupResponseGetItemRetType) { +func setListRolesResponseGetRolesAttributeType(arg *ListRolesResponseGetRolesAttributeType, val ListRolesResponseGetRolesRetType) { *arg = &val } -// GetBackupResponse struct for GetBackupResponse +// ListRolesResponse struct for ListRolesResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type GetBackupResponse struct { - Item GetBackupResponseGetItemAttributeType `json:"item,omitempty"` +type ListRolesResponse struct { + // List of all role names available in the instance + // REQUIRED + Roles ListRolesResponseGetRolesAttributeType `json:"roles" required:"true"` } -// NewGetBackupResponse instantiates a new GetBackupResponse object +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _ListRolesResponse ListRolesResponse + +// NewListRolesResponse instantiates a new ListRolesResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewGetBackupResponse() *GetBackupResponse { - this := GetBackupResponse{} +func NewListRolesResponse(roles ListRolesResponseGetRolesArgType) *ListRolesResponse { + this := ListRolesResponse{} + setListRolesResponseGetRolesAttributeType(&this.Roles, roles) return &this } -// NewGetBackupResponseWithDefaults instantiates a new GetBackupResponse object +// NewListRolesResponseWithDefaults instantiates a new ListRolesResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewGetBackupResponseWithDefaults() *GetBackupResponse { - this := GetBackupResponse{} +func NewListRolesResponseWithDefaults() *ListRolesResponse { + this := ListRolesResponse{} return &this } -// GetItem returns the Item field value if set, zero value otherwise. +// GetRoles returns the Roles field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *GetBackupResponse) GetItem() (res GetBackupResponseGetItemRetType) { - res, _ = o.GetItemOk() - return +func (o *ListRolesResponse) GetRoles() (ret ListRolesResponseGetRolesRetType) { + ret, _ = o.GetRolesOk() + return ret } -// GetItemOk returns a tuple with the Item field value if set, nil otherwise +// GetRolesOk returns a tuple with the Roles field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *GetBackupResponse) GetItemOk() (ret GetBackupResponseGetItemRetType, ok bool) { - return getGetBackupResponseGetItemAttributeTypeOk(o.Item) -} - -// HasItem returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *GetBackupResponse) HasItem() bool { - _, ok := o.GetItemOk() - return ok +func (o *ListRolesResponse) GetRolesOk() (ret ListRolesResponseGetRolesRetType, ok bool) { + return getListRolesResponseGetRolesAttributeTypeOk(o.Roles) } -// SetItem gets a reference to the given Backup and assigns it to the Item field. +// SetRoles sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *GetBackupResponse) SetItem(v GetBackupResponseGetItemRetType) { - setGetBackupResponseGetItemAttributeType(&o.Item, v) +func (o *ListRolesResponse) SetRoles(v ListRolesResponseGetRolesRetType) { + setListRolesResponseGetRolesAttributeType(&o.Roles, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o GetBackupResponse) ToMap() (map[string]interface{}, error) { +func (o ListRolesResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getGetBackupResponseGetItemAttributeTypeOk(o.Item); ok { - toSerialize["Item"] = val + if val, ok := getListRolesResponseGetRolesAttributeTypeOk(o.Roles); ok { + toSerialize["Roles"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableGetBackupResponse struct { - value *GetBackupResponse +type NullableListRolesResponse struct { + value *ListRolesResponse isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableGetBackupResponse) Get() *GetBackupResponse { +func (v NullableListRolesResponse) Get() *ListRolesResponse { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableGetBackupResponse) Set(val *GetBackupResponse) { +func (v *NullableListRolesResponse) Set(val *ListRolesResponse) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableGetBackupResponse) IsSet() bool { +func (v NullableListRolesResponse) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableGetBackupResponse) Unset() { +func (v *NullableListRolesResponse) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableGetBackupResponse(val *GetBackupResponse) *NullableGetBackupResponse { - return &NullableGetBackupResponse{value: val, isSet: true} +func NewNullableListRolesResponse(val *ListRolesResponse) *NullableListRolesResponse { + return &NullableListRolesResponse{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableGetBackupResponse) MarshalJSON() ([]byte, error) { +func (v NullableListRolesResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableGetBackupResponse) UnmarshalJSON(src []byte) error { +func (v *NullableListRolesResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_list_roles_response_test.go b/services/postgresflex/model_list_roles_response_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_list_roles_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_list_storages_response.go b/services/postgresflex/model_list_storages_response.go deleted file mode 100644 index d1b0f5691..000000000 --- a/services/postgresflex/model_list_storages_response.go +++ /dev/null @@ -1,209 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package postgresflex - -import ( - "encoding/json" -) - -// checks if the ListStoragesResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListStoragesResponse{} - -/* - types and functions for storageClasses -*/ - -// isArray -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListStoragesResponseGetStorageClassesAttributeType = *[]string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListStoragesResponseGetStorageClassesArgType = []string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListStoragesResponseGetStorageClassesRetType = []string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getListStoragesResponseGetStorageClassesAttributeTypeOk(arg ListStoragesResponseGetStorageClassesAttributeType) (ret ListStoragesResponseGetStorageClassesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setListStoragesResponseGetStorageClassesAttributeType(arg *ListStoragesResponseGetStorageClassesAttributeType, val ListStoragesResponseGetStorageClassesRetType) { - *arg = &val -} - -/* - types and functions for storageRange -*/ - -// isModel -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListStoragesResponseGetStorageRangeAttributeType = *StorageRange - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListStoragesResponseGetStorageRangeArgType = StorageRange - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListStoragesResponseGetStorageRangeRetType = StorageRange - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getListStoragesResponseGetStorageRangeAttributeTypeOk(arg ListStoragesResponseGetStorageRangeAttributeType) (ret ListStoragesResponseGetStorageRangeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setListStoragesResponseGetStorageRangeAttributeType(arg *ListStoragesResponseGetStorageRangeAttributeType, val ListStoragesResponseGetStorageRangeRetType) { - *arg = &val -} - -// ListStoragesResponse struct for ListStoragesResponse -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListStoragesResponse struct { - StorageClasses ListStoragesResponseGetStorageClassesAttributeType `json:"storageClasses,omitempty"` - StorageRange ListStoragesResponseGetStorageRangeAttributeType `json:"storageRange,omitempty"` -} - -// NewListStoragesResponse instantiates a new ListStoragesResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewListStoragesResponse() *ListStoragesResponse { - this := ListStoragesResponse{} - return &this -} - -// NewListStoragesResponseWithDefaults instantiates a new ListStoragesResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewListStoragesResponseWithDefaults() *ListStoragesResponse { - this := ListStoragesResponse{} - return &this -} - -// GetStorageClasses returns the StorageClasses field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListStoragesResponse) GetStorageClasses() (res ListStoragesResponseGetStorageClassesRetType) { - res, _ = o.GetStorageClassesOk() - return -} - -// GetStorageClassesOk returns a tuple with the StorageClasses field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListStoragesResponse) GetStorageClassesOk() (ret ListStoragesResponseGetStorageClassesRetType, ok bool) { - return getListStoragesResponseGetStorageClassesAttributeTypeOk(o.StorageClasses) -} - -// HasStorageClasses returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListStoragesResponse) HasStorageClasses() bool { - _, ok := o.GetStorageClassesOk() - return ok -} - -// SetStorageClasses gets a reference to the given []string and assigns it to the StorageClasses field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListStoragesResponse) SetStorageClasses(v ListStoragesResponseGetStorageClassesRetType) { - setListStoragesResponseGetStorageClassesAttributeType(&o.StorageClasses, v) -} - -// GetStorageRange returns the StorageRange field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListStoragesResponse) GetStorageRange() (res ListStoragesResponseGetStorageRangeRetType) { - res, _ = o.GetStorageRangeOk() - return -} - -// GetStorageRangeOk returns a tuple with the StorageRange field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListStoragesResponse) GetStorageRangeOk() (ret ListStoragesResponseGetStorageRangeRetType, ok bool) { - return getListStoragesResponseGetStorageRangeAttributeTypeOk(o.StorageRange) -} - -// HasStorageRange returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListStoragesResponse) HasStorageRange() bool { - _, ok := o.GetStorageRangeOk() - return ok -} - -// SetStorageRange gets a reference to the given StorageRange and assigns it to the StorageRange field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListStoragesResponse) SetStorageRange(v ListStoragesResponseGetStorageRangeRetType) { - setListStoragesResponseGetStorageRangeAttributeType(&o.StorageRange, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o ListStoragesResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getListStoragesResponseGetStorageClassesAttributeTypeOk(o.StorageClasses); ok { - toSerialize["StorageClasses"] = val - } - if val, ok := getListStoragesResponseGetStorageRangeAttributeTypeOk(o.StorageRange); ok { - toSerialize["StorageRange"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableListStoragesResponse struct { - value *ListStoragesResponse - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableListStoragesResponse) Get() *ListStoragesResponse { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableListStoragesResponse) Set(val *ListStoragesResponse) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableListStoragesResponse) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableListStoragesResponse) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableListStoragesResponse(val *ListStoragesResponse) *NullableListStoragesResponse { - return &NullableListStoragesResponse{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableListStoragesResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableListStoragesResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/model_list_storages_response_test.go b/services/postgresflex/model_list_storages_response_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_list_storages_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_api_extension_list.go b/services/postgresflex/model_list_user.go similarity index 51% rename from services/postgresflex/model_api_extension_list.go rename to services/postgresflex/model_list_user.go index 0e6f4339f..a8f379007 100644 --- a/services/postgresflex/model_api_extension_list.go +++ b/services/postgresflex/model_list_user.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,25 +15,25 @@ import ( "encoding/json" ) -// checks if the ApiExtensionList type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ApiExtensionList{} +// checks if the ListUser type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListUser{} /* - types and functions for ID + types and functions for id */ // isLong // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionListGetIDAttributeType = *int64 +type ListUserGetIdAttributeType = *int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionListGetIDArgType = int64 +type ListUserGetIdArgType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionListGetIDRetType = int64 +type ListUserGetIdRetType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getApiExtensionListGetIDAttributeTypeOk(arg ApiExtensionListGetIDAttributeType) (ret ApiExtensionListGetIDRetType, ok bool) { +func getListUserGetIdAttributeTypeOk(arg ListUserGetIdAttributeType) (ret ListUserGetIdRetType, ok bool) { if arg == nil { return ret, false } @@ -41,20 +41,20 @@ func getApiExtensionListGetIDAttributeTypeOk(arg ApiExtensionListGetIDAttributeT } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setApiExtensionListGetIDAttributeType(arg *ApiExtensionListGetIDAttributeType, val ApiExtensionListGetIDRetType) { +func setListUserGetIdAttributeType(arg *ListUserGetIdAttributeType, val ListUserGetIdRetType) { *arg = &val } /* - types and functions for description + types and functions for name */ // isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionListGetDescriptionAttributeType = *string +type ListUserGetNameAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getApiExtensionListGetDescriptionAttributeTypeOk(arg ApiExtensionListGetDescriptionAttributeType) (ret ApiExtensionListGetDescriptionRetType, ok bool) { +func getListUserGetNameAttributeTypeOk(arg ListUserGetNameAttributeType) (ret ListUserGetNameRetType, ok bool) { if arg == nil { return ret, false } @@ -62,26 +62,26 @@ func getApiExtensionListGetDescriptionAttributeTypeOk(arg ApiExtensionListGetDes } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setApiExtensionListGetDescriptionAttributeType(arg *ApiExtensionListGetDescriptionAttributeType, val ApiExtensionListGetDescriptionRetType) { +func setListUserGetNameAttributeType(arg *ListUserGetNameAttributeType, val ListUserGetNameRetType) { *arg = &val } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionListGetDescriptionArgType = string +type ListUserGetNameArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionListGetDescriptionRetType = string +type ListUserGetNameRetType = string /* - types and functions for name + types and functions for state */ // isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionListGetNameAttributeType = *string +type ListUserGetStateAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getApiExtensionListGetNameAttributeTypeOk(arg ApiExtensionListGetNameAttributeType) (ret ApiExtensionListGetNameRetType, ok bool) { +func getListUserGetStateAttributeTypeOk(arg ListUserGetStateAttributeType) (ret ListUserGetStateRetType, ok bool) { if arg == nil { return ret, false } @@ -89,179 +89,170 @@ func getApiExtensionListGetNameAttributeTypeOk(arg ApiExtensionListGetNameAttrib } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setApiExtensionListGetNameAttributeType(arg *ApiExtensionListGetNameAttributeType, val ApiExtensionListGetNameRetType) { +func setListUserGetStateAttributeType(arg *ListUserGetStateAttributeType, val ListUserGetStateRetType) { *arg = &val } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionListGetNameArgType = string +type ListUserGetStateArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionListGetNameRetType = string +type ListUserGetStateRetType = string -// ApiExtensionList struct for ApiExtensionList +// ListUser struct for ListUser // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionList struct { - ID ApiExtensionListGetIDAttributeType `json:"ID,omitempty"` - Description ApiExtensionListGetDescriptionAttributeType `json:"description,omitempty"` - Name ApiExtensionListGetNameAttributeType `json:"name,omitempty"` +type ListUser struct { + // The ID of the user. + // REQUIRED + Id ListUserGetIdAttributeType `json:"id" required:"true"` + // The name of the user. + // REQUIRED + Name ListUserGetNameAttributeType `json:"name" required:"true"` + // The current state of the user. + // REQUIRED + State ListUserGetStateAttributeType `json:"state" required:"true"` } -// NewApiExtensionList instantiates a new ApiExtensionList object +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _ListUser ListUser + +// NewListUser instantiates a new ListUser object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewApiExtensionList() *ApiExtensionList { - this := ApiExtensionList{} +func NewListUser(id ListUserGetIdArgType, name ListUserGetNameArgType, state ListUserGetStateArgType) *ListUser { + this := ListUser{} + setListUserGetIdAttributeType(&this.Id, id) + setListUserGetNameAttributeType(&this.Name, name) + setListUserGetStateAttributeType(&this.State, state) return &this } -// NewApiExtensionListWithDefaults instantiates a new ApiExtensionList object +// NewListUserWithDefaults instantiates a new ListUser object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewApiExtensionListWithDefaults() *ApiExtensionList { - this := ApiExtensionList{} +func NewListUserWithDefaults() *ListUser { + this := ListUser{} return &this } -// GetID returns the ID field value if set, zero value otherwise. +// GetId returns the Id field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionList) GetID() (res ApiExtensionListGetIDRetType) { - res, _ = o.GetIDOk() - return +func (o *ListUser) GetId() (ret ListUserGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } -// GetIDOk returns a tuple with the ID field value if set, nil otherwise +// GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionList) GetIDOk() (ret ApiExtensionListGetIDRetType, ok bool) { - return getApiExtensionListGetIDAttributeTypeOk(o.ID) +func (o *ListUser) GetIdOk() (ret ListUserGetIdRetType, ok bool) { + return getListUserGetIdAttributeTypeOk(o.Id) } -// HasID returns a boolean if a field has been set. +// SetId sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionList) HasID() bool { - _, ok := o.GetIDOk() - return ok +func (o *ListUser) SetId(v ListUserGetIdRetType) { + setListUserGetIdAttributeType(&o.Id, v) } -// SetID gets a reference to the given int64 and assigns it to the ID field. +// GetName returns the Name field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionList) SetID(v ApiExtensionListGetIDRetType) { - setApiExtensionListGetIDAttributeType(&o.ID, v) +func (o *ListUser) GetName() (ret ListUserGetNameRetType) { + ret, _ = o.GetNameOk() + return ret } -// GetDescription returns the Description field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionList) GetDescription() (res ApiExtensionListGetDescriptionRetType) { - res, _ = o.GetDescriptionOk() - return -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionList) GetDescriptionOk() (ret ApiExtensionListGetDescriptionRetType, ok bool) { - return getApiExtensionListGetDescriptionAttributeTypeOk(o.Description) +func (o *ListUser) GetNameOk() (ret ListUserGetNameRetType, ok bool) { + return getListUserGetNameAttributeTypeOk(o.Name) } -// HasDescription returns a boolean if a field has been set. +// SetName sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionList) HasDescription() bool { - _, ok := o.GetDescriptionOk() - return ok +func (o *ListUser) SetName(v ListUserGetNameRetType) { + setListUserGetNameAttributeType(&o.Name, v) } -// SetDescription gets a reference to the given string and assigns it to the Description field. +// GetState returns the State field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionList) SetDescription(v ApiExtensionListGetDescriptionRetType) { - setApiExtensionListGetDescriptionAttributeType(&o.Description, v) +func (o *ListUser) GetState() (ret ListUserGetStateRetType) { + ret, _ = o.GetStateOk() + return ret } -// GetName returns the Name field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionList) GetName() (res ApiExtensionListGetNameRetType) { - res, _ = o.GetNameOk() - return -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionList) GetNameOk() (ret ApiExtensionListGetNameRetType, ok bool) { - return getApiExtensionListGetNameAttributeTypeOk(o.Name) +func (o *ListUser) GetStateOk() (ret ListUserGetStateRetType, ok bool) { + return getListUserGetStateAttributeTypeOk(o.State) } -// HasName returns a boolean if a field has been set. +// SetState sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionList) HasName() bool { - _, ok := o.GetNameOk() - return ok +func (o *ListUser) SetState(v ListUserGetStateRetType) { + setListUserGetStateAttributeType(&o.State, v) } -// SetName gets a reference to the given string and assigns it to the Name field. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionList) SetName(v ApiExtensionListGetNameRetType) { - setApiExtensionListGetNameAttributeType(&o.Name, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o ApiExtensionList) ToMap() (map[string]interface{}, error) { +func (o ListUser) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getApiExtensionListGetIDAttributeTypeOk(o.ID); ok { - toSerialize["ID"] = val - } - if val, ok := getApiExtensionListGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val + if val, ok := getListUserGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if val, ok := getApiExtensionListGetNameAttributeTypeOk(o.Name); ok { + if val, ok := getListUserGetNameAttributeTypeOk(o.Name); ok { toSerialize["Name"] = val } + if val, ok := getListUserGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val + } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableApiExtensionList struct { - value *ApiExtensionList +type NullableListUser struct { + value *ListUser isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiExtensionList) Get() *ApiExtensionList { +func (v NullableListUser) Get() *ListUser { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiExtensionList) Set(val *ApiExtensionList) { +func (v *NullableListUser) Set(val *ListUser) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiExtensionList) IsSet() bool { +func (v NullableListUser) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiExtensionList) Unset() { +func (v *NullableListUser) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableApiExtensionList(val *ApiExtensionList) *NullableApiExtensionList { - return &NullableApiExtensionList{value: val, isSet: true} +func NewNullableListUser(val *ListUser) *NullableListUser { + return &NullableListUser{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiExtensionList) MarshalJSON() ([]byte, error) { +func (v NullableListUser) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiExtensionList) UnmarshalJSON(src []byte) error { +func (v *NullableListUser) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_list_users_response.go b/services/postgresflex/model_list_user_response.go similarity index 52% rename from services/postgresflex/model_list_users_response.go rename to services/postgresflex/model_list_user_response.go index dcc5865d8..35f2689cb 100644 --- a/services/postgresflex/model_list_users_response.go +++ b/services/postgresflex/model_list_user_response.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,25 +15,25 @@ import ( "encoding/json" ) -// checks if the ListUsersResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListUsersResponse{} +// checks if the ListUserResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListUserResponse{} /* - types and functions for count + types and functions for pagination */ -// isLong +// isModel // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListUsersResponseGetCountAttributeType = *int64 +type ListUserResponseGetPaginationAttributeType = *Pagination // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListUsersResponseGetCountArgType = int64 +type ListUserResponseGetPaginationArgType = Pagination // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListUsersResponseGetCountRetType = int64 +type ListUserResponseGetPaginationRetType = Pagination // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getListUsersResponseGetCountAttributeTypeOk(arg ListUsersResponseGetCountAttributeType) (ret ListUsersResponseGetCountRetType, ok bool) { +func getListUserResponseGetPaginationAttributeTypeOk(arg ListUserResponseGetPaginationAttributeType) (ret ListUserResponseGetPaginationRetType, ok bool) { if arg == nil { return ret, false } @@ -41,26 +41,26 @@ func getListUsersResponseGetCountAttributeTypeOk(arg ListUsersResponseGetCountAt } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setListUsersResponseGetCountAttributeType(arg *ListUsersResponseGetCountAttributeType, val ListUsersResponseGetCountRetType) { +func setListUserResponseGetPaginationAttributeType(arg *ListUserResponseGetPaginationAttributeType, val ListUserResponseGetPaginationRetType) { *arg = &val } /* - types and functions for items + types and functions for users */ // isArray // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListUsersResponseGetItemsAttributeType = *[]ListUsersResponseItem +type ListUserResponseGetUsersAttributeType = *[]ListUser // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListUsersResponseGetItemsArgType = []ListUsersResponseItem +type ListUserResponseGetUsersArgType = []ListUser // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListUsersResponseGetItemsRetType = []ListUsersResponseItem +type ListUserResponseGetUsersRetType = []ListUser // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getListUsersResponseGetItemsAttributeTypeOk(arg ListUsersResponseGetItemsAttributeType) (ret ListUsersResponseGetItemsRetType, ok bool) { +func getListUserResponseGetUsersAttributeTypeOk(arg ListUserResponseGetUsersAttributeType) (ret ListUserResponseGetUsersRetType, ok bool) { if arg == nil { return ret, false } @@ -68,142 +68,136 @@ func getListUsersResponseGetItemsAttributeTypeOk(arg ListUsersResponseGetItemsAt } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setListUsersResponseGetItemsAttributeType(arg *ListUsersResponseGetItemsAttributeType, val ListUsersResponseGetItemsRetType) { +func setListUserResponseGetUsersAttributeType(arg *ListUserResponseGetUsersAttributeType, val ListUserResponseGetUsersRetType) { *arg = &val } -// ListUsersResponse struct for ListUsersResponse +// ListUserResponse struct for ListUserResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListUsersResponse struct { - Count ListUsersResponseGetCountAttributeType `json:"count,omitempty"` - Items ListUsersResponseGetItemsAttributeType `json:"items,omitempty"` +type ListUserResponse struct { + // REQUIRED + Pagination ListUserResponseGetPaginationAttributeType `json:"pagination" required:"true"` + // List of all users inside an instance + // REQUIRED + Users ListUserResponseGetUsersAttributeType `json:"users" required:"true"` } -// NewListUsersResponse instantiates a new ListUsersResponse object +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _ListUserResponse ListUserResponse + +// NewListUserResponse instantiates a new ListUserResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewListUsersResponse() *ListUsersResponse { - this := ListUsersResponse{} +func NewListUserResponse(pagination ListUserResponseGetPaginationArgType, users ListUserResponseGetUsersArgType) *ListUserResponse { + this := ListUserResponse{} + setListUserResponseGetPaginationAttributeType(&this.Pagination, pagination) + setListUserResponseGetUsersAttributeType(&this.Users, users) return &this } -// NewListUsersResponseWithDefaults instantiates a new ListUsersResponse object +// NewListUserResponseWithDefaults instantiates a new ListUserResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewListUsersResponseWithDefaults() *ListUsersResponse { - this := ListUsersResponse{} +func NewListUserResponseWithDefaults() *ListUserResponse { + this := ListUserResponse{} return &this } -// GetCount returns the Count field value if set, zero value otherwise. +// GetPagination returns the Pagination field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListUsersResponse) GetCount() (res ListUsersResponseGetCountRetType) { - res, _ = o.GetCountOk() - return +func (o *ListUserResponse) GetPagination() (ret ListUserResponseGetPaginationRetType) { + ret, _ = o.GetPaginationOk() + return ret } -// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// GetPaginationOk returns a tuple with the Pagination field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListUsersResponse) GetCountOk() (ret ListUsersResponseGetCountRetType, ok bool) { - return getListUsersResponseGetCountAttributeTypeOk(o.Count) -} - -// HasCount returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListUsersResponse) HasCount() bool { - _, ok := o.GetCountOk() - return ok +func (o *ListUserResponse) GetPaginationOk() (ret ListUserResponseGetPaginationRetType, ok bool) { + return getListUserResponseGetPaginationAttributeTypeOk(o.Pagination) } -// SetCount gets a reference to the given int64 and assigns it to the Count field. +// SetPagination sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListUsersResponse) SetCount(v ListUsersResponseGetCountRetType) { - setListUsersResponseGetCountAttributeType(&o.Count, v) +func (o *ListUserResponse) SetPagination(v ListUserResponseGetPaginationRetType) { + setListUserResponseGetPaginationAttributeType(&o.Pagination, v) } -// GetItems returns the Items field value if set, zero value otherwise. +// GetUsers returns the Users field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListUsersResponse) GetItems() (res ListUsersResponseGetItemsRetType) { - res, _ = o.GetItemsOk() - return +func (o *ListUserResponse) GetUsers() (ret ListUserResponseGetUsersRetType) { + ret, _ = o.GetUsersOk() + return ret } -// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// GetUsersOk returns a tuple with the Users field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListUsersResponse) GetItemsOk() (ret ListUsersResponseGetItemsRetType, ok bool) { - return getListUsersResponseGetItemsAttributeTypeOk(o.Items) -} - -// HasItems returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListUsersResponse) HasItems() bool { - _, ok := o.GetItemsOk() - return ok +func (o *ListUserResponse) GetUsersOk() (ret ListUserResponseGetUsersRetType, ok bool) { + return getListUserResponseGetUsersAttributeTypeOk(o.Users) } -// SetItems gets a reference to the given []ListUsersResponseItem and assigns it to the Items field. +// SetUsers sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListUsersResponse) SetItems(v ListUsersResponseGetItemsRetType) { - setListUsersResponseGetItemsAttributeType(&o.Items, v) +func (o *ListUserResponse) SetUsers(v ListUserResponseGetUsersRetType) { + setListUserResponseGetUsersAttributeType(&o.Users, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o ListUsersResponse) ToMap() (map[string]interface{}, error) { +func (o ListUserResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getListUsersResponseGetCountAttributeTypeOk(o.Count); ok { - toSerialize["Count"] = val + if val, ok := getListUserResponseGetPaginationAttributeTypeOk(o.Pagination); ok { + toSerialize["Pagination"] = val } - if val, ok := getListUsersResponseGetItemsAttributeTypeOk(o.Items); ok { - toSerialize["Items"] = val + if val, ok := getListUserResponseGetUsersAttributeTypeOk(o.Users); ok { + toSerialize["Users"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableListUsersResponse struct { - value *ListUsersResponse +type NullableListUserResponse struct { + value *ListUserResponse isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableListUsersResponse) Get() *ListUsersResponse { +func (v NullableListUserResponse) Get() *ListUserResponse { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableListUsersResponse) Set(val *ListUsersResponse) { +func (v *NullableListUserResponse) Set(val *ListUserResponse) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableListUsersResponse) IsSet() bool { +func (v NullableListUserResponse) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableListUsersResponse) Unset() { +func (v *NullableListUserResponse) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableListUsersResponse(val *ListUsersResponse) *NullableListUsersResponse { - return &NullableListUsersResponse{value: val, isSet: true} +func NewNullableListUserResponse(val *ListUserResponse) *NullableListUserResponse { + return &NullableListUserResponse{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableListUsersResponse) MarshalJSON() ([]byte, error) { +func (v NullableListUserResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableListUsersResponse) UnmarshalJSON(src []byte) error { +func (v *NullableListUserResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_list_user_response_test.go b/services/postgresflex/model_list_user_response_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_list_user_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_list_user_test.go b/services/postgresflex/model_list_user_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_list_user_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_list_users_response_item_test.go b/services/postgresflex/model_list_users_response_item_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_list_users_response_item_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_list_users_response_test.go b/services/postgresflex/model_list_users_response_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_list_users_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_list_versions_response.go b/services/postgresflex/model_list_version_response.go similarity index 56% rename from services/postgresflex/model_list_versions_response.go rename to services/postgresflex/model_list_version_response.go index f8e741aeb..52dd4c607 100644 --- a/services/postgresflex/model_list_versions_response.go +++ b/services/postgresflex/model_list_version_response.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,8 +15,8 @@ import ( "encoding/json" ) -// checks if the ListVersionsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListVersionsResponse{} +// checks if the ListVersionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListVersionResponse{} /* types and functions for versions @@ -24,16 +24,16 @@ var _ MappedNullable = &ListVersionsResponse{} // isArray // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListVersionsResponseGetVersionsAttributeType = *[]string +type ListVersionResponseGetVersionsAttributeType = *[]Version // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListVersionsResponseGetVersionsArgType = []string +type ListVersionResponseGetVersionsArgType = []Version // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListVersionsResponseGetVersionsRetType = []string +type ListVersionResponseGetVersionsRetType = []Version // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getListVersionsResponseGetVersionsAttributeTypeOk(arg ListVersionsResponseGetVersionsAttributeType) (ret ListVersionsResponseGetVersionsRetType, ok bool) { +func getListVersionResponseGetVersionsAttributeTypeOk(arg ListVersionResponseGetVersionsAttributeType) (ret ListVersionResponseGetVersionsRetType, ok bool) { if arg == nil { return ret, false } @@ -41,111 +41,110 @@ func getListVersionsResponseGetVersionsAttributeTypeOk(arg ListVersionsResponseG } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setListVersionsResponseGetVersionsAttributeType(arg *ListVersionsResponseGetVersionsAttributeType, val ListVersionsResponseGetVersionsRetType) { +func setListVersionResponseGetVersionsAttributeType(arg *ListVersionResponseGetVersionsAttributeType, val ListVersionResponseGetVersionsRetType) { *arg = &val } -// ListVersionsResponse struct for ListVersionsResponse +// ListVersionResponse struct for ListVersionResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListVersionsResponse struct { - Versions ListVersionsResponseGetVersionsAttributeType `json:"versions,omitempty"` +type ListVersionResponse struct { + // A list containing available postgres versions. + // REQUIRED + Versions ListVersionResponseGetVersionsAttributeType `json:"versions" required:"true"` } -// NewListVersionsResponse instantiates a new ListVersionsResponse object +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _ListVersionResponse ListVersionResponse + +// NewListVersionResponse instantiates a new ListVersionResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewListVersionsResponse() *ListVersionsResponse { - this := ListVersionsResponse{} +func NewListVersionResponse(versions ListVersionResponseGetVersionsArgType) *ListVersionResponse { + this := ListVersionResponse{} + setListVersionResponseGetVersionsAttributeType(&this.Versions, versions) return &this } -// NewListVersionsResponseWithDefaults instantiates a new ListVersionsResponse object +// NewListVersionResponseWithDefaults instantiates a new ListVersionResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewListVersionsResponseWithDefaults() *ListVersionsResponse { - this := ListVersionsResponse{} +func NewListVersionResponseWithDefaults() *ListVersionResponse { + this := ListVersionResponse{} return &this } -// GetVersions returns the Versions field value if set, zero value otherwise. +// GetVersions returns the Versions field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListVersionsResponse) GetVersions() (res ListVersionsResponseGetVersionsRetType) { - res, _ = o.GetVersionsOk() - return +func (o *ListVersionResponse) GetVersions() (ret ListVersionResponseGetVersionsRetType) { + ret, _ = o.GetVersionsOk() + return ret } -// GetVersionsOk returns a tuple with the Versions field value if set, nil otherwise +// GetVersionsOk returns a tuple with the Versions field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListVersionsResponse) GetVersionsOk() (ret ListVersionsResponseGetVersionsRetType, ok bool) { - return getListVersionsResponseGetVersionsAttributeTypeOk(o.Versions) -} - -// HasVersions returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListVersionsResponse) HasVersions() bool { - _, ok := o.GetVersionsOk() - return ok +func (o *ListVersionResponse) GetVersionsOk() (ret ListVersionResponseGetVersionsRetType, ok bool) { + return getListVersionResponseGetVersionsAttributeTypeOk(o.Versions) } -// SetVersions gets a reference to the given []string and assigns it to the Versions field. +// SetVersions sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ListVersionsResponse) SetVersions(v ListVersionsResponseGetVersionsRetType) { - setListVersionsResponseGetVersionsAttributeType(&o.Versions, v) +func (o *ListVersionResponse) SetVersions(v ListVersionResponseGetVersionsRetType) { + setListVersionResponseGetVersionsAttributeType(&o.Versions, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o ListVersionsResponse) ToMap() (map[string]interface{}, error) { +func (o ListVersionResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getListVersionsResponseGetVersionsAttributeTypeOk(o.Versions); ok { + if val, ok := getListVersionResponseGetVersionsAttributeTypeOk(o.Versions); ok { toSerialize["Versions"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableListVersionsResponse struct { - value *ListVersionsResponse +type NullableListVersionResponse struct { + value *ListVersionResponse isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableListVersionsResponse) Get() *ListVersionsResponse { +func (v NullableListVersionResponse) Get() *ListVersionResponse { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableListVersionsResponse) Set(val *ListVersionsResponse) { +func (v *NullableListVersionResponse) Set(val *ListVersionResponse) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableListVersionsResponse) IsSet() bool { +func (v NullableListVersionResponse) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableListVersionsResponse) Unset() { +func (v *NullableListVersionResponse) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableListVersionsResponse(val *ListVersionsResponse) *NullableListVersionsResponse { - return &NullableListVersionsResponse{value: val, isSet: true} +func NewNullableListVersionResponse(val *ListVersionResponse) *NullableListVersionResponse { + return &NullableListVersionResponse{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableListVersionsResponse) MarshalJSON() ([]byte, error) { +func (v NullableListVersionResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableListVersionsResponse) UnmarshalJSON(src []byte) error { +func (v *NullableListVersionResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_list_version_response_test.go b/services/postgresflex/model_list_version_response_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_list_version_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_list_versions_response_test.go b/services/postgresflex/model_list_versions_response_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_list_versions_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_user_response.go b/services/postgresflex/model_pagination.go similarity index 50% rename from services/postgresflex/model_user_response.go rename to services/postgresflex/model_pagination.go index 460a6ddaa..827f4aa83 100644 --- a/services/postgresflex/model_user_response.go +++ b/services/postgresflex/model_pagination.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,19 +15,25 @@ import ( "encoding/json" ) -// checks if the UserResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UserResponse{} +// checks if the Pagination type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Pagination{} /* - types and functions for host + types and functions for page */ -// isNotNullableString +// isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PaginationGetPageAttributeType = *int64 + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserResponseGetHostAttributeType = *string +type PaginationGetPageArgType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUserResponseGetHostAttributeTypeOk(arg UserResponseGetHostAttributeType) (ret UserResponseGetHostRetType, ok bool) { +type PaginationGetPageRetType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getPaginationGetPageAttributeTypeOk(arg PaginationGetPageAttributeType) (ret PaginationGetPageRetType, ok bool) { if arg == nil { return ret, false } @@ -35,26 +41,26 @@ func getUserResponseGetHostAttributeTypeOk(arg UserResponseGetHostAttributeType) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setUserResponseGetHostAttributeType(arg *UserResponseGetHostAttributeType, val UserResponseGetHostRetType) { +func setPaginationGetPageAttributeType(arg *PaginationGetPageAttributeType, val PaginationGetPageRetType) { *arg = &val } -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserResponseGetHostArgType = string +/* + types and functions for size +*/ +// isLong // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserResponseGetHostRetType = string +type PaginationGetSizeAttributeType = *int64 -/* - types and functions for id -*/ +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PaginationGetSizeArgType = int64 -// isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserResponseGetIdAttributeType = *string +type PaginationGetSizeRetType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUserResponseGetIdAttributeTypeOk(arg UserResponseGetIdAttributeType) (ret UserResponseGetIdRetType, ok bool) { +func getPaginationGetSizeAttributeTypeOk(arg PaginationGetSizeAttributeType) (ret PaginationGetSizeRetType, ok bool) { if arg == nil { return ret, false } @@ -62,32 +68,20 @@ func getUserResponseGetIdAttributeTypeOk(arg UserResponseGetIdAttributeType) (re } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setUserResponseGetIdAttributeType(arg *UserResponseGetIdAttributeType, val UserResponseGetIdRetType) { +func setPaginationGetSizeAttributeType(arg *PaginationGetSizeAttributeType, val PaginationGetSizeRetType) { *arg = &val } -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserResponseGetIdArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserResponseGetIdRetType = string - /* - types and functions for port + types and functions for sort */ -// isLong -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserResponseGetPortAttributeType = *int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserResponseGetPortArgType = int64 - +// isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserResponseGetPortRetType = int64 +type PaginationGetSortAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUserResponseGetPortAttributeTypeOk(arg UserResponseGetPortAttributeType) (ret UserResponseGetPortRetType, ok bool) { +func getPaginationGetSortAttributeTypeOk(arg PaginationGetSortAttributeType) (ret PaginationGetSortRetType, ok bool) { if arg == nil { return ret, false } @@ -95,26 +89,32 @@ func getUserResponseGetPortAttributeTypeOk(arg UserResponseGetPortAttributeType) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setUserResponseGetPortAttributeType(arg *UserResponseGetPortAttributeType, val UserResponseGetPortRetType) { +func setPaginationGetSortAttributeType(arg *PaginationGetSortAttributeType, val PaginationGetSortRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PaginationGetSortArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PaginationGetSortRetType = string + /* - types and functions for roles + types and functions for totalPages */ -// isArray +// isLong // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserResponseGetRolesAttributeType = *[]string +type PaginationGetTotalPagesAttributeType = *int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserResponseGetRolesArgType = []string +type PaginationGetTotalPagesArgType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserResponseGetRolesRetType = []string +type PaginationGetTotalPagesRetType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUserResponseGetRolesAttributeTypeOk(arg UserResponseGetRolesAttributeType) (ret UserResponseGetRolesRetType, ok bool) { +func getPaginationGetTotalPagesAttributeTypeOk(arg PaginationGetTotalPagesAttributeType) (ret PaginationGetTotalPagesRetType, ok bool) { if arg == nil { return ret, false } @@ -122,20 +122,26 @@ func getUserResponseGetRolesAttributeTypeOk(arg UserResponseGetRolesAttributeTyp } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setUserResponseGetRolesAttributeType(arg *UserResponseGetRolesAttributeType, val UserResponseGetRolesRetType) { +func setPaginationGetTotalPagesAttributeType(arg *PaginationGetTotalPagesAttributeType, val PaginationGetTotalPagesRetType) { *arg = &val } /* - types and functions for username + types and functions for totalRows */ -// isNotNullableString +// isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PaginationGetTotalRowsAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PaginationGetTotalRowsArgType = int64 + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserResponseGetUsernameAttributeType = *string +type PaginationGetTotalRowsRetType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUserResponseGetUsernameAttributeTypeOk(arg UserResponseGetUsernameAttributeType) (ret UserResponseGetUsernameRetType, ok bool) { +func getPaginationGetTotalRowsAttributeTypeOk(arg PaginationGetTotalRowsAttributeType) (ret PaginationGetTotalRowsRetType, ok bool) { if arg == nil { return ret, false } @@ -143,241 +149,213 @@ func getUserResponseGetUsernameAttributeTypeOk(arg UserResponseGetUsernameAttrib } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setUserResponseGetUsernameAttributeType(arg *UserResponseGetUsernameAttributeType, val UserResponseGetUsernameRetType) { +func setPaginationGetTotalRowsAttributeType(arg *PaginationGetTotalRowsAttributeType, val PaginationGetTotalRowsRetType) { *arg = &val } +// Pagination struct for Pagination // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserResponseGetUsernameArgType = string +type Pagination struct { + // REQUIRED + Page PaginationGetPageAttributeType `json:"page" required:"true"` + // REQUIRED + Size PaginationGetSizeAttributeType `json:"size" required:"true"` + // REQUIRED + Sort PaginationGetSortAttributeType `json:"sort" required:"true"` + // REQUIRED + TotalPages PaginationGetTotalPagesAttributeType `json:"totalPages" required:"true"` + // REQUIRED + TotalRows PaginationGetTotalRowsAttributeType `json:"totalRows" required:"true"` +} // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserResponseGetUsernameRetType = string +type _Pagination Pagination -// UserResponse struct for UserResponse -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserResponse struct { - Host UserResponseGetHostAttributeType `json:"host,omitempty"` - Id UserResponseGetIdAttributeType `json:"id,omitempty"` - Port UserResponseGetPortAttributeType `json:"port,omitempty"` - Roles UserResponseGetRolesAttributeType `json:"roles,omitempty"` - Username UserResponseGetUsernameAttributeType `json:"username,omitempty"` -} - -// NewUserResponse instantiates a new UserResponse object +// NewPagination instantiates a new Pagination object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewUserResponse() *UserResponse { - this := UserResponse{} +func NewPagination(page PaginationGetPageArgType, size PaginationGetSizeArgType, sort PaginationGetSortArgType, totalPages PaginationGetTotalPagesArgType, totalRows PaginationGetTotalRowsArgType) *Pagination { + this := Pagination{} + setPaginationGetPageAttributeType(&this.Page, page) + setPaginationGetSizeAttributeType(&this.Size, size) + setPaginationGetSortAttributeType(&this.Sort, sort) + setPaginationGetTotalPagesAttributeType(&this.TotalPages, totalPages) + setPaginationGetTotalRowsAttributeType(&this.TotalRows, totalRows) return &this } -// NewUserResponseWithDefaults instantiates a new UserResponse object +// NewPaginationWithDefaults instantiates a new Pagination object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewUserResponseWithDefaults() *UserResponse { - this := UserResponse{} +func NewPaginationWithDefaults() *Pagination { + this := Pagination{} return &this } -// GetHost returns the Host field value if set, zero value otherwise. +// GetPage returns the Page field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UserResponse) GetHost() (res UserResponseGetHostRetType) { - res, _ = o.GetHostOk() - return +func (o *Pagination) GetPage() (ret PaginationGetPageRetType) { + ret, _ = o.GetPageOk() + return ret } -// GetHostOk returns a tuple with the Host field value if set, nil otherwise +// GetPageOk returns a tuple with the Page field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UserResponse) GetHostOk() (ret UserResponseGetHostRetType, ok bool) { - return getUserResponseGetHostAttributeTypeOk(o.Host) +func (o *Pagination) GetPageOk() (ret PaginationGetPageRetType, ok bool) { + return getPaginationGetPageAttributeTypeOk(o.Page) } -// HasHost returns a boolean if a field has been set. +// SetPage sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UserResponse) HasHost() bool { - _, ok := o.GetHostOk() - return ok +func (o *Pagination) SetPage(v PaginationGetPageRetType) { + setPaginationGetPageAttributeType(&o.Page, v) } -// SetHost gets a reference to the given string and assigns it to the Host field. +// GetSize returns the Size field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UserResponse) SetHost(v UserResponseGetHostRetType) { - setUserResponseGetHostAttributeType(&o.Host, v) +func (o *Pagination) GetSize() (ret PaginationGetSizeRetType) { + ret, _ = o.GetSizeOk() + return ret } -// GetId returns the Id field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UserResponse) GetId() (res UserResponseGetIdRetType) { - res, _ = o.GetIdOk() - return -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// GetSizeOk returns a tuple with the Size field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UserResponse) GetIdOk() (ret UserResponseGetIdRetType, ok bool) { - return getUserResponseGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UserResponse) HasId() bool { - _, ok := o.GetIdOk() - return ok +func (o *Pagination) GetSizeOk() (ret PaginationGetSizeRetType, ok bool) { + return getPaginationGetSizeAttributeTypeOk(o.Size) } -// SetId gets a reference to the given string and assigns it to the Id field. +// SetSize sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UserResponse) SetId(v UserResponseGetIdRetType) { - setUserResponseGetIdAttributeType(&o.Id, v) +func (o *Pagination) SetSize(v PaginationGetSizeRetType) { + setPaginationGetSizeAttributeType(&o.Size, v) } -// GetPort returns the Port field value if set, zero value otherwise. +// GetSort returns the Sort field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UserResponse) GetPort() (res UserResponseGetPortRetType) { - res, _ = o.GetPortOk() - return +func (o *Pagination) GetSort() (ret PaginationGetSortRetType) { + ret, _ = o.GetSortOk() + return ret } -// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// GetSortOk returns a tuple with the Sort field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UserResponse) GetPortOk() (ret UserResponseGetPortRetType, ok bool) { - return getUserResponseGetPortAttributeTypeOk(o.Port) -} - -// HasPort returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UserResponse) HasPort() bool { - _, ok := o.GetPortOk() - return ok +func (o *Pagination) GetSortOk() (ret PaginationGetSortRetType, ok bool) { + return getPaginationGetSortAttributeTypeOk(o.Sort) } -// SetPort gets a reference to the given int64 and assigns it to the Port field. +// SetSort sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UserResponse) SetPort(v UserResponseGetPortRetType) { - setUserResponseGetPortAttributeType(&o.Port, v) +func (o *Pagination) SetSort(v PaginationGetSortRetType) { + setPaginationGetSortAttributeType(&o.Sort, v) } -// GetRoles returns the Roles field value if set, zero value otherwise. +// GetTotalPages returns the TotalPages field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UserResponse) GetRoles() (res UserResponseGetRolesRetType) { - res, _ = o.GetRolesOk() - return +func (o *Pagination) GetTotalPages() (ret PaginationGetTotalPagesRetType) { + ret, _ = o.GetTotalPagesOk() + return ret } -// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// GetTotalPagesOk returns a tuple with the TotalPages field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UserResponse) GetRolesOk() (ret UserResponseGetRolesRetType, ok bool) { - return getUserResponseGetRolesAttributeTypeOk(o.Roles) +func (o *Pagination) GetTotalPagesOk() (ret PaginationGetTotalPagesRetType, ok bool) { + return getPaginationGetTotalPagesAttributeTypeOk(o.TotalPages) } -// HasRoles returns a boolean if a field has been set. +// SetTotalPages sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UserResponse) HasRoles() bool { - _, ok := o.GetRolesOk() - return ok +func (o *Pagination) SetTotalPages(v PaginationGetTotalPagesRetType) { + setPaginationGetTotalPagesAttributeType(&o.TotalPages, v) } -// SetRoles gets a reference to the given []string and assigns it to the Roles field. +// GetTotalRows returns the TotalRows field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UserResponse) SetRoles(v UserResponseGetRolesRetType) { - setUserResponseGetRolesAttributeType(&o.Roles, v) +func (o *Pagination) GetTotalRows() (ret PaginationGetTotalRowsRetType) { + ret, _ = o.GetTotalRowsOk() + return ret } -// GetUsername returns the Username field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UserResponse) GetUsername() (res UserResponseGetUsernameRetType) { - res, _ = o.GetUsernameOk() - return -} - -// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// GetTotalRowsOk returns a tuple with the TotalRows field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UserResponse) GetUsernameOk() (ret UserResponseGetUsernameRetType, ok bool) { - return getUserResponseGetUsernameAttributeTypeOk(o.Username) -} - -// HasUsername returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UserResponse) HasUsername() bool { - _, ok := o.GetUsernameOk() - return ok +func (o *Pagination) GetTotalRowsOk() (ret PaginationGetTotalRowsRetType, ok bool) { + return getPaginationGetTotalRowsAttributeTypeOk(o.TotalRows) } -// SetUsername gets a reference to the given string and assigns it to the Username field. +// SetTotalRows sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UserResponse) SetUsername(v UserResponseGetUsernameRetType) { - setUserResponseGetUsernameAttributeType(&o.Username, v) +func (o *Pagination) SetTotalRows(v PaginationGetTotalRowsRetType) { + setPaginationGetTotalRowsAttributeType(&o.TotalRows, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o UserResponse) ToMap() (map[string]interface{}, error) { +func (o Pagination) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getUserResponseGetHostAttributeTypeOk(o.Host); ok { - toSerialize["Host"] = val + if val, ok := getPaginationGetPageAttributeTypeOk(o.Page); ok { + toSerialize["Page"] = val } - if val, ok := getUserResponseGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val + if val, ok := getPaginationGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val } - if val, ok := getUserResponseGetPortAttributeTypeOk(o.Port); ok { - toSerialize["Port"] = val + if val, ok := getPaginationGetSortAttributeTypeOk(o.Sort); ok { + toSerialize["Sort"] = val } - if val, ok := getUserResponseGetRolesAttributeTypeOk(o.Roles); ok { - toSerialize["Roles"] = val + if val, ok := getPaginationGetTotalPagesAttributeTypeOk(o.TotalPages); ok { + toSerialize["TotalPages"] = val } - if val, ok := getUserResponseGetUsernameAttributeTypeOk(o.Username); ok { - toSerialize["Username"] = val + if val, ok := getPaginationGetTotalRowsAttributeTypeOk(o.TotalRows); ok { + toSerialize["TotalRows"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableUserResponse struct { - value *UserResponse +type NullablePagination struct { + value *Pagination isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableUserResponse) Get() *UserResponse { +func (v NullablePagination) Get() *Pagination { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableUserResponse) Set(val *UserResponse) { +func (v *NullablePagination) Set(val *Pagination) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableUserResponse) IsSet() bool { +func (v NullablePagination) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableUserResponse) Unset() { +func (v *NullablePagination) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableUserResponse(val *UserResponse) *NullableUserResponse { - return &NullableUserResponse{value: val, isSet: true} +func NewNullablePagination(val *Pagination) *NullablePagination { + return &NullablePagination{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableUserResponse) MarshalJSON() ([]byte, error) { +func (v NullablePagination) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableUserResponse) UnmarshalJSON(src []byte) error { +func (v *NullablePagination) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_pagination_test.go b/services/postgresflex/model_pagination_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_pagination_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_extensions_configuration.go b/services/postgresflex/model_partial_update_database_payload.go similarity index 54% rename from services/postgresflex/model_extensions_configuration.go rename to services/postgresflex/model_partial_update_database_payload.go index 46789fceb..cc800d1bf 100644 --- a/services/postgresflex/model_extensions_configuration.go +++ b/services/postgresflex/model_partial_update_database_payload.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,8 +15,8 @@ import ( "encoding/json" ) -// checks if the ExtensionsConfiguration type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ExtensionsConfiguration{} +// checks if the PartialUpdateDatabasePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateDatabasePayload{} /* types and functions for name @@ -24,10 +24,10 @@ var _ MappedNullable = &ExtensionsConfiguration{} // isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ExtensionsConfigurationGetNameAttributeType = *string +type PartialUpdateDatabasePayloadGetNameAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getExtensionsConfigurationGetNameAttributeTypeOk(arg ExtensionsConfigurationGetNameAttributeType) (ret ExtensionsConfigurationGetNameRetType, ok bool) { +func getPartialUpdateDatabasePayloadGetNameAttributeTypeOk(arg PartialUpdateDatabasePayloadGetNameAttributeType) (ret PartialUpdateDatabasePayloadGetNameRetType, ok bool) { if arg == nil { return ret, false } @@ -35,26 +35,26 @@ func getExtensionsConfigurationGetNameAttributeTypeOk(arg ExtensionsConfiguratio } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setExtensionsConfigurationGetNameAttributeType(arg *ExtensionsConfigurationGetNameAttributeType, val ExtensionsConfigurationGetNameRetType) { +func setPartialUpdateDatabasePayloadGetNameAttributeType(arg *PartialUpdateDatabasePayloadGetNameAttributeType, val PartialUpdateDatabasePayloadGetNameRetType) { *arg = &val } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ExtensionsConfigurationGetNameArgType = string +type PartialUpdateDatabasePayloadGetNameArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ExtensionsConfigurationGetNameRetType = string +type PartialUpdateDatabasePayloadGetNameRetType = string /* - types and functions for setting + types and functions for owner */ // isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ExtensionsConfigurationGetSettingAttributeType = *string +type PartialUpdateDatabasePayloadGetOwnerAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getExtensionsConfigurationGetSettingAttributeTypeOk(arg ExtensionsConfigurationGetSettingAttributeType) (ret ExtensionsConfigurationGetSettingRetType, ok bool) { +func getPartialUpdateDatabasePayloadGetOwnerAttributeTypeOk(arg PartialUpdateDatabasePayloadGetOwnerAttributeType) (ret PartialUpdateDatabasePayloadGetOwnerRetType, ok bool) { if arg == nil { return ret, false } @@ -62,45 +62,47 @@ func getExtensionsConfigurationGetSettingAttributeTypeOk(arg ExtensionsConfigura } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setExtensionsConfigurationGetSettingAttributeType(arg *ExtensionsConfigurationGetSettingAttributeType, val ExtensionsConfigurationGetSettingRetType) { +func setPartialUpdateDatabasePayloadGetOwnerAttributeType(arg *PartialUpdateDatabasePayloadGetOwnerAttributeType, val PartialUpdateDatabasePayloadGetOwnerRetType) { *arg = &val } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ExtensionsConfigurationGetSettingArgType = string +type PartialUpdateDatabasePayloadGetOwnerArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ExtensionsConfigurationGetSettingRetType = string +type PartialUpdateDatabasePayloadGetOwnerRetType = string -// ExtensionsConfiguration struct for ExtensionsConfiguration +// PartialUpdateDatabasePayload struct for PartialUpdateDatabasePayload // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ExtensionsConfiguration struct { - Name ExtensionsConfigurationGetNameAttributeType `json:"name,omitempty"` - Setting ExtensionsConfigurationGetSettingAttributeType `json:"setting,omitempty"` +type PartialUpdateDatabasePayload struct { + // The name of the database. + Name PartialUpdateDatabasePayloadGetNameAttributeType `json:"name,omitempty"` + // The owner of the database. + Owner PartialUpdateDatabasePayloadGetOwnerAttributeType `json:"owner,omitempty"` } -// NewExtensionsConfiguration instantiates a new ExtensionsConfiguration object +// NewPartialUpdateDatabasePayload instantiates a new PartialUpdateDatabasePayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewExtensionsConfiguration() *ExtensionsConfiguration { - this := ExtensionsConfiguration{} +func NewPartialUpdateDatabasePayload() *PartialUpdateDatabasePayload { + this := PartialUpdateDatabasePayload{} return &this } -// NewExtensionsConfigurationWithDefaults instantiates a new ExtensionsConfiguration object +// NewPartialUpdateDatabasePayloadWithDefaults instantiates a new PartialUpdateDatabasePayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewExtensionsConfigurationWithDefaults() *ExtensionsConfiguration { - this := ExtensionsConfiguration{} +func NewPartialUpdateDatabasePayloadWithDefaults() *PartialUpdateDatabasePayload { + this := PartialUpdateDatabasePayload{} return &this } // GetName returns the Name field value if set, zero value otherwise. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ExtensionsConfiguration) GetName() (res ExtensionsConfigurationGetNameRetType) { +func (o *PartialUpdateDatabasePayload) GetName() (res PartialUpdateDatabasePayloadGetNameRetType) { res, _ = o.GetNameOk() return } @@ -108,102 +110,102 @@ func (o *ExtensionsConfiguration) GetName() (res ExtensionsConfigurationGetNameR // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ExtensionsConfiguration) GetNameOk() (ret ExtensionsConfigurationGetNameRetType, ok bool) { - return getExtensionsConfigurationGetNameAttributeTypeOk(o.Name) +func (o *PartialUpdateDatabasePayload) GetNameOk() (ret PartialUpdateDatabasePayloadGetNameRetType, ok bool) { + return getPartialUpdateDatabasePayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ExtensionsConfiguration) HasName() bool { +func (o *PartialUpdateDatabasePayload) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ExtensionsConfiguration) SetName(v ExtensionsConfigurationGetNameRetType) { - setExtensionsConfigurationGetNameAttributeType(&o.Name, v) +func (o *PartialUpdateDatabasePayload) SetName(v PartialUpdateDatabasePayloadGetNameRetType) { + setPartialUpdateDatabasePayloadGetNameAttributeType(&o.Name, v) } -// GetSetting returns the Setting field value if set, zero value otherwise. +// GetOwner returns the Owner field value if set, zero value otherwise. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ExtensionsConfiguration) GetSetting() (res ExtensionsConfigurationGetSettingRetType) { - res, _ = o.GetSettingOk() +func (o *PartialUpdateDatabasePayload) GetOwner() (res PartialUpdateDatabasePayloadGetOwnerRetType) { + res, _ = o.GetOwnerOk() return } -// GetSettingOk returns a tuple with the Setting field value if set, nil otherwise +// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ExtensionsConfiguration) GetSettingOk() (ret ExtensionsConfigurationGetSettingRetType, ok bool) { - return getExtensionsConfigurationGetSettingAttributeTypeOk(o.Setting) +func (o *PartialUpdateDatabasePayload) GetOwnerOk() (ret PartialUpdateDatabasePayloadGetOwnerRetType, ok bool) { + return getPartialUpdateDatabasePayloadGetOwnerAttributeTypeOk(o.Owner) } -// HasSetting returns a boolean if a field has been set. +// HasOwner returns a boolean if a field has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ExtensionsConfiguration) HasSetting() bool { - _, ok := o.GetSettingOk() +func (o *PartialUpdateDatabasePayload) HasOwner() bool { + _, ok := o.GetOwnerOk() return ok } -// SetSetting gets a reference to the given string and assigns it to the Setting field. +// SetOwner gets a reference to the given string and assigns it to the Owner field. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ExtensionsConfiguration) SetSetting(v ExtensionsConfigurationGetSettingRetType) { - setExtensionsConfigurationGetSettingAttributeType(&o.Setting, v) +func (o *PartialUpdateDatabasePayload) SetOwner(v PartialUpdateDatabasePayloadGetOwnerRetType) { + setPartialUpdateDatabasePayloadGetOwnerAttributeType(&o.Owner, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o ExtensionsConfiguration) ToMap() (map[string]interface{}, error) { +func (o PartialUpdateDatabasePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getExtensionsConfigurationGetNameAttributeTypeOk(o.Name); ok { + if val, ok := getPartialUpdateDatabasePayloadGetNameAttributeTypeOk(o.Name); ok { toSerialize["Name"] = val } - if val, ok := getExtensionsConfigurationGetSettingAttributeTypeOk(o.Setting); ok { - toSerialize["Setting"] = val + if val, ok := getPartialUpdateDatabasePayloadGetOwnerAttributeTypeOk(o.Owner); ok { + toSerialize["Owner"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableExtensionsConfiguration struct { - value *ExtensionsConfiguration +type NullablePartialUpdateDatabasePayload struct { + value *PartialUpdateDatabasePayload isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableExtensionsConfiguration) Get() *ExtensionsConfiguration { +func (v NullablePartialUpdateDatabasePayload) Get() *PartialUpdateDatabasePayload { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableExtensionsConfiguration) Set(val *ExtensionsConfiguration) { +func (v *NullablePartialUpdateDatabasePayload) Set(val *PartialUpdateDatabasePayload) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableExtensionsConfiguration) IsSet() bool { +func (v NullablePartialUpdateDatabasePayload) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableExtensionsConfiguration) Unset() { +func (v *NullablePartialUpdateDatabasePayload) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableExtensionsConfiguration(val *ExtensionsConfiguration) *NullableExtensionsConfiguration { - return &NullableExtensionsConfiguration{value: val, isSet: true} +func NewNullablePartialUpdateDatabasePayload(val *PartialUpdateDatabasePayload) *NullablePartialUpdateDatabasePayload { + return &NullablePartialUpdateDatabasePayload{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableExtensionsConfiguration) MarshalJSON() ([]byte, error) { +func (v NullablePartialUpdateDatabasePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableExtensionsConfiguration) UnmarshalJSON(src []byte) error { +func (v *NullablePartialUpdateDatabasePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_partial_update_database_payload_test.go b/services/postgresflex/model_partial_update_database_payload_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_partial_update_database_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_partial_update_instance_payload.go b/services/postgresflex/model_partial_update_instance_payload.go index c80f5e51e..6038e0eb0 100644 --- a/services/postgresflex/model_partial_update_instance_payload.go +++ b/services/postgresflex/model_partial_update_instance_payload.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,33 +18,6 @@ import ( // checks if the PartialUpdateInstancePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &PartialUpdateInstancePayload{} -/* - types and functions for acl -*/ - -// isModel -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PartialUpdateInstancePayloadGetAclAttributeType = *ACL - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PartialUpdateInstancePayloadGetAclArgType = ACL - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PartialUpdateInstancePayloadGetAclRetType = ACL - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPartialUpdateInstancePayloadGetAclAttributeTypeOk(arg PartialUpdateInstancePayloadGetAclAttributeType) (ret PartialUpdateInstancePayloadGetAclRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setPartialUpdateInstancePayloadGetAclAttributeType(arg *PartialUpdateInstancePayloadGetAclAttributeType, val PartialUpdateInstancePayloadGetAclRetType) { - *arg = &val -} - /* types and functions for backupSchedule */ @@ -154,21 +127,21 @@ type PartialUpdateInstancePayloadGetNameArgType = string type PartialUpdateInstancePayloadGetNameRetType = string /* - types and functions for options + types and functions for network */ -// isContainer +// isModel // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PartialUpdateInstancePayloadGetOptionsAttributeType = *map[string]string +type PartialUpdateInstancePayloadGetNetworkAttributeType = *InstanceNetworkOpt // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PartialUpdateInstancePayloadGetOptionsArgType = map[string]string +type PartialUpdateInstancePayloadGetNetworkArgType = InstanceNetworkOpt // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PartialUpdateInstancePayloadGetOptionsRetType = map[string]string +type PartialUpdateInstancePayloadGetNetworkRetType = InstanceNetworkOpt // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPartialUpdateInstancePayloadGetOptionsAttributeTypeOk(arg PartialUpdateInstancePayloadGetOptionsAttributeType) (ret PartialUpdateInstancePayloadGetOptionsRetType, ok bool) { +func getPartialUpdateInstancePayloadGetNetworkAttributeTypeOk(arg PartialUpdateInstancePayloadGetNetworkAttributeType) (ret PartialUpdateInstancePayloadGetNetworkRetType, ok bool) { if arg == nil { return ret, false } @@ -176,26 +149,26 @@ func getPartialUpdateInstancePayloadGetOptionsAttributeTypeOk(arg PartialUpdateI } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setPartialUpdateInstancePayloadGetOptionsAttributeType(arg *PartialUpdateInstancePayloadGetOptionsAttributeType, val PartialUpdateInstancePayloadGetOptionsRetType) { +func setPartialUpdateInstancePayloadGetNetworkAttributeType(arg *PartialUpdateInstancePayloadGetNetworkAttributeType, val PartialUpdateInstancePayloadGetNetworkRetType) { *arg = &val } /* - types and functions for replicas + types and functions for retentionDays */ // isInteger // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PartialUpdateInstancePayloadGetReplicasAttributeType = *int64 +type PartialUpdateInstancePayloadGetRetentionDaysAttributeType = *int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PartialUpdateInstancePayloadGetReplicasArgType = int64 +type PartialUpdateInstancePayloadGetRetentionDaysArgType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PartialUpdateInstancePayloadGetReplicasRetType = int64 +type PartialUpdateInstancePayloadGetRetentionDaysRetType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPartialUpdateInstancePayloadGetReplicasAttributeTypeOk(arg PartialUpdateInstancePayloadGetReplicasAttributeType) (ret PartialUpdateInstancePayloadGetReplicasRetType, ok bool) { +func getPartialUpdateInstancePayloadGetRetentionDaysAttributeTypeOk(arg PartialUpdateInstancePayloadGetRetentionDaysAttributeType) (ret PartialUpdateInstancePayloadGetRetentionDaysRetType, ok bool) { if arg == nil { return ret, false } @@ -203,7 +176,7 @@ func getPartialUpdateInstancePayloadGetReplicasAttributeTypeOk(arg PartialUpdate } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setPartialUpdateInstancePayloadGetReplicasAttributeType(arg *PartialUpdateInstancePayloadGetReplicasAttributeType, val PartialUpdateInstancePayloadGetReplicasRetType) { +func setPartialUpdateInstancePayloadGetRetentionDaysAttributeType(arg *PartialUpdateInstancePayloadGetRetentionDaysAttributeType, val PartialUpdateInstancePayloadGetRetentionDaysRetType) { *arg = &val } @@ -264,17 +237,21 @@ type PartialUpdateInstancePayloadGetVersionRetType = string // PartialUpdateInstancePayload struct for PartialUpdateInstancePayload // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateInstancePayload struct { - Acl PartialUpdateInstancePayloadGetAclAttributeType `json:"acl,omitempty"` + // 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. BackupSchedule PartialUpdateInstancePayloadGetBackupScheduleAttributeType `json:"backupSchedule,omitempty"` - FlavorId PartialUpdateInstancePayloadGetFlavorIdAttributeType `json:"flavorId,omitempty"` - // Labels field is not certain/clear - Labels PartialUpdateInstancePayloadGetLabelsAttributeType `json:"labels,omitempty"` + // The id of the instance flavor. + FlavorId PartialUpdateInstancePayloadGetFlavorIdAttributeType `json:"flavorId,omitempty"` + // 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. + Labels PartialUpdateInstancePayloadGetLabelsAttributeType `json:"labels,omitempty"` + // The name of the instance. Name PartialUpdateInstancePayloadGetNameAttributeType `json:"name,omitempty"` - Options PartialUpdateInstancePayloadGetOptionsAttributeType `json:"options,omitempty"` + Network PartialUpdateInstancePayloadGetNetworkAttributeType `json:"network,omitempty"` + // How long backups are retained. The value can only be between 32 and 90 days. // Can be cast to int32 without loss of precision. - Replicas PartialUpdateInstancePayloadGetReplicasAttributeType `json:"replicas,omitempty"` - Storage PartialUpdateInstancePayloadGetStorageAttributeType `json:"storage,omitempty"` - Version PartialUpdateInstancePayloadGetVersionAttributeType `json:"version,omitempty"` + RetentionDays PartialUpdateInstancePayloadGetRetentionDaysAttributeType `json:"retentionDays,omitempty"` + Storage PartialUpdateInstancePayloadGetStorageAttributeType `json:"storage,omitempty"` + // The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3#tag/Version) for supported version parameters. + Version PartialUpdateInstancePayloadGetVersionAttributeType `json:"version,omitempty"` } // NewPartialUpdateInstancePayload instantiates a new PartialUpdateInstancePayload object @@ -296,33 +273,6 @@ func NewPartialUpdateInstancePayloadWithDefaults() *PartialUpdateInstancePayload return &this } -// GetAcl returns the Acl field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PartialUpdateInstancePayload) GetAcl() (res PartialUpdateInstancePayloadGetAclRetType) { - res, _ = o.GetAclOk() - return -} - -// GetAclOk returns a tuple with the Acl field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PartialUpdateInstancePayload) GetAclOk() (ret PartialUpdateInstancePayloadGetAclRetType, ok bool) { - return getPartialUpdateInstancePayloadGetAclAttributeTypeOk(o.Acl) -} - -// HasAcl returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PartialUpdateInstancePayload) HasAcl() bool { - _, ok := o.GetAclOk() - return ok -} - -// SetAcl gets a reference to the given ACL and assigns it to the Acl field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PartialUpdateInstancePayload) SetAcl(v PartialUpdateInstancePayloadGetAclRetType) { - setPartialUpdateInstancePayloadGetAclAttributeType(&o.Acl, v) -} - // GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateInstancePayload) GetBackupSchedule() (res PartialUpdateInstancePayloadGetBackupScheduleRetType) { @@ -431,58 +381,58 @@ func (o *PartialUpdateInstancePayload) SetName(v PartialUpdateInstancePayloadGet setPartialUpdateInstancePayloadGetNameAttributeType(&o.Name, v) } -// GetOptions returns the Options field value if set, zero value otherwise. +// GetNetwork returns the Network field value if set, zero value otherwise. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PartialUpdateInstancePayload) GetOptions() (res PartialUpdateInstancePayloadGetOptionsRetType) { - res, _ = o.GetOptionsOk() +func (o *PartialUpdateInstancePayload) GetNetwork() (res PartialUpdateInstancePayloadGetNetworkRetType) { + res, _ = o.GetNetworkOk() return } -// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PartialUpdateInstancePayload) GetOptionsOk() (ret PartialUpdateInstancePayloadGetOptionsRetType, ok bool) { - return getPartialUpdateInstancePayloadGetOptionsAttributeTypeOk(o.Options) +func (o *PartialUpdateInstancePayload) GetNetworkOk() (ret PartialUpdateInstancePayloadGetNetworkRetType, ok bool) { + return getPartialUpdateInstancePayloadGetNetworkAttributeTypeOk(o.Network) } -// HasOptions returns a boolean if a field has been set. +// HasNetwork returns a boolean if a field has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PartialUpdateInstancePayload) HasOptions() bool { - _, ok := o.GetOptionsOk() +func (o *PartialUpdateInstancePayload) HasNetwork() bool { + _, ok := o.GetNetworkOk() return ok } -// SetOptions gets a reference to the given map[string]string and assigns it to the Options field. +// SetNetwork gets a reference to the given InstanceNetworkOpt and assigns it to the Network field. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PartialUpdateInstancePayload) SetOptions(v PartialUpdateInstancePayloadGetOptionsRetType) { - setPartialUpdateInstancePayloadGetOptionsAttributeType(&o.Options, v) +func (o *PartialUpdateInstancePayload) SetNetwork(v PartialUpdateInstancePayloadGetNetworkRetType) { + setPartialUpdateInstancePayloadGetNetworkAttributeType(&o.Network, v) } -// GetReplicas returns the Replicas field value if set, zero value otherwise. +// GetRetentionDays returns the RetentionDays field value if set, zero value otherwise. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PartialUpdateInstancePayload) GetReplicas() (res PartialUpdateInstancePayloadGetReplicasRetType) { - res, _ = o.GetReplicasOk() +func (o *PartialUpdateInstancePayload) GetRetentionDays() (res PartialUpdateInstancePayloadGetRetentionDaysRetType) { + res, _ = o.GetRetentionDaysOk() return } -// GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise +// GetRetentionDaysOk returns a tuple with the RetentionDays field value if set, nil otherwise // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PartialUpdateInstancePayload) GetReplicasOk() (ret PartialUpdateInstancePayloadGetReplicasRetType, ok bool) { - return getPartialUpdateInstancePayloadGetReplicasAttributeTypeOk(o.Replicas) +func (o *PartialUpdateInstancePayload) GetRetentionDaysOk() (ret PartialUpdateInstancePayloadGetRetentionDaysRetType, ok bool) { + return getPartialUpdateInstancePayloadGetRetentionDaysAttributeTypeOk(o.RetentionDays) } -// HasReplicas returns a boolean if a field has been set. +// HasRetentionDays returns a boolean if a field has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PartialUpdateInstancePayload) HasReplicas() bool { - _, ok := o.GetReplicasOk() +func (o *PartialUpdateInstancePayload) HasRetentionDays() bool { + _, ok := o.GetRetentionDaysOk() return ok } -// SetReplicas gets a reference to the given int64 and assigns it to the Replicas field. +// SetRetentionDays gets a reference to the given int64 and assigns it to the RetentionDays field. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PartialUpdateInstancePayload) SetReplicas(v PartialUpdateInstancePayloadGetReplicasRetType) { - setPartialUpdateInstancePayloadGetReplicasAttributeType(&o.Replicas, v) +func (o *PartialUpdateInstancePayload) SetRetentionDays(v PartialUpdateInstancePayloadGetRetentionDaysRetType) { + setPartialUpdateInstancePayloadGetRetentionDaysAttributeType(&o.RetentionDays, v) } // GetStorage returns the Storage field value if set, zero value otherwise. @@ -542,9 +492,6 @@ func (o *PartialUpdateInstancePayload) SetVersion(v PartialUpdateInstancePayload // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PartialUpdateInstancePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getPartialUpdateInstancePayloadGetAclAttributeTypeOk(o.Acl); ok { - toSerialize["Acl"] = val - } if val, ok := getPartialUpdateInstancePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule); ok { toSerialize["BackupSchedule"] = val } @@ -557,11 +504,11 @@ func (o PartialUpdateInstancePayload) ToMap() (map[string]interface{}, error) { if val, ok := getPartialUpdateInstancePayloadGetNameAttributeTypeOk(o.Name); ok { toSerialize["Name"] = val } - if val, ok := getPartialUpdateInstancePayloadGetOptionsAttributeTypeOk(o.Options); ok { - toSerialize["Options"] = val + if val, ok := getPartialUpdateInstancePayloadGetNetworkAttributeTypeOk(o.Network); ok { + toSerialize["Network"] = val } - if val, ok := getPartialUpdateInstancePayloadGetReplicasAttributeTypeOk(o.Replicas); ok { - toSerialize["Replicas"] = val + if val, ok := getPartialUpdateInstancePayloadGetRetentionDaysAttributeTypeOk(o.RetentionDays); ok { + toSerialize["RetentionDays"] = val } if val, ok := getPartialUpdateInstancePayloadGetStorageAttributeTypeOk(o.Storage); ok { toSerialize["Storage"] = val diff --git a/services/postgresflex/model_partial_update_instance_payload_test.go b/services/postgresflex/model_partial_update_instance_payload_test.go index 51f50494d..74a76f10e 100644 --- a/services/postgresflex/model_partial_update_instance_payload_test.go +++ b/services/postgresflex/model_partial_update_instance_payload_test.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_partial_update_instance_response.go b/services/postgresflex/model_partial_update_instance_response.go deleted file mode 100644 index 820e1f5e0..000000000 --- a/services/postgresflex/model_partial_update_instance_response.go +++ /dev/null @@ -1,151 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package postgresflex - -import ( - "encoding/json" -) - -// checks if the PartialUpdateInstanceResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PartialUpdateInstanceResponse{} - -/* - types and functions for item -*/ - -// isModel -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PartialUpdateInstanceResponseGetItemAttributeType = *Instance - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PartialUpdateInstanceResponseGetItemArgType = Instance - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PartialUpdateInstanceResponseGetItemRetType = Instance - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPartialUpdateInstanceResponseGetItemAttributeTypeOk(arg PartialUpdateInstanceResponseGetItemAttributeType) (ret PartialUpdateInstanceResponseGetItemRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setPartialUpdateInstanceResponseGetItemAttributeType(arg *PartialUpdateInstanceResponseGetItemAttributeType, val PartialUpdateInstanceResponseGetItemRetType) { - *arg = &val -} - -// PartialUpdateInstanceResponse struct for PartialUpdateInstanceResponse -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PartialUpdateInstanceResponse struct { - Item PartialUpdateInstanceResponseGetItemAttributeType `json:"item,omitempty"` -} - -// NewPartialUpdateInstanceResponse instantiates a new PartialUpdateInstanceResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewPartialUpdateInstanceResponse() *PartialUpdateInstanceResponse { - this := PartialUpdateInstanceResponse{} - return &this -} - -// NewPartialUpdateInstanceResponseWithDefaults instantiates a new PartialUpdateInstanceResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewPartialUpdateInstanceResponseWithDefaults() *PartialUpdateInstanceResponse { - this := PartialUpdateInstanceResponse{} - return &this -} - -// GetItem returns the Item field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PartialUpdateInstanceResponse) GetItem() (res PartialUpdateInstanceResponseGetItemRetType) { - res, _ = o.GetItemOk() - return -} - -// GetItemOk returns a tuple with the Item field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PartialUpdateInstanceResponse) GetItemOk() (ret PartialUpdateInstanceResponseGetItemRetType, ok bool) { - return getPartialUpdateInstanceResponseGetItemAttributeTypeOk(o.Item) -} - -// HasItem returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PartialUpdateInstanceResponse) HasItem() bool { - _, ok := o.GetItemOk() - return ok -} - -// SetItem gets a reference to the given Instance and assigns it to the Item field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PartialUpdateInstanceResponse) SetItem(v PartialUpdateInstanceResponseGetItemRetType) { - setPartialUpdateInstanceResponseGetItemAttributeType(&o.Item, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o PartialUpdateInstanceResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getPartialUpdateInstanceResponseGetItemAttributeTypeOk(o.Item); ok { - toSerialize["Item"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullablePartialUpdateInstanceResponse struct { - value *PartialUpdateInstanceResponse - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullablePartialUpdateInstanceResponse) Get() *PartialUpdateInstanceResponse { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullablePartialUpdateInstanceResponse) Set(val *PartialUpdateInstanceResponse) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullablePartialUpdateInstanceResponse) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullablePartialUpdateInstanceResponse) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullablePartialUpdateInstanceResponse(val *PartialUpdateInstanceResponse) *NullablePartialUpdateInstanceResponse { - return &NullablePartialUpdateInstanceResponse{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullablePartialUpdateInstanceResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullablePartialUpdateInstanceResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/model_partial_update_instance_response_test.go b/services/postgresflex/model_partial_update_instance_response_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_partial_update_instance_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_partial_update_user_payload.go b/services/postgresflex/model_partial_update_user_payload.go index fee074c9e..3aa7a25ad 100644 --- a/services/postgresflex/model_partial_update_user_payload.go +++ b/services/postgresflex/model_partial_update_user_payload.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,15 +19,15 @@ import ( var _ MappedNullable = &PartialUpdateUserPayload{} /* - types and functions for database + types and functions for name */ // isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PartialUpdateUserPayloadGetDatabaseAttributeType = *string +type PartialUpdateUserPayloadGetNameAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPartialUpdateUserPayloadGetDatabaseAttributeTypeOk(arg PartialUpdateUserPayloadGetDatabaseAttributeType) (ret PartialUpdateUserPayloadGetDatabaseRetType, ok bool) { +func getPartialUpdateUserPayloadGetNameAttributeTypeOk(arg PartialUpdateUserPayloadGetNameAttributeType) (ret PartialUpdateUserPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false } @@ -35,15 +35,15 @@ func getPartialUpdateUserPayloadGetDatabaseAttributeTypeOk(arg PartialUpdateUser } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setPartialUpdateUserPayloadGetDatabaseAttributeType(arg *PartialUpdateUserPayloadGetDatabaseAttributeType, val PartialUpdateUserPayloadGetDatabaseRetType) { +func setPartialUpdateUserPayloadGetNameAttributeType(arg *PartialUpdateUserPayloadGetNameAttributeType, val PartialUpdateUserPayloadGetNameRetType) { *arg = &val } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PartialUpdateUserPayloadGetDatabaseArgType = string +type PartialUpdateUserPayloadGetNameArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PartialUpdateUserPayloadGetDatabaseRetType = string +type PartialUpdateUserPayloadGetNameRetType = string /* types and functions for roles @@ -75,8 +75,10 @@ func setPartialUpdateUserPayloadGetRolesAttributeType(arg *PartialUpdateUserPayl // PartialUpdateUserPayload struct for PartialUpdateUserPayload // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateUserPayload struct { - Database PartialUpdateUserPayloadGetDatabaseAttributeType `json:"database,omitempty"` - Roles PartialUpdateUserPayloadGetRolesAttributeType `json:"roles,omitempty"` + // The name of the user. + Name PartialUpdateUserPayloadGetNameAttributeType `json:"name,omitempty"` + // A list containing the user roles for the instance. Please refer to the List Roles endpoint for a list of all available Roles. + Roles PartialUpdateUserPayloadGetRolesAttributeType `json:"roles,omitempty"` } // NewPartialUpdateUserPayload instantiates a new PartialUpdateUserPayload object @@ -98,31 +100,31 @@ func NewPartialUpdateUserPayloadWithDefaults() *PartialUpdateUserPayload { return &this } -// GetDatabase returns the Database field value if set, zero value otherwise. +// GetName returns the Name field value if set, zero value otherwise. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PartialUpdateUserPayload) GetDatabase() (res PartialUpdateUserPayloadGetDatabaseRetType) { - res, _ = o.GetDatabaseOk() +func (o *PartialUpdateUserPayload) GetName() (res PartialUpdateUserPayloadGetNameRetType) { + res, _ = o.GetNameOk() return } -// GetDatabaseOk returns a tuple with the Database field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PartialUpdateUserPayload) GetDatabaseOk() (ret PartialUpdateUserPayloadGetDatabaseRetType, ok bool) { - return getPartialUpdateUserPayloadGetDatabaseAttributeTypeOk(o.Database) +func (o *PartialUpdateUserPayload) GetNameOk() (ret PartialUpdateUserPayloadGetNameRetType, ok bool) { + return getPartialUpdateUserPayloadGetNameAttributeTypeOk(o.Name) } -// HasDatabase returns a boolean if a field has been set. +// HasName returns a boolean if a field has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PartialUpdateUserPayload) HasDatabase() bool { - _, ok := o.GetDatabaseOk() +func (o *PartialUpdateUserPayload) HasName() bool { + _, ok := o.GetNameOk() return ok } -// SetDatabase gets a reference to the given string and assigns it to the Database field. +// SetName gets a reference to the given string and assigns it to the Name field. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PartialUpdateUserPayload) SetDatabase(v PartialUpdateUserPayloadGetDatabaseRetType) { - setPartialUpdateUserPayloadGetDatabaseAttributeType(&o.Database, v) +func (o *PartialUpdateUserPayload) SetName(v PartialUpdateUserPayloadGetNameRetType) { + setPartialUpdateUserPayloadGetNameAttributeType(&o.Name, v) } // GetRoles returns the Roles field value if set, zero value otherwise. @@ -155,8 +157,8 @@ func (o *PartialUpdateUserPayload) SetRoles(v PartialUpdateUserPayloadGetRolesRe // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PartialUpdateUserPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getPartialUpdateUserPayloadGetDatabaseAttributeTypeOk(o.Database); ok { - toSerialize["Database"] = val + if val, ok := getPartialUpdateUserPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } if val, ok := getPartialUpdateUserPayloadGetRolesAttributeTypeOk(o.Roles); ok { toSerialize["Roles"] = val diff --git a/services/postgresflex/model_partial_update_user_payload_test.go b/services/postgresflex/model_partial_update_user_payload_test.go index 51f50494d..74a76f10e 100644 --- a/services/postgresflex/model_partial_update_user_payload_test.go +++ b/services/postgresflex/model_partial_update_user_payload_test.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_postgres_database_parameter.go b/services/postgresflex/model_postgres_database_parameter.go deleted file mode 100644 index b68e5ab39..000000000 --- a/services/postgresflex/model_postgres_database_parameter.go +++ /dev/null @@ -1,801 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package postgresflex - -import ( - "encoding/json" -) - -// checks if the PostgresDatabaseParameter type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PostgresDatabaseParameter{} - -/* - types and functions for context -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetContextAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPostgresDatabaseParameterGetContextAttributeTypeOk(arg PostgresDatabaseParameterGetContextAttributeType) (ret PostgresDatabaseParameterGetContextRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setPostgresDatabaseParameterGetContextAttributeType(arg *PostgresDatabaseParameterGetContextAttributeType, val PostgresDatabaseParameterGetContextRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetContextArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetContextRetType = string - -/* - types and functions for dataType -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetDataTypeAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPostgresDatabaseParameterGetDataTypeAttributeTypeOk(arg PostgresDatabaseParameterGetDataTypeAttributeType) (ret PostgresDatabaseParameterGetDataTypeRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setPostgresDatabaseParameterGetDataTypeAttributeType(arg *PostgresDatabaseParameterGetDataTypeAttributeType, val PostgresDatabaseParameterGetDataTypeRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetDataTypeArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetDataTypeRetType = string - -/* - types and functions for defaultValue -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetDefaultValueAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPostgresDatabaseParameterGetDefaultValueAttributeTypeOk(arg PostgresDatabaseParameterGetDefaultValueAttributeType) (ret PostgresDatabaseParameterGetDefaultValueRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setPostgresDatabaseParameterGetDefaultValueAttributeType(arg *PostgresDatabaseParameterGetDefaultValueAttributeType, val PostgresDatabaseParameterGetDefaultValueRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetDefaultValueArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetDefaultValueRetType = string - -/* - types and functions for description -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetDescriptionAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPostgresDatabaseParameterGetDescriptionAttributeTypeOk(arg PostgresDatabaseParameterGetDescriptionAttributeType) (ret PostgresDatabaseParameterGetDescriptionRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setPostgresDatabaseParameterGetDescriptionAttributeType(arg *PostgresDatabaseParameterGetDescriptionAttributeType, val PostgresDatabaseParameterGetDescriptionRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetDescriptionArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetDescriptionRetType = string - -/* - types and functions for edit -*/ - -// isBoolean -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParametergetEditAttributeType = *bool - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParametergetEditArgType = bool - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParametergetEditRetType = bool - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPostgresDatabaseParametergetEditAttributeTypeOk(arg PostgresDatabaseParametergetEditAttributeType) (ret PostgresDatabaseParametergetEditRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setPostgresDatabaseParametergetEditAttributeType(arg *PostgresDatabaseParametergetEditAttributeType, val PostgresDatabaseParametergetEditRetType) { - *arg = &val -} - -/* - types and functions for maxValue -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetMaxValueAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPostgresDatabaseParameterGetMaxValueAttributeTypeOk(arg PostgresDatabaseParameterGetMaxValueAttributeType) (ret PostgresDatabaseParameterGetMaxValueRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setPostgresDatabaseParameterGetMaxValueAttributeType(arg *PostgresDatabaseParameterGetMaxValueAttributeType, val PostgresDatabaseParameterGetMaxValueRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetMaxValueArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetMaxValueRetType = string - -/* - types and functions for minValue -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetMinValueAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPostgresDatabaseParameterGetMinValueAttributeTypeOk(arg PostgresDatabaseParameterGetMinValueAttributeType) (ret PostgresDatabaseParameterGetMinValueRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setPostgresDatabaseParameterGetMinValueAttributeType(arg *PostgresDatabaseParameterGetMinValueAttributeType, val PostgresDatabaseParameterGetMinValueRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetMinValueArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetMinValueRetType = string - -/* - types and functions for name -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetNameAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPostgresDatabaseParameterGetNameAttributeTypeOk(arg PostgresDatabaseParameterGetNameAttributeType) (ret PostgresDatabaseParameterGetNameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setPostgresDatabaseParameterGetNameAttributeType(arg *PostgresDatabaseParameterGetNameAttributeType, val PostgresDatabaseParameterGetNameRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetNameArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetNameRetType = string - -/* - types and functions for pendingRestart -*/ - -// isBoolean -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParametergetPendingRestartAttributeType = *bool - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParametergetPendingRestartArgType = bool - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParametergetPendingRestartRetType = bool - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPostgresDatabaseParametergetPendingRestartAttributeTypeOk(arg PostgresDatabaseParametergetPendingRestartAttributeType) (ret PostgresDatabaseParametergetPendingRestartRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setPostgresDatabaseParametergetPendingRestartAttributeType(arg *PostgresDatabaseParametergetPendingRestartAttributeType, val PostgresDatabaseParametergetPendingRestartRetType) { - *arg = &val -} - -/* - types and functions for resetValue -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetResetValueAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPostgresDatabaseParameterGetResetValueAttributeTypeOk(arg PostgresDatabaseParameterGetResetValueAttributeType) (ret PostgresDatabaseParameterGetResetValueRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setPostgresDatabaseParameterGetResetValueAttributeType(arg *PostgresDatabaseParameterGetResetValueAttributeType, val PostgresDatabaseParameterGetResetValueRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetResetValueArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetResetValueRetType = string - -/* - types and functions for unit -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetUnitAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPostgresDatabaseParameterGetUnitAttributeTypeOk(arg PostgresDatabaseParameterGetUnitAttributeType) (ret PostgresDatabaseParameterGetUnitRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setPostgresDatabaseParameterGetUnitAttributeType(arg *PostgresDatabaseParameterGetUnitAttributeType, val PostgresDatabaseParameterGetUnitRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetUnitArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetUnitRetType = string - -/* - types and functions for value -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetValueAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPostgresDatabaseParameterGetValueAttributeTypeOk(arg PostgresDatabaseParameterGetValueAttributeType) (ret PostgresDatabaseParameterGetValueRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setPostgresDatabaseParameterGetValueAttributeType(arg *PostgresDatabaseParameterGetValueAttributeType, val PostgresDatabaseParameterGetValueRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetValueArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterGetValueRetType = string - -// PostgresDatabaseParameter struct for PostgresDatabaseParameter -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameter struct { - // Context of the parameter. - Context PostgresDatabaseParameterGetContextAttributeType `json:"context,omitempty"` - // Datatype describes the type of data that is used in the Value field. - DataType PostgresDatabaseParameterGetDataTypeAttributeType `json:"dataType,omitempty"` - // DefaultValue for the value field. - DefaultValue PostgresDatabaseParameterGetDefaultValueAttributeType `json:"defaultValue,omitempty"` - // Description of the parameter. - Description PostgresDatabaseParameterGetDescriptionAttributeType `json:"description,omitempty"` - // Edit shows if the user can change this value. - Edit PostgresDatabaseParametergetEditAttributeType `json:"edit,omitempty"` - // MaxValue describes the highest possible value that can be set. - MaxValue PostgresDatabaseParameterGetMaxValueAttributeType `json:"maxValue,omitempty"` - // MinValue describes the lowest possible value that can be set. - MinValue PostgresDatabaseParameterGetMinValueAttributeType `json:"minValue,omitempty"` - // Name of the parameter. - Name PostgresDatabaseParameterGetNameAttributeType `json:"name,omitempty"` - // PendingRestart describes if a parameter change requires a restart of the server. - PendingRestart PostgresDatabaseParametergetPendingRestartAttributeType `json:"pendingRestart,omitempty"` - // ResetValue for the value field af.ter a reset. - ResetValue PostgresDatabaseParameterGetResetValueAttributeType `json:"resetValue,omitempty"` - // Unit if the parameter has a unit if not empty. - Unit PostgresDatabaseParameterGetUnitAttributeType `json:"unit,omitempty"` - // Value of this parameter. - Value PostgresDatabaseParameterGetValueAttributeType `json:"value,omitempty"` -} - -// NewPostgresDatabaseParameter instantiates a new PostgresDatabaseParameter object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewPostgresDatabaseParameter() *PostgresDatabaseParameter { - this := PostgresDatabaseParameter{} - return &this -} - -// NewPostgresDatabaseParameterWithDefaults instantiates a new PostgresDatabaseParameter object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewPostgresDatabaseParameterWithDefaults() *PostgresDatabaseParameter { - this := PostgresDatabaseParameter{} - return &this -} - -// GetContext returns the Context field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetContext() (res PostgresDatabaseParameterGetContextRetType) { - res, _ = o.GetContextOk() - return -} - -// GetContextOk returns a tuple with the Context field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetContextOk() (ret PostgresDatabaseParameterGetContextRetType, ok bool) { - return getPostgresDatabaseParameterGetContextAttributeTypeOk(o.Context) -} - -// HasContext returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) HasContext() bool { - _, ok := o.GetContextOk() - return ok -} - -// SetContext gets a reference to the given string and assigns it to the Context field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) SetContext(v PostgresDatabaseParameterGetContextRetType) { - setPostgresDatabaseParameterGetContextAttributeType(&o.Context, v) -} - -// GetDataType returns the DataType field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetDataType() (res PostgresDatabaseParameterGetDataTypeRetType) { - res, _ = o.GetDataTypeOk() - return -} - -// GetDataTypeOk returns a tuple with the DataType field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetDataTypeOk() (ret PostgresDatabaseParameterGetDataTypeRetType, ok bool) { - return getPostgresDatabaseParameterGetDataTypeAttributeTypeOk(o.DataType) -} - -// HasDataType returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) HasDataType() bool { - _, ok := o.GetDataTypeOk() - return ok -} - -// SetDataType gets a reference to the given string and assigns it to the DataType field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) SetDataType(v PostgresDatabaseParameterGetDataTypeRetType) { - setPostgresDatabaseParameterGetDataTypeAttributeType(&o.DataType, v) -} - -// GetDefaultValue returns the DefaultValue field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetDefaultValue() (res PostgresDatabaseParameterGetDefaultValueRetType) { - res, _ = o.GetDefaultValueOk() - return -} - -// GetDefaultValueOk returns a tuple with the DefaultValue field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetDefaultValueOk() (ret PostgresDatabaseParameterGetDefaultValueRetType, ok bool) { - return getPostgresDatabaseParameterGetDefaultValueAttributeTypeOk(o.DefaultValue) -} - -// HasDefaultValue returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) HasDefaultValue() bool { - _, ok := o.GetDefaultValueOk() - return ok -} - -// SetDefaultValue gets a reference to the given string and assigns it to the DefaultValue field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) SetDefaultValue(v PostgresDatabaseParameterGetDefaultValueRetType) { - setPostgresDatabaseParameterGetDefaultValueAttributeType(&o.DefaultValue, v) -} - -// GetDescription returns the Description field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetDescription() (res PostgresDatabaseParameterGetDescriptionRetType) { - res, _ = o.GetDescriptionOk() - return -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetDescriptionOk() (ret PostgresDatabaseParameterGetDescriptionRetType, ok bool) { - return getPostgresDatabaseParameterGetDescriptionAttributeTypeOk(o.Description) -} - -// HasDescription returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) HasDescription() bool { - _, ok := o.GetDescriptionOk() - return ok -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) SetDescription(v PostgresDatabaseParameterGetDescriptionRetType) { - setPostgresDatabaseParameterGetDescriptionAttributeType(&o.Description, v) -} - -// GetEdit returns the Edit field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetEdit() (res PostgresDatabaseParametergetEditRetType) { - res, _ = o.GetEditOk() - return -} - -// GetEditOk returns a tuple with the Edit field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetEditOk() (ret PostgresDatabaseParametergetEditRetType, ok bool) { - return getPostgresDatabaseParametergetEditAttributeTypeOk(o.Edit) -} - -// HasEdit returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) HasEdit() bool { - _, ok := o.GetEditOk() - return ok -} - -// SetEdit gets a reference to the given bool and assigns it to the Edit field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) SetEdit(v PostgresDatabaseParametergetEditRetType) { - setPostgresDatabaseParametergetEditAttributeType(&o.Edit, v) -} - -// GetMaxValue returns the MaxValue field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetMaxValue() (res PostgresDatabaseParameterGetMaxValueRetType) { - res, _ = o.GetMaxValueOk() - return -} - -// GetMaxValueOk returns a tuple with the MaxValue field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetMaxValueOk() (ret PostgresDatabaseParameterGetMaxValueRetType, ok bool) { - return getPostgresDatabaseParameterGetMaxValueAttributeTypeOk(o.MaxValue) -} - -// HasMaxValue returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) HasMaxValue() bool { - _, ok := o.GetMaxValueOk() - return ok -} - -// SetMaxValue gets a reference to the given string and assigns it to the MaxValue field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) SetMaxValue(v PostgresDatabaseParameterGetMaxValueRetType) { - setPostgresDatabaseParameterGetMaxValueAttributeType(&o.MaxValue, v) -} - -// GetMinValue returns the MinValue field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetMinValue() (res PostgresDatabaseParameterGetMinValueRetType) { - res, _ = o.GetMinValueOk() - return -} - -// GetMinValueOk returns a tuple with the MinValue field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetMinValueOk() (ret PostgresDatabaseParameterGetMinValueRetType, ok bool) { - return getPostgresDatabaseParameterGetMinValueAttributeTypeOk(o.MinValue) -} - -// HasMinValue returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) HasMinValue() bool { - _, ok := o.GetMinValueOk() - return ok -} - -// SetMinValue gets a reference to the given string and assigns it to the MinValue field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) SetMinValue(v PostgresDatabaseParameterGetMinValueRetType) { - setPostgresDatabaseParameterGetMinValueAttributeType(&o.MinValue, v) -} - -// GetName returns the Name field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetName() (res PostgresDatabaseParameterGetNameRetType) { - res, _ = o.GetNameOk() - return -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetNameOk() (ret PostgresDatabaseParameterGetNameRetType, ok bool) { - return getPostgresDatabaseParameterGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) SetName(v PostgresDatabaseParameterGetNameRetType) { - setPostgresDatabaseParameterGetNameAttributeType(&o.Name, v) -} - -// GetPendingRestart returns the PendingRestart field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetPendingRestart() (res PostgresDatabaseParametergetPendingRestartRetType) { - res, _ = o.GetPendingRestartOk() - return -} - -// GetPendingRestartOk returns a tuple with the PendingRestart field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetPendingRestartOk() (ret PostgresDatabaseParametergetPendingRestartRetType, ok bool) { - return getPostgresDatabaseParametergetPendingRestartAttributeTypeOk(o.PendingRestart) -} - -// HasPendingRestart returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) HasPendingRestart() bool { - _, ok := o.GetPendingRestartOk() - return ok -} - -// SetPendingRestart gets a reference to the given bool and assigns it to the PendingRestart field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) SetPendingRestart(v PostgresDatabaseParametergetPendingRestartRetType) { - setPostgresDatabaseParametergetPendingRestartAttributeType(&o.PendingRestart, v) -} - -// GetResetValue returns the ResetValue field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetResetValue() (res PostgresDatabaseParameterGetResetValueRetType) { - res, _ = o.GetResetValueOk() - return -} - -// GetResetValueOk returns a tuple with the ResetValue field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetResetValueOk() (ret PostgresDatabaseParameterGetResetValueRetType, ok bool) { - return getPostgresDatabaseParameterGetResetValueAttributeTypeOk(o.ResetValue) -} - -// HasResetValue returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) HasResetValue() bool { - _, ok := o.GetResetValueOk() - return ok -} - -// SetResetValue gets a reference to the given string and assigns it to the ResetValue field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) SetResetValue(v PostgresDatabaseParameterGetResetValueRetType) { - setPostgresDatabaseParameterGetResetValueAttributeType(&o.ResetValue, v) -} - -// GetUnit returns the Unit field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetUnit() (res PostgresDatabaseParameterGetUnitRetType) { - res, _ = o.GetUnitOk() - return -} - -// GetUnitOk returns a tuple with the Unit field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetUnitOk() (ret PostgresDatabaseParameterGetUnitRetType, ok bool) { - return getPostgresDatabaseParameterGetUnitAttributeTypeOk(o.Unit) -} - -// HasUnit returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) HasUnit() bool { - _, ok := o.GetUnitOk() - return ok -} - -// SetUnit gets a reference to the given string and assigns it to the Unit field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) SetUnit(v PostgresDatabaseParameterGetUnitRetType) { - setPostgresDatabaseParameterGetUnitAttributeType(&o.Unit, v) -} - -// GetValue returns the Value field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetValue() (res PostgresDatabaseParameterGetValueRetType) { - res, _ = o.GetValueOk() - return -} - -// GetValueOk returns a tuple with the Value field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) GetValueOk() (ret PostgresDatabaseParameterGetValueRetType, ok bool) { - return getPostgresDatabaseParameterGetValueAttributeTypeOk(o.Value) -} - -// HasValue returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) HasValue() bool { - _, ok := o.GetValueOk() - return ok -} - -// SetValue gets a reference to the given string and assigns it to the Value field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameter) SetValue(v PostgresDatabaseParameterGetValueRetType) { - setPostgresDatabaseParameterGetValueAttributeType(&o.Value, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o PostgresDatabaseParameter) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getPostgresDatabaseParameterGetContextAttributeTypeOk(o.Context); ok { - toSerialize["Context"] = val - } - if val, ok := getPostgresDatabaseParameterGetDataTypeAttributeTypeOk(o.DataType); ok { - toSerialize["DataType"] = val - } - if val, ok := getPostgresDatabaseParameterGetDefaultValueAttributeTypeOk(o.DefaultValue); ok { - toSerialize["DefaultValue"] = val - } - if val, ok := getPostgresDatabaseParameterGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getPostgresDatabaseParametergetEditAttributeTypeOk(o.Edit); ok { - toSerialize["Edit"] = val - } - if val, ok := getPostgresDatabaseParameterGetMaxValueAttributeTypeOk(o.MaxValue); ok { - toSerialize["MaxValue"] = val - } - if val, ok := getPostgresDatabaseParameterGetMinValueAttributeTypeOk(o.MinValue); ok { - toSerialize["MinValue"] = val - } - if val, ok := getPostgresDatabaseParameterGetNameAttributeTypeOk(o.Name); ok { - toSerialize["Name"] = val - } - if val, ok := getPostgresDatabaseParametergetPendingRestartAttributeTypeOk(o.PendingRestart); ok { - toSerialize["PendingRestart"] = val - } - if val, ok := getPostgresDatabaseParameterGetResetValueAttributeTypeOk(o.ResetValue); ok { - toSerialize["ResetValue"] = val - } - if val, ok := getPostgresDatabaseParameterGetUnitAttributeTypeOk(o.Unit); ok { - toSerialize["Unit"] = val - } - if val, ok := getPostgresDatabaseParameterGetValueAttributeTypeOk(o.Value); ok { - toSerialize["Value"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullablePostgresDatabaseParameter struct { - value *PostgresDatabaseParameter - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullablePostgresDatabaseParameter) Get() *PostgresDatabaseParameter { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullablePostgresDatabaseParameter) Set(val *PostgresDatabaseParameter) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullablePostgresDatabaseParameter) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullablePostgresDatabaseParameter) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullablePostgresDatabaseParameter(val *PostgresDatabaseParameter) *NullablePostgresDatabaseParameter { - return &NullablePostgresDatabaseParameter{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullablePostgresDatabaseParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullablePostgresDatabaseParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/model_postgres_database_parameter_response.go b/services/postgresflex/model_postgres_database_parameter_response.go deleted file mode 100644 index b95917343..000000000 --- a/services/postgresflex/model_postgres_database_parameter_response.go +++ /dev/null @@ -1,152 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package postgresflex - -import ( - "encoding/json" -) - -// checks if the PostgresDatabaseParameterResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PostgresDatabaseParameterResponse{} - -/* - types and functions for parameter -*/ - -// isArray -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterResponseGetParameterAttributeType = *[]PostgresDatabaseParameter - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterResponseGetParameterArgType = []PostgresDatabaseParameter - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterResponseGetParameterRetType = []PostgresDatabaseParameter - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPostgresDatabaseParameterResponseGetParameterAttributeTypeOk(arg PostgresDatabaseParameterResponseGetParameterAttributeType) (ret PostgresDatabaseParameterResponseGetParameterRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setPostgresDatabaseParameterResponseGetParameterAttributeType(arg *PostgresDatabaseParameterResponseGetParameterAttributeType, val PostgresDatabaseParameterResponseGetParameterRetType) { - *arg = &val -} - -// PostgresDatabaseParameterResponse struct for PostgresDatabaseParameterResponse -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PostgresDatabaseParameterResponse struct { - // List of the parameter - Parameter PostgresDatabaseParameterResponseGetParameterAttributeType `json:"parameter,omitempty"` -} - -// NewPostgresDatabaseParameterResponse instantiates a new PostgresDatabaseParameterResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewPostgresDatabaseParameterResponse() *PostgresDatabaseParameterResponse { - this := PostgresDatabaseParameterResponse{} - return &this -} - -// NewPostgresDatabaseParameterResponseWithDefaults instantiates a new PostgresDatabaseParameterResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewPostgresDatabaseParameterResponseWithDefaults() *PostgresDatabaseParameterResponse { - this := PostgresDatabaseParameterResponse{} - return &this -} - -// GetParameter returns the Parameter field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameterResponse) GetParameter() (res PostgresDatabaseParameterResponseGetParameterRetType) { - res, _ = o.GetParameterOk() - return -} - -// GetParameterOk returns a tuple with the Parameter field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameterResponse) GetParameterOk() (ret PostgresDatabaseParameterResponseGetParameterRetType, ok bool) { - return getPostgresDatabaseParameterResponseGetParameterAttributeTypeOk(o.Parameter) -} - -// HasParameter returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameterResponse) HasParameter() bool { - _, ok := o.GetParameterOk() - return ok -} - -// SetParameter gets a reference to the given []PostgresDatabaseParameter and assigns it to the Parameter field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PostgresDatabaseParameterResponse) SetParameter(v PostgresDatabaseParameterResponseGetParameterRetType) { - setPostgresDatabaseParameterResponseGetParameterAttributeType(&o.Parameter, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o PostgresDatabaseParameterResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getPostgresDatabaseParameterResponseGetParameterAttributeTypeOk(o.Parameter); ok { - toSerialize["Parameter"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullablePostgresDatabaseParameterResponse struct { - value *PostgresDatabaseParameterResponse - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullablePostgresDatabaseParameterResponse) Get() *PostgresDatabaseParameterResponse { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullablePostgresDatabaseParameterResponse) Set(val *PostgresDatabaseParameterResponse) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullablePostgresDatabaseParameterResponse) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullablePostgresDatabaseParameterResponse) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullablePostgresDatabaseParameterResponse(val *PostgresDatabaseParameterResponse) *NullablePostgresDatabaseParameterResponse { - return &NullablePostgresDatabaseParameterResponse{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullablePostgresDatabaseParameterResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullablePostgresDatabaseParameterResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/model_postgres_database_parameter_response_test.go b/services/postgresflex/model_postgres_database_parameter_response_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_postgres_database_parameter_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_postgres_database_parameter_test.go b/services/postgresflex/model_postgres_database_parameter_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_postgres_database_parameter_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_reset_user_password_response.go b/services/postgresflex/model_reset_user_password_response.go new file mode 100644 index 000000000..2e6744e09 --- /dev/null +++ b/services/postgresflex/model_reset_user_password_response.go @@ -0,0 +1,258 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package postgresflex + +import ( + "encoding/json" +) + +// checks if the ResetUserPasswordResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResetUserPasswordResponse{} + +/* + types and functions for name +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResetUserPasswordResponseGetNameAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getResetUserPasswordResponseGetNameAttributeTypeOk(arg ResetUserPasswordResponseGetNameAttributeType) (ret ResetUserPasswordResponseGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setResetUserPasswordResponseGetNameAttributeType(arg *ResetUserPasswordResponseGetNameAttributeType, val ResetUserPasswordResponseGetNameRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResetUserPasswordResponseGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResetUserPasswordResponseGetNameRetType = string + +/* + types and functions for password +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResetUserPasswordResponseGetPasswordAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getResetUserPasswordResponseGetPasswordAttributeTypeOk(arg ResetUserPasswordResponseGetPasswordAttributeType) (ret ResetUserPasswordResponseGetPasswordRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setResetUserPasswordResponseGetPasswordAttributeType(arg *ResetUserPasswordResponseGetPasswordAttributeType, val ResetUserPasswordResponseGetPasswordRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResetUserPasswordResponseGetPasswordArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResetUserPasswordResponseGetPasswordRetType = string + +/* + types and functions for state +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResetUserPasswordResponseGetStateAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getResetUserPasswordResponseGetStateAttributeTypeOk(arg ResetUserPasswordResponseGetStateAttributeType) (ret ResetUserPasswordResponseGetStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setResetUserPasswordResponseGetStateAttributeType(arg *ResetUserPasswordResponseGetStateAttributeType, val ResetUserPasswordResponseGetStateRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResetUserPasswordResponseGetStateArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResetUserPasswordResponseGetStateRetType = string + +// ResetUserPasswordResponse struct for ResetUserPasswordResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResetUserPasswordResponse struct { + // The name of the user. + // REQUIRED + Name ResetUserPasswordResponseGetNameAttributeType `json:"name" required:"true"` + // The password for the user. + // REQUIRED + Password ResetUserPasswordResponseGetPasswordAttributeType `json:"password" required:"true"` + // The current state of the user. + // REQUIRED + State ResetUserPasswordResponseGetStateAttributeType `json:"state" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _ResetUserPasswordResponse ResetUserPasswordResponse + +// NewResetUserPasswordResponse instantiates a new ResetUserPasswordResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewResetUserPasswordResponse(name ResetUserPasswordResponseGetNameArgType, password ResetUserPasswordResponseGetPasswordArgType, state ResetUserPasswordResponseGetStateArgType) *ResetUserPasswordResponse { + this := ResetUserPasswordResponse{} + setResetUserPasswordResponseGetNameAttributeType(&this.Name, name) + setResetUserPasswordResponseGetPasswordAttributeType(&this.Password, password) + setResetUserPasswordResponseGetStateAttributeType(&this.State, state) + return &this +} + +// NewResetUserPasswordResponseWithDefaults instantiates a new ResetUserPasswordResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewResetUserPasswordResponseWithDefaults() *ResetUserPasswordResponse { + this := ResetUserPasswordResponse{} + return &this +} + +// GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResetUserPasswordResponse) GetName() (ret ResetUserPasswordResponseGetNameRetType) { + ret, _ = o.GetNameOk() + return ret +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResetUserPasswordResponse) GetNameOk() (ret ResetUserPasswordResponseGetNameRetType, ok bool) { + return getResetUserPasswordResponseGetNameAttributeTypeOk(o.Name) +} + +// SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResetUserPasswordResponse) SetName(v ResetUserPasswordResponseGetNameRetType) { + setResetUserPasswordResponseGetNameAttributeType(&o.Name, v) +} + +// GetPassword returns the Password field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResetUserPasswordResponse) GetPassword() (ret ResetUserPasswordResponseGetPasswordRetType) { + ret, _ = o.GetPasswordOk() + return ret +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResetUserPasswordResponse) GetPasswordOk() (ret ResetUserPasswordResponseGetPasswordRetType, ok bool) { + return getResetUserPasswordResponseGetPasswordAttributeTypeOk(o.Password) +} + +// SetPassword sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResetUserPasswordResponse) SetPassword(v ResetUserPasswordResponseGetPasswordRetType) { + setResetUserPasswordResponseGetPasswordAttributeType(&o.Password, v) +} + +// GetState returns the State field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResetUserPasswordResponse) GetState() (ret ResetUserPasswordResponseGetStateRetType) { + ret, _ = o.GetStateOk() + return ret +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResetUserPasswordResponse) GetStateOk() (ret ResetUserPasswordResponseGetStateRetType, ok bool) { + return getResetUserPasswordResponseGetStateAttributeTypeOk(o.State) +} + +// SetState sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResetUserPasswordResponse) SetState(v ResetUserPasswordResponseGetStateRetType) { + setResetUserPasswordResponseGetStateAttributeType(&o.State, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o ResetUserPasswordResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getResetUserPasswordResponseGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getResetUserPasswordResponseGetPasswordAttributeTypeOk(o.Password); ok { + toSerialize["Password"] = val + } + if val, ok := getResetUserPasswordResponseGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableResetUserPasswordResponse struct { + value *ResetUserPasswordResponse + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableResetUserPasswordResponse) Get() *ResetUserPasswordResponse { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableResetUserPasswordResponse) Set(val *ResetUserPasswordResponse) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableResetUserPasswordResponse) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableResetUserPasswordResponse) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableResetUserPasswordResponse(val *ResetUserPasswordResponse) *NullableResetUserPasswordResponse { + return &NullableResetUserPasswordResponse{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableResetUserPasswordResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableResetUserPasswordResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/model_reset_user_password_response_test.go b/services/postgresflex/model_reset_user_password_response_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_reset_user_password_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_reset_user_response_test.go b/services/postgresflex/model_reset_user_response_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_reset_user_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_state.go b/services/postgresflex/model_state.go new file mode 100644 index 000000000..abd0b1f17 --- /dev/null +++ b/services/postgresflex/model_state.go @@ -0,0 +1,144 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package postgresflex + +import ( + "encoding/json" + "fmt" +) + +// State The current state of the instance. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type State string + +// List of state +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + STATE_READY State = "READY" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + STATE_PENDING State = "PENDING" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + STATE_PROGRESSING State = "PROGRESSING" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + STATE_FAILURE State = "FAILURE" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + STATE_UNKNOWN State = "UNKNOWN" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + STATE_TERMINATING State = "TERMINATING" +) + +// All allowed values of State enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedStateEnumValues = []State{ + "READY", + "PENDING", + "PROGRESSING", + "FAILURE", + "UNKNOWN", + "TERMINATING", +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *State) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue string + if value == zeroValue { + return nil + } + enumTypeValue := State(value) + for _, existing := range AllowedStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid State", value) +} + +// NewStateFromValue returns a pointer to a valid State +// for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewStateFromValue(v string) (*State, error) { + ev := State(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for State: valid values are %v", v, AllowedStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v State) IsValid() bool { + for _, existing := range AllowedStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to state value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v State) Ptr() *State { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableState struct { + value *State + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableState) Get() *State { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableState) Set(val *State) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableState) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableState) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableState(val *State) *NullableState { + return &NullableState{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/model_state_test.go b/services/postgresflex/model_state_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_state_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_storage.go b/services/postgresflex/model_storage.go index 33922e5b1..cdfb4751a 100644 --- a/services/postgresflex/model_storage.go +++ b/services/postgresflex/model_storage.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -72,11 +72,13 @@ func setStorageGetSizeAttributeType(arg *StorageGetSizeAttributeType, val Storag *arg = &val } -// Storage struct for Storage +// Storage The object containing information about the storage size and class. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Storage struct { + // The storage class for the storage. Class StorageGetClassAttributeType `json:"class,omitempty"` - Size StorageGetSizeAttributeType `json:"size,omitempty"` + // The storage size in Gigabytes. + Size StorageGetSizeAttributeType `json:"size,omitempty"` } // NewStorage instantiates a new Storage object diff --git a/services/postgresflex/model_storage_range.go b/services/postgresflex/model_storage_create.go similarity index 56% rename from services/postgresflex/model_storage_range.go rename to services/postgresflex/model_storage_create.go index 6bc2fe6a1..eac3db97e 100644 --- a/services/postgresflex/model_storage_range.go +++ b/services/postgresflex/model_storage_create.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,25 +15,19 @@ import ( "encoding/json" ) -// checks if the StorageRange type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &StorageRange{} +// checks if the StorageCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StorageCreate{} /* - types and functions for max + types and functions for class */ -// isLong -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type StorageRangeGetMaxAttributeType = *int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type StorageRangeGetMaxArgType = int64 - +// isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type StorageRangeGetMaxRetType = int64 +type StorageCreateGetClassAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getStorageRangeGetMaxAttributeTypeOk(arg StorageRangeGetMaxAttributeType) (ret StorageRangeGetMaxRetType, ok bool) { +func getStorageCreateGetClassAttributeTypeOk(arg StorageCreateGetClassAttributeType) (ret StorageCreateGetClassRetType, ok bool) { if arg == nil { return ret, false } @@ -41,26 +35,32 @@ func getStorageRangeGetMaxAttributeTypeOk(arg StorageRangeGetMaxAttributeType) ( } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setStorageRangeGetMaxAttributeType(arg *StorageRangeGetMaxAttributeType, val StorageRangeGetMaxRetType) { +func setStorageCreateGetClassAttributeType(arg *StorageCreateGetClassAttributeType, val StorageCreateGetClassRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type StorageCreateGetClassArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type StorageCreateGetClassRetType = string + /* - types and functions for min + types and functions for size */ // isLong // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type StorageRangeGetMinAttributeType = *int64 +type StorageCreateGetSizeAttributeType = *int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type StorageRangeGetMinArgType = int64 +type StorageCreateGetSizeArgType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type StorageRangeGetMinRetType = int64 +type StorageCreateGetSizeRetType = int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getStorageRangeGetMinAttributeTypeOk(arg StorageRangeGetMinAttributeType) (ret StorageRangeGetMinRetType, ok bool) { +func getStorageCreateGetSizeAttributeTypeOk(arg StorageCreateGetSizeAttributeType) (ret StorageCreateGetSizeRetType, ok bool) { if arg == nil { return ret, false } @@ -68,142 +68,142 @@ func getStorageRangeGetMinAttributeTypeOk(arg StorageRangeGetMinAttributeType) ( } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setStorageRangeGetMinAttributeType(arg *StorageRangeGetMinAttributeType, val StorageRangeGetMinRetType) { +func setStorageCreateGetSizeAttributeType(arg *StorageCreateGetSizeAttributeType, val StorageCreateGetSizeRetType) { *arg = &val } -// StorageRange struct for StorageRange +// StorageCreate The object containing information about the storage size and class. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type StorageRange struct { - Max StorageRangeGetMaxAttributeType `json:"max,omitempty"` - Min StorageRangeGetMinAttributeType `json:"min,omitempty"` +type StorageCreate struct { + // The storage class for the storage. + Class StorageCreateGetClassAttributeType `json:"class,omitempty"` + // The storage size in Gigabytes. + // REQUIRED + Size StorageCreateGetSizeAttributeType `json:"size" required:"true"` } -// NewStorageRange instantiates a new StorageRange object +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _StorageCreate StorageCreate + +// NewStorageCreate instantiates a new StorageCreate object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewStorageRange() *StorageRange { - this := StorageRange{} +func NewStorageCreate(size StorageCreateGetSizeArgType) *StorageCreate { + this := StorageCreate{} + setStorageCreateGetSizeAttributeType(&this.Size, size) return &this } -// NewStorageRangeWithDefaults instantiates a new StorageRange object +// NewStorageCreateWithDefaults instantiates a new StorageCreate object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewStorageRangeWithDefaults() *StorageRange { - this := StorageRange{} +func NewStorageCreateWithDefaults() *StorageCreate { + this := StorageCreate{} return &this } -// GetMax returns the Max field value if set, zero value otherwise. +// GetClass returns the Class field value if set, zero value otherwise. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *StorageRange) GetMax() (res StorageRangeGetMaxRetType) { - res, _ = o.GetMaxOk() +func (o *StorageCreate) GetClass() (res StorageCreateGetClassRetType) { + res, _ = o.GetClassOk() return } -// GetMaxOk returns a tuple with the Max field value if set, nil otherwise +// GetClassOk returns a tuple with the Class field value if set, nil otherwise // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *StorageRange) GetMaxOk() (ret StorageRangeGetMaxRetType, ok bool) { - return getStorageRangeGetMaxAttributeTypeOk(o.Max) +func (o *StorageCreate) GetClassOk() (ret StorageCreateGetClassRetType, ok bool) { + return getStorageCreateGetClassAttributeTypeOk(o.Class) } -// HasMax returns a boolean if a field has been set. +// HasClass returns a boolean if a field has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *StorageRange) HasMax() bool { - _, ok := o.GetMaxOk() +func (o *StorageCreate) HasClass() bool { + _, ok := o.GetClassOk() return ok } -// SetMax gets a reference to the given int64 and assigns it to the Max field. +// SetClass gets a reference to the given string and assigns it to the Class field. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *StorageRange) SetMax(v StorageRangeGetMaxRetType) { - setStorageRangeGetMaxAttributeType(&o.Max, v) +func (o *StorageCreate) SetClass(v StorageCreateGetClassRetType) { + setStorageCreateGetClassAttributeType(&o.Class, v) } -// GetMin returns the Min field value if set, zero value otherwise. +// GetSize returns the Size field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *StorageRange) GetMin() (res StorageRangeGetMinRetType) { - res, _ = o.GetMinOk() - return +func (o *StorageCreate) GetSize() (ret StorageCreateGetSizeRetType) { + ret, _ = o.GetSizeOk() + return ret } -// GetMinOk returns a tuple with the Min field value if set, nil otherwise +// GetSizeOk returns a tuple with the Size field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *StorageRange) GetMinOk() (ret StorageRangeGetMinRetType, ok bool) { - return getStorageRangeGetMinAttributeTypeOk(o.Min) -} - -// HasMin returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *StorageRange) HasMin() bool { - _, ok := o.GetMinOk() - return ok +func (o *StorageCreate) GetSizeOk() (ret StorageCreateGetSizeRetType, ok bool) { + return getStorageCreateGetSizeAttributeTypeOk(o.Size) } -// SetMin gets a reference to the given int64 and assigns it to the Min field. +// SetSize sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *StorageRange) SetMin(v StorageRangeGetMinRetType) { - setStorageRangeGetMinAttributeType(&o.Min, v) +func (o *StorageCreate) SetSize(v StorageCreateGetSizeRetType) { + setStorageCreateGetSizeAttributeType(&o.Size, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o StorageRange) ToMap() (map[string]interface{}, error) { +func (o StorageCreate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getStorageRangeGetMaxAttributeTypeOk(o.Max); ok { - toSerialize["Max"] = val + if val, ok := getStorageCreateGetClassAttributeTypeOk(o.Class); ok { + toSerialize["Class"] = val } - if val, ok := getStorageRangeGetMinAttributeTypeOk(o.Min); ok { - toSerialize["Min"] = val + if val, ok := getStorageCreateGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableStorageRange struct { - value *StorageRange +type NullableStorageCreate struct { + value *StorageCreate isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableStorageRange) Get() *StorageRange { +func (v NullableStorageCreate) Get() *StorageCreate { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableStorageRange) Set(val *StorageRange) { +func (v *NullableStorageCreate) Set(val *StorageCreate) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableStorageRange) IsSet() bool { +func (v NullableStorageCreate) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableStorageRange) Unset() { +func (v *NullableStorageCreate) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableStorageRange(val *StorageRange) *NullableStorageRange { - return &NullableStorageRange{value: val, isSet: true} +func NewNullableStorageCreate(val *StorageCreate) *NullableStorageCreate { + return &NullableStorageCreate{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableStorageRange) MarshalJSON() ([]byte, error) { +func (v NullableStorageCreate) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableStorageRange) UnmarshalJSON(src []byte) error { +func (v *NullableStorageCreate) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_storage_create_test.go b/services/postgresflex/model_storage_create_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_storage_create_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_storage_range_test.go b/services/postgresflex/model_storage_range_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_storage_range_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_storage_test.go b/services/postgresflex/model_storage_test.go index 51f50494d..74a76f10e 100644 --- a/services/postgresflex/model_storage_test.go +++ b/services/postgresflex/model_storage_test.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_storage_update.go b/services/postgresflex/model_storage_update.go index ac676e41f..ed2e1fd58 100644 --- a/services/postgresflex/model_storage_update.go +++ b/services/postgresflex/model_storage_update.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,33 +18,6 @@ import ( // checks if the StorageUpdate type satisfies the MappedNullable interface at compile time var _ MappedNullable = &StorageUpdate{} -/* - types and functions for class -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type StorageUpdateGetClassAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getStorageUpdateGetClassAttributeTypeOk(arg StorageUpdateGetClassAttributeType) (ret StorageUpdateGetClassRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setStorageUpdateGetClassAttributeType(arg *StorageUpdateGetClassAttributeType, val StorageUpdateGetClassRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type StorageUpdateGetClassArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type StorageUpdateGetClassRetType = string - /* types and functions for size */ @@ -72,12 +45,11 @@ func setStorageUpdateGetSizeAttributeType(arg *StorageUpdateGetSizeAttributeType *arg = &val } -// StorageUpdate struct for StorageUpdate +// StorageUpdate The object containing information about the storage size and class. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StorageUpdate struct { - // Deprecated: ⚠️ **DEPRECATED AND NON-FUNCTIONAL:** Updating the performance class field is not possible. - Class StorageUpdateGetClassAttributeType `json:"class,omitempty"` - Size StorageUpdateGetSizeAttributeType `json:"size,omitempty"` + // The storage size in Gigabytes. + Size StorageUpdateGetSizeAttributeType `json:"size,omitempty"` } // NewStorageUpdate instantiates a new StorageUpdate object @@ -99,33 +71,6 @@ func NewStorageUpdateWithDefaults() *StorageUpdate { return &this } -// GetClass returns the Class field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *StorageUpdate) GetClass() (res StorageUpdateGetClassRetType) { - res, _ = o.GetClassOk() - return -} - -// GetClassOk returns a tuple with the Class field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *StorageUpdate) GetClassOk() (ret StorageUpdateGetClassRetType, ok bool) { - return getStorageUpdateGetClassAttributeTypeOk(o.Class) -} - -// HasClass returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *StorageUpdate) HasClass() bool { - _, ok := o.GetClassOk() - return ok -} - -// SetClass gets a reference to the given string and assigns it to the Class field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *StorageUpdate) SetClass(v StorageUpdateGetClassRetType) { - setStorageUpdateGetClassAttributeType(&o.Class, v) -} - // GetSize returns the Size field value if set, zero value otherwise. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StorageUpdate) GetSize() (res StorageUpdateGetSizeRetType) { @@ -156,9 +101,6 @@ func (o *StorageUpdate) SetSize(v StorageUpdateGetSizeRetType) { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o StorageUpdate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getStorageUpdateGetClassAttributeTypeOk(o.Class); ok { - toSerialize["Class"] = val - } if val, ok := getStorageUpdateGetSizeAttributeTypeOk(o.Size); ok { toSerialize["Size"] = val } diff --git a/services/postgresflex/model_storage_update_test.go b/services/postgresflex/model_storage_update_test.go index 51f50494d..74a76f10e 100644 --- a/services/postgresflex/model_storage_update_test.go +++ b/services/postgresflex/model_storage_update_test.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_update_backup_schedule_payload_test.go b/services/postgresflex/model_update_backup_schedule_payload_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_update_backup_schedule_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_extensions_extension_list_response.go b/services/postgresflex/model_update_database_partially_response.go similarity index 52% rename from services/postgresflex/model_extensions_extension_list_response.go rename to services/postgresflex/model_update_database_partially_response.go index 607481349..6d65aac28 100644 --- a/services/postgresflex/model_extensions_extension_list_response.go +++ b/services/postgresflex/model_update_database_partially_response.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,25 +15,25 @@ import ( "encoding/json" ) -// checks if the ExtensionsExtensionListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ExtensionsExtensionListResponse{} +// checks if the UpdateDatabasePartiallyResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateDatabasePartiallyResponse{} /* - types and functions for list + types and functions for database */ -// isArray +// isModel // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ExtensionsExtensionListResponseGetListAttributeType = *[]ApiExtensionList +type UpdateDatabasePartiallyResponseGetDatabaseAttributeType = *ListDatabase // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ExtensionsExtensionListResponseGetListArgType = []ApiExtensionList +type UpdateDatabasePartiallyResponseGetDatabaseArgType = ListDatabase // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ExtensionsExtensionListResponseGetListRetType = []ApiExtensionList +type UpdateDatabasePartiallyResponseGetDatabaseRetType = ListDatabase // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getExtensionsExtensionListResponseGetListAttributeTypeOk(arg ExtensionsExtensionListResponseGetListAttributeType) (ret ExtensionsExtensionListResponseGetListRetType, ok bool) { +func getUpdateDatabasePartiallyResponseGetDatabaseAttributeTypeOk(arg UpdateDatabasePartiallyResponseGetDatabaseAttributeType) (ret UpdateDatabasePartiallyResponseGetDatabaseRetType, ok bool) { if arg == nil { return ret, false } @@ -41,111 +41,109 @@ func getExtensionsExtensionListResponseGetListAttributeTypeOk(arg ExtensionsExte } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setExtensionsExtensionListResponseGetListAttributeType(arg *ExtensionsExtensionListResponseGetListAttributeType, val ExtensionsExtensionListResponseGetListRetType) { +func setUpdateDatabasePartiallyResponseGetDatabaseAttributeType(arg *UpdateDatabasePartiallyResponseGetDatabaseAttributeType, val UpdateDatabasePartiallyResponseGetDatabaseRetType) { *arg = &val } -// ExtensionsExtensionListResponse struct for ExtensionsExtensionListResponse +// UpdateDatabasePartiallyResponse struct for UpdateDatabasePartiallyResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ExtensionsExtensionListResponse struct { - List ExtensionsExtensionListResponseGetListAttributeType `json:"list,omitempty"` +type UpdateDatabasePartiallyResponse struct { + // REQUIRED + Database UpdateDatabasePartiallyResponseGetDatabaseAttributeType `json:"database" required:"true"` } -// NewExtensionsExtensionListResponse instantiates a new ExtensionsExtensionListResponse object +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _UpdateDatabasePartiallyResponse UpdateDatabasePartiallyResponse + +// NewUpdateDatabasePartiallyResponse instantiates a new UpdateDatabasePartiallyResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewExtensionsExtensionListResponse() *ExtensionsExtensionListResponse { - this := ExtensionsExtensionListResponse{} +func NewUpdateDatabasePartiallyResponse(database UpdateDatabasePartiallyResponseGetDatabaseArgType) *UpdateDatabasePartiallyResponse { + this := UpdateDatabasePartiallyResponse{} + setUpdateDatabasePartiallyResponseGetDatabaseAttributeType(&this.Database, database) return &this } -// NewExtensionsExtensionListResponseWithDefaults instantiates a new ExtensionsExtensionListResponse object +// NewUpdateDatabasePartiallyResponseWithDefaults instantiates a new UpdateDatabasePartiallyResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewExtensionsExtensionListResponseWithDefaults() *ExtensionsExtensionListResponse { - this := ExtensionsExtensionListResponse{} +func NewUpdateDatabasePartiallyResponseWithDefaults() *UpdateDatabasePartiallyResponse { + this := UpdateDatabasePartiallyResponse{} return &this } -// GetList returns the List field value if set, zero value otherwise. +// GetDatabase returns the Database field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ExtensionsExtensionListResponse) GetList() (res ExtensionsExtensionListResponseGetListRetType) { - res, _ = o.GetListOk() - return +func (o *UpdateDatabasePartiallyResponse) GetDatabase() (ret UpdateDatabasePartiallyResponseGetDatabaseRetType) { + ret, _ = o.GetDatabaseOk() + return ret } -// GetListOk returns a tuple with the List field value if set, nil otherwise +// GetDatabaseOk returns a tuple with the Database field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ExtensionsExtensionListResponse) GetListOk() (ret ExtensionsExtensionListResponseGetListRetType, ok bool) { - return getExtensionsExtensionListResponseGetListAttributeTypeOk(o.List) -} - -// HasList returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ExtensionsExtensionListResponse) HasList() bool { - _, ok := o.GetListOk() - return ok +func (o *UpdateDatabasePartiallyResponse) GetDatabaseOk() (ret UpdateDatabasePartiallyResponseGetDatabaseRetType, ok bool) { + return getUpdateDatabasePartiallyResponseGetDatabaseAttributeTypeOk(o.Database) } -// SetList gets a reference to the given []ApiExtensionList and assigns it to the List field. +// SetDatabase sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ExtensionsExtensionListResponse) SetList(v ExtensionsExtensionListResponseGetListRetType) { - setExtensionsExtensionListResponseGetListAttributeType(&o.List, v) +func (o *UpdateDatabasePartiallyResponse) SetDatabase(v UpdateDatabasePartiallyResponseGetDatabaseRetType) { + setUpdateDatabasePartiallyResponseGetDatabaseAttributeType(&o.Database, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o ExtensionsExtensionListResponse) ToMap() (map[string]interface{}, error) { +func (o UpdateDatabasePartiallyResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getExtensionsExtensionListResponseGetListAttributeTypeOk(o.List); ok { - toSerialize["List"] = val + if val, ok := getUpdateDatabasePartiallyResponseGetDatabaseAttributeTypeOk(o.Database); ok { + toSerialize["Database"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableExtensionsExtensionListResponse struct { - value *ExtensionsExtensionListResponse +type NullableUpdateDatabasePartiallyResponse struct { + value *UpdateDatabasePartiallyResponse isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableExtensionsExtensionListResponse) Get() *ExtensionsExtensionListResponse { +func (v NullableUpdateDatabasePartiallyResponse) Get() *UpdateDatabasePartiallyResponse { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableExtensionsExtensionListResponse) Set(val *ExtensionsExtensionListResponse) { +func (v *NullableUpdateDatabasePartiallyResponse) Set(val *UpdateDatabasePartiallyResponse) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableExtensionsExtensionListResponse) IsSet() bool { +func (v NullableUpdateDatabasePartiallyResponse) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableExtensionsExtensionListResponse) Unset() { +func (v *NullableUpdateDatabasePartiallyResponse) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableExtensionsExtensionListResponse(val *ExtensionsExtensionListResponse) *NullableExtensionsExtensionListResponse { - return &NullableExtensionsExtensionListResponse{value: val, isSet: true} +func NewNullableUpdateDatabasePartiallyResponse(val *UpdateDatabasePartiallyResponse) *NullableUpdateDatabasePartiallyResponse { + return &NullableUpdateDatabasePartiallyResponse{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableExtensionsExtensionListResponse) MarshalJSON() ([]byte, error) { +func (v NullableUpdateDatabasePartiallyResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableExtensionsExtensionListResponse) UnmarshalJSON(src []byte) error { +func (v *NullableUpdateDatabasePartiallyResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_update_database_partially_response_test.go b/services/postgresflex/model_update_database_partially_response_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_update_database_partially_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_api_configuration.go b/services/postgresflex/model_update_database_payload.go similarity index 54% rename from services/postgresflex/model_api_configuration.go rename to services/postgresflex/model_update_database_payload.go index 5885b94eb..50a652546 100644 --- a/services/postgresflex/model_api_configuration.go +++ b/services/postgresflex/model_update_database_payload.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,8 +15,8 @@ import ( "encoding/json" ) -// checks if the ApiConfiguration type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ApiConfiguration{} +// checks if the UpdateDatabasePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateDatabasePayload{} /* types and functions for name @@ -24,10 +24,10 @@ var _ MappedNullable = &ApiConfiguration{} // isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiConfigurationGetNameAttributeType = *string +type UpdateDatabasePayloadGetNameAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getApiConfigurationGetNameAttributeTypeOk(arg ApiConfigurationGetNameAttributeType) (ret ApiConfigurationGetNameRetType, ok bool) { +func getUpdateDatabasePayloadGetNameAttributeTypeOk(arg UpdateDatabasePayloadGetNameAttributeType) (ret UpdateDatabasePayloadGetNameRetType, ok bool) { if arg == nil { return ret, false } @@ -35,26 +35,26 @@ func getApiConfigurationGetNameAttributeTypeOk(arg ApiConfigurationGetNameAttrib } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setApiConfigurationGetNameAttributeType(arg *ApiConfigurationGetNameAttributeType, val ApiConfigurationGetNameRetType) { +func setUpdateDatabasePayloadGetNameAttributeType(arg *UpdateDatabasePayloadGetNameAttributeType, val UpdateDatabasePayloadGetNameRetType) { *arg = &val } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiConfigurationGetNameArgType = string +type UpdateDatabasePayloadGetNameArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiConfigurationGetNameRetType = string +type UpdateDatabasePayloadGetNameRetType = string /* - types and functions for setting + types and functions for owner */ // isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiConfigurationGetSettingAttributeType = *string +type UpdateDatabasePayloadGetOwnerAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getApiConfigurationGetSettingAttributeTypeOk(arg ApiConfigurationGetSettingAttributeType) (ret ApiConfigurationGetSettingRetType, ok bool) { +func getUpdateDatabasePayloadGetOwnerAttributeTypeOk(arg UpdateDatabasePayloadGetOwnerAttributeType) (ret UpdateDatabasePayloadGetOwnerRetType, ok bool) { if arg == nil { return ret, false } @@ -62,148 +62,143 @@ func getApiConfigurationGetSettingAttributeTypeOk(arg ApiConfigurationGetSetting } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setApiConfigurationGetSettingAttributeType(arg *ApiConfigurationGetSettingAttributeType, val ApiConfigurationGetSettingRetType) { +func setUpdateDatabasePayloadGetOwnerAttributeType(arg *UpdateDatabasePayloadGetOwnerAttributeType, val UpdateDatabasePayloadGetOwnerRetType) { *arg = &val } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiConfigurationGetSettingArgType = string +type UpdateDatabasePayloadGetOwnerArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiConfigurationGetSettingRetType = string +type UpdateDatabasePayloadGetOwnerRetType = string -// ApiConfiguration struct for ApiConfiguration +// UpdateDatabasePayload struct for UpdateDatabasePayload // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiConfiguration struct { - Name ApiConfigurationGetNameAttributeType `json:"name,omitempty"` - Setting ApiConfigurationGetSettingAttributeType `json:"setting,omitempty"` +type UpdateDatabasePayload struct { + // The name of the database. + // REQUIRED + Name UpdateDatabasePayloadGetNameAttributeType `json:"name" required:"true"` + // The owner of the database. + // REQUIRED + Owner UpdateDatabasePayloadGetOwnerAttributeType `json:"owner" required:"true"` } -// NewApiConfiguration instantiates a new ApiConfiguration object +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _UpdateDatabasePayload UpdateDatabasePayload + +// NewUpdateDatabasePayload instantiates a new UpdateDatabasePayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewApiConfiguration() *ApiConfiguration { - this := ApiConfiguration{} +func NewUpdateDatabasePayload(name UpdateDatabasePayloadGetNameArgType, owner UpdateDatabasePayloadGetOwnerArgType) *UpdateDatabasePayload { + this := UpdateDatabasePayload{} + setUpdateDatabasePayloadGetNameAttributeType(&this.Name, name) + setUpdateDatabasePayloadGetOwnerAttributeType(&this.Owner, owner) return &this } -// NewApiConfigurationWithDefaults instantiates a new ApiConfiguration object +// NewUpdateDatabasePayloadWithDefaults instantiates a new UpdateDatabasePayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewApiConfigurationWithDefaults() *ApiConfiguration { - this := ApiConfiguration{} +func NewUpdateDatabasePayloadWithDefaults() *UpdateDatabasePayload { + this := UpdateDatabasePayload{} return &this } -// GetName returns the Name field value if set, zero value otherwise. +// GetName returns the Name field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiConfiguration) GetName() (res ApiConfigurationGetNameRetType) { - res, _ = o.GetNameOk() - return +func (o *UpdateDatabasePayload) GetName() (ret UpdateDatabasePayloadGetNameRetType) { + ret, _ = o.GetNameOk() + return ret } -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiConfiguration) GetNameOk() (ret ApiConfigurationGetNameRetType, ok bool) { - return getApiConfigurationGetNameAttributeTypeOk(o.Name) -} - -// HasName returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiConfiguration) HasName() bool { - _, ok := o.GetNameOk() - return ok +func (o *UpdateDatabasePayload) GetNameOk() (ret UpdateDatabasePayloadGetNameRetType, ok bool) { + return getUpdateDatabasePayloadGetNameAttributeTypeOk(o.Name) } -// SetName gets a reference to the given string and assigns it to the Name field. +// SetName sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiConfiguration) SetName(v ApiConfigurationGetNameRetType) { - setApiConfigurationGetNameAttributeType(&o.Name, v) +func (o *UpdateDatabasePayload) SetName(v UpdateDatabasePayloadGetNameRetType) { + setUpdateDatabasePayloadGetNameAttributeType(&o.Name, v) } -// GetSetting returns the Setting field value if set, zero value otherwise. +// GetOwner returns the Owner field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiConfiguration) GetSetting() (res ApiConfigurationGetSettingRetType) { - res, _ = o.GetSettingOk() - return +func (o *UpdateDatabasePayload) GetOwner() (ret UpdateDatabasePayloadGetOwnerRetType) { + ret, _ = o.GetOwnerOk() + return ret } -// GetSettingOk returns a tuple with the Setting field value if set, nil otherwise +// GetOwnerOk returns a tuple with the Owner field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiConfiguration) GetSettingOk() (ret ApiConfigurationGetSettingRetType, ok bool) { - return getApiConfigurationGetSettingAttributeTypeOk(o.Setting) -} - -// HasSetting returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiConfiguration) HasSetting() bool { - _, ok := o.GetSettingOk() - return ok +func (o *UpdateDatabasePayload) GetOwnerOk() (ret UpdateDatabasePayloadGetOwnerRetType, ok bool) { + return getUpdateDatabasePayloadGetOwnerAttributeTypeOk(o.Owner) } -// SetSetting gets a reference to the given string and assigns it to the Setting field. +// SetOwner sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiConfiguration) SetSetting(v ApiConfigurationGetSettingRetType) { - setApiConfigurationGetSettingAttributeType(&o.Setting, v) +func (o *UpdateDatabasePayload) SetOwner(v UpdateDatabasePayloadGetOwnerRetType) { + setUpdateDatabasePayloadGetOwnerAttributeType(&o.Owner, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o ApiConfiguration) ToMap() (map[string]interface{}, error) { +func (o UpdateDatabasePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getApiConfigurationGetNameAttributeTypeOk(o.Name); ok { + if val, ok := getUpdateDatabasePayloadGetNameAttributeTypeOk(o.Name); ok { toSerialize["Name"] = val } - if val, ok := getApiConfigurationGetSettingAttributeTypeOk(o.Setting); ok { - toSerialize["Setting"] = val + if val, ok := getUpdateDatabasePayloadGetOwnerAttributeTypeOk(o.Owner); ok { + toSerialize["Owner"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableApiConfiguration struct { - value *ApiConfiguration +type NullableUpdateDatabasePayload struct { + value *UpdateDatabasePayload isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiConfiguration) Get() *ApiConfiguration { +func (v NullableUpdateDatabasePayload) Get() *UpdateDatabasePayload { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiConfiguration) Set(val *ApiConfiguration) { +func (v *NullableUpdateDatabasePayload) Set(val *UpdateDatabasePayload) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiConfiguration) IsSet() bool { +func (v NullableUpdateDatabasePayload) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiConfiguration) Unset() { +func (v *NullableUpdateDatabasePayload) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableApiConfiguration(val *ApiConfiguration) *NullableApiConfiguration { - return &NullableApiConfiguration{value: val, isSet: true} +func NewNullableUpdateDatabasePayload(val *UpdateDatabasePayload) *NullableUpdateDatabasePayload { + return &NullableUpdateDatabasePayload{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiConfiguration) MarshalJSON() ([]byte, error) { +func (v NullableUpdateDatabasePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiConfiguration) UnmarshalJSON(src []byte) error { +func (v *NullableUpdateDatabasePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_update_database_payload_test.go b/services/postgresflex/model_update_database_payload_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_update_database_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_update_database_response.go b/services/postgresflex/model_update_database_response.go new file mode 100644 index 000000000..b658472ec --- /dev/null +++ b/services/postgresflex/model_update_database_response.go @@ -0,0 +1,149 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package postgresflex + +import ( + "encoding/json" +) + +// checks if the UpdateDatabaseResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateDatabaseResponse{} + +/* + types and functions for database +*/ + +// isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UpdateDatabaseResponseGetDatabaseAttributeType = *ListDatabase + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UpdateDatabaseResponseGetDatabaseArgType = ListDatabase + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UpdateDatabaseResponseGetDatabaseRetType = ListDatabase + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getUpdateDatabaseResponseGetDatabaseAttributeTypeOk(arg UpdateDatabaseResponseGetDatabaseAttributeType) (ret UpdateDatabaseResponseGetDatabaseRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setUpdateDatabaseResponseGetDatabaseAttributeType(arg *UpdateDatabaseResponseGetDatabaseAttributeType, val UpdateDatabaseResponseGetDatabaseRetType) { + *arg = &val +} + +// UpdateDatabaseResponse struct for UpdateDatabaseResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UpdateDatabaseResponse struct { + // REQUIRED + Database UpdateDatabaseResponseGetDatabaseAttributeType `json:"database" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _UpdateDatabaseResponse UpdateDatabaseResponse + +// NewUpdateDatabaseResponse instantiates a new UpdateDatabaseResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewUpdateDatabaseResponse(database UpdateDatabaseResponseGetDatabaseArgType) *UpdateDatabaseResponse { + this := UpdateDatabaseResponse{} + setUpdateDatabaseResponseGetDatabaseAttributeType(&this.Database, database) + return &this +} + +// NewUpdateDatabaseResponseWithDefaults instantiates a new UpdateDatabaseResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewUpdateDatabaseResponseWithDefaults() *UpdateDatabaseResponse { + this := UpdateDatabaseResponse{} + return &this +} + +// GetDatabase returns the Database field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UpdateDatabaseResponse) GetDatabase() (ret UpdateDatabaseResponseGetDatabaseRetType) { + ret, _ = o.GetDatabaseOk() + return ret +} + +// GetDatabaseOk returns a tuple with the Database field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UpdateDatabaseResponse) GetDatabaseOk() (ret UpdateDatabaseResponseGetDatabaseRetType, ok bool) { + return getUpdateDatabaseResponseGetDatabaseAttributeTypeOk(o.Database) +} + +// SetDatabase sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UpdateDatabaseResponse) SetDatabase(v UpdateDatabaseResponseGetDatabaseRetType) { + setUpdateDatabaseResponseGetDatabaseAttributeType(&o.Database, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o UpdateDatabaseResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getUpdateDatabaseResponseGetDatabaseAttributeTypeOk(o.Database); ok { + toSerialize["Database"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableUpdateDatabaseResponse struct { + value *UpdateDatabaseResponse + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableUpdateDatabaseResponse) Get() *UpdateDatabaseResponse { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableUpdateDatabaseResponse) Set(val *UpdateDatabaseResponse) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableUpdateDatabaseResponse) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableUpdateDatabaseResponse) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableUpdateDatabaseResponse(val *UpdateDatabaseResponse) *NullableUpdateDatabaseResponse { + return &NullableUpdateDatabaseResponse{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableUpdateDatabaseResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableUpdateDatabaseResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/model_update_database_response_test.go b/services/postgresflex/model_update_database_response_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_update_database_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_update_instance_payload.go b/services/postgresflex/model_update_instance_payload.go index 060c694d2..f1e7b3e04 100644 --- a/services/postgresflex/model_update_instance_payload.go +++ b/services/postgresflex/model_update_instance_payload.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -18,33 +18,6 @@ import ( // checks if the UpdateInstancePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateInstancePayload{} -/* - types and functions for acl -*/ - -// isModel -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstancePayloadGetAclAttributeType = *ACL - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstancePayloadGetAclArgType = ACL - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstancePayloadGetAclRetType = ACL - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUpdateInstancePayloadGetAclAttributeTypeOk(arg UpdateInstancePayloadGetAclAttributeType) (ret UpdateInstancePayloadGetAclRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setUpdateInstancePayloadGetAclAttributeType(arg *UpdateInstancePayloadGetAclAttributeType, val UpdateInstancePayloadGetAclRetType) { - *arg = &val -} - /* types and functions for backupSchedule */ @@ -154,21 +127,21 @@ type UpdateInstancePayloadGetNameArgType = string type UpdateInstancePayloadGetNameRetType = string /* - types and functions for options + types and functions for network */ -// isContainer +// isModel // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstancePayloadGetOptionsAttributeType = *map[string]string +type UpdateInstancePayloadGetNetworkAttributeType = *InstanceNetworkUpdate // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstancePayloadGetOptionsArgType = map[string]string +type UpdateInstancePayloadGetNetworkArgType = InstanceNetworkUpdate // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstancePayloadGetOptionsRetType = map[string]string +type UpdateInstancePayloadGetNetworkRetType = InstanceNetworkUpdate // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUpdateInstancePayloadGetOptionsAttributeTypeOk(arg UpdateInstancePayloadGetOptionsAttributeType) (ret UpdateInstancePayloadGetOptionsRetType, ok bool) { +func getUpdateInstancePayloadGetNetworkAttributeTypeOk(arg UpdateInstancePayloadGetNetworkAttributeType) (ret UpdateInstancePayloadGetNetworkRetType, ok bool) { if arg == nil { return ret, false } @@ -176,35 +149,35 @@ func getUpdateInstancePayloadGetOptionsAttributeTypeOk(arg UpdateInstancePayload } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setUpdateInstancePayloadGetOptionsAttributeType(arg *UpdateInstancePayloadGetOptionsAttributeType, val UpdateInstancePayloadGetOptionsRetType) { +func setUpdateInstancePayloadGetNetworkAttributeType(arg *UpdateInstancePayloadGetNetworkAttributeType, val UpdateInstancePayloadGetNetworkRetType) { *arg = &val } /* - types and functions for replicas + types and functions for retentionDays */ // isInteger // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstancePayloadGetReplicasAttributeType = *int64 +type UpdateInstancePayloadGetRetentionDaysAttributeType = *int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstancePayloadGetReplicasArgType = int64 +type UpdateInstancePayloadGetRetentionDaysArgType = *int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstancePayloadGetReplicasRetType = int64 +type UpdateInstancePayloadGetRetentionDaysRetType = *int64 // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUpdateInstancePayloadGetReplicasAttributeTypeOk(arg UpdateInstancePayloadGetReplicasAttributeType) (ret UpdateInstancePayloadGetReplicasRetType, ok bool) { +func getUpdateInstancePayloadGetRetentionDaysAttributeTypeOk(arg UpdateInstancePayloadGetRetentionDaysAttributeType) (ret UpdateInstancePayloadGetRetentionDaysRetType, ok bool) { if arg == nil { - return ret, false + return nil, false } - return *arg, true + return arg, true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setUpdateInstancePayloadGetReplicasAttributeType(arg *UpdateInstancePayloadGetReplicasAttributeType, val UpdateInstancePayloadGetReplicasRetType) { - *arg = &val +func setUpdateInstancePayloadGetRetentionDaysAttributeType(arg *UpdateInstancePayloadGetRetentionDaysAttributeType, val UpdateInstancePayloadGetRetentionDaysRetType) { + *arg = val } /* @@ -264,26 +237,47 @@ type UpdateInstancePayloadGetVersionRetType = string // UpdateInstancePayload struct for UpdateInstancePayload // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateInstancePayload struct { - Acl UpdateInstancePayloadGetAclAttributeType `json:"acl,omitempty"` - BackupSchedule UpdateInstancePayloadGetBackupScheduleAttributeType `json:"backupSchedule,omitempty"` - FlavorId UpdateInstancePayloadGetFlavorIdAttributeType `json:"flavorId,omitempty"` - // Labels field is not certain/clear - Labels UpdateInstancePayloadGetLabelsAttributeType `json:"labels,omitempty"` - Name UpdateInstancePayloadGetNameAttributeType `json:"name,omitempty"` - Options UpdateInstancePayloadGetOptionsAttributeType `json:"options,omitempty"` + // 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. + // REQUIRED + BackupSchedule UpdateInstancePayloadGetBackupScheduleAttributeType `json:"backupSchedule" required:"true"` + // The id of the instance flavor. + // REQUIRED + FlavorId UpdateInstancePayloadGetFlavorIdAttributeType `json:"flavorId" required:"true"` + // 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. + Labels UpdateInstancePayloadGetLabelsAttributeType `json:"labels,omitempty"` + // The name of the instance. + // REQUIRED + Name UpdateInstancePayloadGetNameAttributeType `json:"name" required:"true"` + // REQUIRED + Network UpdateInstancePayloadGetNetworkAttributeType `json:"network" required:"true"` + // How long backups are retained. The value can only be between 32 and 90 days. // Can be cast to int32 without loss of precision. - Replicas UpdateInstancePayloadGetReplicasAttributeType `json:"replicas,omitempty"` - Storage UpdateInstancePayloadGetStorageAttributeType `json:"storage,omitempty"` - Version UpdateInstancePayloadGetVersionAttributeType `json:"version,omitempty"` + // REQUIRED + RetentionDays UpdateInstancePayloadGetRetentionDaysAttributeType `json:"retentionDays" required:"true"` + // REQUIRED + Storage UpdateInstancePayloadGetStorageAttributeType `json:"storage" required:"true"` + // The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3#tag/Version) for supported version parameters. + // REQUIRED + Version UpdateInstancePayloadGetVersionAttributeType `json:"version" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _UpdateInstancePayload UpdateInstancePayload + // NewUpdateInstancePayload instantiates a new UpdateInstancePayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewUpdateInstancePayload() *UpdateInstancePayload { +func NewUpdateInstancePayload(backupSchedule UpdateInstancePayloadGetBackupScheduleArgType, flavorId UpdateInstancePayloadGetFlavorIdArgType, name UpdateInstancePayloadGetNameArgType, network UpdateInstancePayloadGetNetworkArgType, retentionDays UpdateInstancePayloadGetRetentionDaysArgType, storage UpdateInstancePayloadGetStorageArgType, version UpdateInstancePayloadGetVersionArgType) *UpdateInstancePayload { this := UpdateInstancePayload{} + setUpdateInstancePayloadGetBackupScheduleAttributeType(&this.BackupSchedule, backupSchedule) + setUpdateInstancePayloadGetFlavorIdAttributeType(&this.FlavorId, flavorId) + setUpdateInstancePayloadGetNameAttributeType(&this.Name, name) + setUpdateInstancePayloadGetNetworkAttributeType(&this.Network, network) + setUpdateInstancePayloadGetRetentionDaysAttributeType(&this.RetentionDays, retentionDays) + setUpdateInstancePayloadGetStorageAttributeType(&this.Storage, storage) + setUpdateInstancePayloadGetVersionAttributeType(&this.Version, version) return &this } @@ -296,82 +290,41 @@ func NewUpdateInstancePayloadWithDefaults() *UpdateInstancePayload { return &this } -// GetAcl returns the Acl field value if set, zero value otherwise. +// GetBackupSchedule returns the BackupSchedule field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) GetAcl() (res UpdateInstancePayloadGetAclRetType) { - res, _ = o.GetAclOk() - return +func (o *UpdateInstancePayload) GetBackupSchedule() (ret UpdateInstancePayloadGetBackupScheduleRetType) { + ret, _ = o.GetBackupScheduleOk() + return ret } -// GetAclOk returns a tuple with the Acl field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) GetAclOk() (ret UpdateInstancePayloadGetAclRetType, ok bool) { - return getUpdateInstancePayloadGetAclAttributeTypeOk(o.Acl) -} - -// HasAcl returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) HasAcl() bool { - _, ok := o.GetAclOk() - return ok -} - -// SetAcl gets a reference to the given ACL and assigns it to the Acl field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) SetAcl(v UpdateInstancePayloadGetAclRetType) { - setUpdateInstancePayloadGetAclAttributeType(&o.Acl, v) -} - -// GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) GetBackupSchedule() (res UpdateInstancePayloadGetBackupScheduleRetType) { - res, _ = o.GetBackupScheduleOk() - return -} - -// GetBackupScheduleOk returns a tuple with the BackupSchedule field value if set, nil otherwise +// GetBackupScheduleOk returns a tuple with the BackupSchedule field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) GetBackupScheduleOk() (ret UpdateInstancePayloadGetBackupScheduleRetType, ok bool) { return getUpdateInstancePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule) } -// HasBackupSchedule returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) HasBackupSchedule() bool { - _, ok := o.GetBackupScheduleOk() - return ok -} - -// SetBackupSchedule gets a reference to the given string and assigns it to the BackupSchedule field. +// SetBackupSchedule sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) SetBackupSchedule(v UpdateInstancePayloadGetBackupScheduleRetType) { setUpdateInstancePayloadGetBackupScheduleAttributeType(&o.BackupSchedule, v) } -// GetFlavorId returns the FlavorId field value if set, zero value otherwise. +// GetFlavorId returns the FlavorId field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) GetFlavorId() (res UpdateInstancePayloadGetFlavorIdRetType) { - res, _ = o.GetFlavorIdOk() - return +func (o *UpdateInstancePayload) GetFlavorId() (ret UpdateInstancePayloadGetFlavorIdRetType) { + ret, _ = o.GetFlavorIdOk() + return ret } -// GetFlavorIdOk returns a tuple with the FlavorId field value if set, nil otherwise +// GetFlavorIdOk returns a tuple with the FlavorId field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) GetFlavorIdOk() (ret UpdateInstancePayloadGetFlavorIdRetType, ok bool) { return getUpdateInstancePayloadGetFlavorIdAttributeTypeOk(o.FlavorId) } -// HasFlavorId returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) HasFlavorId() bool { - _, ok := o.GetFlavorIdOk() - return ok -} - -// SetFlavorId gets a reference to the given string and assigns it to the FlavorId field. +// SetFlavorId sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) SetFlavorId(v UpdateInstancePayloadGetFlavorIdRetType) { setUpdateInstancePayloadGetFlavorIdAttributeType(&o.FlavorId, v) @@ -404,136 +357,103 @@ func (o *UpdateInstancePayload) SetLabels(v UpdateInstancePayloadGetLabelsRetTyp setUpdateInstancePayloadGetLabelsAttributeType(&o.Labels, v) } -// GetName returns the Name field value if set, zero value otherwise. +// GetName returns the Name field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) GetName() (res UpdateInstancePayloadGetNameRetType) { - res, _ = o.GetNameOk() - return +func (o *UpdateInstancePayload) GetName() (ret UpdateInstancePayloadGetNameRetType) { + ret, _ = o.GetNameOk() + return ret } -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) GetNameOk() (ret UpdateInstancePayloadGetNameRetType, ok bool) { return getUpdateInstancePayloadGetNameAttributeTypeOk(o.Name) } -// HasName returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) HasName() bool { - _, ok := o.GetNameOk() - return ok -} - -// SetName gets a reference to the given string and assigns it to the Name field. +// SetName sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) SetName(v UpdateInstancePayloadGetNameRetType) { setUpdateInstancePayloadGetNameAttributeType(&o.Name, v) } -// GetOptions returns the Options field value if set, zero value otherwise. +// GetNetwork returns the Network field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) GetOptions() (res UpdateInstancePayloadGetOptionsRetType) { - res, _ = o.GetOptionsOk() - return +func (o *UpdateInstancePayload) GetNetwork() (ret UpdateInstancePayloadGetNetworkRetType) { + ret, _ = o.GetNetworkOk() + return ret } -// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// GetNetworkOk returns a tuple with the Network field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) GetOptionsOk() (ret UpdateInstancePayloadGetOptionsRetType, ok bool) { - return getUpdateInstancePayloadGetOptionsAttributeTypeOk(o.Options) +func (o *UpdateInstancePayload) GetNetworkOk() (ret UpdateInstancePayloadGetNetworkRetType, ok bool) { + return getUpdateInstancePayloadGetNetworkAttributeTypeOk(o.Network) } -// HasOptions returns a boolean if a field has been set. +// SetNetwork sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) HasOptions() bool { - _, ok := o.GetOptionsOk() - return ok +func (o *UpdateInstancePayload) SetNetwork(v UpdateInstancePayloadGetNetworkRetType) { + setUpdateInstancePayloadGetNetworkAttributeType(&o.Network, v) } -// SetOptions gets a reference to the given map[string]string and assigns it to the Options field. +// GetRetentionDays returns the RetentionDays field value +// If the value is explicit nil, the zero value for int32 will be returned // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) SetOptions(v UpdateInstancePayloadGetOptionsRetType) { - setUpdateInstancePayloadGetOptionsAttributeType(&o.Options, v) +func (o *UpdateInstancePayload) GetRetentionDays() (ret UpdateInstancePayloadGetRetentionDaysRetType) { + ret, _ = o.GetRetentionDaysOk() + return ret } -// GetReplicas returns the Replicas field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) GetReplicas() (res UpdateInstancePayloadGetReplicasRetType) { - res, _ = o.GetReplicasOk() - return -} - -// GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise +// GetRetentionDaysOk returns a tuple with the RetentionDays field value // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) GetReplicasOk() (ret UpdateInstancePayloadGetReplicasRetType, ok bool) { - return getUpdateInstancePayloadGetReplicasAttributeTypeOk(o.Replicas) -} - -// HasReplicas returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) HasReplicas() bool { - _, ok := o.GetReplicasOk() - return ok +func (o *UpdateInstancePayload) GetRetentionDaysOk() (ret UpdateInstancePayloadGetRetentionDaysRetType, ok bool) { + return getUpdateInstancePayloadGetRetentionDaysAttributeTypeOk(o.RetentionDays) } -// SetReplicas gets a reference to the given int64 and assigns it to the Replicas field. +// SetRetentionDays sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) SetReplicas(v UpdateInstancePayloadGetReplicasRetType) { - setUpdateInstancePayloadGetReplicasAttributeType(&o.Replicas, v) +func (o *UpdateInstancePayload) SetRetentionDays(v UpdateInstancePayloadGetRetentionDaysRetType) { + setUpdateInstancePayloadGetRetentionDaysAttributeType(&o.RetentionDays, v) } -// GetStorage returns the Storage field value if set, zero value otherwise. +// GetStorage returns the Storage field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) GetStorage() (res UpdateInstancePayloadGetStorageRetType) { - res, _ = o.GetStorageOk() - return +func (o *UpdateInstancePayload) GetStorage() (ret UpdateInstancePayloadGetStorageRetType) { + ret, _ = o.GetStorageOk() + return ret } -// GetStorageOk returns a tuple with the Storage field value if set, nil otherwise +// GetStorageOk returns a tuple with the Storage field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) GetStorageOk() (ret UpdateInstancePayloadGetStorageRetType, ok bool) { return getUpdateInstancePayloadGetStorageAttributeTypeOk(o.Storage) } -// HasStorage returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) HasStorage() bool { - _, ok := o.GetStorageOk() - return ok -} - -// SetStorage gets a reference to the given StorageUpdate and assigns it to the Storage field. +// SetStorage sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) SetStorage(v UpdateInstancePayloadGetStorageRetType) { setUpdateInstancePayloadGetStorageAttributeType(&o.Storage, v) } -// GetVersion returns the Version field value if set, zero value otherwise. +// GetVersion returns the Version field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) GetVersion() (res UpdateInstancePayloadGetVersionRetType) { - res, _ = o.GetVersionOk() - return +func (o *UpdateInstancePayload) GetVersion() (ret UpdateInstancePayloadGetVersionRetType) { + ret, _ = o.GetVersionOk() + return ret } -// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// GetVersionOk returns a tuple with the Version field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) GetVersionOk() (ret UpdateInstancePayloadGetVersionRetType, ok bool) { return getUpdateInstancePayloadGetVersionAttributeTypeOk(o.Version) } -// HasVersion returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) HasVersion() bool { - _, ok := o.GetVersionOk() - return ok -} - -// SetVersion gets a reference to the given string and assigns it to the Version field. +// SetVersion sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateInstancePayload) SetVersion(v UpdateInstancePayloadGetVersionRetType) { setUpdateInstancePayloadGetVersionAttributeType(&o.Version, v) @@ -542,9 +462,6 @@ func (o *UpdateInstancePayload) SetVersion(v UpdateInstancePayloadGetVersionRetT // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateInstancePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getUpdateInstancePayloadGetAclAttributeTypeOk(o.Acl); ok { - toSerialize["Acl"] = val - } if val, ok := getUpdateInstancePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule); ok { toSerialize["BackupSchedule"] = val } @@ -557,11 +474,11 @@ func (o UpdateInstancePayload) ToMap() (map[string]interface{}, error) { if val, ok := getUpdateInstancePayloadGetNameAttributeTypeOk(o.Name); ok { toSerialize["Name"] = val } - if val, ok := getUpdateInstancePayloadGetOptionsAttributeTypeOk(o.Options); ok { - toSerialize["Options"] = val + if val, ok := getUpdateInstancePayloadGetNetworkAttributeTypeOk(o.Network); ok { + toSerialize["Network"] = val } - if val, ok := getUpdateInstancePayloadGetReplicasAttributeTypeOk(o.Replicas); ok { - toSerialize["Replicas"] = val + if val, ok := getUpdateInstancePayloadGetRetentionDaysAttributeTypeOk(o.RetentionDays); ok { + toSerialize["RetentionDays"] = val } if val, ok := getUpdateInstancePayloadGetStorageAttributeTypeOk(o.Storage); ok { toSerialize["Storage"] = val diff --git a/services/postgresflex/model_update_instance_payload_test.go b/services/postgresflex/model_update_instance_payload_test.go index 51f50494d..74a76f10e 100644 --- a/services/postgresflex/model_update_instance_payload_test.go +++ b/services/postgresflex/model_update_instance_payload_test.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_update_backup_schedule_payload.go b/services/postgresflex/model_update_instance_protection_payload.go similarity index 50% rename from services/postgresflex/model_update_backup_schedule_payload.go rename to services/postgresflex/model_update_instance_protection_payload.go index b883a9273..3c2444238 100644 --- a/services/postgresflex/model_update_backup_schedule_payload.go +++ b/services/postgresflex/model_update_instance_protection_payload.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,19 +15,25 @@ import ( "encoding/json" ) -// checks if the UpdateBackupSchedulePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateBackupSchedulePayload{} +// checks if the UpdateInstanceProtectionPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateInstanceProtectionPayload{} /* - types and functions for backupSchedule + types and functions for isDeletable */ -// isNotNullableString +// isBoolean // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateBackupSchedulePayloadGetBackupScheduleAttributeType = *string +type UpdateInstanceProtectionPayloadgetIsDeletableAttributeType = *bool // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUpdateBackupSchedulePayloadGetBackupScheduleAttributeTypeOk(arg UpdateBackupSchedulePayloadGetBackupScheduleAttributeType) (ret UpdateBackupSchedulePayloadGetBackupScheduleRetType, ok bool) { +type UpdateInstanceProtectionPayloadgetIsDeletableArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UpdateInstanceProtectionPayloadgetIsDeletableRetType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getUpdateInstanceProtectionPayloadgetIsDeletableAttributeTypeOk(arg UpdateInstanceProtectionPayloadgetIsDeletableAttributeType) (ret UpdateInstanceProtectionPayloadgetIsDeletableRetType, ok bool) { if arg == nil { return ret, false } @@ -35,115 +41,110 @@ func getUpdateBackupSchedulePayloadGetBackupScheduleAttributeTypeOk(arg UpdateBa } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setUpdateBackupSchedulePayloadGetBackupScheduleAttributeType(arg *UpdateBackupSchedulePayloadGetBackupScheduleAttributeType, val UpdateBackupSchedulePayloadGetBackupScheduleRetType) { +func setUpdateInstanceProtectionPayloadgetIsDeletableAttributeType(arg *UpdateInstanceProtectionPayloadgetIsDeletableAttributeType, val UpdateInstanceProtectionPayloadgetIsDeletableRetType) { *arg = &val } +// UpdateInstanceProtectionPayload struct for UpdateInstanceProtectionPayload // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateBackupSchedulePayloadGetBackupScheduleArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateBackupSchedulePayloadGetBackupScheduleRetType = string - -// UpdateBackupSchedulePayload struct for UpdateBackupSchedulePayload -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateBackupSchedulePayload struct { +type UpdateInstanceProtectionPayload struct { + // Protect instance from deletion. // REQUIRED - BackupSchedule UpdateBackupSchedulePayloadGetBackupScheduleAttributeType `json:"backupSchedule" required:"true"` + IsDeletable UpdateInstanceProtectionPayloadgetIsDeletableAttributeType `json:"isDeletable" required:"true"` } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type _UpdateBackupSchedulePayload UpdateBackupSchedulePayload +type _UpdateInstanceProtectionPayload UpdateInstanceProtectionPayload -// NewUpdateBackupSchedulePayload instantiates a new UpdateBackupSchedulePayload object +// NewUpdateInstanceProtectionPayload instantiates a new UpdateInstanceProtectionPayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewUpdateBackupSchedulePayload(backupSchedule UpdateBackupSchedulePayloadGetBackupScheduleArgType) *UpdateBackupSchedulePayload { - this := UpdateBackupSchedulePayload{} - setUpdateBackupSchedulePayloadGetBackupScheduleAttributeType(&this.BackupSchedule, backupSchedule) +func NewUpdateInstanceProtectionPayload(isDeletable UpdateInstanceProtectionPayloadgetIsDeletableArgType) *UpdateInstanceProtectionPayload { + this := UpdateInstanceProtectionPayload{} + setUpdateInstanceProtectionPayloadgetIsDeletableAttributeType(&this.IsDeletable, isDeletable) return &this } -// NewUpdateBackupSchedulePayloadWithDefaults instantiates a new UpdateBackupSchedulePayload object +// NewUpdateInstanceProtectionPayloadWithDefaults instantiates a new UpdateInstanceProtectionPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewUpdateBackupSchedulePayloadWithDefaults() *UpdateBackupSchedulePayload { - this := UpdateBackupSchedulePayload{} +func NewUpdateInstanceProtectionPayloadWithDefaults() *UpdateInstanceProtectionPayload { + this := UpdateInstanceProtectionPayload{} return &this } -// GetBackupSchedule returns the BackupSchedule field value +// GetIsDeletable returns the IsDeletable field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateBackupSchedulePayload) GetBackupSchedule() (ret UpdateBackupSchedulePayloadGetBackupScheduleRetType) { - ret, _ = o.GetBackupScheduleOk() +func (o *UpdateInstanceProtectionPayload) GetIsDeletable() (ret UpdateInstanceProtectionPayloadgetIsDeletableRetType) { + ret, _ = o.GetIsDeletableOk() return ret } -// GetBackupScheduleOk returns a tuple with the BackupSchedule field value +// GetIsDeletableOk returns a tuple with the IsDeletable field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateBackupSchedulePayload) GetBackupScheduleOk() (ret UpdateBackupSchedulePayloadGetBackupScheduleRetType, ok bool) { - return getUpdateBackupSchedulePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule) +func (o *UpdateInstanceProtectionPayload) GetIsDeletableOk() (ret UpdateInstanceProtectionPayloadgetIsDeletableRetType, ok bool) { + return getUpdateInstanceProtectionPayloadgetIsDeletableAttributeTypeOk(o.IsDeletable) } -// SetBackupSchedule sets field value +// SetIsDeletable sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateBackupSchedulePayload) SetBackupSchedule(v UpdateBackupSchedulePayloadGetBackupScheduleRetType) { - setUpdateBackupSchedulePayloadGetBackupScheduleAttributeType(&o.BackupSchedule, v) +func (o *UpdateInstanceProtectionPayload) SetIsDeletable(v UpdateInstanceProtectionPayloadgetIsDeletableRetType) { + setUpdateInstanceProtectionPayloadgetIsDeletableAttributeType(&o.IsDeletable, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o UpdateBackupSchedulePayload) ToMap() (map[string]interface{}, error) { +func (o UpdateInstanceProtectionPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getUpdateBackupSchedulePayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule); ok { - toSerialize["BackupSchedule"] = val + if val, ok := getUpdateInstanceProtectionPayloadgetIsDeletableAttributeTypeOk(o.IsDeletable); ok { + toSerialize["IsDeletable"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableUpdateBackupSchedulePayload struct { - value *UpdateBackupSchedulePayload +type NullableUpdateInstanceProtectionPayload struct { + value *UpdateInstanceProtectionPayload isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableUpdateBackupSchedulePayload) Get() *UpdateBackupSchedulePayload { +func (v NullableUpdateInstanceProtectionPayload) Get() *UpdateInstanceProtectionPayload { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableUpdateBackupSchedulePayload) Set(val *UpdateBackupSchedulePayload) { +func (v *NullableUpdateInstanceProtectionPayload) Set(val *UpdateInstanceProtectionPayload) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableUpdateBackupSchedulePayload) IsSet() bool { +func (v NullableUpdateInstanceProtectionPayload) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableUpdateBackupSchedulePayload) Unset() { +func (v *NullableUpdateInstanceProtectionPayload) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableUpdateBackupSchedulePayload(val *UpdateBackupSchedulePayload) *NullableUpdateBackupSchedulePayload { - return &NullableUpdateBackupSchedulePayload{value: val, isSet: true} +func NewNullableUpdateInstanceProtectionPayload(val *UpdateInstanceProtectionPayload) *NullableUpdateInstanceProtectionPayload { + return &NullableUpdateInstanceProtectionPayload{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableUpdateBackupSchedulePayload) MarshalJSON() ([]byte, error) { +func (v NullableUpdateInstanceProtectionPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableUpdateBackupSchedulePayload) UnmarshalJSON(src []byte) error { +func (v *NullableUpdateInstanceProtectionPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_update_instance_protection_payload_test.go b/services/postgresflex/model_update_instance_protection_payload_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_update_instance_protection_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_api_extension_delete_response.go b/services/postgresflex/model_update_instance_protection_response.go similarity index 50% rename from services/postgresflex/model_api_extension_delete_response.go rename to services/postgresflex/model_update_instance_protection_response.go index 9aeb39ef3..09a39f737 100644 --- a/services/postgresflex/model_api_extension_delete_response.go +++ b/services/postgresflex/model_update_instance_protection_response.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -15,25 +15,25 @@ import ( "encoding/json" ) -// checks if the ApiExtensionDeleteResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ApiExtensionDeleteResponse{} +// checks if the UpdateInstanceProtectionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateInstanceProtectionResponse{} /* - types and functions for isSucceded + types and functions for isDeletable */ // isBoolean // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionDeleteResponsegetIsSuccededAttributeType = *bool +type UpdateInstanceProtectionResponsegetIsDeletableAttributeType = *bool // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionDeleteResponsegetIsSuccededArgType = bool +type UpdateInstanceProtectionResponsegetIsDeletableArgType = bool // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionDeleteResponsegetIsSuccededRetType = bool +type UpdateInstanceProtectionResponsegetIsDeletableRetType = bool // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getApiExtensionDeleteResponsegetIsSuccededAttributeTypeOk(arg ApiExtensionDeleteResponsegetIsSuccededAttributeType) (ret ApiExtensionDeleteResponsegetIsSuccededRetType, ok bool) { +func getUpdateInstanceProtectionResponsegetIsDeletableAttributeTypeOk(arg UpdateInstanceProtectionResponsegetIsDeletableAttributeType) (ret UpdateInstanceProtectionResponsegetIsDeletableRetType, ok bool) { if arg == nil { return ret, false } @@ -41,111 +41,110 @@ func getApiExtensionDeleteResponsegetIsSuccededAttributeTypeOk(arg ApiExtensionD } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setApiExtensionDeleteResponsegetIsSuccededAttributeType(arg *ApiExtensionDeleteResponsegetIsSuccededAttributeType, val ApiExtensionDeleteResponsegetIsSuccededRetType) { +func setUpdateInstanceProtectionResponsegetIsDeletableAttributeType(arg *UpdateInstanceProtectionResponsegetIsDeletableAttributeType, val UpdateInstanceProtectionResponsegetIsDeletableRetType) { *arg = &val } -// ApiExtensionDeleteResponse struct for ApiExtensionDeleteResponse +// UpdateInstanceProtectionResponse struct for UpdateInstanceProtectionResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiExtensionDeleteResponse struct { - IsSucceded ApiExtensionDeleteResponsegetIsSuccededAttributeType `json:"isSucceded,omitempty"` +type UpdateInstanceProtectionResponse struct { + // Protect instance from deletion. + // REQUIRED + IsDeletable UpdateInstanceProtectionResponsegetIsDeletableAttributeType `json:"isDeletable" required:"true"` } -// NewApiExtensionDeleteResponse instantiates a new ApiExtensionDeleteResponse object +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _UpdateInstanceProtectionResponse UpdateInstanceProtectionResponse + +// NewUpdateInstanceProtectionResponse instantiates a new UpdateInstanceProtectionResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewApiExtensionDeleteResponse() *ApiExtensionDeleteResponse { - this := ApiExtensionDeleteResponse{} +func NewUpdateInstanceProtectionResponse(isDeletable UpdateInstanceProtectionResponsegetIsDeletableArgType) *UpdateInstanceProtectionResponse { + this := UpdateInstanceProtectionResponse{} + setUpdateInstanceProtectionResponsegetIsDeletableAttributeType(&this.IsDeletable, isDeletable) return &this } -// NewApiExtensionDeleteResponseWithDefaults instantiates a new ApiExtensionDeleteResponse object +// NewUpdateInstanceProtectionResponseWithDefaults instantiates a new UpdateInstanceProtectionResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewApiExtensionDeleteResponseWithDefaults() *ApiExtensionDeleteResponse { - this := ApiExtensionDeleteResponse{} +func NewUpdateInstanceProtectionResponseWithDefaults() *UpdateInstanceProtectionResponse { + this := UpdateInstanceProtectionResponse{} return &this } -// GetIsSucceded returns the IsSucceded field value if set, zero value otherwise. +// GetIsDeletable returns the IsDeletable field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionDeleteResponse) GetIsSucceded() (res ApiExtensionDeleteResponsegetIsSuccededRetType) { - res, _ = o.GetIsSuccededOk() - return +func (o *UpdateInstanceProtectionResponse) GetIsDeletable() (ret UpdateInstanceProtectionResponsegetIsDeletableRetType) { + ret, _ = o.GetIsDeletableOk() + return ret } -// GetIsSuccededOk returns a tuple with the IsSucceded field value if set, nil otherwise +// GetIsDeletableOk returns a tuple with the IsDeletable field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionDeleteResponse) GetIsSuccededOk() (ret ApiExtensionDeleteResponsegetIsSuccededRetType, ok bool) { - return getApiExtensionDeleteResponsegetIsSuccededAttributeTypeOk(o.IsSucceded) -} - -// HasIsSucceded returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionDeleteResponse) HasIsSucceded() bool { - _, ok := o.GetIsSuccededOk() - return ok +func (o *UpdateInstanceProtectionResponse) GetIsDeletableOk() (ret UpdateInstanceProtectionResponsegetIsDeletableRetType, ok bool) { + return getUpdateInstanceProtectionResponsegetIsDeletableAttributeTypeOk(o.IsDeletable) } -// SetIsSucceded gets a reference to the given bool and assigns it to the IsSucceded field. +// SetIsDeletable sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ApiExtensionDeleteResponse) SetIsSucceded(v ApiExtensionDeleteResponsegetIsSuccededRetType) { - setApiExtensionDeleteResponsegetIsSuccededAttributeType(&o.IsSucceded, v) +func (o *UpdateInstanceProtectionResponse) SetIsDeletable(v UpdateInstanceProtectionResponsegetIsDeletableRetType) { + setUpdateInstanceProtectionResponsegetIsDeletableAttributeType(&o.IsDeletable, v) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o ApiExtensionDeleteResponse) ToMap() (map[string]interface{}, error) { +func (o UpdateInstanceProtectionResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getApiExtensionDeleteResponsegetIsSuccededAttributeTypeOk(o.IsSucceded); ok { - toSerialize["IsSucceded"] = val + if val, ok := getUpdateInstanceProtectionResponsegetIsDeletableAttributeTypeOk(o.IsDeletable); ok { + toSerialize["IsDeletable"] = val } return toSerialize, nil } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableApiExtensionDeleteResponse struct { - value *ApiExtensionDeleteResponse +type NullableUpdateInstanceProtectionResponse struct { + value *UpdateInstanceProtectionResponse isSet bool } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiExtensionDeleteResponse) Get() *ApiExtensionDeleteResponse { +func (v NullableUpdateInstanceProtectionResponse) Get() *UpdateInstanceProtectionResponse { return v.value } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiExtensionDeleteResponse) Set(val *ApiExtensionDeleteResponse) { +func (v *NullableUpdateInstanceProtectionResponse) Set(val *UpdateInstanceProtectionResponse) { v.value = val v.isSet = true } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiExtensionDeleteResponse) IsSet() bool { +func (v NullableUpdateInstanceProtectionResponse) IsSet() bool { return v.isSet } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiExtensionDeleteResponse) Unset() { +func (v *NullableUpdateInstanceProtectionResponse) Unset() { v.value = nil v.isSet = false } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableApiExtensionDeleteResponse(val *ApiExtensionDeleteResponse) *NullableApiExtensionDeleteResponse { - return &NullableApiExtensionDeleteResponse{value: val, isSet: true} +func NewNullableUpdateInstanceProtectionResponse(val *UpdateInstanceProtectionResponse) *NullableUpdateInstanceProtectionResponse { + return &NullableUpdateInstanceProtectionResponse{value: val, isSet: true} } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableApiExtensionDeleteResponse) MarshalJSON() ([]byte, error) { +func (v NullableUpdateInstanceProtectionResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableApiExtensionDeleteResponse) UnmarshalJSON(src []byte) error { +func (v *NullableUpdateInstanceProtectionResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/postgresflex/model_update_instance_protection_response_test.go b/services/postgresflex/model_update_instance_protection_response_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_update_instance_protection_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_update_user_payload.go b/services/postgresflex/model_update_user_payload.go index 80879a207..1f1e98519 100644 --- a/services/postgresflex/model_update_user_payload.go +++ b/services/postgresflex/model_update_user_payload.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,15 +19,15 @@ import ( var _ MappedNullable = &UpdateUserPayload{} /* - types and functions for database + types and functions for name */ // isNotNullableString // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateUserPayloadGetDatabaseAttributeType = *string +type UpdateUserPayloadGetNameAttributeType = *string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUpdateUserPayloadGetDatabaseAttributeTypeOk(arg UpdateUserPayloadGetDatabaseAttributeType) (ret UpdateUserPayloadGetDatabaseRetType, ok bool) { +func getUpdateUserPayloadGetNameAttributeTypeOk(arg UpdateUserPayloadGetNameAttributeType) (ret UpdateUserPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false } @@ -35,15 +35,15 @@ func getUpdateUserPayloadGetDatabaseAttributeTypeOk(arg UpdateUserPayloadGetData } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setUpdateUserPayloadGetDatabaseAttributeType(arg *UpdateUserPayloadGetDatabaseAttributeType, val UpdateUserPayloadGetDatabaseRetType) { +func setUpdateUserPayloadGetNameAttributeType(arg *UpdateUserPayloadGetNameAttributeType, val UpdateUserPayloadGetNameRetType) { *arg = &val } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateUserPayloadGetDatabaseArgType = string +type UpdateUserPayloadGetNameArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateUserPayloadGetDatabaseRetType = string +type UpdateUserPayloadGetNameRetType = string /* types and functions for roles @@ -75,17 +75,24 @@ func setUpdateUserPayloadGetRolesAttributeType(arg *UpdateUserPayloadGetRolesAtt // UpdateUserPayload struct for UpdateUserPayload // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateUserPayload struct { - Database UpdateUserPayloadGetDatabaseAttributeType `json:"database,omitempty"` - Roles UpdateUserPayloadGetRolesAttributeType `json:"roles,omitempty"` + // The name of the user. + Name UpdateUserPayloadGetNameAttributeType `json:"name,omitempty"` + // A list containing the user roles for the instance. Please refer to the List Roles endpoint for a list of all available Roles. + // REQUIRED + Roles UpdateUserPayloadGetRolesAttributeType `json:"roles" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _UpdateUserPayload UpdateUserPayload + // NewUpdateUserPayload instantiates a new UpdateUserPayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewUpdateUserPayload() *UpdateUserPayload { +func NewUpdateUserPayload(roles UpdateUserPayloadGetRolesArgType) *UpdateUserPayload { this := UpdateUserPayload{} + setUpdateUserPayloadGetRolesAttributeType(&this.Roles, roles) return &this } @@ -98,55 +105,48 @@ func NewUpdateUserPayloadWithDefaults() *UpdateUserPayload { return &this } -// GetDatabase returns the Database field value if set, zero value otherwise. +// GetName returns the Name field value if set, zero value otherwise. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateUserPayload) GetDatabase() (res UpdateUserPayloadGetDatabaseRetType) { - res, _ = o.GetDatabaseOk() +func (o *UpdateUserPayload) GetName() (res UpdateUserPayloadGetNameRetType) { + res, _ = o.GetNameOk() return } -// GetDatabaseOk returns a tuple with the Database field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateUserPayload) GetDatabaseOk() (ret UpdateUserPayloadGetDatabaseRetType, ok bool) { - return getUpdateUserPayloadGetDatabaseAttributeTypeOk(o.Database) +func (o *UpdateUserPayload) GetNameOk() (ret UpdateUserPayloadGetNameRetType, ok bool) { + return getUpdateUserPayloadGetNameAttributeTypeOk(o.Name) } -// HasDatabase returns a boolean if a field has been set. +// HasName returns a boolean if a field has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateUserPayload) HasDatabase() bool { - _, ok := o.GetDatabaseOk() +func (o *UpdateUserPayload) HasName() bool { + _, ok := o.GetNameOk() return ok } -// SetDatabase gets a reference to the given string and assigns it to the Database field. +// SetName gets a reference to the given string and assigns it to the Name field. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateUserPayload) SetDatabase(v UpdateUserPayloadGetDatabaseRetType) { - setUpdateUserPayloadGetDatabaseAttributeType(&o.Database, v) +func (o *UpdateUserPayload) SetName(v UpdateUserPayloadGetNameRetType) { + setUpdateUserPayloadGetNameAttributeType(&o.Name, v) } -// GetRoles returns the Roles field value if set, zero value otherwise. +// GetRoles returns the Roles field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateUserPayload) GetRoles() (res UpdateUserPayloadGetRolesRetType) { - res, _ = o.GetRolesOk() - return +func (o *UpdateUserPayload) GetRoles() (ret UpdateUserPayloadGetRolesRetType) { + ret, _ = o.GetRolesOk() + return ret } -// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// GetRolesOk returns a tuple with the Roles field value // and a boolean to check if the value has been set. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateUserPayload) GetRolesOk() (ret UpdateUserPayloadGetRolesRetType, ok bool) { return getUpdateUserPayloadGetRolesAttributeTypeOk(o.Roles) } -// HasRoles returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateUserPayload) HasRoles() bool { - _, ok := o.GetRolesOk() - return ok -} - -// SetRoles gets a reference to the given []string and assigns it to the Roles field. +// SetRoles sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateUserPayload) SetRoles(v UpdateUserPayloadGetRolesRetType) { setUpdateUserPayloadGetRolesAttributeType(&o.Roles, v) @@ -155,8 +155,8 @@ func (o *UpdateUserPayload) SetRoles(v UpdateUserPayloadGetRolesRetType) { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateUserPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getUpdateUserPayloadGetDatabaseAttributeTypeOk(o.Database); ok { - toSerialize["Database"] = val + if val, ok := getUpdateUserPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } if val, ok := getUpdateUserPayloadGetRolesAttributeTypeOk(o.Roles); ok { toSerialize["Roles"] = val diff --git a/services/postgresflex/model_update_user_payload_test.go b/services/postgresflex/model_update_user_payload_test.go index 51f50494d..74a76f10e 100644 --- a/services/postgresflex/model_update_user_payload_test.go +++ b/services/postgresflex/model_update_user_payload_test.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/model_user.go b/services/postgresflex/model_user.go deleted file mode 100644 index 4bd4cbe5a..000000000 --- a/services/postgresflex/model_user.go +++ /dev/null @@ -1,557 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package postgresflex - -import ( - "encoding/json" -) - -// checks if the User type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &User{} - -/* - types and functions for database -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetDatabaseAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUserGetDatabaseAttributeTypeOk(arg UserGetDatabaseAttributeType) (ret UserGetDatabaseRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setUserGetDatabaseAttributeType(arg *UserGetDatabaseAttributeType, val UserGetDatabaseRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetDatabaseArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetDatabaseRetType = string - -/* - types and functions for host -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetHostAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUserGetHostAttributeTypeOk(arg UserGetHostAttributeType) (ret UserGetHostRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setUserGetHostAttributeType(arg *UserGetHostAttributeType, val UserGetHostRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetHostArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetHostRetType = string - -/* - types and functions for id -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetIdAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUserGetIdAttributeTypeOk(arg UserGetIdAttributeType) (ret UserGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setUserGetIdAttributeType(arg *UserGetIdAttributeType, val UserGetIdRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetIdArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetIdRetType = string - -/* - types and functions for password -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetPasswordAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUserGetPasswordAttributeTypeOk(arg UserGetPasswordAttributeType) (ret UserGetPasswordRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setUserGetPasswordAttributeType(arg *UserGetPasswordAttributeType, val UserGetPasswordRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetPasswordArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetPasswordRetType = string - -/* - types and functions for port -*/ - -// isLong -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetPortAttributeType = *int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetPortArgType = int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetPortRetType = int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUserGetPortAttributeTypeOk(arg UserGetPortAttributeType) (ret UserGetPortRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setUserGetPortAttributeType(arg *UserGetPortAttributeType, val UserGetPortRetType) { - *arg = &val -} - -/* - types and functions for roles -*/ - -// isArray -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetRolesAttributeType = *[]string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetRolesArgType = []string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetRolesRetType = []string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUserGetRolesAttributeTypeOk(arg UserGetRolesAttributeType) (ret UserGetRolesRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setUserGetRolesAttributeType(arg *UserGetRolesAttributeType, val UserGetRolesRetType) { - *arg = &val -} - -/* - types and functions for uri -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetUriAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUserGetUriAttributeTypeOk(arg UserGetUriAttributeType) (ret UserGetUriRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setUserGetUriAttributeType(arg *UserGetUriAttributeType, val UserGetUriRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetUriArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetUriRetType = string - -/* - types and functions for username -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetUsernameAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUserGetUsernameAttributeTypeOk(arg UserGetUsernameAttributeType) (ret UserGetUsernameRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setUserGetUsernameAttributeType(arg *UserGetUsernameAttributeType, val UserGetUsernameRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetUsernameArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetUsernameRetType = string - -// User struct for User -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type User struct { - Database UserGetDatabaseAttributeType `json:"database,omitempty"` - Host UserGetHostAttributeType `json:"host,omitempty"` - Id UserGetIdAttributeType `json:"id,omitempty"` - Password UserGetPasswordAttributeType `json:"password,omitempty"` - Port UserGetPortAttributeType `json:"port,omitempty"` - Roles UserGetRolesAttributeType `json:"roles,omitempty"` - Uri UserGetUriAttributeType `json:"uri,omitempty"` - Username UserGetUsernameAttributeType `json:"username,omitempty"` -} - -// NewUser instantiates a new User object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewUser() *User { - this := User{} - return &this -} - -// NewUserWithDefaults instantiates a new User object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewUserWithDefaults() *User { - this := User{} - return &this -} - -// GetDatabase returns the Database field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) GetDatabase() (res UserGetDatabaseRetType) { - res, _ = o.GetDatabaseOk() - return -} - -// GetDatabaseOk returns a tuple with the Database field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) GetDatabaseOk() (ret UserGetDatabaseRetType, ok bool) { - return getUserGetDatabaseAttributeTypeOk(o.Database) -} - -// HasDatabase returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) HasDatabase() bool { - _, ok := o.GetDatabaseOk() - return ok -} - -// SetDatabase gets a reference to the given string and assigns it to the Database field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) SetDatabase(v UserGetDatabaseRetType) { - setUserGetDatabaseAttributeType(&o.Database, v) -} - -// GetHost returns the Host field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) GetHost() (res UserGetHostRetType) { - res, _ = o.GetHostOk() - return -} - -// GetHostOk returns a tuple with the Host field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) GetHostOk() (ret UserGetHostRetType, ok bool) { - return getUserGetHostAttributeTypeOk(o.Host) -} - -// HasHost returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) HasHost() bool { - _, ok := o.GetHostOk() - return ok -} - -// SetHost gets a reference to the given string and assigns it to the Host field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) SetHost(v UserGetHostRetType) { - setUserGetHostAttributeType(&o.Host, v) -} - -// GetId returns the Id field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) GetId() (res UserGetIdRetType) { - res, _ = o.GetIdOk() - return -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) GetIdOk() (ret UserGetIdRetType, ok bool) { - return getUserGetIdAttributeTypeOk(o.Id) -} - -// HasId returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) HasId() bool { - _, ok := o.GetIdOk() - return ok -} - -// SetId gets a reference to the given string and assigns it to the Id field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) SetId(v UserGetIdRetType) { - setUserGetIdAttributeType(&o.Id, v) -} - -// GetPassword returns the Password field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) GetPassword() (res UserGetPasswordRetType) { - res, _ = o.GetPasswordOk() - return -} - -// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) GetPasswordOk() (ret UserGetPasswordRetType, ok bool) { - return getUserGetPasswordAttributeTypeOk(o.Password) -} - -// HasPassword returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) HasPassword() bool { - _, ok := o.GetPasswordOk() - return ok -} - -// SetPassword gets a reference to the given string and assigns it to the Password field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) SetPassword(v UserGetPasswordRetType) { - setUserGetPasswordAttributeType(&o.Password, v) -} - -// GetPort returns the Port field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) GetPort() (res UserGetPortRetType) { - res, _ = o.GetPortOk() - return -} - -// GetPortOk returns a tuple with the Port field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) GetPortOk() (ret UserGetPortRetType, ok bool) { - return getUserGetPortAttributeTypeOk(o.Port) -} - -// HasPort returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) HasPort() bool { - _, ok := o.GetPortOk() - return ok -} - -// SetPort gets a reference to the given int64 and assigns it to the Port field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) SetPort(v UserGetPortRetType) { - setUserGetPortAttributeType(&o.Port, v) -} - -// GetRoles returns the Roles field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) GetRoles() (res UserGetRolesRetType) { - res, _ = o.GetRolesOk() - return -} - -// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) GetRolesOk() (ret UserGetRolesRetType, ok bool) { - return getUserGetRolesAttributeTypeOk(o.Roles) -} - -// HasRoles returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) HasRoles() bool { - _, ok := o.GetRolesOk() - return ok -} - -// SetRoles gets a reference to the given []string and assigns it to the Roles field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) SetRoles(v UserGetRolesRetType) { - setUserGetRolesAttributeType(&o.Roles, v) -} - -// GetUri returns the Uri field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) GetUri() (res UserGetUriRetType) { - res, _ = o.GetUriOk() - return -} - -// GetUriOk returns a tuple with the Uri field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) GetUriOk() (ret UserGetUriRetType, ok bool) { - return getUserGetUriAttributeTypeOk(o.Uri) -} - -// HasUri returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) HasUri() bool { - _, ok := o.GetUriOk() - return ok -} - -// SetUri gets a reference to the given string and assigns it to the Uri field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) SetUri(v UserGetUriRetType) { - setUserGetUriAttributeType(&o.Uri, v) -} - -// GetUsername returns the Username field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) GetUsername() (res UserGetUsernameRetType) { - res, _ = o.GetUsernameOk() - return -} - -// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) GetUsernameOk() (ret UserGetUsernameRetType, ok bool) { - return getUserGetUsernameAttributeTypeOk(o.Username) -} - -// HasUsername returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) HasUsername() bool { - _, ok := o.GetUsernameOk() - return ok -} - -// SetUsername gets a reference to the given string and assigns it to the Username field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) SetUsername(v UserGetUsernameRetType) { - setUserGetUsernameAttributeType(&o.Username, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o User) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUserGetDatabaseAttributeTypeOk(o.Database); ok { - toSerialize["Database"] = val - } - if val, ok := getUserGetHostAttributeTypeOk(o.Host); ok { - toSerialize["Host"] = val - } - if val, ok := getUserGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getUserGetPasswordAttributeTypeOk(o.Password); ok { - toSerialize["Password"] = val - } - if val, ok := getUserGetPortAttributeTypeOk(o.Port); ok { - toSerialize["Port"] = val - } - if val, ok := getUserGetRolesAttributeTypeOk(o.Roles); ok { - toSerialize["Roles"] = val - } - if val, ok := getUserGetUriAttributeTypeOk(o.Uri); ok { - toSerialize["Uri"] = val - } - if val, ok := getUserGetUsernameAttributeTypeOk(o.Username); ok { - toSerialize["Username"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableUser struct { - value *User - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableUser) Get() *User { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableUser) Set(val *User) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableUser) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableUser) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableUser(val *User) *NullableUser { - return &NullableUser{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableUser) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableUser) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/model_user_response_test.go b/services/postgresflex/model_user_response_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_user_response_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_user_sort.go b/services/postgresflex/model_user_sort.go new file mode 100644 index 000000000..a517c9c3f --- /dev/null +++ b/services/postgresflex/model_user_sort.go @@ -0,0 +1,144 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package postgresflex + +import ( + "encoding/json" + "fmt" +) + +// UserSort the model 'UserSort' +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UserSort string + +// List of user.sort +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + USERSORT_ID_ASC UserSort = "id.asc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + USERSORT_ID_DESC UserSort = "id.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + USERSORT_NAME_DESC UserSort = "name.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + USERSORT_NAME_ASC UserSort = "name.asc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + USERSORT_STATE_DESC UserSort = "state.desc" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + USERSORT_STATE_ASC UserSort = "state.asc" +) + +// All allowed values of UserSort enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedUserSortEnumValues = []UserSort{ + "id.asc", + "id.desc", + "name.desc", + "name.asc", + "state.desc", + "state.asc", +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *UserSort) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + // Allow unmarshalling zero value for testing purposes + var zeroValue string + if value == zeroValue { + return nil + } + enumTypeValue := UserSort(value) + for _, existing := range AllowedUserSortEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid UserSort", value) +} + +// NewUserSortFromValue returns a pointer to a valid UserSort +// for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewUserSortFromValue(v string) (*UserSort, error) { + ev := UserSort(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UserSort: valid values are %v", v, AllowedUserSortEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v UserSort) IsValid() bool { + for _, existing := range AllowedUserSortEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to user.sort value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v UserSort) Ptr() *UserSort { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableUserSort struct { + value *UserSort + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableUserSort) Get() *UserSort { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableUserSort) Set(val *UserSort) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableUserSort) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableUserSort) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableUserSort(val *UserSort) *NullableUserSort { + return &NullableUserSort{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableUserSort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableUserSort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/model_user_sort_test.go b/services/postgresflex/model_user_sort_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_user_sort_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_user_test.go b/services/postgresflex/model_user_test.go deleted file mode 100644 index 51f50494d..000000000 --- a/services/postgresflex/model_user_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT PostgreSQL Flex API - -This is the documentation for the STACKIT postgres service - -API version: 2.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package postgresflex diff --git a/services/postgresflex/model_validation_error.go b/services/postgresflex/model_validation_error.go new file mode 100644 index 000000000..f5dc5cf35 --- /dev/null +++ b/services/postgresflex/model_validation_error.go @@ -0,0 +1,205 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package postgresflex + +import ( + "encoding/json" +) + +// checks if the ValidationError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ValidationError{} + +/* + types and functions for code +*/ + +// isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ValidationErrorGetCodeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ValidationErrorGetCodeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ValidationErrorGetCodeRetType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getValidationErrorGetCodeAttributeTypeOk(arg ValidationErrorGetCodeAttributeType) (ret ValidationErrorGetCodeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setValidationErrorGetCodeAttributeType(arg *ValidationErrorGetCodeAttributeType, val ValidationErrorGetCodeRetType) { + *arg = &val +} + +/* + types and functions for validation +*/ + +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ValidationErrorGetValidationAttributeType = *[]ValidationErrorValidationInner + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ValidationErrorGetValidationArgType = []ValidationErrorValidationInner + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ValidationErrorGetValidationRetType = []ValidationErrorValidationInner + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getValidationErrorGetValidationAttributeTypeOk(arg ValidationErrorGetValidationAttributeType) (ret ValidationErrorGetValidationRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setValidationErrorGetValidationAttributeType(arg *ValidationErrorGetValidationAttributeType, val ValidationErrorGetValidationRetType) { + *arg = &val +} + +// ValidationError struct for ValidationError +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ValidationError struct { + // the http error should be always 422 for validationError + // Can be cast to int32 without loss of precision. + // REQUIRED + Code ValidationErrorGetCodeAttributeType `json:"code" required:"true"` + // errors for all fields where the error happened + // REQUIRED + Validation ValidationErrorGetValidationAttributeType `json:"validation" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _ValidationError ValidationError + +// NewValidationError instantiates a new ValidationError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewValidationError(code ValidationErrorGetCodeArgType, validation ValidationErrorGetValidationArgType) *ValidationError { + this := ValidationError{} + setValidationErrorGetCodeAttributeType(&this.Code, code) + setValidationErrorGetValidationAttributeType(&this.Validation, validation) + return &this +} + +// NewValidationErrorWithDefaults instantiates a new ValidationError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewValidationErrorWithDefaults() *ValidationError { + this := ValidationError{} + return &this +} + +// GetCode returns the Code field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ValidationError) GetCode() (ret ValidationErrorGetCodeRetType) { + ret, _ = o.GetCodeOk() + return ret +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ValidationError) GetCodeOk() (ret ValidationErrorGetCodeRetType, ok bool) { + return getValidationErrorGetCodeAttributeTypeOk(o.Code) +} + +// SetCode sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ValidationError) SetCode(v ValidationErrorGetCodeRetType) { + setValidationErrorGetCodeAttributeType(&o.Code, v) +} + +// GetValidation returns the Validation field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ValidationError) GetValidation() (ret ValidationErrorGetValidationRetType) { + ret, _ = o.GetValidationOk() + return ret +} + +// GetValidationOk returns a tuple with the Validation field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ValidationError) GetValidationOk() (ret ValidationErrorGetValidationRetType, ok bool) { + return getValidationErrorGetValidationAttributeTypeOk(o.Validation) +} + +// SetValidation sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ValidationError) SetValidation(v ValidationErrorGetValidationRetType) { + setValidationErrorGetValidationAttributeType(&o.Validation, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o ValidationError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getValidationErrorGetCodeAttributeTypeOk(o.Code); ok { + toSerialize["Code"] = val + } + if val, ok := getValidationErrorGetValidationAttributeTypeOk(o.Validation); ok { + toSerialize["Validation"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableValidationError struct { + value *ValidationError + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableValidationError) Get() *ValidationError { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableValidationError) Set(val *ValidationError) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableValidationError) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableValidationError) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableValidationError(val *ValidationError) *NullableValidationError { + return &NullableValidationError{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableValidationError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableValidationError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/model_validation_error_test.go b/services/postgresflex/model_validation_error_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_validation_error_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_validation_error_validation_inner.go b/services/postgresflex/model_validation_error_validation_inner.go new file mode 100644 index 000000000..541c6a293 --- /dev/null +++ b/services/postgresflex/model_validation_error_validation_inner.go @@ -0,0 +1,202 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package postgresflex + +import ( + "encoding/json" +) + +// checks if the ValidationErrorValidationInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ValidationErrorValidationInner{} + +/* + types and functions for field +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ValidationErrorValidationInnerGetFieldAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getValidationErrorValidationInnerGetFieldAttributeTypeOk(arg ValidationErrorValidationInnerGetFieldAttributeType) (ret ValidationErrorValidationInnerGetFieldRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setValidationErrorValidationInnerGetFieldAttributeType(arg *ValidationErrorValidationInnerGetFieldAttributeType, val ValidationErrorValidationInnerGetFieldRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ValidationErrorValidationInnerGetFieldArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ValidationErrorValidationInnerGetFieldRetType = string + +/* + types and functions for message +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ValidationErrorValidationInnerGetMessageAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getValidationErrorValidationInnerGetMessageAttributeTypeOk(arg ValidationErrorValidationInnerGetMessageAttributeType) (ret ValidationErrorValidationInnerGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setValidationErrorValidationInnerGetMessageAttributeType(arg *ValidationErrorValidationInnerGetMessageAttributeType, val ValidationErrorValidationInnerGetMessageRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ValidationErrorValidationInnerGetMessageArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ValidationErrorValidationInnerGetMessageRetType = string + +// ValidationErrorValidationInner struct for ValidationErrorValidationInner +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ValidationErrorValidationInner struct { + // REQUIRED + Field ValidationErrorValidationInnerGetFieldAttributeType `json:"field" required:"true"` + // REQUIRED + Message ValidationErrorValidationInnerGetMessageAttributeType `json:"message" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _ValidationErrorValidationInner ValidationErrorValidationInner + +// NewValidationErrorValidationInner instantiates a new ValidationErrorValidationInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewValidationErrorValidationInner(field ValidationErrorValidationInnerGetFieldArgType, message ValidationErrorValidationInnerGetMessageArgType) *ValidationErrorValidationInner { + this := ValidationErrorValidationInner{} + setValidationErrorValidationInnerGetFieldAttributeType(&this.Field, field) + setValidationErrorValidationInnerGetMessageAttributeType(&this.Message, message) + return &this +} + +// NewValidationErrorValidationInnerWithDefaults instantiates a new ValidationErrorValidationInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewValidationErrorValidationInnerWithDefaults() *ValidationErrorValidationInner { + this := ValidationErrorValidationInner{} + return &this +} + +// GetField returns the Field field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ValidationErrorValidationInner) GetField() (ret ValidationErrorValidationInnerGetFieldRetType) { + ret, _ = o.GetFieldOk() + return ret +} + +// GetFieldOk returns a tuple with the Field field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ValidationErrorValidationInner) GetFieldOk() (ret ValidationErrorValidationInnerGetFieldRetType, ok bool) { + return getValidationErrorValidationInnerGetFieldAttributeTypeOk(o.Field) +} + +// SetField sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ValidationErrorValidationInner) SetField(v ValidationErrorValidationInnerGetFieldRetType) { + setValidationErrorValidationInnerGetFieldAttributeType(&o.Field, v) +} + +// GetMessage returns the Message field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ValidationErrorValidationInner) GetMessage() (ret ValidationErrorValidationInnerGetMessageRetType) { + ret, _ = o.GetMessageOk() + return ret +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ValidationErrorValidationInner) GetMessageOk() (ret ValidationErrorValidationInnerGetMessageRetType, ok bool) { + return getValidationErrorValidationInnerGetMessageAttributeTypeOk(o.Message) +} + +// SetMessage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ValidationErrorValidationInner) SetMessage(v ValidationErrorValidationInnerGetMessageRetType) { + setValidationErrorValidationInnerGetMessageAttributeType(&o.Message, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o ValidationErrorValidationInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getValidationErrorValidationInnerGetFieldAttributeTypeOk(o.Field); ok { + toSerialize["Field"] = val + } + if val, ok := getValidationErrorValidationInnerGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableValidationErrorValidationInner struct { + value *ValidationErrorValidationInner + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableValidationErrorValidationInner) Get() *ValidationErrorValidationInner { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableValidationErrorValidationInner) Set(val *ValidationErrorValidationInner) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableValidationErrorValidationInner) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableValidationErrorValidationInner) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableValidationErrorValidationInner(val *ValidationErrorValidationInner) *NullableValidationErrorValidationInner { + return &NullableValidationErrorValidationInner{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableValidationErrorValidationInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableValidationErrorValidationInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/model_validation_error_validation_inner_test.go b/services/postgresflex/model_validation_error_validation_inner_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_validation_error_validation_inner_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/model_version.go b/services/postgresflex/model_version.go new file mode 100644 index 000000000..13671791d --- /dev/null +++ b/services/postgresflex/model_version.go @@ -0,0 +1,312 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package postgresflex + +import ( + "encoding/json" +) + +// checks if the Version type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Version{} + +/* + types and functions for beta +*/ + +// isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type VersiongetBetaAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type VersiongetBetaArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type VersiongetBetaRetType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getVersiongetBetaAttributeTypeOk(arg VersiongetBetaAttributeType) (ret VersiongetBetaRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setVersiongetBetaAttributeType(arg *VersiongetBetaAttributeType, val VersiongetBetaRetType) { + *arg = &val +} + +/* + types and functions for deprecated +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type VersionGetDeprecatedAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getVersionGetDeprecatedAttributeTypeOk(arg VersionGetDeprecatedAttributeType) (ret VersionGetDeprecatedRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setVersionGetDeprecatedAttributeType(arg *VersionGetDeprecatedAttributeType, val VersionGetDeprecatedRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type VersionGetDeprecatedArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type VersionGetDeprecatedRetType = string + +/* + types and functions for recommend +*/ + +// isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type VersiongetRecommendAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type VersiongetRecommendArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type VersiongetRecommendRetType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getVersiongetRecommendAttributeTypeOk(arg VersiongetRecommendAttributeType) (ret VersiongetRecommendRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setVersiongetRecommendAttributeType(arg *VersiongetRecommendAttributeType, val VersiongetRecommendRetType) { + *arg = &val +} + +/* + types and functions for version +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type VersionGetVersionAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getVersionGetVersionAttributeTypeOk(arg VersionGetVersionAttributeType) (ret VersionGetVersionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setVersionGetVersionAttributeType(arg *VersionGetVersionAttributeType, val VersionGetVersionRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type VersionGetVersionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type VersionGetVersionRetType = string + +// Version The version of the postgres instance and more details. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type Version struct { + // Flag if the version is a beta version. If set the version may contain bugs and is not fully tested. + // REQUIRED + Beta VersiongetBetaAttributeType `json:"beta" required:"true"` + // Timestamp in RFC3339 format which says when the version will no longer be supported by STACKIT. + // REQUIRED + Deprecated VersionGetDeprecatedAttributeType `json:"deprecated" required:"true"` + // Flag if the version is recommend by the STACKIT Team. + // REQUIRED + Recommend VersiongetRecommendAttributeType `json:"recommend" required:"true"` + // The postgres version used for the instance. + // REQUIRED + Version VersionGetVersionAttributeType `json:"version" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _Version Version + +// NewVersion instantiates a new Version object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewVersion(beta VersiongetBetaArgType, deprecated VersionGetDeprecatedArgType, recommend VersiongetRecommendArgType, version VersionGetVersionArgType) *Version { + this := Version{} + setVersiongetBetaAttributeType(&this.Beta, beta) + setVersionGetDeprecatedAttributeType(&this.Deprecated, deprecated) + setVersiongetRecommendAttributeType(&this.Recommend, recommend) + setVersionGetVersionAttributeType(&this.Version, version) + return &this +} + +// NewVersionWithDefaults instantiates a new Version object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewVersionWithDefaults() *Version { + this := Version{} + return &this +} + +// GetBeta returns the Beta field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Version) GetBeta() (ret VersiongetBetaRetType) { + ret, _ = o.GetBetaOk() + return ret +} + +// GetBetaOk returns a tuple with the Beta field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Version) GetBetaOk() (ret VersiongetBetaRetType, ok bool) { + return getVersiongetBetaAttributeTypeOk(o.Beta) +} + +// SetBeta sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Version) SetBeta(v VersiongetBetaRetType) { + setVersiongetBetaAttributeType(&o.Beta, v) +} + +// GetDeprecated returns the Deprecated field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Version) GetDeprecated() (ret VersionGetDeprecatedRetType) { + ret, _ = o.GetDeprecatedOk() + return ret +} + +// GetDeprecatedOk returns a tuple with the Deprecated field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Version) GetDeprecatedOk() (ret VersionGetDeprecatedRetType, ok bool) { + return getVersionGetDeprecatedAttributeTypeOk(o.Deprecated) +} + +// SetDeprecated sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Version) SetDeprecated(v VersionGetDeprecatedRetType) { + setVersionGetDeprecatedAttributeType(&o.Deprecated, v) +} + +// GetRecommend returns the Recommend field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Version) GetRecommend() (ret VersiongetRecommendRetType) { + ret, _ = o.GetRecommendOk() + return ret +} + +// GetRecommendOk returns a tuple with the Recommend field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Version) GetRecommendOk() (ret VersiongetRecommendRetType, ok bool) { + return getVersiongetRecommendAttributeTypeOk(o.Recommend) +} + +// SetRecommend sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Version) SetRecommend(v VersiongetRecommendRetType) { + setVersiongetRecommendAttributeType(&o.Recommend, v) +} + +// GetVersion returns the Version field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Version) GetVersion() (ret VersionGetVersionRetType) { + ret, _ = o.GetVersionOk() + return ret +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Version) GetVersionOk() (ret VersionGetVersionRetType, ok bool) { + return getVersionGetVersionAttributeTypeOk(o.Version) +} + +// SetVersion sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Version) SetVersion(v VersionGetVersionRetType) { + setVersionGetVersionAttributeType(&o.Version, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o Version) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getVersiongetBetaAttributeTypeOk(o.Beta); ok { + toSerialize["Beta"] = val + } + if val, ok := getVersionGetDeprecatedAttributeTypeOk(o.Deprecated); ok { + toSerialize["Deprecated"] = val + } + if val, ok := getVersiongetRecommendAttributeTypeOk(o.Recommend); ok { + toSerialize["Recommend"] = val + } + if val, ok := getVersionGetVersionAttributeTypeOk(o.Version); ok { + toSerialize["Version"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableVersion struct { + value *Version + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableVersion) Get() *Version { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableVersion) Set(val *Version) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableVersion) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableVersion) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableVersion(val *Version) *NullableVersion { + return &NullableVersion{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableVersion) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableVersion) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/model_version_test.go b/services/postgresflex/model_version_test.go new file mode 100644 index 000000000..74a76f10e --- /dev/null +++ b/services/postgresflex/model_version_test.go @@ -0,0 +1,11 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package postgresflex diff --git a/services/postgresflex/oas_commit b/services/postgresflex/oas_commit index be073bf26..ca9404655 100644 --- a/services/postgresflex/oas_commit +++ b/services/postgresflex/oas_commit @@ -1 +1 @@ -72230b88b02a415757a997174c27da16db266be6 +8471248f0077b8c08001ad49b3b879c34e0e4969 diff --git a/services/postgresflex/utils.go b/services/postgresflex/utils.go index 3554b3ece..ddbc5ecd9 100644 --- a/services/postgresflex/utils.go +++ b/services/postgresflex/utils.go @@ -1,9 +1,9 @@ /* STACKIT PostgreSQL Flex API -This is the documentation for the STACKIT postgres service +This is the documentation for the STACKIT Postgres Flex service -API version: 2.0.0 +API version: 3.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/postgresflex/v3api/api_default.go b/services/postgresflex/v3api/api_default.go new file mode 100644 index 000000000..3f94d75ca --- /dev/null +++ b/services/postgresflex/v3api/api_default.go @@ -0,0 +1,6180 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v3api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +type DefaultAPI interface { + + /* + CloneInstance Clone Instance + + Clone Instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiCloneInstanceRequest + */ + CloneInstance(ctx context.Context, projectId string, region string, instanceId string) ApiCloneInstanceRequest + + // CloneInstanceExecute executes the request + // @return CloneInstanceResponse + CloneInstanceExecute(r ApiCloneInstanceRequest) (*CloneInstanceResponse, error) + + /* + CreateDatabase 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' + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiCreateDatabaseRequest + */ + CreateDatabase(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequest + + // CreateDatabaseExecute executes the request + // @return CreateDatabaseResponse + CreateDatabaseExecute(r ApiCreateDatabaseRequest) (*CreateDatabaseResponse, error) + + /* + CreateInstance Create Instance + + Create a new instance of a postgres database instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @return ApiCreateInstanceRequest + */ + CreateInstance(ctx context.Context, projectId string, region string) ApiCreateInstanceRequest + + // CreateInstanceExecute executes the request + // @return CreateInstanceResponse + CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) + + /* + CreateUser Create User + + Create user for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiCreateUserRequest + */ + CreateUser(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequest + + // CreateUserExecute executes the request + // @return CreateUserResponse + CreateUserExecute(r ApiCreateUserRequest) (*CreateUserResponse, error) + + /* + DeleteDatabase Delete Database + + Delete database for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return ApiDeleteDatabaseRequest + */ + DeleteDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) ApiDeleteDatabaseRequest + + // DeleteDatabaseExecute executes the request + DeleteDatabaseExecute(r ApiDeleteDatabaseRequest) error + + /* + DeleteInstance Delete Instance + + Delete an available postgres instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiDeleteInstanceRequest + */ + DeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequest + + // DeleteInstanceExecute executes the request + DeleteInstanceExecute(r ApiDeleteInstanceRequest) error + + /* + DeleteUser Delete User + + Delete an user from a specific instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiDeleteUserRequest + */ + DeleteUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiDeleteUserRequest + + // DeleteUserExecute executes the request + DeleteUserExecute(r ApiDeleteUserRequest) error + + /* + GetBackup Get specific backup + + Get information about a specific backup for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param backupId The ID of the backup. + @return ApiGetBackupRequest + */ + GetBackup(ctx context.Context, projectId string, region string, instanceId string, backupId int64) ApiGetBackupRequest + + // GetBackupExecute executes the request + // @return BackupData + GetBackupExecute(r ApiGetBackupRequest) (*BackupData, error) + + /* + GetDatabase Get Specific Database + + Get information about a specific database in an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return ApiGetDatabaseRequest + */ + GetDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) ApiGetDatabaseRequest + + // GetDatabaseExecute executes the request + // @return GetDatabaseResponse + GetDatabaseExecute(r ApiGetDatabaseRequest) (*GetDatabaseResponse, error) + + /* + GetInstance Get Specific Instance + + Get information about a specific available instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiGetInstanceRequest + */ + GetInstance(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequest + + // GetInstanceExecute executes the request + // @return GetInstanceResponse + GetInstanceExecute(r ApiGetInstanceRequest) (*GetInstanceResponse, error) + + /* + GetUser Get User + + Get a specific available user for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiGetUserRequest + */ + GetUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiGetUserRequest + + // GetUserExecute executes the request + // @return GetUserResponse + GetUserExecute(r ApiGetUserRequest) (*GetUserResponse, error) + + /* + ListBackups List backups + + List all backups which are available for a specific instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiListBackupsRequest + */ + ListBackups(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequest + + // ListBackupsExecute executes the request + // @return ListBackupResponse + ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupResponse, error) + + /* + ListCollations Get Collations for an Instance + + Get available collations for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiListCollationsRequest + */ + ListCollations(ctx context.Context, projectId string, region string, instanceId string) ApiListCollationsRequest + + // ListCollationsExecute executes the request + // @return ListCollationsResponse + ListCollationsExecute(r ApiListCollationsRequest) (*ListCollationsResponse, error) + + /* + ListDatabases List Databases + + List available databases for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiListDatabasesRequest + */ + ListDatabases(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequest + + // ListDatabasesExecute executes the request + // @return ListDatabasesResponse + ListDatabasesExecute(r ApiListDatabasesRequest) (*ListDatabasesResponse, error) + + /* + ListFlavors Get Flavors + + Get all available flavors for a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @return ApiListFlavorsRequest + */ + ListFlavors(ctx context.Context, projectId string, region string) ApiListFlavorsRequest + + // ListFlavorsExecute executes the request + // @return ListFlavorsResponse + ListFlavorsExecute(r ApiListFlavorsRequest) (*ListFlavorsResponse, error) + + /* + ListInstances List Instances + + List all available instances for your project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @return ApiListInstancesRequest + */ + ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest + + // ListInstancesExecute executes the request + // @return ListInstancesResponse + ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) + + /* + ListRoles List Roles + + List available roles for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiListRolesRequest + */ + ListRoles(ctx context.Context, projectId string, region string, instanceId string) ApiListRolesRequest + + // ListRolesExecute executes the request + // @return ListRolesResponse + ListRolesExecute(r ApiListRolesRequest) (*ListRolesResponse, error) + + /* + ListUsers List Users + + List available users for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiListUsersRequest + */ + ListUsers(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequest + + // ListUsersExecute executes the request + // @return ListUserResponse + ListUsersExecute(r ApiListUsersRequest) (*ListUserResponse, error) + + /* + ListVersions Get Versions + + Get available postgres versions for the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @return ApiListVersionsRequest + */ + ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest + + // ListVersionsExecute executes the request + // @return ListVersionResponse + ListVersionsExecute(r ApiListVersionsRequest) (*ListVersionResponse, error) + + /* + PartialUpdateDatabase Update Database partially + + Update a database partially in an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return ApiPartialUpdateDatabaseRequest + */ + PartialUpdateDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) ApiPartialUpdateDatabaseRequest + + // PartialUpdateDatabaseExecute executes the request + PartialUpdateDatabaseExecute(r ApiPartialUpdateDatabaseRequest) error + + /* + PartialUpdateInstance Update Instance Partially + + Update an available instance of a postgres database. No fields are required. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiPartialUpdateInstanceRequest + */ + PartialUpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiPartialUpdateInstanceRequest + + // PartialUpdateInstanceExecute executes the request + PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error + + /* + PartialUpdateUser Update User Partially + + Update an user partially for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiPartialUpdateUserRequest + */ + PartialUpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiPartialUpdateUserRequest + + // PartialUpdateUserExecute executes the request + PartialUpdateUserExecute(r ApiPartialUpdateUserRequest) error + + /* + ResetUserPassword Reset User + + Reset an user from an specific instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiResetUserPasswordRequest + */ + ResetUserPassword(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiResetUserPasswordRequest + + // ResetUserPasswordExecute executes the request + // @return ResetUserPasswordResponse + ResetUserPasswordExecute(r ApiResetUserPasswordRequest) (*ResetUserPasswordResponse, error) + + /* + UpdateDatabase Update Database + + Update a database in an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return ApiUpdateDatabaseRequest + */ + UpdateDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) ApiUpdateDatabaseRequest + + // UpdateDatabaseExecute executes the request + UpdateDatabaseExecute(r ApiUpdateDatabaseRequest) error + + /* + UpdateInstance Update Instance + + Updates an available instance of a postgres database + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiUpdateInstanceRequest + */ + UpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequest + + // UpdateInstanceExecute executes the request + UpdateInstanceExecute(r ApiUpdateInstanceRequest) error + + /* + UpdateInstanceProtection Toggle Instance Protection + + Toggle the deletion protection for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiUpdateInstanceProtectionRequest + */ + UpdateInstanceProtection(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceProtectionRequest + + // UpdateInstanceProtectionExecute executes the request + // @return UpdateInstanceProtectionResponse + UpdateInstanceProtectionExecute(r ApiUpdateInstanceProtectionRequest) (*UpdateInstanceProtectionResponse, error) + + /* + UpdateUser Update User + + Update user for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiUpdateUserRequest + */ + UpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiUpdateUserRequest + + // UpdateUserExecute executes the request + UpdateUserExecute(r ApiUpdateUserRequest) error +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiCloneInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + cloneInstancePayload *CloneInstancePayload +} + +// The request body with the parameters for cloning an instance by a point in time into a new instance. +func (r ApiCloneInstanceRequest) CloneInstancePayload(cloneInstancePayload CloneInstancePayload) ApiCloneInstanceRequest { + r.cloneInstancePayload = &cloneInstancePayload + return r +} + +func (r ApiCloneInstanceRequest) Execute() (*CloneInstanceResponse, error) { + return r.ApiService.CloneInstanceExecute(r) +} + +/* +CloneInstance Clone Instance + +Clone Instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiCloneInstanceRequest +*/ +func (a *DefaultAPIService) CloneInstance(ctx context.Context, projectId string, region string, instanceId string) ApiCloneInstanceRequest { + return ApiCloneInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CloneInstanceResponse +func (a *DefaultAPIService) CloneInstanceExecute(r ApiCloneInstanceRequest) (*CloneInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CloneInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CloneInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/clone" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.cloneInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateDatabaseRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + createDatabasePayload *CreateDatabasePayload +} + +// The request body containing the information for the new database. +func (r ApiCreateDatabaseRequest) CreateDatabasePayload(createDatabasePayload CreateDatabasePayload) ApiCreateDatabaseRequest { + r.createDatabasePayload = &createDatabasePayload + return r +} + +func (r ApiCreateDatabaseRequest) Execute() (*CreateDatabaseResponse, error) { + return r.ApiService.CreateDatabaseExecute(r) +} + +/* +CreateDatabase 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' + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiCreateDatabaseRequest +*/ +func (a *DefaultAPIService) CreateDatabase(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequest { + return ApiCreateDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CreateDatabaseResponse +func (a *DefaultAPIService) CreateDatabaseExecute(r ApiCreateDatabaseRequest) (*CreateDatabaseResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateDatabaseResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateDatabase") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/databases" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createDatabasePayload == nil { + return localVarReturnValue, reportError("createDatabasePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createDatabasePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createInstancePayload *CreateInstancePayload +} + +// The request body with the parameters for the instance creation. Every parameter is required. +func (r ApiCreateInstanceRequest) CreateInstancePayload(createInstancePayload CreateInstancePayload) ApiCreateInstanceRequest { + r.createInstancePayload = &createInstancePayload + return r +} + +func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { + return r.ApiService.CreateInstanceExecute(r) +} + +/* +CreateInstance Create Instance + +Create a new instance of a postgres database instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @return ApiCreateInstanceRequest +*/ +func (a *DefaultAPIService) CreateInstance(ctx context.Context, projectId string, region string) ApiCreateInstanceRequest { + return ApiCreateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return CreateInstanceResponse +func (a *DefaultAPIService) CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createInstancePayload == nil { + return localVarReturnValue, reportError("createInstancePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + createUserPayload *CreateUserPayload +} + +// The request body containing the user details. +func (r ApiCreateUserRequest) CreateUserPayload(createUserPayload CreateUserPayload) ApiCreateUserRequest { + r.createUserPayload = &createUserPayload + return r +} + +func (r ApiCreateUserRequest) Execute() (*CreateUserResponse, error) { + return r.ApiService.CreateUserExecute(r) +} + +/* +CreateUser Create User + +Create user for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiCreateUserRequest +*/ +func (a *DefaultAPIService) CreateUser(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequest { + return ApiCreateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CreateUserResponse +func (a *DefaultAPIService) CreateUserExecute(r ApiCreateUserRequest) (*CreateUserResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateUserResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateUser") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createUserPayload == nil { + return localVarReturnValue, reportError("createUserPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createUserPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeleteDatabaseRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + databaseId int64 +} + +func (r ApiDeleteDatabaseRequest) Execute() error { + return r.ApiService.DeleteDatabaseExecute(r) +} + +/* +DeleteDatabase Delete Database + +Delete database for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return ApiDeleteDatabaseRequest +*/ +func (a *DefaultAPIService) DeleteDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) ApiDeleteDatabaseRequest { + return ApiDeleteDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseId: databaseId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteDatabaseExecute(r ApiDeleteDatabaseRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteDatabase") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"databaseId"+"}", url.PathEscape(parameterValueToString(r.databaseId, "databaseId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiDeleteInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiDeleteInstanceRequest) Execute() error { + return r.ApiService.DeleteInstanceExecute(r) +} + +/* +DeleteInstance Delete Instance + +Delete an available postgres instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiDeleteInstanceRequest +*/ +func (a *DefaultAPIService) DeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequest { + return ApiDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteInstanceExecute(r ApiDeleteInstanceRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteInstance") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 412 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiDeleteUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + userId int64 +} + +func (r ApiDeleteUserRequest) Execute() error { + return r.ApiService.DeleteUserExecute(r) +} + +/* +DeleteUser Delete User + +Delete an user from a specific instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiDeleteUserRequest +*/ +func (a *DefaultAPIService) DeleteUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiDeleteUserRequest { + return ApiDeleteUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteUserExecute(r ApiDeleteUserRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteUser") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiGetBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + backupId int64 +} + +func (r ApiGetBackupRequest) Execute() (*BackupData, error) { + return r.ApiService.GetBackupExecute(r) +} + +/* +GetBackup Get specific backup + +Get information about a specific backup for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param backupId The ID of the backup. + @return ApiGetBackupRequest +*/ +func (a *DefaultAPIService) GetBackup(ctx context.Context, projectId string, region string, instanceId string, backupId int64) ApiGetBackupRequest { + return ApiGetBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return BackupData +func (a *DefaultAPIService) GetBackupExecute(r ApiGetBackupRequest) (*BackupData, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BackupData + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/backups/{backupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetDatabaseRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + databaseId int64 +} + +func (r ApiGetDatabaseRequest) Execute() (*GetDatabaseResponse, error) { + return r.ApiService.GetDatabaseExecute(r) +} + +/* +GetDatabase Get Specific Database + +Get information about a specific database in an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return ApiGetDatabaseRequest +*/ +func (a *DefaultAPIService) GetDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) ApiGetDatabaseRequest { + return ApiGetDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseId: databaseId, + } +} + +// Execute executes the request +// +// @return GetDatabaseResponse +func (a *DefaultAPIService) GetDatabaseExecute(r ApiGetDatabaseRequest) (*GetDatabaseResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetDatabaseResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetDatabase") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"databaseId"+"}", url.PathEscape(parameterValueToString(r.databaseId, "databaseId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiGetInstanceRequest) Execute() (*GetInstanceResponse, error) { + return r.ApiService.GetInstanceExecute(r) +} + +/* +GetInstance Get Specific Instance + +Get information about a specific available instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiGetInstanceRequest +*/ +func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return GetInstanceResponse +func (a *DefaultAPIService) GetInstanceExecute(r ApiGetInstanceRequest) (*GetInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + userId int64 +} + +func (r ApiGetUserRequest) Execute() (*GetUserResponse, error) { + return r.ApiService.GetUserExecute(r) +} + +/* +GetUser Get User + +Get a specific available user for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiGetUserRequest +*/ +func (a *DefaultAPIService) GetUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiGetUserRequest { + return ApiGetUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// Execute executes the request +// +// @return GetUserResponse +func (a *DefaultAPIService) GetUserExecute(r ApiGetUserRequest) (*GetUserResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetUserResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetUser") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListBackupsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + page *int64 + size *int64 + sort *BackupSort +} + +// Number of the page of items list to be returned. +func (r ApiListBackupsRequest) Page(page int64) ApiListBackupsRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiListBackupsRequest) Size(size int64) ApiListBackupsRequest { + r.size = &size + return r +} + +// Sorting of the backups to be returned on each page. +func (r ApiListBackupsRequest) Sort(sort BackupSort) ApiListBackupsRequest { + r.sort = &sort + return r +} + +func (r ApiListBackupsRequest) Execute() (*ListBackupResponse, error) { + return r.ApiService.ListBackupsExecute(r) +} + +/* +ListBackups List backups + +List all backups which are available for a specific instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiListBackupsRequest +*/ +func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListBackupResponse +func (a *DefaultAPIService) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListBackupResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListBackups") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } else { + var defaultValue int64 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int64 = 10 + parameterAddToHeaderOrQuery(localVarQueryParams, "size", defaultValue, "form", "") + r.size = &defaultValue + } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListCollationsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiListCollationsRequest) Execute() (*ListCollationsResponse, error) { + return r.ApiService.ListCollationsExecute(r) +} + +/* +ListCollations Get Collations for an Instance + +Get available collations for an instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiListCollationsRequest +*/ +func (a *DefaultAPIService) ListCollations(ctx context.Context, projectId string, region string, instanceId string) ApiListCollationsRequest { + return ApiListCollationsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListCollationsResponse +func (a *DefaultAPIService) ListCollationsExecute(r ApiListCollationsRequest) (*ListCollationsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListCollationsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCollations") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/collations" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListDatabasesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + page *int64 + size *int64 + sort *DatabaseSort +} + +// Number of the page of items list to be returned. +func (r ApiListDatabasesRequest) Page(page int64) ApiListDatabasesRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiListDatabasesRequest) Size(size int64) ApiListDatabasesRequest { + r.size = &size + return r +} + +// Sorting of the databases to be returned on each page. +func (r ApiListDatabasesRequest) Sort(sort DatabaseSort) ApiListDatabasesRequest { + r.sort = &sort + return r +} + +func (r ApiListDatabasesRequest) Execute() (*ListDatabasesResponse, error) { + return r.ApiService.ListDatabasesExecute(r) +} + +/* +ListDatabases List Databases + +List available databases for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiListDatabasesRequest +*/ +func (a *DefaultAPIService) ListDatabases(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequest { + return ApiListDatabasesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListDatabasesResponse +func (a *DefaultAPIService) ListDatabasesExecute(r ApiListDatabasesRequest) (*ListDatabasesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListDatabasesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListDatabases") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/databases" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } else { + var defaultValue int64 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int64 = 10 + parameterAddToHeaderOrQuery(localVarQueryParams, "size", defaultValue, "form", "") + r.size = &defaultValue + } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListFlavorsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + page *int64 + size *int64 + sort *FlavorSort +} + +// Number of the page of items list to be returned. +func (r ApiListFlavorsRequest) Page(page int64) ApiListFlavorsRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiListFlavorsRequest) Size(size int64) ApiListFlavorsRequest { + r.size = &size + return r +} + +// Sorting of the flavors to be returned on each page. +func (r ApiListFlavorsRequest) Sort(sort FlavorSort) ApiListFlavorsRequest { + r.sort = &sort + return r +} + +func (r ApiListFlavorsRequest) Execute() (*ListFlavorsResponse, error) { + return r.ApiService.ListFlavorsExecute(r) +} + +/* +ListFlavors Get Flavors + +Get all available flavors for a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @return ApiListFlavorsRequest +*/ +func (a *DefaultAPIService) ListFlavors(ctx context.Context, projectId string, region string) ApiListFlavorsRequest { + return ApiListFlavorsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return ListFlavorsResponse +func (a *DefaultAPIService) ListFlavorsExecute(r ApiListFlavorsRequest) (*ListFlavorsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListFlavorsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListFlavors") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/flavors" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } else { + var defaultValue int64 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int64 = 10 + parameterAddToHeaderOrQuery(localVarQueryParams, "size", defaultValue, "form", "") + r.size = &defaultValue + } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListInstancesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + page *int64 + size *int64 + sort *InstanceSort +} + +// Number of the page of items list to be returned. +func (r ApiListInstancesRequest) Page(page int64) ApiListInstancesRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiListInstancesRequest) Size(size int64) ApiListInstancesRequest { + r.size = &size + return r +} + +// Sorting of the items to be returned on each page. +func (r ApiListInstancesRequest) Sort(sort InstanceSort) ApiListInstancesRequest { + r.sort = &sort + return r +} + +func (r ApiListInstancesRequest) Execute() (*ListInstancesResponse, error) { + return r.ApiService.ListInstancesExecute(r) +} + +/* +ListInstances List Instances + +List all available instances for your project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @return ApiListInstancesRequest +*/ +func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest { + return ApiListInstancesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return ListInstancesResponse +func (a *DefaultAPIService) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListInstancesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListInstances") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } else { + var defaultValue int64 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int64 = 10 + parameterAddToHeaderOrQuery(localVarQueryParams, "size", defaultValue, "form", "") + r.size = &defaultValue + } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListRolesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string +} + +func (r ApiListRolesRequest) Execute() (*ListRolesResponse, error) { + return r.ApiService.ListRolesExecute(r) +} + +/* +ListRoles List Roles + +List available roles for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiListRolesRequest +*/ +func (a *DefaultAPIService) ListRoles(ctx context.Context, projectId string, region string, instanceId string) ApiListRolesRequest { + return ApiListRolesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListRolesResponse +func (a *DefaultAPIService) ListRolesExecute(r ApiListRolesRequest) (*ListRolesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListRolesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRoles") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/roles" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListUsersRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + page *int64 + size *int64 + sort *UserSort +} + +// Number of the page of items list to be returned. +func (r ApiListUsersRequest) Page(page int64) ApiListUsersRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiListUsersRequest) Size(size int64) ApiListUsersRequest { + r.size = &size + return r +} + +// Sorting of the users to be returned on each page. +func (r ApiListUsersRequest) Sort(sort UserSort) ApiListUsersRequest { + r.sort = &sort + return r +} + +func (r ApiListUsersRequest) Execute() (*ListUserResponse, error) { + return r.ApiService.ListUsersExecute(r) +} + +/* +ListUsers List Users + +List available users for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiListUsersRequest +*/ +func (a *DefaultAPIService) ListUsers(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequest { + return ApiListUsersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListUserResponse +func (a *DefaultAPIService) ListUsersExecute(r ApiListUsersRequest) (*ListUserResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListUserResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListUsers") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } else { + var defaultValue int64 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int64 = 10 + parameterAddToHeaderOrQuery(localVarQueryParams, "size", defaultValue, "form", "") + r.size = &defaultValue + } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListVersionsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string +} + +func (r ApiListVersionsRequest) Execute() (*ListVersionResponse, error) { + return r.ApiService.ListVersionsExecute(r) +} + +/* +ListVersions Get Versions + +Get available postgres versions for the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @return ApiListVersionsRequest +*/ +func (a *DefaultAPIService) ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest { + return ApiListVersionsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return ListVersionResponse +func (a *DefaultAPIService) ListVersionsExecute(r ApiListVersionsRequest) (*ListVersionResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListVersionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListVersions") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/versions" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPartialUpdateDatabaseRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + databaseId int64 + partialUpdateDatabasePayload *PartialUpdateDatabasePayload +} + +// The request body containing the information for the database update. +func (r ApiPartialUpdateDatabaseRequest) PartialUpdateDatabasePayload(partialUpdateDatabasePayload PartialUpdateDatabasePayload) ApiPartialUpdateDatabaseRequest { + r.partialUpdateDatabasePayload = &partialUpdateDatabasePayload + return r +} + +func (r ApiPartialUpdateDatabaseRequest) Execute() error { + return r.ApiService.PartialUpdateDatabaseExecute(r) +} + +/* +PartialUpdateDatabase Update Database partially + +Update a database partially in an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return ApiPartialUpdateDatabaseRequest +*/ +func (a *DefaultAPIService) PartialUpdateDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) ApiPartialUpdateDatabaseRequest { + return ApiPartialUpdateDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseId: databaseId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) PartialUpdateDatabaseExecute(r ApiPartialUpdateDatabaseRequest) error { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateDatabase") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"databaseId"+"}", url.PathEscape(parameterValueToString(r.databaseId, "databaseId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.partialUpdateDatabasePayload == nil { + return reportError("partialUpdateDatabasePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.partialUpdateDatabasePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiPartialUpdateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + partialUpdateInstancePayload *PartialUpdateInstancePayload +} + +// The request body with the parameters for updating the instance. +func (r ApiPartialUpdateInstanceRequest) PartialUpdateInstancePayload(partialUpdateInstancePayload PartialUpdateInstancePayload) ApiPartialUpdateInstanceRequest { + r.partialUpdateInstancePayload = &partialUpdateInstancePayload + return r +} + +func (r ApiPartialUpdateInstanceRequest) Execute() error { + return r.ApiService.PartialUpdateInstanceExecute(r) +} + +/* +PartialUpdateInstance Update Instance Partially + +Update an available instance of a postgres database. No fields are required. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiPartialUpdateInstanceRequest +*/ +func (a *DefaultAPIService) PartialUpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiPartialUpdateInstanceRequest { + return ApiPartialUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateInstance") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.partialUpdateInstancePayload == nil { + return reportError("partialUpdateInstancePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.partialUpdateInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 412 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiPartialUpdateUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + userId int64 + partialUpdateUserPayload *PartialUpdateUserPayload +} + +// 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. +func (r ApiPartialUpdateUserRequest) PartialUpdateUserPayload(partialUpdateUserPayload PartialUpdateUserPayload) ApiPartialUpdateUserRequest { + r.partialUpdateUserPayload = &partialUpdateUserPayload + return r +} + +func (r ApiPartialUpdateUserRequest) Execute() error { + return r.ApiService.PartialUpdateUserExecute(r) +} + +/* +PartialUpdateUser Update User Partially + +Update an user partially for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiPartialUpdateUserRequest +*/ +func (a *DefaultAPIService) PartialUpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiPartialUpdateUserRequest { + return ApiPartialUpdateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) PartialUpdateUserExecute(r ApiPartialUpdateUserRequest) error { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateUser") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.partialUpdateUserPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiResetUserPasswordRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + userId int64 +} + +func (r ApiResetUserPasswordRequest) Execute() (*ResetUserPasswordResponse, error) { + return r.ApiService.ResetUserPasswordExecute(r) +} + +/* +ResetUserPassword Reset User + +Reset an user from an specific instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiResetUserPasswordRequest +*/ +func (a *DefaultAPIService) ResetUserPassword(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiResetUserPasswordRequest { + return ApiResetUserPasswordRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// Execute executes the request +// +// @return ResetUserPasswordResponse +func (a *DefaultAPIService) ResetUserPasswordExecute(r ApiResetUserPasswordRequest) (*ResetUserPasswordResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ResetUserPasswordResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ResetUserPassword") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}/reset" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateDatabaseRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + databaseId int64 + updateDatabasePayload *UpdateDatabasePayload +} + +// The request body containing the information for the database update. +func (r ApiUpdateDatabaseRequest) UpdateDatabasePayload(updateDatabasePayload UpdateDatabasePayload) ApiUpdateDatabaseRequest { + r.updateDatabasePayload = &updateDatabasePayload + return r +} + +func (r ApiUpdateDatabaseRequest) Execute() error { + return r.ApiService.UpdateDatabaseExecute(r) +} + +/* +UpdateDatabase Update Database + +Update a database in an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param databaseId The ID of the database. + @return ApiUpdateDatabaseRequest +*/ +func (a *DefaultAPIService) UpdateDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) ApiUpdateDatabaseRequest { + return ApiUpdateDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseId: databaseId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) UpdateDatabaseExecute(r ApiUpdateDatabaseRequest) error { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateDatabase") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"databaseId"+"}", url.PathEscape(parameterValueToString(r.databaseId, "databaseId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateDatabasePayload == nil { + return reportError("updateDatabasePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateDatabasePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiUpdateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + updateInstancePayload *UpdateInstancePayload +} + +// The request body with the parameters for updating the instance +func (r ApiUpdateInstanceRequest) UpdateInstancePayload(updateInstancePayload UpdateInstancePayload) ApiUpdateInstanceRequest { + r.updateInstancePayload = &updateInstancePayload + return r +} + +func (r ApiUpdateInstanceRequest) Execute() error { + return r.ApiService.UpdateInstanceExecute(r) +} + +/* +UpdateInstance Update Instance + +Updates an available instance of a postgres database + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiUpdateInstanceRequest +*/ +func (a *DefaultAPIService) UpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequest { + return ApiUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) UpdateInstanceExecute(r ApiUpdateInstanceRequest) error { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateInstance") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateInstancePayload == nil { + return reportError("updateInstancePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 412 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +type ApiUpdateInstanceProtectionRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + updateInstanceProtectionPayload *UpdateInstanceProtectionPayload +} + +// The request body with flag isDeletable. Parameter is required. +func (r ApiUpdateInstanceProtectionRequest) UpdateInstanceProtectionPayload(updateInstanceProtectionPayload UpdateInstanceProtectionPayload) ApiUpdateInstanceProtectionRequest { + r.updateInstanceProtectionPayload = &updateInstanceProtectionPayload + return r +} + +func (r ApiUpdateInstanceProtectionRequest) Execute() (*UpdateInstanceProtectionResponse, error) { + return r.ApiService.UpdateInstanceProtectionExecute(r) +} + +/* +UpdateInstanceProtection Toggle Instance Protection + +Toggle the deletion protection for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiUpdateInstanceProtectionRequest +*/ +func (a *DefaultAPIService) UpdateInstanceProtection(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceProtectionRequest { + return ApiUpdateInstanceProtectionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return UpdateInstanceProtectionResponse +func (a *DefaultAPIService) UpdateInstanceProtectionExecute(r ApiUpdateInstanceProtectionRequest) (*UpdateInstanceProtectionResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateInstanceProtectionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateInstanceProtection") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/protections" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateInstanceProtectionPayload == nil { + return localVarReturnValue, reportError("updateInstanceProtectionPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateInstanceProtectionPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateUserRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + userId int64 + updateUserPayload *UpdateUserPayload +} + +// The Request body containing the updated infos for the user. +func (r ApiUpdateUserRequest) UpdateUserPayload(updateUserPayload UpdateUserPayload) ApiUpdateUserRequest { + r.updateUserPayload = &updateUserPayload + return r +} + +func (r ApiUpdateUserRequest) Execute() error { + return r.ApiService.UpdateUserExecute(r) +} + +/* +UpdateUser Update User + +Update user for an instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @param userId The ID of the user. + @return ApiUpdateUserRequest +*/ +func (a *DefaultAPIService) UpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiUpdateUserRequest { + return ApiUpdateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) UpdateUserExecute(r ApiUpdateUserRequest) error { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateUser") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v3/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateUserPayload == nil { + return reportError("updateUserPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateUserPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} diff --git a/services/postgresflex/v3api/api_default_mock.go b/services/postgresflex/v3api/api_default_mock.go new file mode 100644 index 000000000..9e7d22cc8 --- /dev/null +++ b/services/postgresflex/v3api/api_default_mock.go @@ -0,0 +1,615 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "context" +) + +// assert the implementation matches the interface +var _ DefaultAPI = &DefaultAPIServiceMock{} + +// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. +// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. +type DefaultAPIServiceMock struct { + // CloneInstanceExecuteMock can be populated to implement the behavior of the CloneInstanceExecute function of this mock + CloneInstanceExecuteMock *func(r ApiCloneInstanceRequest) (*CloneInstanceResponse, error) + // CreateDatabaseExecuteMock can be populated to implement the behavior of the CreateDatabaseExecute function of this mock + CreateDatabaseExecuteMock *func(r ApiCreateDatabaseRequest) (*CreateDatabaseResponse, error) + // CreateInstanceExecuteMock can be populated to implement the behavior of the CreateInstanceExecute function of this mock + CreateInstanceExecuteMock *func(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) + // CreateUserExecuteMock can be populated to implement the behavior of the CreateUserExecute function of this mock + CreateUserExecuteMock *func(r ApiCreateUserRequest) (*CreateUserResponse, error) + // DeleteDatabaseExecuteMock can be populated to implement the behavior of the DeleteDatabaseExecute function of this mock + DeleteDatabaseExecuteMock *func(r ApiDeleteDatabaseRequest) error + // DeleteInstanceExecuteMock can be populated to implement the behavior of the DeleteInstanceExecute function of this mock + DeleteInstanceExecuteMock *func(r ApiDeleteInstanceRequest) error + // DeleteUserExecuteMock can be populated to implement the behavior of the DeleteUserExecute function of this mock + DeleteUserExecuteMock *func(r ApiDeleteUserRequest) error + // GetBackupExecuteMock can be populated to implement the behavior of the GetBackupExecute function of this mock + GetBackupExecuteMock *func(r ApiGetBackupRequest) (*BackupData, error) + // GetDatabaseExecuteMock can be populated to implement the behavior of the GetDatabaseExecute function of this mock + GetDatabaseExecuteMock *func(r ApiGetDatabaseRequest) (*GetDatabaseResponse, error) + // GetInstanceExecuteMock can be populated to implement the behavior of the GetInstanceExecute function of this mock + GetInstanceExecuteMock *func(r ApiGetInstanceRequest) (*GetInstanceResponse, error) + // GetUserExecuteMock can be populated to implement the behavior of the GetUserExecute function of this mock + GetUserExecuteMock *func(r ApiGetUserRequest) (*GetUserResponse, error) + // ListBackupsExecuteMock can be populated to implement the behavior of the ListBackupsExecute function of this mock + ListBackupsExecuteMock *func(r ApiListBackupsRequest) (*ListBackupResponse, error) + // ListCollationsExecuteMock can be populated to implement the behavior of the ListCollationsExecute function of this mock + ListCollationsExecuteMock *func(r ApiListCollationsRequest) (*ListCollationsResponse, error) + // ListDatabasesExecuteMock can be populated to implement the behavior of the ListDatabasesExecute function of this mock + ListDatabasesExecuteMock *func(r ApiListDatabasesRequest) (*ListDatabasesResponse, error) + // ListFlavorsExecuteMock can be populated to implement the behavior of the ListFlavorsExecute function of this mock + ListFlavorsExecuteMock *func(r ApiListFlavorsRequest) (*ListFlavorsResponse, error) + // ListInstancesExecuteMock can be populated to implement the behavior of the ListInstancesExecute function of this mock + ListInstancesExecuteMock *func(r ApiListInstancesRequest) (*ListInstancesResponse, error) + // ListRolesExecuteMock can be populated to implement the behavior of the ListRolesExecute function of this mock + ListRolesExecuteMock *func(r ApiListRolesRequest) (*ListRolesResponse, error) + // ListUsersExecuteMock can be populated to implement the behavior of the ListUsersExecute function of this mock + ListUsersExecuteMock *func(r ApiListUsersRequest) (*ListUserResponse, error) + // ListVersionsExecuteMock can be populated to implement the behavior of the ListVersionsExecute function of this mock + ListVersionsExecuteMock *func(r ApiListVersionsRequest) (*ListVersionResponse, error) + // PartialUpdateDatabaseExecuteMock can be populated to implement the behavior of the PartialUpdateDatabaseExecute function of this mock + PartialUpdateDatabaseExecuteMock *func(r ApiPartialUpdateDatabaseRequest) error + // PartialUpdateInstanceExecuteMock can be populated to implement the behavior of the PartialUpdateInstanceExecute function of this mock + PartialUpdateInstanceExecuteMock *func(r ApiPartialUpdateInstanceRequest) error + // PartialUpdateUserExecuteMock can be populated to implement the behavior of the PartialUpdateUserExecute function of this mock + PartialUpdateUserExecuteMock *func(r ApiPartialUpdateUserRequest) error + // ResetUserPasswordExecuteMock can be populated to implement the behavior of the ResetUserPasswordExecute function of this mock + ResetUserPasswordExecuteMock *func(r ApiResetUserPasswordRequest) (*ResetUserPasswordResponse, error) + // UpdateDatabaseExecuteMock can be populated to implement the behavior of the UpdateDatabaseExecute function of this mock + UpdateDatabaseExecuteMock *func(r ApiUpdateDatabaseRequest) error + // UpdateInstanceExecuteMock can be populated to implement the behavior of the UpdateInstanceExecute function of this mock + UpdateInstanceExecuteMock *func(r ApiUpdateInstanceRequest) error + // UpdateInstanceProtectionExecuteMock can be populated to implement the behavior of the UpdateInstanceProtectionExecute function of this mock + UpdateInstanceProtectionExecuteMock *func(r ApiUpdateInstanceProtectionRequest) (*UpdateInstanceProtectionResponse, error) + // UpdateUserExecuteMock can be populated to implement the behavior of the UpdateUserExecute function of this mock + UpdateUserExecuteMock *func(r ApiUpdateUserRequest) error +} + +func (a DefaultAPIServiceMock) CloneInstance(ctx context.Context, projectId string, region string, instanceId string) ApiCloneInstanceRequest { + return ApiCloneInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// CloneInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CloneInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CloneInstanceExecute(r ApiCloneInstanceRequest) (*CloneInstanceResponse, error) { + if a.CloneInstanceExecuteMock == nil { + var localVarReturnValue *CloneInstanceResponse + return localVarReturnValue, nil + } + + return (*a.CloneInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateDatabase(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequest { + return ApiCreateDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// CreateDatabaseExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateDatabaseExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateDatabaseExecute(r ApiCreateDatabaseRequest) (*CreateDatabaseResponse, error) { + if a.CreateDatabaseExecuteMock == nil { + var localVarReturnValue *CreateDatabaseResponse + return localVarReturnValue, nil + } + + return (*a.CreateDatabaseExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateInstance(ctx context.Context, projectId string, region string) ApiCreateInstanceRequest { + return ApiCreateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) { + if a.CreateInstanceExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.CreateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateUser(ctx context.Context, projectId string, region string, instanceId string) ApiCreateUserRequest { + return ApiCreateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// CreateUserExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateUserExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateUserExecute(r ApiCreateUserRequest) (*CreateUserResponse, error) { + if a.CreateUserExecuteMock == nil { + var localVarReturnValue *CreateUserResponse + return localVarReturnValue, nil + } + + return (*a.CreateUserExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) ApiDeleteDatabaseRequest { + return ApiDeleteDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseId: databaseId, + } +} + +// DeleteDatabaseExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteDatabaseExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteDatabaseExecute(r ApiDeleteDatabaseRequest) error { + if a.DeleteDatabaseExecuteMock == nil { + return nil + } + + return (*a.DeleteDatabaseExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteInstance(ctx context.Context, projectId string, region string, instanceId string) ApiDeleteInstanceRequest { + return ApiDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// DeleteInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteInstanceExecute(r ApiDeleteInstanceRequest) error { + if a.DeleteInstanceExecuteMock == nil { + return nil + } + + return (*a.DeleteInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiDeleteUserRequest { + return ApiDeleteUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// DeleteUserExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteUserExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteUserExecute(r ApiDeleteUserRequest) error { + if a.DeleteUserExecuteMock == nil { + return nil + } + + return (*a.DeleteUserExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetBackup(ctx context.Context, projectId string, region string, instanceId string, backupId int64) ApiGetBackupRequest { + return ApiGetBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + backupId: backupId, + } +} + +// GetBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetBackupExecute(r ApiGetBackupRequest) (*BackupData, error) { + if a.GetBackupExecuteMock == nil { + var localVarReturnValue *BackupData + return localVarReturnValue, nil + } + + return (*a.GetBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) ApiGetDatabaseRequest { + return ApiGetDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseId: databaseId, + } +} + +// GetDatabaseExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetDatabaseExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetDatabaseExecute(r ApiGetDatabaseRequest) (*GetDatabaseResponse, error) { + if a.GetDatabaseExecuteMock == nil { + var localVarReturnValue *GetDatabaseResponse + return localVarReturnValue, nil + } + + return (*a.GetDatabaseExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// GetInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetInstanceExecute(r ApiGetInstanceRequest) (*GetInstanceResponse, error) { + if a.GetInstanceExecuteMock == nil { + var localVarReturnValue *GetInstanceResponse + return localVarReturnValue, nil + } + + return (*a.GetInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiGetUserRequest { + return ApiGetUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// GetUserExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetUserExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetUserExecute(r ApiGetUserRequest) (*GetUserResponse, error) { + if a.GetUserExecuteMock == nil { + var localVarReturnValue *GetUserResponse + return localVarReturnValue, nil + } + + return (*a.GetUserExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// ListBackupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListBackupsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupResponse, error) { + if a.ListBackupsExecuteMock == nil { + var localVarReturnValue *ListBackupResponse + return localVarReturnValue, nil + } + + return (*a.ListBackupsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListCollations(ctx context.Context, projectId string, region string, instanceId string) ApiListCollationsRequest { + return ApiListCollationsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// ListCollationsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListCollationsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListCollationsExecute(r ApiListCollationsRequest) (*ListCollationsResponse, error) { + if a.ListCollationsExecuteMock == nil { + var localVarReturnValue *ListCollationsResponse + return localVarReturnValue, nil + } + + return (*a.ListCollationsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListDatabases(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequest { + return ApiListDatabasesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// ListDatabasesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListDatabasesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListDatabasesExecute(r ApiListDatabasesRequest) (*ListDatabasesResponse, error) { + if a.ListDatabasesExecuteMock == nil { + var localVarReturnValue *ListDatabasesResponse + return localVarReturnValue, nil + } + + return (*a.ListDatabasesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListFlavors(ctx context.Context, projectId string, region string) ApiListFlavorsRequest { + return ApiListFlavorsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListFlavorsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListFlavorsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListFlavorsExecute(r ApiListFlavorsRequest) (*ListFlavorsResponse, error) { + if a.ListFlavorsExecuteMock == nil { + var localVarReturnValue *ListFlavorsResponse + return localVarReturnValue, nil + } + + return (*a.ListFlavorsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest { + return ApiListInstancesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListInstancesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListInstancesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) { + if a.ListInstancesExecuteMock == nil { + var localVarReturnValue *ListInstancesResponse + return localVarReturnValue, nil + } + + return (*a.ListInstancesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListRoles(ctx context.Context, projectId string, region string, instanceId string) ApiListRolesRequest { + return ApiListRolesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// ListRolesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListRolesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListRolesExecute(r ApiListRolesRequest) (*ListRolesResponse, error) { + if a.ListRolesExecuteMock == nil { + var localVarReturnValue *ListRolesResponse + return localVarReturnValue, nil + } + + return (*a.ListRolesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListUsers(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequest { + return ApiListUsersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// ListUsersExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListUsersExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListUsersExecute(r ApiListUsersRequest) (*ListUserResponse, error) { + if a.ListUsersExecuteMock == nil { + var localVarReturnValue *ListUserResponse + return localVarReturnValue, nil + } + + return (*a.ListUsersExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest { + return ApiListVersionsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListVersionsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListVersionsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListVersionsExecute(r ApiListVersionsRequest) (*ListVersionResponse, error) { + if a.ListVersionsExecuteMock == nil { + var localVarReturnValue *ListVersionResponse + return localVarReturnValue, nil + } + + return (*a.ListVersionsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PartialUpdateDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) ApiPartialUpdateDatabaseRequest { + return ApiPartialUpdateDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseId: databaseId, + } +} + +// PartialUpdateDatabaseExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateDatabaseExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateDatabaseExecute(r ApiPartialUpdateDatabaseRequest) error { + if a.PartialUpdateDatabaseExecuteMock == nil { + return nil + } + + return (*a.PartialUpdateDatabaseExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PartialUpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiPartialUpdateInstanceRequest { + return ApiPartialUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// PartialUpdateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error { + if a.PartialUpdateInstanceExecuteMock == nil { + return nil + } + + return (*a.PartialUpdateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PartialUpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiPartialUpdateUserRequest { + return ApiPartialUpdateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// PartialUpdateUserExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateUserExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateUserExecute(r ApiPartialUpdateUserRequest) error { + if a.PartialUpdateUserExecuteMock == nil { + return nil + } + + return (*a.PartialUpdateUserExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ResetUserPassword(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiResetUserPasswordRequest { + return ApiResetUserPasswordRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// ResetUserPasswordExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ResetUserPasswordExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ResetUserPasswordExecute(r ApiResetUserPasswordRequest) (*ResetUserPasswordResponse, error) { + if a.ResetUserPasswordExecuteMock == nil { + var localVarReturnValue *ResetUserPasswordResponse + return localVarReturnValue, nil + } + + return (*a.ResetUserPasswordExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseId int64) ApiUpdateDatabaseRequest { + return ApiUpdateDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseId: databaseId, + } +} + +// UpdateDatabaseExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateDatabaseExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateDatabaseExecute(r ApiUpdateDatabaseRequest) error { + if a.UpdateDatabaseExecuteMock == nil { + return nil + } + + return (*a.UpdateDatabaseExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceRequest { + return ApiUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// UpdateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateInstanceExecute(r ApiUpdateInstanceRequest) error { + if a.UpdateInstanceExecuteMock == nil { + return nil + } + + return (*a.UpdateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateInstanceProtection(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceProtectionRequest { + return ApiUpdateInstanceProtectionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// UpdateInstanceProtectionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateInstanceProtectionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateInstanceProtectionExecute(r ApiUpdateInstanceProtectionRequest) (*UpdateInstanceProtectionResponse, error) { + if a.UpdateInstanceProtectionExecuteMock == nil { + var localVarReturnValue *UpdateInstanceProtectionResponse + return localVarReturnValue, nil + } + + return (*a.UpdateInstanceProtectionExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiUpdateUserRequest { + return ApiUpdateUserRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + userId: userId, + } +} + +// UpdateUserExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateUserExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateUserExecute(r ApiUpdateUserRequest) error { + if a.UpdateUserExecuteMock == nil { + return nil + } + + return (*a.UpdateUserExecuteMock)(r) +} diff --git a/services/postgresflex/v3api/client.go b/services/postgresflex/v3api/client.go new file mode 100644 index 000000000..7f004f9d2 --- /dev/null +++ b/services/postgresflex/v3api/client.go @@ -0,0 +1,659 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v3api + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the STACKIT PostgreSQL Flex API API v3.0.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultAPI DefaultAPI +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultAPI = (*DefaultAPIService)(&c.common) + + return c, nil +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *config.Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/services/postgresflex/v3api/configuration.go b/services/postgresflex/v3api/configuration.go new file mode 100644 index 000000000..ef1fce50c --- /dev/null +++ b/services/postgresflex/v3api/configuration.go @@ -0,0 +1,38 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v3api + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "stackit-sdk-go/postgresflex", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://postgres-flex-service.api.stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "global", + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/postgresflex/v3api/model_backup_data.go b/services/postgresflex/v3api/model_backup_data.go new file mode 100644 index 000000000..3d2dd4827 --- /dev/null +++ b/services/postgresflex/v3api/model_backup_data.go @@ -0,0 +1,318 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the BackupData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupData{} + +// BackupData struct for BackupData +type BackupData struct { + // The time when the backup was completed in RFC3339 format. + CompletionTime string `json:"completionTime"` + // The ID of the backup. + Id int64 `json:"id"` + // The name of the backup. + Name string `json:"name"` + // The time until the backup will be retained. + RetainedUntil string `json:"retainedUntil"` + // The size of the backup in bytes. + Size int64 `json:"size"` + // The type of the backup, which can be automated or manual triggered. + Type string `json:"type"` + AdditionalProperties map[string]interface{} +} + +type _BackupData BackupData + +// NewBackupData instantiates a new BackupData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackupData(completionTime string, id int64, name string, retainedUntil string, size int64, types string) *BackupData { + this := BackupData{} + this.CompletionTime = completionTime + this.Id = id + this.Name = name + this.RetainedUntil = retainedUntil + this.Size = size + this.Type = types + return &this +} + +// NewBackupDataWithDefaults instantiates a new BackupData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupDataWithDefaults() *BackupData { + this := BackupData{} + return &this +} + +// GetCompletionTime returns the CompletionTime field value +func (o *BackupData) GetCompletionTime() string { + if o == nil { + var ret string + return ret + } + + return o.CompletionTime +} + +// GetCompletionTimeOk returns a tuple with the CompletionTime field value +// and a boolean to check if the value has been set. +func (o *BackupData) GetCompletionTimeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CompletionTime, true +} + +// SetCompletionTime sets field value +func (o *BackupData) SetCompletionTime(v string) { + o.CompletionTime = v +} + +// GetId returns the Id field value +func (o *BackupData) GetId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *BackupData) GetIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *BackupData) SetId(v int64) { + o.Id = v +} + +// GetName returns the Name field value +func (o *BackupData) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *BackupData) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *BackupData) SetName(v string) { + o.Name = v +} + +// GetRetainedUntil returns the RetainedUntil field value +func (o *BackupData) GetRetainedUntil() string { + if o == nil { + var ret string + return ret + } + + return o.RetainedUntil +} + +// GetRetainedUntilOk returns a tuple with the RetainedUntil field value +// and a boolean to check if the value has been set. +func (o *BackupData) GetRetainedUntilOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RetainedUntil, true +} + +// SetRetainedUntil sets field value +func (o *BackupData) SetRetainedUntil(v string) { + o.RetainedUntil = v +} + +// GetSize returns the Size field value +func (o *BackupData) GetSize() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *BackupData) GetSizeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *BackupData) SetSize(v int64) { + o.Size = v +} + +// GetType returns the Type field value +func (o *BackupData) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *BackupData) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *BackupData) SetType(v string) { + o.Type = v +} + +func (o BackupData) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BackupData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["completionTime"] = o.CompletionTime + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["retainedUntil"] = o.RetainedUntil + toSerialize["size"] = o.Size + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BackupData) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "completionTime", + "id", + "name", + "retainedUntil", + "size", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackupData := _BackupData{} + + err = json.Unmarshal(data, &varBackupData) + + if err != nil { + return err + } + + *o = BackupData(varBackupData) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "completionTime") + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "retainedUntil") + delete(additionalProperties, "size") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBackupData struct { + value *BackupData + isSet bool +} + +func (v NullableBackupData) Get() *BackupData { + return v.value +} + +func (v *NullableBackupData) Set(val *BackupData) { + v.value = val + v.isSet = true +} + +func (v NullableBackupData) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupData(val *BackupData) *NullableBackupData { + return &NullableBackupData{value: val, isSet: true} +} + +func (v NullableBackupData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_backup_sort.go b/services/postgresflex/v3api/model_backup_sort.go new file mode 100644 index 000000000..6127d83c8 --- /dev/null +++ b/services/postgresflex/v3api/model_backup_sort.go @@ -0,0 +1,134 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// BackupSort the model 'BackupSort' +type BackupSort string + +// List of backup.sort +const ( + BACKUPSORT_COMPLETION_TIME_DESC BackupSort = "completion_time.desc" + BACKUPSORT_COMPLETION_TIME_ASC BackupSort = "completion_time.asc" + BACKUPSORT_END_TIME_DESC BackupSort = "end_time.desc" + BACKUPSORT_END_TIME_ASC BackupSort = "end_time.asc" + BACKUPSORT_NAME_DESC BackupSort = "name.desc" + BACKUPSORT_NAME_ASC BackupSort = "name.asc" + BACKUPSORT_RETAINED_UNTIL_DESC BackupSort = "retained_until.desc" + BACKUPSORT_RETAINED_UNTIL_ASC BackupSort = "retained_until.asc" + BACKUPSORT_SIZE_DESC BackupSort = "size.desc" + BACKUPSORT_SIZE_ASC BackupSort = "size.asc" + BACKUPSORT_TYPE_DESC BackupSort = "type.desc" + BACKUPSORT_TYPE_ASC BackupSort = "type.asc" + BACKUPSORT_UNKNOWN_DEFAULT_OPEN_API BackupSort = "unknown_default_open_api" +) + +// All allowed values of BackupSort enum +var AllowedBackupSortEnumValues = []BackupSort{ + "completion_time.desc", + "completion_time.asc", + "end_time.desc", + "end_time.asc", + "name.desc", + "name.asc", + "retained_until.desc", + "retained_until.asc", + "size.desc", + "size.asc", + "type.desc", + "type.asc", + "unknown_default_open_api", +} + +func (v *BackupSort) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := BackupSort(value) + for _, existing := range AllowedBackupSortEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = BACKUPSORT_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewBackupSortFromValue returns a pointer to a valid BackupSort +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewBackupSortFromValue(v string) (*BackupSort, error) { + ev := BackupSort(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BackupSort: valid values are %v", v, AllowedBackupSortEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v BackupSort) IsValid() bool { + for _, existing := range AllowedBackupSortEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to backup.sort value +func (v BackupSort) Ptr() *BackupSort { + return &v +} + +type NullableBackupSort struct { + value *BackupSort + isSet bool +} + +func (v NullableBackupSort) Get() *BackupSort { + return v.value +} + +func (v *NullableBackupSort) Set(val *BackupSort) { + v.value = val + v.isSet = true +} + +func (v NullableBackupSort) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupSort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupSort(val *BackupSort) *NullableBackupSort { + return &NullableBackupSort{value: val, isSet: true} +} + +func (v NullableBackupSort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupSort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_clone_instance_overrides.go b/services/postgresflex/v3api/model_clone_instance_overrides.go new file mode 100644 index 000000000..546f20042 --- /dev/null +++ b/services/postgresflex/v3api/model_clone_instance_overrides.go @@ -0,0 +1,244 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CloneInstanceOverrides type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CloneInstanceOverrides{} + +// CloneInstanceOverrides struct for CloneInstanceOverrides +type CloneInstanceOverrides struct { + // The storage class for the storage. + Class *string `json:"class,omitempty"` + // The name of the cloned instance. If not provided, the default naming behavior of appending '-clone' to the source instance name is used. + Name *string `json:"name,omitempty"` + // The storage size in Gigabytes. + Size int64 `json:"size"` + AdditionalProperties map[string]interface{} +} + +type _CloneInstanceOverrides CloneInstanceOverrides + +// NewCloneInstanceOverrides instantiates a new CloneInstanceOverrides object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCloneInstanceOverrides(size int64) *CloneInstanceOverrides { + this := CloneInstanceOverrides{} + this.Size = size + return &this +} + +// NewCloneInstanceOverridesWithDefaults instantiates a new CloneInstanceOverrides object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCloneInstanceOverridesWithDefaults() *CloneInstanceOverrides { + this := CloneInstanceOverrides{} + return &this +} + +// GetClass returns the Class field value if set, zero value otherwise. +func (o *CloneInstanceOverrides) GetClass() string { + if o == nil || IsNil(o.Class) { + var ret string + return ret + } + return *o.Class +} + +// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CloneInstanceOverrides) GetClassOk() (*string, bool) { + if o == nil || IsNil(o.Class) { + return nil, false + } + return o.Class, true +} + +// HasClass returns a boolean if a field has been set. +func (o *CloneInstanceOverrides) HasClass() bool { + if o != nil && !IsNil(o.Class) { + return true + } + + return false +} + +// SetClass gets a reference to the given string and assigns it to the Class field. +func (o *CloneInstanceOverrides) SetClass(v string) { + o.Class = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CloneInstanceOverrides) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CloneInstanceOverrides) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CloneInstanceOverrides) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CloneInstanceOverrides) SetName(v string) { + o.Name = &v +} + +// GetSize returns the Size field value +func (o *CloneInstanceOverrides) GetSize() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *CloneInstanceOverrides) GetSizeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *CloneInstanceOverrides) SetSize(v int64) { + o.Size = v +} + +func (o CloneInstanceOverrides) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CloneInstanceOverrides) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Class) { + toSerialize["class"] = o.Class + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["size"] = o.Size + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CloneInstanceOverrides) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "size", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCloneInstanceOverrides := _CloneInstanceOverrides{} + + err = json.Unmarshal(data, &varCloneInstanceOverrides) + + if err != nil { + return err + } + + *o = CloneInstanceOverrides(varCloneInstanceOverrides) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "class") + delete(additionalProperties, "name") + delete(additionalProperties, "size") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCloneInstanceOverrides struct { + value *CloneInstanceOverrides + isSet bool +} + +func (v NullableCloneInstanceOverrides) Get() *CloneInstanceOverrides { + return v.value +} + +func (v *NullableCloneInstanceOverrides) Set(val *CloneInstanceOverrides) { + v.value = val + v.isSet = true +} + +func (v NullableCloneInstanceOverrides) IsSet() bool { + return v.isSet +} + +func (v *NullableCloneInstanceOverrides) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCloneInstanceOverrides(val *CloneInstanceOverrides) *NullableCloneInstanceOverrides { + return &NullableCloneInstanceOverrides{value: val, isSet: true} +} + +func (v NullableCloneInstanceOverrides) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCloneInstanceOverrides) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_clone_instance_payload.go b/services/postgresflex/v3api/model_clone_instance_payload.go new file mode 100644 index 000000000..9cc6591ee --- /dev/null +++ b/services/postgresflex/v3api/model_clone_instance_payload.go @@ -0,0 +1,198 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the CloneInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CloneInstancePayload{} + +// CloneInstancePayload struct for CloneInstancePayload +type CloneInstancePayload struct { + InstanceOverrides CloneInstanceOverrides `json:"instanceOverrides"` + // the time for the point in time recovery it will be calculated between first backup and last backup + PointInTime time.Time `json:"pointInTime"` + AdditionalProperties map[string]interface{} +} + +type _CloneInstancePayload CloneInstancePayload + +// NewCloneInstancePayload instantiates a new CloneInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCloneInstancePayload(instanceOverrides CloneInstanceOverrides, pointInTime time.Time) *CloneInstancePayload { + this := CloneInstancePayload{} + this.InstanceOverrides = instanceOverrides + this.PointInTime = pointInTime + return &this +} + +// NewCloneInstancePayloadWithDefaults instantiates a new CloneInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCloneInstancePayloadWithDefaults() *CloneInstancePayload { + this := CloneInstancePayload{} + return &this +} + +// GetInstanceOverrides returns the InstanceOverrides field value +func (o *CloneInstancePayload) GetInstanceOverrides() CloneInstanceOverrides { + if o == nil { + var ret CloneInstanceOverrides + return ret + } + + return o.InstanceOverrides +} + +// GetInstanceOverridesOk returns a tuple with the InstanceOverrides field value +// and a boolean to check if the value has been set. +func (o *CloneInstancePayload) GetInstanceOverridesOk() (*CloneInstanceOverrides, bool) { + if o == nil { + return nil, false + } + return &o.InstanceOverrides, true +} + +// SetInstanceOverrides sets field value +func (o *CloneInstancePayload) SetInstanceOverrides(v CloneInstanceOverrides) { + o.InstanceOverrides = v +} + +// GetPointInTime returns the PointInTime field value +func (o *CloneInstancePayload) GetPointInTime() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.PointInTime +} + +// GetPointInTimeOk returns a tuple with the PointInTime field value +// and a boolean to check if the value has been set. +func (o *CloneInstancePayload) GetPointInTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.PointInTime, true +} + +// SetPointInTime sets field value +func (o *CloneInstancePayload) SetPointInTime(v time.Time) { + o.PointInTime = v +} + +func (o CloneInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CloneInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceOverrides"] = o.InstanceOverrides + toSerialize["pointInTime"] = o.PointInTime + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CloneInstancePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceOverrides", + "pointInTime", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCloneInstancePayload := _CloneInstancePayload{} + + err = json.Unmarshal(data, &varCloneInstancePayload) + + if err != nil { + return err + } + + *o = CloneInstancePayload(varCloneInstancePayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceOverrides") + delete(additionalProperties, "pointInTime") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCloneInstancePayload struct { + value *CloneInstancePayload + isSet bool +} + +func (v NullableCloneInstancePayload) Get() *CloneInstancePayload { + return v.value +} + +func (v *NullableCloneInstancePayload) Set(val *CloneInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCloneInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCloneInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCloneInstancePayload(val *CloneInstancePayload) *NullableCloneInstancePayload { + return &NullableCloneInstancePayload{value: val, isSet: true} +} + +func (v NullableCloneInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCloneInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_clone_instance_response.go b/services/postgresflex/v3api/model_clone_instance_response.go new file mode 100644 index 000000000..163829c58 --- /dev/null +++ b/services/postgresflex/v3api/model_clone_instance_response.go @@ -0,0 +1,168 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CloneInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CloneInstanceResponse{} + +// CloneInstanceResponse struct for CloneInstanceResponse +type CloneInstanceResponse struct { + // The ID of the instance. + Id string `json:"id"` + AdditionalProperties map[string]interface{} +} + +type _CloneInstanceResponse CloneInstanceResponse + +// NewCloneInstanceResponse instantiates a new CloneInstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCloneInstanceResponse(id string) *CloneInstanceResponse { + this := CloneInstanceResponse{} + this.Id = id + return &this +} + +// NewCloneInstanceResponseWithDefaults instantiates a new CloneInstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCloneInstanceResponseWithDefaults() *CloneInstanceResponse { + this := CloneInstanceResponse{} + return &this +} + +// GetId returns the Id field value +func (o *CloneInstanceResponse) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CloneInstanceResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CloneInstanceResponse) SetId(v string) { + o.Id = v +} + +func (o CloneInstanceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CloneInstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CloneInstanceResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCloneInstanceResponse := _CloneInstanceResponse{} + + err = json.Unmarshal(data, &varCloneInstanceResponse) + + if err != nil { + return err + } + + *o = CloneInstanceResponse(varCloneInstanceResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCloneInstanceResponse struct { + value *CloneInstanceResponse + isSet bool +} + +func (v NullableCloneInstanceResponse) Get() *CloneInstanceResponse { + return v.value +} + +func (v *NullableCloneInstanceResponse) Set(val *CloneInstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCloneInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCloneInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCloneInstanceResponse(val *CloneInstanceResponse) *NullableCloneInstanceResponse { + return &NullableCloneInstanceResponse{value: val, isSet: true} +} + +func (v NullableCloneInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCloneInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_create_database_payload.go b/services/postgresflex/v3api/model_create_database_payload.go new file mode 100644 index 000000000..0badeeaf6 --- /dev/null +++ b/services/postgresflex/v3api/model_create_database_payload.go @@ -0,0 +1,206 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateDatabasePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateDatabasePayload{} + +// CreateDatabasePayload struct for CreateDatabasePayload +type CreateDatabasePayload struct { + // The name of the database. + Name string `json:"name"` + // The owner of the database. + Owner *string `json:"owner,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateDatabasePayload CreateDatabasePayload + +// NewCreateDatabasePayload instantiates a new CreateDatabasePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateDatabasePayload(name string) *CreateDatabasePayload { + this := CreateDatabasePayload{} + this.Name = name + return &this +} + +// NewCreateDatabasePayloadWithDefaults instantiates a new CreateDatabasePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateDatabasePayloadWithDefaults() *CreateDatabasePayload { + this := CreateDatabasePayload{} + return &this +} + +// GetName returns the Name field value +func (o *CreateDatabasePayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateDatabasePayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateDatabasePayload) SetName(v string) { + o.Name = v +} + +// GetOwner returns the Owner field value if set, zero value otherwise. +func (o *CreateDatabasePayload) GetOwner() string { + if o == nil || IsNil(o.Owner) { + var ret string + return ret + } + return *o.Owner +} + +// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDatabasePayload) GetOwnerOk() (*string, bool) { + if o == nil || IsNil(o.Owner) { + return nil, false + } + return o.Owner, true +} + +// HasOwner returns a boolean if a field has been set. +func (o *CreateDatabasePayload) HasOwner() bool { + if o != nil && !IsNil(o.Owner) { + return true + } + + return false +} + +// SetOwner gets a reference to the given string and assigns it to the Owner field. +func (o *CreateDatabasePayload) SetOwner(v string) { + o.Owner = &v +} + +func (o CreateDatabasePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateDatabasePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Owner) { + toSerialize["owner"] = o.Owner + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateDatabasePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateDatabasePayload := _CreateDatabasePayload{} + + err = json.Unmarshal(data, &varCreateDatabasePayload) + + if err != nil { + return err + } + + *o = CreateDatabasePayload(varCreateDatabasePayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "owner") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateDatabasePayload struct { + value *CreateDatabasePayload + isSet bool +} + +func (v NullableCreateDatabasePayload) Get() *CreateDatabasePayload { + return v.value +} + +func (v *NullableCreateDatabasePayload) Set(val *CreateDatabasePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateDatabasePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateDatabasePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateDatabasePayload(val *CreateDatabasePayload) *NullableCreateDatabasePayload { + return &NullableCreateDatabasePayload{value: val, isSet: true} +} + +func (v NullableCreateDatabasePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateDatabasePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_create_database_response.go b/services/postgresflex/v3api/model_create_database_response.go new file mode 100644 index 000000000..005f10e98 --- /dev/null +++ b/services/postgresflex/v3api/model_create_database_response.go @@ -0,0 +1,168 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateDatabaseResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateDatabaseResponse{} + +// CreateDatabaseResponse struct for CreateDatabaseResponse +type CreateDatabaseResponse struct { + // The id of the database. + Id int64 `json:"id"` + AdditionalProperties map[string]interface{} +} + +type _CreateDatabaseResponse CreateDatabaseResponse + +// NewCreateDatabaseResponse instantiates a new CreateDatabaseResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateDatabaseResponse(id int64) *CreateDatabaseResponse { + this := CreateDatabaseResponse{} + this.Id = id + return &this +} + +// NewCreateDatabaseResponseWithDefaults instantiates a new CreateDatabaseResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateDatabaseResponseWithDefaults() *CreateDatabaseResponse { + this := CreateDatabaseResponse{} + return &this +} + +// GetId returns the Id field value +func (o *CreateDatabaseResponse) GetId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CreateDatabaseResponse) GetIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CreateDatabaseResponse) SetId(v int64) { + o.Id = v +} + +func (o CreateDatabaseResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateDatabaseResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateDatabaseResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateDatabaseResponse := _CreateDatabaseResponse{} + + err = json.Unmarshal(data, &varCreateDatabaseResponse) + + if err != nil { + return err + } + + *o = CreateDatabaseResponse(varCreateDatabaseResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateDatabaseResponse struct { + value *CreateDatabaseResponse + isSet bool +} + +func (v NullableCreateDatabaseResponse) Get() *CreateDatabaseResponse { + return v.value +} + +func (v *NullableCreateDatabaseResponse) Set(val *CreateDatabaseResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateDatabaseResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateDatabaseResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateDatabaseResponse(val *CreateDatabaseResponse) *NullableCreateDatabaseResponse { + return &NullableCreateDatabaseResponse{value: val, isSet: true} +} + +func (v NullableCreateDatabaseResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateDatabaseResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_create_instance_payload.go b/services/postgresflex/v3api/model_create_instance_payload.go new file mode 100644 index 000000000..c12a9d94e --- /dev/null +++ b/services/postgresflex/v3api/model_create_instance_payload.go @@ -0,0 +1,423 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstancePayload{} + +// CreateInstancePayload struct for CreateInstancePayload +type CreateInstancePayload struct { + // 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. + BackupSchedule string `json:"backupSchedule"` + Encryption *InstanceEncryption `json:"encryption,omitempty"` + // The id of the instance flavor. + FlavorId string `json:"flavorId"` + // 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. + Labels *map[string]string `json:"labels,omitempty"` + // The name of the instance. + Name string `json:"name"` + Network InstanceNetworkCreate `json:"network"` + // How long backups are retained. The value can only be between 32 and 90 days. + RetentionDays NullableInt32 `json:"retentionDays"` + Storage StorageCreate `json:"storage"` + // The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3#tag/Version) for supported version parameters. + Version string `json:"version"` + AdditionalProperties map[string]interface{} +} + +type _CreateInstancePayload CreateInstancePayload + +// NewCreateInstancePayload instantiates a new CreateInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateInstancePayload(backupSchedule string, flavorId string, name string, network InstanceNetworkCreate, retentionDays NullableInt32, storage StorageCreate, version string) *CreateInstancePayload { + this := CreateInstancePayload{} + this.BackupSchedule = backupSchedule + this.FlavorId = flavorId + this.Name = name + this.Network = network + this.RetentionDays = retentionDays + this.Storage = storage + this.Version = version + return &this +} + +// NewCreateInstancePayloadWithDefaults instantiates a new CreateInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateInstancePayloadWithDefaults() *CreateInstancePayload { + this := CreateInstancePayload{} + return &this +} + +// GetBackupSchedule returns the BackupSchedule field value +func (o *CreateInstancePayload) GetBackupSchedule() string { + if o == nil { + var ret string + return ret + } + + return o.BackupSchedule +} + +// GetBackupScheduleOk returns a tuple with the BackupSchedule field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetBackupScheduleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BackupSchedule, true +} + +// SetBackupSchedule sets field value +func (o *CreateInstancePayload) SetBackupSchedule(v string) { + o.BackupSchedule = v +} + +// GetEncryption returns the Encryption field value if set, zero value otherwise. +func (o *CreateInstancePayload) GetEncryption() InstanceEncryption { + if o == nil || IsNil(o.Encryption) { + var ret InstanceEncryption + return ret + } + return *o.Encryption +} + +// GetEncryptionOk returns a tuple with the Encryption field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetEncryptionOk() (*InstanceEncryption, bool) { + if o == nil || IsNil(o.Encryption) { + return nil, false + } + return o.Encryption, true +} + +// HasEncryption returns a boolean if a field has been set. +func (o *CreateInstancePayload) HasEncryption() bool { + if o != nil && !IsNil(o.Encryption) { + return true + } + + return false +} + +// SetEncryption gets a reference to the given InstanceEncryption and assigns it to the Encryption field. +func (o *CreateInstancePayload) SetEncryption(v InstanceEncryption) { + o.Encryption = &v +} + +// GetFlavorId returns the FlavorId field value +func (o *CreateInstancePayload) GetFlavorId() string { + if o == nil { + var ret string + return ret + } + + return o.FlavorId +} + +// GetFlavorIdOk returns a tuple with the FlavorId field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetFlavorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FlavorId, true +} + +// SetFlavorId sets field value +func (o *CreateInstancePayload) SetFlavorId(v string) { + o.FlavorId = v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateInstancePayload) GetLabels() map[string]string { + if o == nil || IsNil(o.Labels) { + var ret map[string]string + return ret + } + return *o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Labels) { + return nil, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateInstancePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *CreateInstancePayload) SetLabels(v map[string]string) { + o.Labels = &v +} + +// GetName returns the Name field value +func (o *CreateInstancePayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateInstancePayload) SetName(v string) { + o.Name = v +} + +// GetNetwork returns the Network field value +func (o *CreateInstancePayload) GetNetwork() InstanceNetworkCreate { + if o == nil { + var ret InstanceNetworkCreate + return ret + } + + return o.Network +} + +// GetNetworkOk returns a tuple with the Network field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetNetworkOk() (*InstanceNetworkCreate, bool) { + if o == nil { + return nil, false + } + return &o.Network, true +} + +// SetNetwork sets field value +func (o *CreateInstancePayload) SetNetwork(v InstanceNetworkCreate) { + o.Network = v +} + +// GetRetentionDays returns the RetentionDays field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *CreateInstancePayload) GetRetentionDays() int32 { + if o == nil || o.RetentionDays.Get() == nil { + var ret int32 + return ret + } + + return *o.RetentionDays.Get() +} + +// GetRetentionDaysOk returns a tuple with the RetentionDays field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateInstancePayload) GetRetentionDaysOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.RetentionDays.Get(), o.RetentionDays.IsSet() +} + +// SetRetentionDays sets field value +func (o *CreateInstancePayload) SetRetentionDays(v int32) { + o.RetentionDays.Set(&v) +} + +// GetStorage returns the Storage field value +func (o *CreateInstancePayload) GetStorage() StorageCreate { + if o == nil { + var ret StorageCreate + return ret + } + + return o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetStorageOk() (*StorageCreate, bool) { + if o == nil { + return nil, false + } + return &o.Storage, true +} + +// SetStorage sets field value +func (o *CreateInstancePayload) SetStorage(v StorageCreate) { + o.Storage = v +} + +// GetVersion returns the Version field value +func (o *CreateInstancePayload) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *CreateInstancePayload) SetVersion(v string) { + o.Version = v +} + +func (o CreateInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backupSchedule"] = o.BackupSchedule + if !IsNil(o.Encryption) { + toSerialize["encryption"] = o.Encryption + } + toSerialize["flavorId"] = o.FlavorId + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + toSerialize["network"] = o.Network + toSerialize["retentionDays"] = o.RetentionDays.Get() + toSerialize["storage"] = o.Storage + toSerialize["version"] = o.Version + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateInstancePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backupSchedule", + "flavorId", + "name", + "network", + "retentionDays", + "storage", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateInstancePayload := _CreateInstancePayload{} + + err = json.Unmarshal(data, &varCreateInstancePayload) + + if err != nil { + return err + } + + *o = CreateInstancePayload(varCreateInstancePayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "backupSchedule") + delete(additionalProperties, "encryption") + delete(additionalProperties, "flavorId") + delete(additionalProperties, "labels") + delete(additionalProperties, "name") + delete(additionalProperties, "network") + delete(additionalProperties, "retentionDays") + delete(additionalProperties, "storage") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateInstancePayload struct { + value *CreateInstancePayload + isSet bool +} + +func (v NullableCreateInstancePayload) Get() *CreateInstancePayload { + return v.value +} + +func (v *NullableCreateInstancePayload) Set(val *CreateInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstancePayload(val *CreateInstancePayload) *NullableCreateInstancePayload { + return &NullableCreateInstancePayload{value: val, isSet: true} +} + +func (v NullableCreateInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_create_instance_response.go b/services/postgresflex/v3api/model_create_instance_response.go new file mode 100644 index 000000000..e13d163df --- /dev/null +++ b/services/postgresflex/v3api/model_create_instance_response.go @@ -0,0 +1,168 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstanceResponse{} + +// CreateInstanceResponse struct for CreateInstanceResponse +type CreateInstanceResponse struct { + // The ID of the instance. + Id string `json:"id"` + AdditionalProperties map[string]interface{} +} + +type _CreateInstanceResponse CreateInstanceResponse + +// NewCreateInstanceResponse instantiates a new CreateInstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateInstanceResponse(id string) *CreateInstanceResponse { + this := CreateInstanceResponse{} + this.Id = id + return &this +} + +// NewCreateInstanceResponseWithDefaults instantiates a new CreateInstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateInstanceResponseWithDefaults() *CreateInstanceResponse { + this := CreateInstanceResponse{} + return &this +} + +// GetId returns the Id field value +func (o *CreateInstanceResponse) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CreateInstanceResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CreateInstanceResponse) SetId(v string) { + o.Id = v +} + +func (o CreateInstanceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateInstanceResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateInstanceResponse := _CreateInstanceResponse{} + + err = json.Unmarshal(data, &varCreateInstanceResponse) + + if err != nil { + return err + } + + *o = CreateInstanceResponse(varCreateInstanceResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateInstanceResponse struct { + value *CreateInstanceResponse + isSet bool +} + +func (v NullableCreateInstanceResponse) Get() *CreateInstanceResponse { + return v.value +} + +func (v *NullableCreateInstanceResponse) Set(val *CreateInstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstanceResponse(val *CreateInstanceResponse) *NullableCreateInstanceResponse { + return &NullableCreateInstanceResponse{value: val, isSet: true} +} + +func (v NullableCreateInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_create_user_payload.go b/services/postgresflex/v3api/model_create_user_payload.go new file mode 100644 index 000000000..76e19fa97 --- /dev/null +++ b/services/postgresflex/v3api/model_create_user_payload.go @@ -0,0 +1,206 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateUserPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateUserPayload{} + +// CreateUserPayload struct for CreateUserPayload +type CreateUserPayload struct { + // The name of the user. + Name string `json:"name"` + // A list containing the user roles for the instance. Please refer to the List Roles endpoint for a list of all available Roles. + Roles []string `json:"roles,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateUserPayload CreateUserPayload + +// NewCreateUserPayload instantiates a new CreateUserPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateUserPayload(name string) *CreateUserPayload { + this := CreateUserPayload{} + this.Name = name + return &this +} + +// NewCreateUserPayloadWithDefaults instantiates a new CreateUserPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateUserPayloadWithDefaults() *CreateUserPayload { + this := CreateUserPayload{} + return &this +} + +// GetName returns the Name field value +func (o *CreateUserPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateUserPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateUserPayload) SetName(v string) { + o.Name = v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *CreateUserPayload) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateUserPayload) GetRolesOk() ([]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *CreateUserPayload) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *CreateUserPayload) SetRoles(v []string) { + o.Roles = v +} + +func (o CreateUserPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateUserPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateUserPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateUserPayload := _CreateUserPayload{} + + err = json.Unmarshal(data, &varCreateUserPayload) + + if err != nil { + return err + } + + *o = CreateUserPayload(varCreateUserPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "roles") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateUserPayload struct { + value *CreateUserPayload + isSet bool +} + +func (v NullableCreateUserPayload) Get() *CreateUserPayload { + return v.value +} + +func (v *NullableCreateUserPayload) Set(val *CreateUserPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateUserPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateUserPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateUserPayload(val *CreateUserPayload) *NullableCreateUserPayload { + return &NullableCreateUserPayload{value: val, isSet: true} +} + +func (v NullableCreateUserPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateUserPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_create_user_response.go b/services/postgresflex/v3api/model_create_user_response.go new file mode 100644 index 000000000..1528fff46 --- /dev/null +++ b/services/postgresflex/v3api/model_create_user_response.go @@ -0,0 +1,258 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateUserResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateUserResponse{} + +// CreateUserResponse struct for CreateUserResponse +type CreateUserResponse struct { + // The ID of the user. + Id int64 `json:"id"` + // The name of the user. + Name string `json:"name"` + // The password for the user. + Password string `json:"password"` + // The current state of the user. + State string `json:"state"` + AdditionalProperties map[string]interface{} +} + +type _CreateUserResponse CreateUserResponse + +// NewCreateUserResponse instantiates a new CreateUserResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateUserResponse(id int64, name string, password string, state string) *CreateUserResponse { + this := CreateUserResponse{} + this.Id = id + this.Name = name + this.Password = password + this.State = state + return &this +} + +// NewCreateUserResponseWithDefaults instantiates a new CreateUserResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateUserResponseWithDefaults() *CreateUserResponse { + this := CreateUserResponse{} + return &this +} + +// GetId returns the Id field value +func (o *CreateUserResponse) GetId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CreateUserResponse) GetIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CreateUserResponse) SetId(v int64) { + o.Id = v +} + +// GetName returns the Name field value +func (o *CreateUserResponse) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateUserResponse) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateUserResponse) SetName(v string) { + o.Name = v +} + +// GetPassword returns the Password field value +func (o *CreateUserResponse) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *CreateUserResponse) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *CreateUserResponse) SetPassword(v string) { + o.Password = v +} + +// GetState returns the State field value +func (o *CreateUserResponse) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *CreateUserResponse) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *CreateUserResponse) SetState(v string) { + o.State = v +} + +func (o CreateUserResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateUserResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["password"] = o.Password + toSerialize["state"] = o.State + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateUserResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "name", + "password", + "state", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateUserResponse := _CreateUserResponse{} + + err = json.Unmarshal(data, &varCreateUserResponse) + + if err != nil { + return err + } + + *o = CreateUserResponse(varCreateUserResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "password") + delete(additionalProperties, "state") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateUserResponse struct { + value *CreateUserResponse + isSet bool +} + +func (v NullableCreateUserResponse) Get() *CreateUserResponse { + return v.value +} + +func (v *NullableCreateUserResponse) Set(val *CreateUserResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateUserResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateUserResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateUserResponse(val *CreateUserResponse) *NullableCreateUserResponse { + return &NullableCreateUserResponse{value: val, isSet: true} +} + +func (v NullableCreateUserResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateUserResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_database_roles.go b/services/postgresflex/v3api/model_database_roles.go new file mode 100644 index 000000000..cb92ef0a4 --- /dev/null +++ b/services/postgresflex/v3api/model_database_roles.go @@ -0,0 +1,198 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DatabaseRoles type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DatabaseRoles{} + +// DatabaseRoles The name and the roles for a database for a user. +type DatabaseRoles struct { + // The name of the database. + Name string `json:"name"` + // The name and the roles for a database + Roles []string `json:"roles"` + AdditionalProperties map[string]interface{} +} + +type _DatabaseRoles DatabaseRoles + +// NewDatabaseRoles instantiates a new DatabaseRoles object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDatabaseRoles(name string, roles []string) *DatabaseRoles { + this := DatabaseRoles{} + this.Name = name + this.Roles = roles + return &this +} + +// NewDatabaseRolesWithDefaults instantiates a new DatabaseRoles object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDatabaseRolesWithDefaults() *DatabaseRoles { + this := DatabaseRoles{} + return &this +} + +// GetName returns the Name field value +func (o *DatabaseRoles) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DatabaseRoles) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DatabaseRoles) SetName(v string) { + o.Name = v +} + +// GetRoles returns the Roles field value +func (o *DatabaseRoles) GetRoles() []string { + if o == nil { + var ret []string + return ret + } + + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value +// and a boolean to check if the value has been set. +func (o *DatabaseRoles) GetRolesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Roles, true +} + +// SetRoles sets field value +func (o *DatabaseRoles) SetRoles(v []string) { + o.Roles = v +} + +func (o DatabaseRoles) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DatabaseRoles) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["roles"] = o.Roles + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DatabaseRoles) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "roles", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDatabaseRoles := _DatabaseRoles{} + + err = json.Unmarshal(data, &varDatabaseRoles) + + if err != nil { + return err + } + + *o = DatabaseRoles(varDatabaseRoles) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "roles") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDatabaseRoles struct { + value *DatabaseRoles + isSet bool +} + +func (v NullableDatabaseRoles) Get() *DatabaseRoles { + return v.value +} + +func (v *NullableDatabaseRoles) Set(val *DatabaseRoles) { + v.value = val + v.isSet = true +} + +func (v NullableDatabaseRoles) IsSet() bool { + return v.isSet +} + +func (v *NullableDatabaseRoles) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDatabaseRoles(val *DatabaseRoles) *NullableDatabaseRoles { + return &NullableDatabaseRoles{value: val, isSet: true} +} + +func (v NullableDatabaseRoles) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDatabaseRoles) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_database_sort.go b/services/postgresflex/v3api/model_database_sort.go new file mode 100644 index 000000000..7c8e6cd91 --- /dev/null +++ b/services/postgresflex/v3api/model_database_sort.go @@ -0,0 +1,126 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// DatabaseSort the model 'DatabaseSort' +type DatabaseSort string + +// List of database.sort +const ( + DATABASESORT_CREATED_AT_DESC DatabaseSort = "created_at.desc" + DATABASESORT_CREATED_AT_ASC DatabaseSort = "created_at.asc" + DATABASESORT_DATABASE_ID_DESC DatabaseSort = "database_id.desc" + DATABASESORT_DATABASE_ID_ASC DatabaseSort = "database_id.asc" + DATABASESORT_DATABASE_NAME_DESC DatabaseSort = "database_name.desc" + DATABASESORT_DATABASE_NAME_ASC DatabaseSort = "database_name.asc" + DATABASESORT_DATABASE_OWNER_DESC DatabaseSort = "database_owner.desc" + DATABASESORT_DATABASE_OWNER_ASC DatabaseSort = "database_owner.asc" + DATABASESORT_UNKNOWN_DEFAULT_OPEN_API DatabaseSort = "unknown_default_open_api" +) + +// All allowed values of DatabaseSort enum +var AllowedDatabaseSortEnumValues = []DatabaseSort{ + "created_at.desc", + "created_at.asc", + "database_id.desc", + "database_id.asc", + "database_name.desc", + "database_name.asc", + "database_owner.desc", + "database_owner.asc", + "unknown_default_open_api", +} + +func (v *DatabaseSort) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DatabaseSort(value) + for _, existing := range AllowedDatabaseSortEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = DATABASESORT_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewDatabaseSortFromValue returns a pointer to a valid DatabaseSort +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDatabaseSortFromValue(v string) (*DatabaseSort, error) { + ev := DatabaseSort(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DatabaseSort: valid values are %v", v, AllowedDatabaseSortEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DatabaseSort) IsValid() bool { + for _, existing := range AllowedDatabaseSortEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to database.sort value +func (v DatabaseSort) Ptr() *DatabaseSort { + return &v +} + +type NullableDatabaseSort struct { + value *DatabaseSort + isSet bool +} + +func (v NullableDatabaseSort) Get() *DatabaseSort { + return v.value +} + +func (v *NullableDatabaseSort) Set(val *DatabaseSort) { + v.value = val + v.isSet = true +} + +func (v NullableDatabaseSort) IsSet() bool { + return v.isSet +} + +func (v *NullableDatabaseSort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDatabaseSort(val *DatabaseSort) *NullableDatabaseSort { + return &NullableDatabaseSort{value: val, isSet: true} +} + +func (v NullableDatabaseSort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDatabaseSort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_error.go b/services/postgresflex/v3api/model_error.go new file mode 100644 index 000000000..bafa37ae8 --- /dev/null +++ b/services/postgresflex/v3api/model_error.go @@ -0,0 +1,258 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Error{} + +// Error struct for Error +type Error struct { + // The http error code of the error. + Code int32 `json:"code"` + // More detailed information about the error. + Message string `json:"message"` + // The trace id of the request. + TraceId string `json:"traceId"` + // Describes in which state the api was when the error happened. + Type string `json:"type"` + AdditionalProperties map[string]interface{} +} + +type _Error Error + +// NewError instantiates a new Error object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewError(code int32, message string, traceId string, types string) *Error { + this := Error{} + this.Code = code + this.Message = message + this.TraceId = traceId + this.Type = types + return &this +} + +// NewErrorWithDefaults instantiates a new Error object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorWithDefaults() *Error { + this := Error{} + return &this +} + +// GetCode returns the Code field value +func (o *Error) GetCode() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *Error) GetCodeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value +func (o *Error) SetCode(v int32) { + o.Code = v +} + +// GetMessage returns the Message field value +func (o *Error) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *Error) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *Error) SetMessage(v string) { + o.Message = v +} + +// GetTraceId returns the TraceId field value +func (o *Error) GetTraceId() string { + if o == nil { + var ret string + return ret + } + + return o.TraceId +} + +// GetTraceIdOk returns a tuple with the TraceId field value +// and a boolean to check if the value has been set. +func (o *Error) GetTraceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TraceId, true +} + +// SetTraceId sets field value +func (o *Error) SetTraceId(v string) { + o.TraceId = v +} + +// GetType returns the Type field value +func (o *Error) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Error) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Error) SetType(v string) { + o.Type = v +} + +func (o Error) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Error) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["code"] = o.Code + toSerialize["message"] = o.Message + toSerialize["traceId"] = o.TraceId + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Error) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "code", + "message", + "traceId", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varError := _Error{} + + err = json.Unmarshal(data, &varError) + + if err != nil { + return err + } + + *o = Error(varError) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "code") + delete(additionalProperties, "message") + delete(additionalProperties, "traceId") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableError struct { + value *Error + isSet bool +} + +func (v NullableError) Get() *Error { + return v.value +} + +func (v *NullableError) Set(val *Error) { + v.value = val + v.isSet = true +} + +func (v NullableError) IsSet() bool { + return v.isSet +} + +func (v *NullableError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableError(val *Error) *NullableError { + return &NullableError{value: val, isSet: true} +} + +func (v NullableError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_flavor_sort.go b/services/postgresflex/v3api/model_flavor_sort.go new file mode 100644 index 000000000..017e3a8a7 --- /dev/null +++ b/services/postgresflex/v3api/model_flavor_sort.go @@ -0,0 +1,142 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// FlavorSort the model 'FlavorSort' +type FlavorSort string + +// List of flavor.sort +const ( + FLAVORSORT_CPU_DESC FlavorSort = "cpu.desc" + FLAVORSORT_CPU_ASC FlavorSort = "cpu.asc" + FLAVORSORT_FLAVOR_DESCRIPTION_ASC FlavorSort = "flavor_description.asc" + FLAVORSORT_FLAVOR_DESCRIPTION_DESC FlavorSort = "flavor_description.desc" + FLAVORSORT_ID_DESC FlavorSort = "id.desc" + FLAVORSORT_ID_ASC FlavorSort = "id.asc" + FLAVORSORT_SIZE_MAX_DESC FlavorSort = "size_max.desc" + FLAVORSORT_SIZE_MAX_ASC FlavorSort = "size_max.asc" + FLAVORSORT_RAM_DESC FlavorSort = "ram.desc" + FLAVORSORT_RAM_ASC FlavorSort = "ram.asc" + FLAVORSORT_SIZE_MIN_DESC FlavorSort = "size_min.desc" + FLAVORSORT_SIZE_MIN_ASC FlavorSort = "size_min.asc" + FLAVORSORT_STORAGE_CLASS_ASC FlavorSort = "storage_class.asc" + FLAVORSORT_STORAGE_CLASS_DESC FlavorSort = "storage_class.desc" + FLAVORSORT_NODE_TYPE_ASC FlavorSort = "node_type.asc" + FLAVORSORT_NODE_TYPE_DESC FlavorSort = "node_type.desc" + FLAVORSORT_UNKNOWN_DEFAULT_OPEN_API FlavorSort = "unknown_default_open_api" +) + +// All allowed values of FlavorSort enum +var AllowedFlavorSortEnumValues = []FlavorSort{ + "cpu.desc", + "cpu.asc", + "flavor_description.asc", + "flavor_description.desc", + "id.desc", + "id.asc", + "size_max.desc", + "size_max.asc", + "ram.desc", + "ram.asc", + "size_min.desc", + "size_min.asc", + "storage_class.asc", + "storage_class.desc", + "node_type.asc", + "node_type.desc", + "unknown_default_open_api", +} + +func (v *FlavorSort) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FlavorSort(value) + for _, existing := range AllowedFlavorSortEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = FLAVORSORT_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewFlavorSortFromValue returns a pointer to a valid FlavorSort +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFlavorSortFromValue(v string) (*FlavorSort, error) { + ev := FlavorSort(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FlavorSort: valid values are %v", v, AllowedFlavorSortEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FlavorSort) IsValid() bool { + for _, existing := range AllowedFlavorSortEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to flavor.sort value +func (v FlavorSort) Ptr() *FlavorSort { + return &v +} + +type NullableFlavorSort struct { + value *FlavorSort + isSet bool +} + +func (v NullableFlavorSort) Get() *FlavorSort { + return v.value +} + +func (v *NullableFlavorSort) Set(val *FlavorSort) { + v.value = val + v.isSet = true +} + +func (v NullableFlavorSort) IsSet() bool { + return v.isSet +} + +func (v *NullableFlavorSort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlavorSort(val *FlavorSort) *NullableFlavorSort { + return &NullableFlavorSort{value: val, isSet: true} +} + +func (v NullableFlavorSort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlavorSort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_flavor_storage_classes_storage_class.go b/services/postgresflex/v3api/model_flavor_storage_classes_storage_class.go new file mode 100644 index 000000000..245062496 --- /dev/null +++ b/services/postgresflex/v3api/model_flavor_storage_classes_storage_class.go @@ -0,0 +1,225 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the FlavorStorageClassesStorageClass type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FlavorStorageClassesStorageClass{} + +// FlavorStorageClassesStorageClass a storageClass defines how efficient the storage can work +type FlavorStorageClassesStorageClass struct { + Class string `json:"class"` + MaxIoPerSec int32 `json:"maxIoPerSec"` + MaxThroughInMb int32 `json:"maxThroughInMb"` + AdditionalProperties map[string]interface{} +} + +type _FlavorStorageClassesStorageClass FlavorStorageClassesStorageClass + +// NewFlavorStorageClassesStorageClass instantiates a new FlavorStorageClassesStorageClass object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlavorStorageClassesStorageClass(class string, maxIoPerSec int32, maxThroughInMb int32) *FlavorStorageClassesStorageClass { + this := FlavorStorageClassesStorageClass{} + this.Class = class + this.MaxIoPerSec = maxIoPerSec + this.MaxThroughInMb = maxThroughInMb + return &this +} + +// NewFlavorStorageClassesStorageClassWithDefaults instantiates a new FlavorStorageClassesStorageClass object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlavorStorageClassesStorageClassWithDefaults() *FlavorStorageClassesStorageClass { + this := FlavorStorageClassesStorageClass{} + return &this +} + +// GetClass returns the Class field value +func (o *FlavorStorageClassesStorageClass) GetClass() string { + if o == nil { + var ret string + return ret + } + + return o.Class +} + +// GetClassOk returns a tuple with the Class field value +// and a boolean to check if the value has been set. +func (o *FlavorStorageClassesStorageClass) GetClassOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Class, true +} + +// SetClass sets field value +func (o *FlavorStorageClassesStorageClass) SetClass(v string) { + o.Class = v +} + +// GetMaxIoPerSec returns the MaxIoPerSec field value +func (o *FlavorStorageClassesStorageClass) GetMaxIoPerSec() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MaxIoPerSec +} + +// GetMaxIoPerSecOk returns a tuple with the MaxIoPerSec field value +// and a boolean to check if the value has been set. +func (o *FlavorStorageClassesStorageClass) GetMaxIoPerSecOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MaxIoPerSec, true +} + +// SetMaxIoPerSec sets field value +func (o *FlavorStorageClassesStorageClass) SetMaxIoPerSec(v int32) { + o.MaxIoPerSec = v +} + +// GetMaxThroughInMb returns the MaxThroughInMb field value +func (o *FlavorStorageClassesStorageClass) GetMaxThroughInMb() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MaxThroughInMb +} + +// GetMaxThroughInMbOk returns a tuple with the MaxThroughInMb field value +// and a boolean to check if the value has been set. +func (o *FlavorStorageClassesStorageClass) GetMaxThroughInMbOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MaxThroughInMb, true +} + +// SetMaxThroughInMb sets field value +func (o *FlavorStorageClassesStorageClass) SetMaxThroughInMb(v int32) { + o.MaxThroughInMb = v +} + +func (o FlavorStorageClassesStorageClass) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FlavorStorageClassesStorageClass) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["class"] = o.Class + toSerialize["maxIoPerSec"] = o.MaxIoPerSec + toSerialize["maxThroughInMb"] = o.MaxThroughInMb + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FlavorStorageClassesStorageClass) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "class", + "maxIoPerSec", + "maxThroughInMb", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFlavorStorageClassesStorageClass := _FlavorStorageClassesStorageClass{} + + err = json.Unmarshal(data, &varFlavorStorageClassesStorageClass) + + if err != nil { + return err + } + + *o = FlavorStorageClassesStorageClass(varFlavorStorageClassesStorageClass) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "class") + delete(additionalProperties, "maxIoPerSec") + delete(additionalProperties, "maxThroughInMb") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFlavorStorageClassesStorageClass struct { + value *FlavorStorageClassesStorageClass + isSet bool +} + +func (v NullableFlavorStorageClassesStorageClass) Get() *FlavorStorageClassesStorageClass { + return v.value +} + +func (v *NullableFlavorStorageClassesStorageClass) Set(val *FlavorStorageClassesStorageClass) { + v.value = val + v.isSet = true +} + +func (v NullableFlavorStorageClassesStorageClass) IsSet() bool { + return v.isSet +} + +func (v *NullableFlavorStorageClassesStorageClass) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlavorStorageClassesStorageClass(val *FlavorStorageClassesStorageClass) *NullableFlavorStorageClassesStorageClass { + return &NullableFlavorStorageClassesStorageClass{value: val, isSet: true} +} + +func (v NullableFlavorStorageClassesStorageClass) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlavorStorageClassesStorageClass) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_get_database_response.go b/services/postgresflex/v3api/model_get_database_response.go new file mode 100644 index 000000000..9fa18bbc2 --- /dev/null +++ b/services/postgresflex/v3api/model_get_database_response.go @@ -0,0 +1,228 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GetDatabaseResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetDatabaseResponse{} + +// GetDatabaseResponse struct for GetDatabaseResponse +type GetDatabaseResponse struct { + // The id of the database. + Id int64 `json:"id"` + // The name of the database. + Name string `json:"name"` + // The owner of the database. + Owner string `json:"owner"` + AdditionalProperties map[string]interface{} +} + +type _GetDatabaseResponse GetDatabaseResponse + +// NewGetDatabaseResponse instantiates a new GetDatabaseResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetDatabaseResponse(id int64, name string, owner string) *GetDatabaseResponse { + this := GetDatabaseResponse{} + this.Id = id + this.Name = name + this.Owner = owner + return &this +} + +// NewGetDatabaseResponseWithDefaults instantiates a new GetDatabaseResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetDatabaseResponseWithDefaults() *GetDatabaseResponse { + this := GetDatabaseResponse{} + return &this +} + +// GetId returns the Id field value +func (o *GetDatabaseResponse) GetId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *GetDatabaseResponse) GetIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GetDatabaseResponse) SetId(v int64) { + o.Id = v +} + +// GetName returns the Name field value +func (o *GetDatabaseResponse) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *GetDatabaseResponse) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *GetDatabaseResponse) SetName(v string) { + o.Name = v +} + +// GetOwner returns the Owner field value +func (o *GetDatabaseResponse) GetOwner() string { + if o == nil { + var ret string + return ret + } + + return o.Owner +} + +// GetOwnerOk returns a tuple with the Owner field value +// and a boolean to check if the value has been set. +func (o *GetDatabaseResponse) GetOwnerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Owner, true +} + +// SetOwner sets field value +func (o *GetDatabaseResponse) SetOwner(v string) { + o.Owner = v +} + +func (o GetDatabaseResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetDatabaseResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["owner"] = o.Owner + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetDatabaseResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "name", + "owner", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetDatabaseResponse := _GetDatabaseResponse{} + + err = json.Unmarshal(data, &varGetDatabaseResponse) + + if err != nil { + return err + } + + *o = GetDatabaseResponse(varGetDatabaseResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "owner") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetDatabaseResponse struct { + value *GetDatabaseResponse + isSet bool +} + +func (v NullableGetDatabaseResponse) Get() *GetDatabaseResponse { + return v.value +} + +func (v *NullableGetDatabaseResponse) Set(val *GetDatabaseResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetDatabaseResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetDatabaseResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetDatabaseResponse(val *GetDatabaseResponse) *NullableGetDatabaseResponse { + return &NullableGetDatabaseResponse{value: val, isSet: true} +} + +func (v NullableGetDatabaseResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetDatabaseResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_get_instance_response.go b/services/postgresflex/v3api/model_get_instance_response.go new file mode 100644 index 000000000..b095ecdf3 --- /dev/null +++ b/services/postgresflex/v3api/model_get_instance_response.go @@ -0,0 +1,579 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GetInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetInstanceResponse{} + +// GetInstanceResponse struct for GetInstanceResponse +type GetInstanceResponse struct { + // List of IPV4 cidr. + Acl []string `json:"acl,omitempty"` + // 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. + BackupSchedule string `json:"backupSchedule"` + ConnectionInfo InstanceConnectionInfo `json:"connectionInfo"` + Encryption *InstanceEncryption `json:"encryption,omitempty"` + // The id of the instance flavor. + FlavorId string `json:"flavorId"` + // The ID of the instance. + Id string `json:"id"` + // Whether the instance can be deleted or not. + IsDeletable bool `json:"isDeletable"` + // 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. + Labels *map[string]string `json:"labels,omitempty"` + // The name of the instance. + Name string `json:"name"` + Network InstanceNetwork `json:"network"` + // How long backups are retained. The value can only be between 32 and 90 days. + RetentionDays NullableInt32 `json:"retentionDays"` + State State `json:"state"` + Storage Storage `json:"storage"` + // The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3#tag/Version) for supported version parameters. + Version string `json:"version"` + AdditionalProperties map[string]interface{} +} + +type _GetInstanceResponse GetInstanceResponse + +// NewGetInstanceResponse instantiates a new GetInstanceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetInstanceResponse(backupSchedule string, connectionInfo InstanceConnectionInfo, flavorId string, id string, isDeletable bool, name string, network InstanceNetwork, retentionDays NullableInt32, state State, storage Storage, version string) *GetInstanceResponse { + this := GetInstanceResponse{} + this.BackupSchedule = backupSchedule + this.ConnectionInfo = connectionInfo + this.FlavorId = flavorId + this.Id = id + this.IsDeletable = isDeletable + this.Name = name + this.Network = network + this.RetentionDays = retentionDays + this.State = state + this.Storage = storage + this.Version = version + return &this +} + +// NewGetInstanceResponseWithDefaults instantiates a new GetInstanceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetInstanceResponseWithDefaults() *GetInstanceResponse { + this := GetInstanceResponse{} + return &this +} + +// GetAcl returns the Acl field value if set, zero value otherwise. +func (o *GetInstanceResponse) GetAcl() []string { + if o == nil || IsNil(o.Acl) { + var ret []string + return ret + } + return o.Acl +} + +// GetAclOk returns a tuple with the Acl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetAclOk() ([]string, bool) { + if o == nil || IsNil(o.Acl) { + return nil, false + } + return o.Acl, true +} + +// HasAcl returns a boolean if a field has been set. +func (o *GetInstanceResponse) HasAcl() bool { + if o != nil && !IsNil(o.Acl) { + return true + } + + return false +} + +// SetAcl gets a reference to the given []string and assigns it to the Acl field. +func (o *GetInstanceResponse) SetAcl(v []string) { + o.Acl = v +} + +// GetBackupSchedule returns the BackupSchedule field value +func (o *GetInstanceResponse) GetBackupSchedule() string { + if o == nil { + var ret string + return ret + } + + return o.BackupSchedule +} + +// GetBackupScheduleOk returns a tuple with the BackupSchedule field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetBackupScheduleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BackupSchedule, true +} + +// SetBackupSchedule sets field value +func (o *GetInstanceResponse) SetBackupSchedule(v string) { + o.BackupSchedule = v +} + +// GetConnectionInfo returns the ConnectionInfo field value +func (o *GetInstanceResponse) GetConnectionInfo() InstanceConnectionInfo { + if o == nil { + var ret InstanceConnectionInfo + return ret + } + + return o.ConnectionInfo +} + +// GetConnectionInfoOk returns a tuple with the ConnectionInfo field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetConnectionInfoOk() (*InstanceConnectionInfo, bool) { + if o == nil { + return nil, false + } + return &o.ConnectionInfo, true +} + +// SetConnectionInfo sets field value +func (o *GetInstanceResponse) SetConnectionInfo(v InstanceConnectionInfo) { + o.ConnectionInfo = v +} + +// GetEncryption returns the Encryption field value if set, zero value otherwise. +func (o *GetInstanceResponse) GetEncryption() InstanceEncryption { + if o == nil || IsNil(o.Encryption) { + var ret InstanceEncryption + return ret + } + return *o.Encryption +} + +// GetEncryptionOk returns a tuple with the Encryption field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetEncryptionOk() (*InstanceEncryption, bool) { + if o == nil || IsNil(o.Encryption) { + return nil, false + } + return o.Encryption, true +} + +// HasEncryption returns a boolean if a field has been set. +func (o *GetInstanceResponse) HasEncryption() bool { + if o != nil && !IsNil(o.Encryption) { + return true + } + + return false +} + +// SetEncryption gets a reference to the given InstanceEncryption and assigns it to the Encryption field. +func (o *GetInstanceResponse) SetEncryption(v InstanceEncryption) { + o.Encryption = &v +} + +// GetFlavorId returns the FlavorId field value +func (o *GetInstanceResponse) GetFlavorId() string { + if o == nil { + var ret string + return ret + } + + return o.FlavorId +} + +// GetFlavorIdOk returns a tuple with the FlavorId field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetFlavorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FlavorId, true +} + +// SetFlavorId sets field value +func (o *GetInstanceResponse) SetFlavorId(v string) { + o.FlavorId = v +} + +// GetId returns the Id field value +func (o *GetInstanceResponse) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GetInstanceResponse) SetId(v string) { + o.Id = v +} + +// GetIsDeletable returns the IsDeletable field value +func (o *GetInstanceResponse) GetIsDeletable() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsDeletable +} + +// GetIsDeletableOk returns a tuple with the IsDeletable field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetIsDeletableOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsDeletable, true +} + +// SetIsDeletable sets field value +func (o *GetInstanceResponse) SetIsDeletable(v bool) { + o.IsDeletable = v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *GetInstanceResponse) GetLabels() map[string]string { + if o == nil || IsNil(o.Labels) { + var ret map[string]string + return ret + } + return *o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Labels) { + return nil, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *GetInstanceResponse) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *GetInstanceResponse) SetLabels(v map[string]string) { + o.Labels = &v +} + +// GetName returns the Name field value +func (o *GetInstanceResponse) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *GetInstanceResponse) SetName(v string) { + o.Name = v +} + +// GetNetwork returns the Network field value +func (o *GetInstanceResponse) GetNetwork() InstanceNetwork { + if o == nil { + var ret InstanceNetwork + return ret + } + + return o.Network +} + +// GetNetworkOk returns a tuple with the Network field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetNetworkOk() (*InstanceNetwork, bool) { + if o == nil { + return nil, false + } + return &o.Network, true +} + +// SetNetwork sets field value +func (o *GetInstanceResponse) SetNetwork(v InstanceNetwork) { + o.Network = v +} + +// GetRetentionDays returns the RetentionDays field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *GetInstanceResponse) GetRetentionDays() int32 { + if o == nil || o.RetentionDays.Get() == nil { + var ret int32 + return ret + } + + return *o.RetentionDays.Get() +} + +// GetRetentionDaysOk returns a tuple with the RetentionDays field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GetInstanceResponse) GetRetentionDaysOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.RetentionDays.Get(), o.RetentionDays.IsSet() +} + +// SetRetentionDays sets field value +func (o *GetInstanceResponse) SetRetentionDays(v int32) { + o.RetentionDays.Set(&v) +} + +// GetState returns the State field value +func (o *GetInstanceResponse) GetState() State { + if o == nil { + var ret State + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetStateOk() (*State, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *GetInstanceResponse) SetState(v State) { + o.State = v +} + +// GetStorage returns the Storage field value +func (o *GetInstanceResponse) GetStorage() Storage { + if o == nil { + var ret Storage + return ret + } + + return o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetStorageOk() (*Storage, bool) { + if o == nil { + return nil, false + } + return &o.Storage, true +} + +// SetStorage sets field value +func (o *GetInstanceResponse) SetStorage(v Storage) { + o.Storage = v +} + +// GetVersion returns the Version field value +func (o *GetInstanceResponse) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *GetInstanceResponse) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *GetInstanceResponse) SetVersion(v string) { + o.Version = v +} + +func (o GetInstanceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetInstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Acl) { + toSerialize["acl"] = o.Acl + } + toSerialize["backupSchedule"] = o.BackupSchedule + toSerialize["connectionInfo"] = o.ConnectionInfo + if !IsNil(o.Encryption) { + toSerialize["encryption"] = o.Encryption + } + toSerialize["flavorId"] = o.FlavorId + toSerialize["id"] = o.Id + toSerialize["isDeletable"] = o.IsDeletable + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + toSerialize["network"] = o.Network + toSerialize["retentionDays"] = o.RetentionDays.Get() + toSerialize["state"] = o.State + toSerialize["storage"] = o.Storage + toSerialize["version"] = o.Version + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetInstanceResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backupSchedule", + "connectionInfo", + "flavorId", + "id", + "isDeletable", + "name", + "network", + "retentionDays", + "state", + "storage", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetInstanceResponse := _GetInstanceResponse{} + + err = json.Unmarshal(data, &varGetInstanceResponse) + + if err != nil { + return err + } + + *o = GetInstanceResponse(varGetInstanceResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "acl") + delete(additionalProperties, "backupSchedule") + delete(additionalProperties, "connectionInfo") + delete(additionalProperties, "encryption") + delete(additionalProperties, "flavorId") + delete(additionalProperties, "id") + delete(additionalProperties, "isDeletable") + delete(additionalProperties, "labels") + delete(additionalProperties, "name") + delete(additionalProperties, "network") + delete(additionalProperties, "retentionDays") + delete(additionalProperties, "state") + delete(additionalProperties, "storage") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetInstanceResponse struct { + value *GetInstanceResponse + isSet bool +} + +func (v NullableGetInstanceResponse) Get() *GetInstanceResponse { + return v.value +} + +func (v *NullableGetInstanceResponse) Set(val *GetInstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetInstanceResponse(val *GetInstanceResponse) *NullableGetInstanceResponse { + return &NullableGetInstanceResponse{value: val, isSet: true} +} + +func (v NullableGetInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_get_user_response.go b/services/postgresflex/v3api/model_get_user_response.go new file mode 100644 index 000000000..de707e53a --- /dev/null +++ b/services/postgresflex/v3api/model_get_user_response.go @@ -0,0 +1,258 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GetUserResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetUserResponse{} + +// GetUserResponse struct for GetUserResponse +type GetUserResponse struct { + // The ID of the user. + Id int64 `json:"id"` + // The name of the user. + Name string `json:"name"` + // A list of user roles. + Roles []string `json:"roles"` + // The current state of the user. + State string `json:"state"` + AdditionalProperties map[string]interface{} +} + +type _GetUserResponse GetUserResponse + +// NewGetUserResponse instantiates a new GetUserResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetUserResponse(id int64, name string, roles []string, state string) *GetUserResponse { + this := GetUserResponse{} + this.Id = id + this.Name = name + this.Roles = roles + this.State = state + return &this +} + +// NewGetUserResponseWithDefaults instantiates a new GetUserResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetUserResponseWithDefaults() *GetUserResponse { + this := GetUserResponse{} + return &this +} + +// GetId returns the Id field value +func (o *GetUserResponse) GetId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *GetUserResponse) GetIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GetUserResponse) SetId(v int64) { + o.Id = v +} + +// GetName returns the Name field value +func (o *GetUserResponse) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *GetUserResponse) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *GetUserResponse) SetName(v string) { + o.Name = v +} + +// GetRoles returns the Roles field value +func (o *GetUserResponse) GetRoles() []string { + if o == nil { + var ret []string + return ret + } + + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value +// and a boolean to check if the value has been set. +func (o *GetUserResponse) GetRolesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Roles, true +} + +// SetRoles sets field value +func (o *GetUserResponse) SetRoles(v []string) { + o.Roles = v +} + +// GetState returns the State field value +func (o *GetUserResponse) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *GetUserResponse) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *GetUserResponse) SetState(v string) { + o.State = v +} + +func (o GetUserResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetUserResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["roles"] = o.Roles + toSerialize["state"] = o.State + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetUserResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "name", + "roles", + "state", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetUserResponse := _GetUserResponse{} + + err = json.Unmarshal(data, &varGetUserResponse) + + if err != nil { + return err + } + + *o = GetUserResponse(varGetUserResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "roles") + delete(additionalProperties, "state") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetUserResponse struct { + value *GetUserResponse + isSet bool +} + +func (v NullableGetUserResponse) Get() *GetUserResponse { + return v.value +} + +func (v *NullableGetUserResponse) Set(val *GetUserResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetUserResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetUserResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetUserResponse(val *GetUserResponse) *NullableGetUserResponse { + return &NullableGetUserResponse{value: val, isSet: true} +} + +func (v NullableGetUserResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetUserResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_instance_connection_info.go b/services/postgresflex/v3api/model_instance_connection_info.go new file mode 100644 index 000000000..1d1aac9de --- /dev/null +++ b/services/postgresflex/v3api/model_instance_connection_info.go @@ -0,0 +1,167 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InstanceConnectionInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceConnectionInfo{} + +// InstanceConnectionInfo The connection information of the instance +type InstanceConnectionInfo struct { + Write InstanceConnectionInfoWrite `json:"write"` + AdditionalProperties map[string]interface{} +} + +type _InstanceConnectionInfo InstanceConnectionInfo + +// NewInstanceConnectionInfo instantiates a new InstanceConnectionInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceConnectionInfo(write InstanceConnectionInfoWrite) *InstanceConnectionInfo { + this := InstanceConnectionInfo{} + this.Write = write + return &this +} + +// NewInstanceConnectionInfoWithDefaults instantiates a new InstanceConnectionInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceConnectionInfoWithDefaults() *InstanceConnectionInfo { + this := InstanceConnectionInfo{} + return &this +} + +// GetWrite returns the Write field value +func (o *InstanceConnectionInfo) GetWrite() InstanceConnectionInfoWrite { + if o == nil { + var ret InstanceConnectionInfoWrite + return ret + } + + return o.Write +} + +// GetWriteOk returns a tuple with the Write field value +// and a boolean to check if the value has been set. +func (o *InstanceConnectionInfo) GetWriteOk() (*InstanceConnectionInfoWrite, bool) { + if o == nil { + return nil, false + } + return &o.Write, true +} + +// SetWrite sets field value +func (o *InstanceConnectionInfo) SetWrite(v InstanceConnectionInfoWrite) { + o.Write = v +} + +func (o InstanceConnectionInfo) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceConnectionInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["write"] = o.Write + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceConnectionInfo) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "write", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceConnectionInfo := _InstanceConnectionInfo{} + + err = json.Unmarshal(data, &varInstanceConnectionInfo) + + if err != nil { + return err + } + + *o = InstanceConnectionInfo(varInstanceConnectionInfo) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "write") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceConnectionInfo struct { + value *InstanceConnectionInfo + isSet bool +} + +func (v NullableInstanceConnectionInfo) Get() *InstanceConnectionInfo { + return v.value +} + +func (v *NullableInstanceConnectionInfo) Set(val *InstanceConnectionInfo) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceConnectionInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceConnectionInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceConnectionInfo(val *InstanceConnectionInfo) *NullableInstanceConnectionInfo { + return &NullableInstanceConnectionInfo{value: val, isSet: true} +} + +func (v NullableInstanceConnectionInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceConnectionInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_instance_connection_info_write.go b/services/postgresflex/v3api/model_instance_connection_info_write.go new file mode 100644 index 000000000..797801d74 --- /dev/null +++ b/services/postgresflex/v3api/model_instance_connection_info_write.go @@ -0,0 +1,198 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InstanceConnectionInfoWrite type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceConnectionInfoWrite{} + +// InstanceConnectionInfoWrite The DNS name and port in the instance overview +type InstanceConnectionInfoWrite struct { + // The host of the instance. + Host string `json:"host"` + // The port of the instance. + Port int32 `json:"port"` + AdditionalProperties map[string]interface{} +} + +type _InstanceConnectionInfoWrite InstanceConnectionInfoWrite + +// NewInstanceConnectionInfoWrite instantiates a new InstanceConnectionInfoWrite object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceConnectionInfoWrite(host string, port int32) *InstanceConnectionInfoWrite { + this := InstanceConnectionInfoWrite{} + this.Host = host + this.Port = port + return &this +} + +// NewInstanceConnectionInfoWriteWithDefaults instantiates a new InstanceConnectionInfoWrite object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceConnectionInfoWriteWithDefaults() *InstanceConnectionInfoWrite { + this := InstanceConnectionInfoWrite{} + return &this +} + +// GetHost returns the Host field value +func (o *InstanceConnectionInfoWrite) GetHost() string { + if o == nil { + var ret string + return ret + } + + return o.Host +} + +// GetHostOk returns a tuple with the Host field value +// and a boolean to check if the value has been set. +func (o *InstanceConnectionInfoWrite) GetHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Host, true +} + +// SetHost sets field value +func (o *InstanceConnectionInfoWrite) SetHost(v string) { + o.Host = v +} + +// GetPort returns the Port field value +func (o *InstanceConnectionInfoWrite) GetPort() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Port +} + +// GetPortOk returns a tuple with the Port field value +// and a boolean to check if the value has been set. +func (o *InstanceConnectionInfoWrite) GetPortOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Port, true +} + +// SetPort sets field value +func (o *InstanceConnectionInfoWrite) SetPort(v int32) { + o.Port = v +} + +func (o InstanceConnectionInfoWrite) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceConnectionInfoWrite) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["host"] = o.Host + toSerialize["port"] = o.Port + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceConnectionInfoWrite) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "host", + "port", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceConnectionInfoWrite := _InstanceConnectionInfoWrite{} + + err = json.Unmarshal(data, &varInstanceConnectionInfoWrite) + + if err != nil { + return err + } + + *o = InstanceConnectionInfoWrite(varInstanceConnectionInfoWrite) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "host") + delete(additionalProperties, "port") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceConnectionInfoWrite struct { + value *InstanceConnectionInfoWrite + isSet bool +} + +func (v NullableInstanceConnectionInfoWrite) Get() *InstanceConnectionInfoWrite { + return v.value +} + +func (v *NullableInstanceConnectionInfoWrite) Set(val *InstanceConnectionInfoWrite) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceConnectionInfoWrite) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceConnectionInfoWrite) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceConnectionInfoWrite(val *InstanceConnectionInfoWrite) *NullableInstanceConnectionInfoWrite { + return &NullableInstanceConnectionInfoWrite{value: val, isSet: true} +} + +func (v NullableInstanceConnectionInfoWrite) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceConnectionInfoWrite) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_instance_encryption.go b/services/postgresflex/v3api/model_instance_encryption.go new file mode 100644 index 000000000..ac1a3a801 --- /dev/null +++ b/services/postgresflex/v3api/model_instance_encryption.go @@ -0,0 +1,257 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InstanceEncryption type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceEncryption{} + +// InstanceEncryption 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. +type InstanceEncryption struct { + // The encryption-key key identifier + KekKeyId string `json:"kekKeyId"` + // The encryption-key keyring identifier + KekKeyRingId string `json:"kekKeyRingId"` + // The encryption-key version + KekKeyVersion string `json:"kekKeyVersion"` + ServiceAccount string `json:"serviceAccount"` + AdditionalProperties map[string]interface{} +} + +type _InstanceEncryption InstanceEncryption + +// NewInstanceEncryption instantiates a new InstanceEncryption object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceEncryption(kekKeyId string, kekKeyRingId string, kekKeyVersion string, serviceAccount string) *InstanceEncryption { + this := InstanceEncryption{} + this.KekKeyId = kekKeyId + this.KekKeyRingId = kekKeyRingId + this.KekKeyVersion = kekKeyVersion + this.ServiceAccount = serviceAccount + return &this +} + +// NewInstanceEncryptionWithDefaults instantiates a new InstanceEncryption object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceEncryptionWithDefaults() *InstanceEncryption { + this := InstanceEncryption{} + return &this +} + +// GetKekKeyId returns the KekKeyId field value +func (o *InstanceEncryption) GetKekKeyId() string { + if o == nil { + var ret string + return ret + } + + return o.KekKeyId +} + +// GetKekKeyIdOk returns a tuple with the KekKeyId field value +// and a boolean to check if the value has been set. +func (o *InstanceEncryption) GetKekKeyIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KekKeyId, true +} + +// SetKekKeyId sets field value +func (o *InstanceEncryption) SetKekKeyId(v string) { + o.KekKeyId = v +} + +// GetKekKeyRingId returns the KekKeyRingId field value +func (o *InstanceEncryption) GetKekKeyRingId() string { + if o == nil { + var ret string + return ret + } + + return o.KekKeyRingId +} + +// GetKekKeyRingIdOk returns a tuple with the KekKeyRingId field value +// and a boolean to check if the value has been set. +func (o *InstanceEncryption) GetKekKeyRingIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KekKeyRingId, true +} + +// SetKekKeyRingId sets field value +func (o *InstanceEncryption) SetKekKeyRingId(v string) { + o.KekKeyRingId = v +} + +// GetKekKeyVersion returns the KekKeyVersion field value +func (o *InstanceEncryption) GetKekKeyVersion() string { + if o == nil { + var ret string + return ret + } + + return o.KekKeyVersion +} + +// GetKekKeyVersionOk returns a tuple with the KekKeyVersion field value +// and a boolean to check if the value has been set. +func (o *InstanceEncryption) GetKekKeyVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KekKeyVersion, true +} + +// SetKekKeyVersion sets field value +func (o *InstanceEncryption) SetKekKeyVersion(v string) { + o.KekKeyVersion = v +} + +// GetServiceAccount returns the ServiceAccount field value +func (o *InstanceEncryption) GetServiceAccount() string { + if o == nil { + var ret string + return ret + } + + return o.ServiceAccount +} + +// GetServiceAccountOk returns a tuple with the ServiceAccount field value +// and a boolean to check if the value has been set. +func (o *InstanceEncryption) GetServiceAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServiceAccount, true +} + +// SetServiceAccount sets field value +func (o *InstanceEncryption) SetServiceAccount(v string) { + o.ServiceAccount = v +} + +func (o InstanceEncryption) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceEncryption) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["kekKeyId"] = o.KekKeyId + toSerialize["kekKeyRingId"] = o.KekKeyRingId + toSerialize["kekKeyVersion"] = o.KekKeyVersion + toSerialize["serviceAccount"] = o.ServiceAccount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceEncryption) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "kekKeyId", + "kekKeyRingId", + "kekKeyVersion", + "serviceAccount", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceEncryption := _InstanceEncryption{} + + err = json.Unmarshal(data, &varInstanceEncryption) + + if err != nil { + return err + } + + *o = InstanceEncryption(varInstanceEncryption) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "kekKeyId") + delete(additionalProperties, "kekKeyRingId") + delete(additionalProperties, "kekKeyVersion") + delete(additionalProperties, "serviceAccount") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceEncryption struct { + value *InstanceEncryption + isSet bool +} + +func (v NullableInstanceEncryption) Get() *InstanceEncryption { + return v.value +} + +func (v *NullableInstanceEncryption) Set(val *InstanceEncryption) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceEncryption) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceEncryption) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceEncryption(val *InstanceEncryption) *NullableInstanceEncryption { + return &NullableInstanceEncryption{value: val, isSet: true} +} + +func (v NullableInstanceEncryption) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceEncryption) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_instance_network.go b/services/postgresflex/v3api/model_instance_network.go new file mode 100644 index 000000000..1c929462c --- /dev/null +++ b/services/postgresflex/v3api/model_instance_network.go @@ -0,0 +1,283 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InstanceNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceNetwork{} + +// InstanceNetwork The access configuration of the instance +type InstanceNetwork struct { + AccessScope *InstanceNetworkAccessScope `json:"accessScope,omitempty"` + // List of IPV4 cidr. + Acl []string `json:"acl"` + InstanceAddress *string `json:"instanceAddress,omitempty"` + RouterAddress *string `json:"routerAddress,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InstanceNetwork InstanceNetwork + +// NewInstanceNetwork instantiates a new InstanceNetwork object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceNetwork(acl []string) *InstanceNetwork { + this := InstanceNetwork{} + var accessScope InstanceNetworkAccessScope = INSTANCENETWORKACCESSSCOPE_PUBLIC + this.AccessScope = &accessScope + this.Acl = acl + return &this +} + +// NewInstanceNetworkWithDefaults instantiates a new InstanceNetwork object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceNetworkWithDefaults() *InstanceNetwork { + this := InstanceNetwork{} + var accessScope InstanceNetworkAccessScope = INSTANCENETWORKACCESSSCOPE_PUBLIC + this.AccessScope = &accessScope + return &this +} + +// GetAccessScope returns the AccessScope field value if set, zero value otherwise. +func (o *InstanceNetwork) GetAccessScope() InstanceNetworkAccessScope { + if o == nil || IsNil(o.AccessScope) { + var ret InstanceNetworkAccessScope + return ret + } + return *o.AccessScope +} + +// GetAccessScopeOk returns a tuple with the AccessScope field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceNetwork) GetAccessScopeOk() (*InstanceNetworkAccessScope, bool) { + if o == nil || IsNil(o.AccessScope) { + return nil, false + } + return o.AccessScope, true +} + +// HasAccessScope returns a boolean if a field has been set. +func (o *InstanceNetwork) HasAccessScope() bool { + if o != nil && !IsNil(o.AccessScope) { + return true + } + + return false +} + +// SetAccessScope gets a reference to the given InstanceNetworkAccessScope and assigns it to the AccessScope field. +func (o *InstanceNetwork) SetAccessScope(v InstanceNetworkAccessScope) { + o.AccessScope = &v +} + +// GetAcl returns the Acl field value +func (o *InstanceNetwork) GetAcl() []string { + if o == nil { + var ret []string + return ret + } + + return o.Acl +} + +// GetAclOk returns a tuple with the Acl field value +// and a boolean to check if the value has been set. +func (o *InstanceNetwork) GetAclOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Acl, true +} + +// SetAcl sets field value +func (o *InstanceNetwork) SetAcl(v []string) { + o.Acl = v +} + +// GetInstanceAddress returns the InstanceAddress field value if set, zero value otherwise. +func (o *InstanceNetwork) GetInstanceAddress() string { + if o == nil || IsNil(o.InstanceAddress) { + var ret string + return ret + } + return *o.InstanceAddress +} + +// GetInstanceAddressOk returns a tuple with the InstanceAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceNetwork) GetInstanceAddressOk() (*string, bool) { + if o == nil || IsNil(o.InstanceAddress) { + return nil, false + } + return o.InstanceAddress, true +} + +// HasInstanceAddress returns a boolean if a field has been set. +func (o *InstanceNetwork) HasInstanceAddress() bool { + if o != nil && !IsNil(o.InstanceAddress) { + return true + } + + return false +} + +// SetInstanceAddress gets a reference to the given string and assigns it to the InstanceAddress field. +func (o *InstanceNetwork) SetInstanceAddress(v string) { + o.InstanceAddress = &v +} + +// GetRouterAddress returns the RouterAddress field value if set, zero value otherwise. +func (o *InstanceNetwork) GetRouterAddress() string { + if o == nil || IsNil(o.RouterAddress) { + var ret string + return ret + } + return *o.RouterAddress +} + +// GetRouterAddressOk returns a tuple with the RouterAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceNetwork) GetRouterAddressOk() (*string, bool) { + if o == nil || IsNil(o.RouterAddress) { + return nil, false + } + return o.RouterAddress, true +} + +// HasRouterAddress returns a boolean if a field has been set. +func (o *InstanceNetwork) HasRouterAddress() bool { + if o != nil && !IsNil(o.RouterAddress) { + return true + } + + return false +} + +// SetRouterAddress gets a reference to the given string and assigns it to the RouterAddress field. +func (o *InstanceNetwork) SetRouterAddress(v string) { + o.RouterAddress = &v +} + +func (o InstanceNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceNetwork) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AccessScope) { + toSerialize["accessScope"] = o.AccessScope + } + toSerialize["acl"] = o.Acl + if !IsNil(o.InstanceAddress) { + toSerialize["instanceAddress"] = o.InstanceAddress + } + if !IsNil(o.RouterAddress) { + toSerialize["routerAddress"] = o.RouterAddress + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceNetwork) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "acl", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceNetwork := _InstanceNetwork{} + + err = json.Unmarshal(data, &varInstanceNetwork) + + if err != nil { + return err + } + + *o = InstanceNetwork(varInstanceNetwork) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "accessScope") + delete(additionalProperties, "acl") + delete(additionalProperties, "instanceAddress") + delete(additionalProperties, "routerAddress") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceNetwork struct { + value *InstanceNetwork + isSet bool +} + +func (v NullableInstanceNetwork) Get() *InstanceNetwork { + return v.value +} + +func (v *NullableInstanceNetwork) Set(val *InstanceNetwork) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceNetwork(val *InstanceNetwork) *NullableInstanceNetwork { + return &NullableInstanceNetwork{value: val, isSet: true} +} + +func (v NullableInstanceNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_instance_network_access_scope.go b/services/postgresflex/v3api/model_instance_network_access_scope.go new file mode 100644 index 000000000..bddbc4845 --- /dev/null +++ b/services/postgresflex/v3api/model_instance_network_access_scope.go @@ -0,0 +1,114 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// InstanceNetworkAccessScope The access scope of the instance. It defines if the instance is public or airgapped. +type InstanceNetworkAccessScope string + +// List of instance.network.accessScope +const ( + INSTANCENETWORKACCESSSCOPE_PUBLIC InstanceNetworkAccessScope = "PUBLIC" + INSTANCENETWORKACCESSSCOPE_SNA InstanceNetworkAccessScope = "SNA" + INSTANCENETWORKACCESSSCOPE_UNKNOWN_DEFAULT_OPEN_API InstanceNetworkAccessScope = "unknown_default_open_api" +) + +// All allowed values of InstanceNetworkAccessScope enum +var AllowedInstanceNetworkAccessScopeEnumValues = []InstanceNetworkAccessScope{ + "PUBLIC", + "SNA", + "unknown_default_open_api", +} + +func (v *InstanceNetworkAccessScope) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceNetworkAccessScope(value) + for _, existing := range AllowedInstanceNetworkAccessScopeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCENETWORKACCESSSCOPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceNetworkAccessScopeFromValue returns a pointer to a valid InstanceNetworkAccessScope +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceNetworkAccessScopeFromValue(v string) (*InstanceNetworkAccessScope, error) { + ev := InstanceNetworkAccessScope(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceNetworkAccessScope: valid values are %v", v, AllowedInstanceNetworkAccessScopeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceNetworkAccessScope) IsValid() bool { + for _, existing := range AllowedInstanceNetworkAccessScopeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to instance.network.accessScope value +func (v InstanceNetworkAccessScope) Ptr() *InstanceNetworkAccessScope { + return &v +} + +type NullableInstanceNetworkAccessScope struct { + value *InstanceNetworkAccessScope + isSet bool +} + +func (v NullableInstanceNetworkAccessScope) Get() *InstanceNetworkAccessScope { + return v.value +} + +func (v *NullableInstanceNetworkAccessScope) Set(val *InstanceNetworkAccessScope) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceNetworkAccessScope) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceNetworkAccessScope) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceNetworkAccessScope(val *InstanceNetworkAccessScope) *NullableInstanceNetworkAccessScope { + return &NullableInstanceNetworkAccessScope{value: val, isSet: true} +} + +func (v NullableInstanceNetworkAccessScope) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceNetworkAccessScope) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_instance_network_create.go b/services/postgresflex/v3api/model_instance_network_create.go new file mode 100644 index 000000000..4a85145e0 --- /dev/null +++ b/services/postgresflex/v3api/model_instance_network_create.go @@ -0,0 +1,209 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InstanceNetworkCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceNetworkCreate{} + +// InstanceNetworkCreate The access configuration of the instance +type InstanceNetworkCreate struct { + AccessScope *InstanceNetworkAccessScope `json:"accessScope,omitempty"` + // List of IPV4 cidr. + Acl []string `json:"acl"` + AdditionalProperties map[string]interface{} +} + +type _InstanceNetworkCreate InstanceNetworkCreate + +// NewInstanceNetworkCreate instantiates a new InstanceNetworkCreate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceNetworkCreate(acl []string) *InstanceNetworkCreate { + this := InstanceNetworkCreate{} + var accessScope InstanceNetworkAccessScope = INSTANCENETWORKACCESSSCOPE_PUBLIC + this.AccessScope = &accessScope + this.Acl = acl + return &this +} + +// NewInstanceNetworkCreateWithDefaults instantiates a new InstanceNetworkCreate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceNetworkCreateWithDefaults() *InstanceNetworkCreate { + this := InstanceNetworkCreate{} + var accessScope InstanceNetworkAccessScope = INSTANCENETWORKACCESSSCOPE_PUBLIC + this.AccessScope = &accessScope + return &this +} + +// GetAccessScope returns the AccessScope field value if set, zero value otherwise. +func (o *InstanceNetworkCreate) GetAccessScope() InstanceNetworkAccessScope { + if o == nil || IsNil(o.AccessScope) { + var ret InstanceNetworkAccessScope + return ret + } + return *o.AccessScope +} + +// GetAccessScopeOk returns a tuple with the AccessScope field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceNetworkCreate) GetAccessScopeOk() (*InstanceNetworkAccessScope, bool) { + if o == nil || IsNil(o.AccessScope) { + return nil, false + } + return o.AccessScope, true +} + +// HasAccessScope returns a boolean if a field has been set. +func (o *InstanceNetworkCreate) HasAccessScope() bool { + if o != nil && !IsNil(o.AccessScope) { + return true + } + + return false +} + +// SetAccessScope gets a reference to the given InstanceNetworkAccessScope and assigns it to the AccessScope field. +func (o *InstanceNetworkCreate) SetAccessScope(v InstanceNetworkAccessScope) { + o.AccessScope = &v +} + +// GetAcl returns the Acl field value +func (o *InstanceNetworkCreate) GetAcl() []string { + if o == nil { + var ret []string + return ret + } + + return o.Acl +} + +// GetAclOk returns a tuple with the Acl field value +// and a boolean to check if the value has been set. +func (o *InstanceNetworkCreate) GetAclOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Acl, true +} + +// SetAcl sets field value +func (o *InstanceNetworkCreate) SetAcl(v []string) { + o.Acl = v +} + +func (o InstanceNetworkCreate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceNetworkCreate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AccessScope) { + toSerialize["accessScope"] = o.AccessScope + } + toSerialize["acl"] = o.Acl + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceNetworkCreate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "acl", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceNetworkCreate := _InstanceNetworkCreate{} + + err = json.Unmarshal(data, &varInstanceNetworkCreate) + + if err != nil { + return err + } + + *o = InstanceNetworkCreate(varInstanceNetworkCreate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "accessScope") + delete(additionalProperties, "acl") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceNetworkCreate struct { + value *InstanceNetworkCreate + isSet bool +} + +func (v NullableInstanceNetworkCreate) Get() *InstanceNetworkCreate { + return v.value +} + +func (v *NullableInstanceNetworkCreate) Set(val *InstanceNetworkCreate) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceNetworkCreate) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceNetworkCreate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceNetworkCreate(val *InstanceNetworkCreate) *NullableInstanceNetworkCreate { + return &NullableInstanceNetworkCreate{value: val, isSet: true} +} + +func (v NullableInstanceNetworkCreate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceNetworkCreate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_instance_network_opt.go b/services/postgresflex/v3api/model_instance_network_opt.go new file mode 100644 index 000000000..f089e9f6c --- /dev/null +++ b/services/postgresflex/v3api/model_instance_network_opt.go @@ -0,0 +1,155 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" +) + +// checks if the InstanceNetworkOpt type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceNetworkOpt{} + +// InstanceNetworkOpt The access configuration of the instance +type InstanceNetworkOpt struct { + // List of IPV4 cidr. + Acl []string `json:"acl,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InstanceNetworkOpt InstanceNetworkOpt + +// NewInstanceNetworkOpt instantiates a new InstanceNetworkOpt object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceNetworkOpt() *InstanceNetworkOpt { + this := InstanceNetworkOpt{} + return &this +} + +// NewInstanceNetworkOptWithDefaults instantiates a new InstanceNetworkOpt object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceNetworkOptWithDefaults() *InstanceNetworkOpt { + this := InstanceNetworkOpt{} + return &this +} + +// GetAcl returns the Acl field value if set, zero value otherwise. +func (o *InstanceNetworkOpt) GetAcl() []string { + if o == nil || IsNil(o.Acl) { + var ret []string + return ret + } + return o.Acl +} + +// GetAclOk returns a tuple with the Acl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceNetworkOpt) GetAclOk() ([]string, bool) { + if o == nil || IsNil(o.Acl) { + return nil, false + } + return o.Acl, true +} + +// HasAcl returns a boolean if a field has been set. +func (o *InstanceNetworkOpt) HasAcl() bool { + if o != nil && !IsNil(o.Acl) { + return true + } + + return false +} + +// SetAcl gets a reference to the given []string and assigns it to the Acl field. +func (o *InstanceNetworkOpt) SetAcl(v []string) { + o.Acl = v +} + +func (o InstanceNetworkOpt) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceNetworkOpt) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Acl) { + toSerialize["acl"] = o.Acl + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceNetworkOpt) UnmarshalJSON(data []byte) (err error) { + varInstanceNetworkOpt := _InstanceNetworkOpt{} + + err = json.Unmarshal(data, &varInstanceNetworkOpt) + + if err != nil { + return err + } + + *o = InstanceNetworkOpt(varInstanceNetworkOpt) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "acl") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceNetworkOpt struct { + value *InstanceNetworkOpt + isSet bool +} + +func (v NullableInstanceNetworkOpt) Get() *InstanceNetworkOpt { + return v.value +} + +func (v *NullableInstanceNetworkOpt) Set(val *InstanceNetworkOpt) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceNetworkOpt) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceNetworkOpt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceNetworkOpt(val *InstanceNetworkOpt) *NullableInstanceNetworkOpt { + return &NullableInstanceNetworkOpt{value: val, isSet: true} +} + +func (v NullableInstanceNetworkOpt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceNetworkOpt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_instance_network_update.go b/services/postgresflex/v3api/model_instance_network_update.go new file mode 100644 index 000000000..841f6d70e --- /dev/null +++ b/services/postgresflex/v3api/model_instance_network_update.go @@ -0,0 +1,168 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InstanceNetworkUpdate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceNetworkUpdate{} + +// InstanceNetworkUpdate The access configuration of the instance +type InstanceNetworkUpdate struct { + // List of IPV4 cidr. + Acl []string `json:"acl"` + AdditionalProperties map[string]interface{} +} + +type _InstanceNetworkUpdate InstanceNetworkUpdate + +// NewInstanceNetworkUpdate instantiates a new InstanceNetworkUpdate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceNetworkUpdate(acl []string) *InstanceNetworkUpdate { + this := InstanceNetworkUpdate{} + this.Acl = acl + return &this +} + +// NewInstanceNetworkUpdateWithDefaults instantiates a new InstanceNetworkUpdate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceNetworkUpdateWithDefaults() *InstanceNetworkUpdate { + this := InstanceNetworkUpdate{} + return &this +} + +// GetAcl returns the Acl field value +func (o *InstanceNetworkUpdate) GetAcl() []string { + if o == nil { + var ret []string + return ret + } + + return o.Acl +} + +// GetAclOk returns a tuple with the Acl field value +// and a boolean to check if the value has been set. +func (o *InstanceNetworkUpdate) GetAclOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Acl, true +} + +// SetAcl sets field value +func (o *InstanceNetworkUpdate) SetAcl(v []string) { + o.Acl = v +} + +func (o InstanceNetworkUpdate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceNetworkUpdate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["acl"] = o.Acl + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceNetworkUpdate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "acl", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceNetworkUpdate := _InstanceNetworkUpdate{} + + err = json.Unmarshal(data, &varInstanceNetworkUpdate) + + if err != nil { + return err + } + + *o = InstanceNetworkUpdate(varInstanceNetworkUpdate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "acl") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceNetworkUpdate struct { + value *InstanceNetworkUpdate + isSet bool +} + +func (v NullableInstanceNetworkUpdate) Get() *InstanceNetworkUpdate { + return v.value +} + +func (v *NullableInstanceNetworkUpdate) Set(val *InstanceNetworkUpdate) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceNetworkUpdate) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceNetworkUpdate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceNetworkUpdate(val *InstanceNetworkUpdate) *NullableInstanceNetworkUpdate { + return &NullableInstanceNetworkUpdate{value: val, isSet: true} +} + +func (v NullableInstanceNetworkUpdate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceNetworkUpdate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_instance_sort.go b/services/postgresflex/v3api/model_instance_sort.go new file mode 100644 index 000000000..13c25bb45 --- /dev/null +++ b/services/postgresflex/v3api/model_instance_sort.go @@ -0,0 +1,126 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// InstanceSort the model 'InstanceSort' +type InstanceSort string + +// List of instance.sort +const ( + INSTANCESORT_ID_DESC InstanceSort = "id.desc" + INSTANCESORT_ID_ASC InstanceSort = "id.asc" + INSTANCESORT_IS_DELETABLE_DESC InstanceSort = "is_deletable.desc" + INSTANCESORT_IS_DELETABLE_ASC InstanceSort = "is_deletable.asc" + INSTANCESORT_NAME_ASC InstanceSort = "name.asc" + INSTANCESORT_NAME_DESC InstanceSort = "name.desc" + INSTANCESORT_STATE_ASC InstanceSort = "state.asc" + INSTANCESORT_STATE_DESC InstanceSort = "state.desc" + INSTANCESORT_UNKNOWN_DEFAULT_OPEN_API InstanceSort = "unknown_default_open_api" +) + +// All allowed values of InstanceSort enum +var AllowedInstanceSortEnumValues = []InstanceSort{ + "id.desc", + "id.asc", + "is_deletable.desc", + "is_deletable.asc", + "name.asc", + "name.desc", + "state.asc", + "state.desc", + "unknown_default_open_api", +} + +func (v *InstanceSort) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InstanceSort(value) + for _, existing := range AllowedInstanceSortEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INSTANCESORT_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewInstanceSortFromValue returns a pointer to a valid InstanceSort +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInstanceSortFromValue(v string) (*InstanceSort, error) { + ev := InstanceSort(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InstanceSort: valid values are %v", v, AllowedInstanceSortEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InstanceSort) IsValid() bool { + for _, existing := range AllowedInstanceSortEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to instance.sort value +func (v InstanceSort) Ptr() *InstanceSort { + return &v +} + +type NullableInstanceSort struct { + value *InstanceSort + isSet bool +} + +func (v NullableInstanceSort) Get() *InstanceSort { + return v.value +} + +func (v *NullableInstanceSort) Set(val *InstanceSort) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceSort) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceSort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceSort(val *InstanceSort) *NullableInstanceSort { + return &NullableInstanceSort{value: val, isSet: true} +} + +func (v NullableInstanceSort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceSort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_instance_storage_range.go b/services/postgresflex/v3api/model_instance_storage_range.go new file mode 100644 index 000000000..52392144e --- /dev/null +++ b/services/postgresflex/v3api/model_instance_storage_range.go @@ -0,0 +1,198 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InstanceStorageRange type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceStorageRange{} + +// InstanceStorageRange Contains the minimum and maximum storage space. +type InstanceStorageRange struct { + // The maximum available amount of storage. + Max int32 `json:"max"` + // The minimum available amount of storage. + Min int32 `json:"min"` + AdditionalProperties map[string]interface{} +} + +type _InstanceStorageRange InstanceStorageRange + +// NewInstanceStorageRange instantiates a new InstanceStorageRange object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstanceStorageRange(max int32, min int32) *InstanceStorageRange { + this := InstanceStorageRange{} + this.Max = max + this.Min = min + return &this +} + +// NewInstanceStorageRangeWithDefaults instantiates a new InstanceStorageRange object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceStorageRangeWithDefaults() *InstanceStorageRange { + this := InstanceStorageRange{} + return &this +} + +// GetMax returns the Max field value +func (o *InstanceStorageRange) GetMax() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Max +} + +// GetMaxOk returns a tuple with the Max field value +// and a boolean to check if the value has been set. +func (o *InstanceStorageRange) GetMaxOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Max, true +} + +// SetMax sets field value +func (o *InstanceStorageRange) SetMax(v int32) { + o.Max = v +} + +// GetMin returns the Min field value +func (o *InstanceStorageRange) GetMin() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Min +} + +// GetMinOk returns a tuple with the Min field value +// and a boolean to check if the value has been set. +func (o *InstanceStorageRange) GetMinOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Min, true +} + +// SetMin sets field value +func (o *InstanceStorageRange) SetMin(v int32) { + o.Min = v +} + +func (o InstanceStorageRange) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceStorageRange) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["max"] = o.Max + toSerialize["min"] = o.Min + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceStorageRange) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "max", + "min", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceStorageRange := _InstanceStorageRange{} + + err = json.Unmarshal(data, &varInstanceStorageRange) + + if err != nil { + return err + } + + *o = InstanceStorageRange(varInstanceStorageRange) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "max") + delete(additionalProperties, "min") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceStorageRange struct { + value *InstanceStorageRange + isSet bool +} + +func (v NullableInstanceStorageRange) Get() *InstanceStorageRange { + return v.value +} + +func (v *NullableInstanceStorageRange) Set(val *InstanceStorageRange) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceStorageRange) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceStorageRange) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceStorageRange(val *InstanceStorageRange) *NullableInstanceStorageRange { + return &NullableInstanceStorageRange{value: val, isSet: true} +} + +func (v NullableInstanceStorageRange) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceStorageRange) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_list_backup_response.go b/services/postgresflex/v3api/model_list_backup_response.go new file mode 100644 index 000000000..d755fce51 --- /dev/null +++ b/services/postgresflex/v3api/model_list_backup_response.go @@ -0,0 +1,197 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListBackupResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListBackupResponse{} + +// ListBackupResponse struct for ListBackupResponse +type ListBackupResponse struct { + // The list containing the information about the backups. + Backups []BackupData `json:"backups"` + Pagination Pagination `json:"pagination"` + AdditionalProperties map[string]interface{} +} + +type _ListBackupResponse ListBackupResponse + +// NewListBackupResponse instantiates a new ListBackupResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListBackupResponse(backups []BackupData, pagination Pagination) *ListBackupResponse { + this := ListBackupResponse{} + this.Backups = backups + this.Pagination = pagination + return &this +} + +// NewListBackupResponseWithDefaults instantiates a new ListBackupResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListBackupResponseWithDefaults() *ListBackupResponse { + this := ListBackupResponse{} + return &this +} + +// GetBackups returns the Backups field value +func (o *ListBackupResponse) GetBackups() []BackupData { + if o == nil { + var ret []BackupData + return ret + } + + return o.Backups +} + +// GetBackupsOk returns a tuple with the Backups field value +// and a boolean to check if the value has been set. +func (o *ListBackupResponse) GetBackupsOk() ([]BackupData, bool) { + if o == nil { + return nil, false + } + return o.Backups, true +} + +// SetBackups sets field value +func (o *ListBackupResponse) SetBackups(v []BackupData) { + o.Backups = v +} + +// GetPagination returns the Pagination field value +func (o *ListBackupResponse) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *ListBackupResponse) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *ListBackupResponse) SetPagination(v Pagination) { + o.Pagination = v +} + +func (o ListBackupResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListBackupResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backups"] = o.Backups + toSerialize["pagination"] = o.Pagination + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListBackupResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backups", + "pagination", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListBackupResponse := _ListBackupResponse{} + + err = json.Unmarshal(data, &varListBackupResponse) + + if err != nil { + return err + } + + *o = ListBackupResponse(varListBackupResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "backups") + delete(additionalProperties, "pagination") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListBackupResponse struct { + value *ListBackupResponse + isSet bool +} + +func (v NullableListBackupResponse) Get() *ListBackupResponse { + return v.value +} + +func (v *NullableListBackupResponse) Set(val *ListBackupResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListBackupResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListBackupResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListBackupResponse(val *ListBackupResponse) *NullableListBackupResponse { + return &NullableListBackupResponse{value: val, isSet: true} +} + +func (v NullableListBackupResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListBackupResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_list_collations_response.go b/services/postgresflex/v3api/model_list_collations_response.go new file mode 100644 index 000000000..23035c85d --- /dev/null +++ b/services/postgresflex/v3api/model_list_collations_response.go @@ -0,0 +1,168 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListCollationsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCollationsResponse{} + +// ListCollationsResponse struct for ListCollationsResponse +type ListCollationsResponse struct { + // List of collations available for the instance. + Collations []string `json:"collations"` + AdditionalProperties map[string]interface{} +} + +type _ListCollationsResponse ListCollationsResponse + +// NewListCollationsResponse instantiates a new ListCollationsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListCollationsResponse(collations []string) *ListCollationsResponse { + this := ListCollationsResponse{} + this.Collations = collations + return &this +} + +// NewListCollationsResponseWithDefaults instantiates a new ListCollationsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListCollationsResponseWithDefaults() *ListCollationsResponse { + this := ListCollationsResponse{} + return &this +} + +// GetCollations returns the Collations field value +func (o *ListCollationsResponse) GetCollations() []string { + if o == nil { + var ret []string + return ret + } + + return o.Collations +} + +// GetCollationsOk returns a tuple with the Collations field value +// and a boolean to check if the value has been set. +func (o *ListCollationsResponse) GetCollationsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Collations, true +} + +// SetCollations sets field value +func (o *ListCollationsResponse) SetCollations(v []string) { + o.Collations = v +} + +func (o ListCollationsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListCollationsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["collations"] = o.Collations + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListCollationsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "collations", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListCollationsResponse := _ListCollationsResponse{} + + err = json.Unmarshal(data, &varListCollationsResponse) + + if err != nil { + return err + } + + *o = ListCollationsResponse(varListCollationsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "collations") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListCollationsResponse struct { + value *ListCollationsResponse + isSet bool +} + +func (v NullableListCollationsResponse) Get() *ListCollationsResponse { + return v.value +} + +func (v *NullableListCollationsResponse) Set(val *ListCollationsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListCollationsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListCollationsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCollationsResponse(val *ListCollationsResponse) *NullableListCollationsResponse { + return &NullableListCollationsResponse{value: val, isSet: true} +} + +func (v NullableListCollationsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCollationsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_list_database.go b/services/postgresflex/v3api/model_list_database.go new file mode 100644 index 000000000..c3de4e00f --- /dev/null +++ b/services/postgresflex/v3api/model_list_database.go @@ -0,0 +1,228 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListDatabase type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListDatabase{} + +// ListDatabase struct for ListDatabase +type ListDatabase struct { + // The id of the database. + Id int64 `json:"id"` + // The name of the database. + Name string `json:"name"` + // The owner of the database. + Owner string `json:"owner"` + AdditionalProperties map[string]interface{} +} + +type _ListDatabase ListDatabase + +// NewListDatabase instantiates a new ListDatabase object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListDatabase(id int64, name string, owner string) *ListDatabase { + this := ListDatabase{} + this.Id = id + this.Name = name + this.Owner = owner + return &this +} + +// NewListDatabaseWithDefaults instantiates a new ListDatabase object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListDatabaseWithDefaults() *ListDatabase { + this := ListDatabase{} + return &this +} + +// GetId returns the Id field value +func (o *ListDatabase) GetId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ListDatabase) GetIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ListDatabase) SetId(v int64) { + o.Id = v +} + +// GetName returns the Name field value +func (o *ListDatabase) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ListDatabase) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ListDatabase) SetName(v string) { + o.Name = v +} + +// GetOwner returns the Owner field value +func (o *ListDatabase) GetOwner() string { + if o == nil { + var ret string + return ret + } + + return o.Owner +} + +// GetOwnerOk returns a tuple with the Owner field value +// and a boolean to check if the value has been set. +func (o *ListDatabase) GetOwnerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Owner, true +} + +// SetOwner sets field value +func (o *ListDatabase) SetOwner(v string) { + o.Owner = v +} + +func (o ListDatabase) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListDatabase) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["owner"] = o.Owner + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListDatabase) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "name", + "owner", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListDatabase := _ListDatabase{} + + err = json.Unmarshal(data, &varListDatabase) + + if err != nil { + return err + } + + *o = ListDatabase(varListDatabase) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "owner") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListDatabase struct { + value *ListDatabase + isSet bool +} + +func (v NullableListDatabase) Get() *ListDatabase { + return v.value +} + +func (v *NullableListDatabase) Set(val *ListDatabase) { + v.value = val + v.isSet = true +} + +func (v NullableListDatabase) IsSet() bool { + return v.isSet +} + +func (v *NullableListDatabase) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListDatabase(val *ListDatabase) *NullableListDatabase { + return &NullableListDatabase{value: val, isSet: true} +} + +func (v NullableListDatabase) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListDatabase) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_list_databases_response.go b/services/postgresflex/v3api/model_list_databases_response.go new file mode 100644 index 000000000..5bd65f7e2 --- /dev/null +++ b/services/postgresflex/v3api/model_list_databases_response.go @@ -0,0 +1,197 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListDatabasesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListDatabasesResponse{} + +// ListDatabasesResponse struct for ListDatabasesResponse +type ListDatabasesResponse struct { + // A list containing all databases for the instance. + Databases []ListDatabase `json:"databases"` + Pagination Pagination `json:"pagination"` + AdditionalProperties map[string]interface{} +} + +type _ListDatabasesResponse ListDatabasesResponse + +// NewListDatabasesResponse instantiates a new ListDatabasesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListDatabasesResponse(databases []ListDatabase, pagination Pagination) *ListDatabasesResponse { + this := ListDatabasesResponse{} + this.Databases = databases + this.Pagination = pagination + return &this +} + +// NewListDatabasesResponseWithDefaults instantiates a new ListDatabasesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListDatabasesResponseWithDefaults() *ListDatabasesResponse { + this := ListDatabasesResponse{} + return &this +} + +// GetDatabases returns the Databases field value +func (o *ListDatabasesResponse) GetDatabases() []ListDatabase { + if o == nil { + var ret []ListDatabase + return ret + } + + return o.Databases +} + +// GetDatabasesOk returns a tuple with the Databases field value +// and a boolean to check if the value has been set. +func (o *ListDatabasesResponse) GetDatabasesOk() ([]ListDatabase, bool) { + if o == nil { + return nil, false + } + return o.Databases, true +} + +// SetDatabases sets field value +func (o *ListDatabasesResponse) SetDatabases(v []ListDatabase) { + o.Databases = v +} + +// GetPagination returns the Pagination field value +func (o *ListDatabasesResponse) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *ListDatabasesResponse) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *ListDatabasesResponse) SetPagination(v Pagination) { + o.Pagination = v +} + +func (o ListDatabasesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListDatabasesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["databases"] = o.Databases + toSerialize["pagination"] = o.Pagination + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListDatabasesResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "databases", + "pagination", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListDatabasesResponse := _ListDatabasesResponse{} + + err = json.Unmarshal(data, &varListDatabasesResponse) + + if err != nil { + return err + } + + *o = ListDatabasesResponse(varListDatabasesResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "databases") + delete(additionalProperties, "pagination") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListDatabasesResponse struct { + value *ListDatabasesResponse + isSet bool +} + +func (v NullableListDatabasesResponse) Get() *ListDatabasesResponse { + return v.value +} + +func (v *NullableListDatabasesResponse) Set(val *ListDatabasesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListDatabasesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListDatabasesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListDatabasesResponse(val *ListDatabasesResponse) *NullableListDatabasesResponse { + return &NullableListDatabasesResponse{value: val, isSet: true} +} + +func (v NullableListDatabasesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListDatabasesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_list_flavors.go b/services/postgresflex/v3api/model_list_flavors.go new file mode 100644 index 000000000..a14c84d7e --- /dev/null +++ b/services/postgresflex/v3api/model_list_flavors.go @@ -0,0 +1,378 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListFlavors type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListFlavors{} + +// ListFlavors The flavor of the instance containing the technical features. +type ListFlavors struct { + // The cpu count of the instance. + Cpu int64 `json:"cpu"` + // The flavor description. + Description string `json:"description"` + // The id of the instance flavor. + Id string `json:"id"` + // maximum storage which can be ordered for the flavor in Gigabyte. + MaxGB int32 `json:"maxGB"` + // The memory of the instance in Gibibyte. + Memory int64 `json:"memory"` + // minimum storage which is required to order in Gigabyte. + MinGB int32 `json:"minGB"` + // defines the nodeType it can be either single or replica + NodeType string `json:"nodeType"` + // maximum storage which can be ordered for the flavor in Gigabyte. + StorageClasses []FlavorStorageClassesStorageClass `json:"storageClasses"` + AdditionalProperties map[string]interface{} +} + +type _ListFlavors ListFlavors + +// NewListFlavors instantiates a new ListFlavors object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListFlavors(cpu int64, description string, id string, maxGB int32, memory int64, minGB int32, nodeType string, storageClasses []FlavorStorageClassesStorageClass) *ListFlavors { + this := ListFlavors{} + this.Cpu = cpu + this.Description = description + this.Id = id + this.MaxGB = maxGB + this.Memory = memory + this.MinGB = minGB + this.NodeType = nodeType + this.StorageClasses = storageClasses + return &this +} + +// NewListFlavorsWithDefaults instantiates a new ListFlavors object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListFlavorsWithDefaults() *ListFlavors { + this := ListFlavors{} + return &this +} + +// GetCpu returns the Cpu field value +func (o *ListFlavors) GetCpu() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Cpu +} + +// GetCpuOk returns a tuple with the Cpu field value +// and a boolean to check if the value has been set. +func (o *ListFlavors) GetCpuOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Cpu, true +} + +// SetCpu sets field value +func (o *ListFlavors) SetCpu(v int64) { + o.Cpu = v +} + +// GetDescription returns the Description field value +func (o *ListFlavors) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *ListFlavors) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *ListFlavors) SetDescription(v string) { + o.Description = v +} + +// GetId returns the Id field value +func (o *ListFlavors) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ListFlavors) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ListFlavors) SetId(v string) { + o.Id = v +} + +// GetMaxGB returns the MaxGB field value +func (o *ListFlavors) GetMaxGB() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MaxGB +} + +// GetMaxGBOk returns a tuple with the MaxGB field value +// and a boolean to check if the value has been set. +func (o *ListFlavors) GetMaxGBOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MaxGB, true +} + +// SetMaxGB sets field value +func (o *ListFlavors) SetMaxGB(v int32) { + o.MaxGB = v +} + +// GetMemory returns the Memory field value +func (o *ListFlavors) GetMemory() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Memory +} + +// GetMemoryOk returns a tuple with the Memory field value +// and a boolean to check if the value has been set. +func (o *ListFlavors) GetMemoryOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Memory, true +} + +// SetMemory sets field value +func (o *ListFlavors) SetMemory(v int64) { + o.Memory = v +} + +// GetMinGB returns the MinGB field value +func (o *ListFlavors) GetMinGB() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MinGB +} + +// GetMinGBOk returns a tuple with the MinGB field value +// and a boolean to check if the value has been set. +func (o *ListFlavors) GetMinGBOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MinGB, true +} + +// SetMinGB sets field value +func (o *ListFlavors) SetMinGB(v int32) { + o.MinGB = v +} + +// GetNodeType returns the NodeType field value +func (o *ListFlavors) GetNodeType() string { + if o == nil { + var ret string + return ret + } + + return o.NodeType +} + +// GetNodeTypeOk returns a tuple with the NodeType field value +// and a boolean to check if the value has been set. +func (o *ListFlavors) GetNodeTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NodeType, true +} + +// SetNodeType sets field value +func (o *ListFlavors) SetNodeType(v string) { + o.NodeType = v +} + +// GetStorageClasses returns the StorageClasses field value +func (o *ListFlavors) GetStorageClasses() []FlavorStorageClassesStorageClass { + if o == nil { + var ret []FlavorStorageClassesStorageClass + return ret + } + + return o.StorageClasses +} + +// GetStorageClassesOk returns a tuple with the StorageClasses field value +// and a boolean to check if the value has been set. +func (o *ListFlavors) GetStorageClassesOk() ([]FlavorStorageClassesStorageClass, bool) { + if o == nil { + return nil, false + } + return o.StorageClasses, true +} + +// SetStorageClasses sets field value +func (o *ListFlavors) SetStorageClasses(v []FlavorStorageClassesStorageClass) { + o.StorageClasses = v +} + +func (o ListFlavors) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListFlavors) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cpu"] = o.Cpu + toSerialize["description"] = o.Description + toSerialize["id"] = o.Id + toSerialize["maxGB"] = o.MaxGB + toSerialize["memory"] = o.Memory + toSerialize["minGB"] = o.MinGB + toSerialize["nodeType"] = o.NodeType + toSerialize["storageClasses"] = o.StorageClasses + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListFlavors) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cpu", + "description", + "id", + "maxGB", + "memory", + "minGB", + "nodeType", + "storageClasses", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListFlavors := _ListFlavors{} + + err = json.Unmarshal(data, &varListFlavors) + + if err != nil { + return err + } + + *o = ListFlavors(varListFlavors) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cpu") + delete(additionalProperties, "description") + delete(additionalProperties, "id") + delete(additionalProperties, "maxGB") + delete(additionalProperties, "memory") + delete(additionalProperties, "minGB") + delete(additionalProperties, "nodeType") + delete(additionalProperties, "storageClasses") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListFlavors struct { + value *ListFlavors + isSet bool +} + +func (v NullableListFlavors) Get() *ListFlavors { + return v.value +} + +func (v *NullableListFlavors) Set(val *ListFlavors) { + v.value = val + v.isSet = true +} + +func (v NullableListFlavors) IsSet() bool { + return v.isSet +} + +func (v *NullableListFlavors) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListFlavors(val *ListFlavors) *NullableListFlavors { + return &NullableListFlavors{value: val, isSet: true} +} + +func (v NullableListFlavors) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListFlavors) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_list_flavors_response.go b/services/postgresflex/v3api/model_list_flavors_response.go new file mode 100644 index 000000000..14d9c2777 --- /dev/null +++ b/services/postgresflex/v3api/model_list_flavors_response.go @@ -0,0 +1,197 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListFlavorsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListFlavorsResponse{} + +// ListFlavorsResponse struct for ListFlavorsResponse +type ListFlavorsResponse struct { + // List of flavors available for the project. + Flavors []ListFlavors `json:"flavors"` + Pagination Pagination `json:"pagination"` + AdditionalProperties map[string]interface{} +} + +type _ListFlavorsResponse ListFlavorsResponse + +// NewListFlavorsResponse instantiates a new ListFlavorsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListFlavorsResponse(flavors []ListFlavors, pagination Pagination) *ListFlavorsResponse { + this := ListFlavorsResponse{} + this.Flavors = flavors + this.Pagination = pagination + return &this +} + +// NewListFlavorsResponseWithDefaults instantiates a new ListFlavorsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListFlavorsResponseWithDefaults() *ListFlavorsResponse { + this := ListFlavorsResponse{} + return &this +} + +// GetFlavors returns the Flavors field value +func (o *ListFlavorsResponse) GetFlavors() []ListFlavors { + if o == nil { + var ret []ListFlavors + return ret + } + + return o.Flavors +} + +// GetFlavorsOk returns a tuple with the Flavors field value +// and a boolean to check if the value has been set. +func (o *ListFlavorsResponse) GetFlavorsOk() ([]ListFlavors, bool) { + if o == nil { + return nil, false + } + return o.Flavors, true +} + +// SetFlavors sets field value +func (o *ListFlavorsResponse) SetFlavors(v []ListFlavors) { + o.Flavors = v +} + +// GetPagination returns the Pagination field value +func (o *ListFlavorsResponse) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *ListFlavorsResponse) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *ListFlavorsResponse) SetPagination(v Pagination) { + o.Pagination = v +} + +func (o ListFlavorsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListFlavorsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["flavors"] = o.Flavors + toSerialize["pagination"] = o.Pagination + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListFlavorsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "flavors", + "pagination", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListFlavorsResponse := _ListFlavorsResponse{} + + err = json.Unmarshal(data, &varListFlavorsResponse) + + if err != nil { + return err + } + + *o = ListFlavorsResponse(varListFlavorsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flavors") + delete(additionalProperties, "pagination") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListFlavorsResponse struct { + value *ListFlavorsResponse + isSet bool +} + +func (v NullableListFlavorsResponse) Get() *ListFlavorsResponse { + return v.value +} + +func (v *NullableListFlavorsResponse) Set(val *ListFlavorsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListFlavorsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListFlavorsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListFlavorsResponse(val *ListFlavorsResponse) *NullableListFlavorsResponse { + return &NullableListFlavorsResponse{value: val, isSet: true} +} + +func (v NullableListFlavorsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListFlavorsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_list_instance.go b/services/postgresflex/v3api/model_list_instance.go new file mode 100644 index 000000000..dfe3baf70 --- /dev/null +++ b/services/postgresflex/v3api/model_list_instance.go @@ -0,0 +1,257 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListInstance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListInstance{} + +// ListInstance struct for ListInstance +type ListInstance struct { + // The ID of the instance. + Id string `json:"id"` + // Whether the instance can be deleted or not. + IsDeletable bool `json:"isDeletable"` + // The name of the instance. + Name string `json:"name"` + State State `json:"state"` + AdditionalProperties map[string]interface{} +} + +type _ListInstance ListInstance + +// NewListInstance instantiates a new ListInstance object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListInstance(id string, isDeletable bool, name string, state State) *ListInstance { + this := ListInstance{} + this.Id = id + this.IsDeletable = isDeletable + this.Name = name + this.State = state + return &this +} + +// NewListInstanceWithDefaults instantiates a new ListInstance object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListInstanceWithDefaults() *ListInstance { + this := ListInstance{} + return &this +} + +// GetId returns the Id field value +func (o *ListInstance) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ListInstance) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ListInstance) SetId(v string) { + o.Id = v +} + +// GetIsDeletable returns the IsDeletable field value +func (o *ListInstance) GetIsDeletable() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsDeletable +} + +// GetIsDeletableOk returns a tuple with the IsDeletable field value +// and a boolean to check if the value has been set. +func (o *ListInstance) GetIsDeletableOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsDeletable, true +} + +// SetIsDeletable sets field value +func (o *ListInstance) SetIsDeletable(v bool) { + o.IsDeletable = v +} + +// GetName returns the Name field value +func (o *ListInstance) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ListInstance) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ListInstance) SetName(v string) { + o.Name = v +} + +// GetState returns the State field value +func (o *ListInstance) GetState() State { + if o == nil { + var ret State + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *ListInstance) GetStateOk() (*State, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *ListInstance) SetState(v State) { + o.State = v +} + +func (o ListInstance) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListInstance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["isDeletable"] = o.IsDeletable + toSerialize["name"] = o.Name + toSerialize["state"] = o.State + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListInstance) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "isDeletable", + "name", + "state", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListInstance := _ListInstance{} + + err = json.Unmarshal(data, &varListInstance) + + if err != nil { + return err + } + + *o = ListInstance(varListInstance) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "isDeletable") + delete(additionalProperties, "name") + delete(additionalProperties, "state") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListInstance struct { + value *ListInstance + isSet bool +} + +func (v NullableListInstance) Get() *ListInstance { + return v.value +} + +func (v *NullableListInstance) Set(val *ListInstance) { + v.value = val + v.isSet = true +} + +func (v NullableListInstance) IsSet() bool { + return v.isSet +} + +func (v *NullableListInstance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListInstance(val *ListInstance) *NullableListInstance { + return &NullableListInstance{value: val, isSet: true} +} + +func (v NullableListInstance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListInstance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_list_instances_response.go b/services/postgresflex/v3api/model_list_instances_response.go new file mode 100644 index 000000000..2144290a6 --- /dev/null +++ b/services/postgresflex/v3api/model_list_instances_response.go @@ -0,0 +1,197 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListInstancesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListInstancesResponse{} + +// ListInstancesResponse struct for ListInstancesResponse +type ListInstancesResponse struct { + // List of owned instances and their current state. + Instances []ListInstance `json:"instances"` + Pagination Pagination `json:"pagination"` + AdditionalProperties map[string]interface{} +} + +type _ListInstancesResponse ListInstancesResponse + +// NewListInstancesResponse instantiates a new ListInstancesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListInstancesResponse(instances []ListInstance, pagination Pagination) *ListInstancesResponse { + this := ListInstancesResponse{} + this.Instances = instances + this.Pagination = pagination + return &this +} + +// NewListInstancesResponseWithDefaults instantiates a new ListInstancesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListInstancesResponseWithDefaults() *ListInstancesResponse { + this := ListInstancesResponse{} + return &this +} + +// GetInstances returns the Instances field value +func (o *ListInstancesResponse) GetInstances() []ListInstance { + if o == nil { + var ret []ListInstance + return ret + } + + return o.Instances +} + +// GetInstancesOk returns a tuple with the Instances field value +// and a boolean to check if the value has been set. +func (o *ListInstancesResponse) GetInstancesOk() ([]ListInstance, bool) { + if o == nil { + return nil, false + } + return o.Instances, true +} + +// SetInstances sets field value +func (o *ListInstancesResponse) SetInstances(v []ListInstance) { + o.Instances = v +} + +// GetPagination returns the Pagination field value +func (o *ListInstancesResponse) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *ListInstancesResponse) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *ListInstancesResponse) SetPagination(v Pagination) { + o.Pagination = v +} + +func (o ListInstancesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListInstancesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instances"] = o.Instances + toSerialize["pagination"] = o.Pagination + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListInstancesResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instances", + "pagination", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListInstancesResponse := _ListInstancesResponse{} + + err = json.Unmarshal(data, &varListInstancesResponse) + + if err != nil { + return err + } + + *o = ListInstancesResponse(varListInstancesResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instances") + delete(additionalProperties, "pagination") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListInstancesResponse struct { + value *ListInstancesResponse + isSet bool +} + +func (v NullableListInstancesResponse) Get() *ListInstancesResponse { + return v.value +} + +func (v *NullableListInstancesResponse) Set(val *ListInstancesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListInstancesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListInstancesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListInstancesResponse(val *ListInstancesResponse) *NullableListInstancesResponse { + return &NullableListInstancesResponse{value: val, isSet: true} +} + +func (v NullableListInstancesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListInstancesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_list_roles_response.go b/services/postgresflex/v3api/model_list_roles_response.go new file mode 100644 index 000000000..acab8eb44 --- /dev/null +++ b/services/postgresflex/v3api/model_list_roles_response.go @@ -0,0 +1,168 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListRolesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListRolesResponse{} + +// ListRolesResponse struct for ListRolesResponse +type ListRolesResponse struct { + // List of all role names available in the instance + Roles []string `json:"roles"` + AdditionalProperties map[string]interface{} +} + +type _ListRolesResponse ListRolesResponse + +// NewListRolesResponse instantiates a new ListRolesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListRolesResponse(roles []string) *ListRolesResponse { + this := ListRolesResponse{} + this.Roles = roles + return &this +} + +// NewListRolesResponseWithDefaults instantiates a new ListRolesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListRolesResponseWithDefaults() *ListRolesResponse { + this := ListRolesResponse{} + return &this +} + +// GetRoles returns the Roles field value +func (o *ListRolesResponse) GetRoles() []string { + if o == nil { + var ret []string + return ret + } + + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value +// and a boolean to check if the value has been set. +func (o *ListRolesResponse) GetRolesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Roles, true +} + +// SetRoles sets field value +func (o *ListRolesResponse) SetRoles(v []string) { + o.Roles = v +} + +func (o ListRolesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListRolesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["roles"] = o.Roles + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListRolesResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "roles", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListRolesResponse := _ListRolesResponse{} + + err = json.Unmarshal(data, &varListRolesResponse) + + if err != nil { + return err + } + + *o = ListRolesResponse(varListRolesResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "roles") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListRolesResponse struct { + value *ListRolesResponse + isSet bool +} + +func (v NullableListRolesResponse) Get() *ListRolesResponse { + return v.value +} + +func (v *NullableListRolesResponse) Set(val *ListRolesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListRolesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListRolesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRolesResponse(val *ListRolesResponse) *NullableListRolesResponse { + return &NullableListRolesResponse{value: val, isSet: true} +} + +func (v NullableListRolesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRolesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_list_user.go b/services/postgresflex/v3api/model_list_user.go new file mode 100644 index 000000000..995c4fdac --- /dev/null +++ b/services/postgresflex/v3api/model_list_user.go @@ -0,0 +1,228 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListUser type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListUser{} + +// ListUser struct for ListUser +type ListUser struct { + // The ID of the user. + Id int64 `json:"id"` + // The name of the user. + Name string `json:"name"` + // The current state of the user. + State string `json:"state"` + AdditionalProperties map[string]interface{} +} + +type _ListUser ListUser + +// NewListUser instantiates a new ListUser object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListUser(id int64, name string, state string) *ListUser { + this := ListUser{} + this.Id = id + this.Name = name + this.State = state + return &this +} + +// NewListUserWithDefaults instantiates a new ListUser object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListUserWithDefaults() *ListUser { + this := ListUser{} + return &this +} + +// GetId returns the Id field value +func (o *ListUser) GetId() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ListUser) GetIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ListUser) SetId(v int64) { + o.Id = v +} + +// GetName returns the Name field value +func (o *ListUser) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ListUser) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ListUser) SetName(v string) { + o.Name = v +} + +// GetState returns the State field value +func (o *ListUser) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *ListUser) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *ListUser) SetState(v string) { + o.State = v +} + +func (o ListUser) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListUser) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["state"] = o.State + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListUser) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "name", + "state", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListUser := _ListUser{} + + err = json.Unmarshal(data, &varListUser) + + if err != nil { + return err + } + + *o = ListUser(varListUser) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "state") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListUser struct { + value *ListUser + isSet bool +} + +func (v NullableListUser) Get() *ListUser { + return v.value +} + +func (v *NullableListUser) Set(val *ListUser) { + v.value = val + v.isSet = true +} + +func (v NullableListUser) IsSet() bool { + return v.isSet +} + +func (v *NullableListUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListUser(val *ListUser) *NullableListUser { + return &NullableListUser{value: val, isSet: true} +} + +func (v NullableListUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_list_user_response.go b/services/postgresflex/v3api/model_list_user_response.go new file mode 100644 index 000000000..bf68e1998 --- /dev/null +++ b/services/postgresflex/v3api/model_list_user_response.go @@ -0,0 +1,197 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListUserResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListUserResponse{} + +// ListUserResponse struct for ListUserResponse +type ListUserResponse struct { + Pagination Pagination `json:"pagination"` + // List of all users inside an instance + Users []ListUser `json:"users"` + AdditionalProperties map[string]interface{} +} + +type _ListUserResponse ListUserResponse + +// NewListUserResponse instantiates a new ListUserResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListUserResponse(pagination Pagination, users []ListUser) *ListUserResponse { + this := ListUserResponse{} + this.Pagination = pagination + this.Users = users + return &this +} + +// NewListUserResponseWithDefaults instantiates a new ListUserResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListUserResponseWithDefaults() *ListUserResponse { + this := ListUserResponse{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *ListUserResponse) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *ListUserResponse) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *ListUserResponse) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetUsers returns the Users field value +func (o *ListUserResponse) GetUsers() []ListUser { + if o == nil { + var ret []ListUser + return ret + } + + return o.Users +} + +// GetUsersOk returns a tuple with the Users field value +// and a boolean to check if the value has been set. +func (o *ListUserResponse) GetUsersOk() ([]ListUser, bool) { + if o == nil { + return nil, false + } + return o.Users, true +} + +// SetUsers sets field value +func (o *ListUserResponse) SetUsers(v []ListUser) { + o.Users = v +} + +func (o ListUserResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListUserResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["users"] = o.Users + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListUserResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "users", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListUserResponse := _ListUserResponse{} + + err = json.Unmarshal(data, &varListUserResponse) + + if err != nil { + return err + } + + *o = ListUserResponse(varListUserResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "users") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListUserResponse struct { + value *ListUserResponse + isSet bool +} + +func (v NullableListUserResponse) Get() *ListUserResponse { + return v.value +} + +func (v *NullableListUserResponse) Set(val *ListUserResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListUserResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListUserResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListUserResponse(val *ListUserResponse) *NullableListUserResponse { + return &NullableListUserResponse{value: val, isSet: true} +} + +func (v NullableListUserResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListUserResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_list_version_response.go b/services/postgresflex/v3api/model_list_version_response.go new file mode 100644 index 000000000..62b25b6ba --- /dev/null +++ b/services/postgresflex/v3api/model_list_version_response.go @@ -0,0 +1,168 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListVersionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListVersionResponse{} + +// ListVersionResponse struct for ListVersionResponse +type ListVersionResponse struct { + // A list containing available postgres versions. + Versions []Version `json:"versions"` + AdditionalProperties map[string]interface{} +} + +type _ListVersionResponse ListVersionResponse + +// NewListVersionResponse instantiates a new ListVersionResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListVersionResponse(versions []Version) *ListVersionResponse { + this := ListVersionResponse{} + this.Versions = versions + return &this +} + +// NewListVersionResponseWithDefaults instantiates a new ListVersionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListVersionResponseWithDefaults() *ListVersionResponse { + this := ListVersionResponse{} + return &this +} + +// GetVersions returns the Versions field value +func (o *ListVersionResponse) GetVersions() []Version { + if o == nil { + var ret []Version + return ret + } + + return o.Versions +} + +// GetVersionsOk returns a tuple with the Versions field value +// and a boolean to check if the value has been set. +func (o *ListVersionResponse) GetVersionsOk() ([]Version, bool) { + if o == nil { + return nil, false + } + return o.Versions, true +} + +// SetVersions sets field value +func (o *ListVersionResponse) SetVersions(v []Version) { + o.Versions = v +} + +func (o ListVersionResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListVersionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["versions"] = o.Versions + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListVersionResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "versions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListVersionResponse := _ListVersionResponse{} + + err = json.Unmarshal(data, &varListVersionResponse) + + if err != nil { + return err + } + + *o = ListVersionResponse(varListVersionResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "versions") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListVersionResponse struct { + value *ListVersionResponse + isSet bool +} + +func (v NullableListVersionResponse) Get() *ListVersionResponse { + return v.value +} + +func (v *NullableListVersionResponse) Set(val *ListVersionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListVersionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListVersionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListVersionResponse(val *ListVersionResponse) *NullableListVersionResponse { + return &NullableListVersionResponse{value: val, isSet: true} +} + +func (v NullableListVersionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListVersionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_pagination.go b/services/postgresflex/v3api/model_pagination.go new file mode 100644 index 000000000..9c6da04f2 --- /dev/null +++ b/services/postgresflex/v3api/model_pagination.go @@ -0,0 +1,283 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Pagination type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Pagination{} + +// Pagination struct for Pagination +type Pagination struct { + Page int64 `json:"page"` + Size int64 `json:"size"` + Sort string `json:"sort"` + TotalPages int64 `json:"totalPages"` + TotalRows int64 `json:"totalRows"` + AdditionalProperties map[string]interface{} +} + +type _Pagination Pagination + +// NewPagination instantiates a new Pagination object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPagination(page int64, size int64, sort string, totalPages int64, totalRows int64) *Pagination { + this := Pagination{} + this.Page = page + this.Size = size + this.Sort = sort + this.TotalPages = totalPages + this.TotalRows = totalRows + return &this +} + +// NewPaginationWithDefaults instantiates a new Pagination object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginationWithDefaults() *Pagination { + this := Pagination{} + return &this +} + +// GetPage returns the Page field value +func (o *Pagination) GetPage() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Page +} + +// GetPageOk returns a tuple with the Page field value +// and a boolean to check if the value has been set. +func (o *Pagination) GetPageOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Page, true +} + +// SetPage sets field value +func (o *Pagination) SetPage(v int64) { + o.Page = v +} + +// GetSize returns the Size field value +func (o *Pagination) GetSize() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *Pagination) GetSizeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *Pagination) SetSize(v int64) { + o.Size = v +} + +// GetSort returns the Sort field value +func (o *Pagination) GetSort() string { + if o == nil { + var ret string + return ret + } + + return o.Sort +} + +// GetSortOk returns a tuple with the Sort field value +// and a boolean to check if the value has been set. +func (o *Pagination) GetSortOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Sort, true +} + +// SetSort sets field value +func (o *Pagination) SetSort(v string) { + o.Sort = v +} + +// GetTotalPages returns the TotalPages field value +func (o *Pagination) GetTotalPages() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.TotalPages +} + +// GetTotalPagesOk returns a tuple with the TotalPages field value +// and a boolean to check if the value has been set. +func (o *Pagination) GetTotalPagesOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TotalPages, true +} + +// SetTotalPages sets field value +func (o *Pagination) SetTotalPages(v int64) { + o.TotalPages = v +} + +// GetTotalRows returns the TotalRows field value +func (o *Pagination) GetTotalRows() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.TotalRows +} + +// GetTotalRowsOk returns a tuple with the TotalRows field value +// and a boolean to check if the value has been set. +func (o *Pagination) GetTotalRowsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TotalRows, true +} + +// SetTotalRows sets field value +func (o *Pagination) SetTotalRows(v int64) { + o.TotalRows = v +} + +func (o Pagination) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Pagination) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["page"] = o.Page + toSerialize["size"] = o.Size + toSerialize["sort"] = o.Sort + toSerialize["totalPages"] = o.TotalPages + toSerialize["totalRows"] = o.TotalRows + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Pagination) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "page", + "size", + "sort", + "totalPages", + "totalRows", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPagination := _Pagination{} + + err = json.Unmarshal(data, &varPagination) + + if err != nil { + return err + } + + *o = Pagination(varPagination) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "page") + delete(additionalProperties, "size") + delete(additionalProperties, "sort") + delete(additionalProperties, "totalPages") + delete(additionalProperties, "totalRows") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePagination struct { + value *Pagination + isSet bool +} + +func (v NullablePagination) Get() *Pagination { + return v.value +} + +func (v *NullablePagination) Set(val *Pagination) { + v.value = val + v.isSet = true +} + +func (v NullablePagination) IsSet() bool { + return v.isSet +} + +func (v *NullablePagination) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePagination(val *Pagination) *NullablePagination { + return &NullablePagination{value: val, isSet: true} +} + +func (v NullablePagination) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePagination) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_partial_update_database_payload.go b/services/postgresflex/v3api/model_partial_update_database_payload.go new file mode 100644 index 000000000..9bb8bebdc --- /dev/null +++ b/services/postgresflex/v3api/model_partial_update_database_payload.go @@ -0,0 +1,193 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateDatabasePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateDatabasePayload{} + +// PartialUpdateDatabasePayload struct for PartialUpdateDatabasePayload +type PartialUpdateDatabasePayload struct { + // The name of the database. + Name *string `json:"name,omitempty"` + // The owner of the database. + Owner *string `json:"owner,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PartialUpdateDatabasePayload PartialUpdateDatabasePayload + +// NewPartialUpdateDatabasePayload instantiates a new PartialUpdateDatabasePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateDatabasePayload() *PartialUpdateDatabasePayload { + this := PartialUpdateDatabasePayload{} + return &this +} + +// NewPartialUpdateDatabasePayloadWithDefaults instantiates a new PartialUpdateDatabasePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateDatabasePayloadWithDefaults() *PartialUpdateDatabasePayload { + this := PartialUpdateDatabasePayload{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PartialUpdateDatabasePayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateDatabasePayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PartialUpdateDatabasePayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PartialUpdateDatabasePayload) SetName(v string) { + o.Name = &v +} + +// GetOwner returns the Owner field value if set, zero value otherwise. +func (o *PartialUpdateDatabasePayload) GetOwner() string { + if o == nil || IsNil(o.Owner) { + var ret string + return ret + } + return *o.Owner +} + +// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateDatabasePayload) GetOwnerOk() (*string, bool) { + if o == nil || IsNil(o.Owner) { + return nil, false + } + return o.Owner, true +} + +// HasOwner returns a boolean if a field has been set. +func (o *PartialUpdateDatabasePayload) HasOwner() bool { + if o != nil && !IsNil(o.Owner) { + return true + } + + return false +} + +// SetOwner gets a reference to the given string and assigns it to the Owner field. +func (o *PartialUpdateDatabasePayload) SetOwner(v string) { + o.Owner = &v +} + +func (o PartialUpdateDatabasePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateDatabasePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Owner) { + toSerialize["owner"] = o.Owner + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PartialUpdateDatabasePayload) UnmarshalJSON(data []byte) (err error) { + varPartialUpdateDatabasePayload := _PartialUpdateDatabasePayload{} + + err = json.Unmarshal(data, &varPartialUpdateDatabasePayload) + + if err != nil { + return err + } + + *o = PartialUpdateDatabasePayload(varPartialUpdateDatabasePayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "owner") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePartialUpdateDatabasePayload struct { + value *PartialUpdateDatabasePayload + isSet bool +} + +func (v NullablePartialUpdateDatabasePayload) Get() *PartialUpdateDatabasePayload { + return v.value +} + +func (v *NullablePartialUpdateDatabasePayload) Set(val *PartialUpdateDatabasePayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateDatabasePayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateDatabasePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateDatabasePayload(val *PartialUpdateDatabasePayload) *NullablePartialUpdateDatabasePayload { + return &NullablePartialUpdateDatabasePayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateDatabasePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateDatabasePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_partial_update_instance_payload.go b/services/postgresflex/v3api/model_partial_update_instance_payload.go new file mode 100644 index 000000000..47a25a964 --- /dev/null +++ b/services/postgresflex/v3api/model_partial_update_instance_payload.go @@ -0,0 +1,419 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateInstancePayload{} + +// PartialUpdateInstancePayload struct for PartialUpdateInstancePayload +type PartialUpdateInstancePayload struct { + // 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. + BackupSchedule *string `json:"backupSchedule,omitempty"` + // The id of the instance flavor. + FlavorId *string `json:"flavorId,omitempty"` + // 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. + Labels *map[string]string `json:"labels,omitempty"` + // The name of the instance. + Name *string `json:"name,omitempty"` + Network *InstanceNetworkOpt `json:"network,omitempty"` + // How long backups are retained. The value can only be between 32 and 90 days. + RetentionDays *int32 `json:"retentionDays,omitempty"` + Storage *StorageUpdate `json:"storage,omitempty"` + // The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3#tag/Version) for supported version parameters. + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PartialUpdateInstancePayload PartialUpdateInstancePayload + +// NewPartialUpdateInstancePayload instantiates a new PartialUpdateInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateInstancePayload() *PartialUpdateInstancePayload { + this := PartialUpdateInstancePayload{} + return &this +} + +// NewPartialUpdateInstancePayloadWithDefaults instantiates a new PartialUpdateInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateInstancePayloadWithDefaults() *PartialUpdateInstancePayload { + this := PartialUpdateInstancePayload{} + return &this +} + +// GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetBackupSchedule() string { + if o == nil || IsNil(o.BackupSchedule) { + var ret string + return ret + } + return *o.BackupSchedule +} + +// GetBackupScheduleOk returns a tuple with the BackupSchedule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetBackupScheduleOk() (*string, bool) { + if o == nil || IsNil(o.BackupSchedule) { + return nil, false + } + return o.BackupSchedule, true +} + +// HasBackupSchedule returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasBackupSchedule() bool { + if o != nil && !IsNil(o.BackupSchedule) { + return true + } + + return false +} + +// SetBackupSchedule gets a reference to the given string and assigns it to the BackupSchedule field. +func (o *PartialUpdateInstancePayload) SetBackupSchedule(v string) { + o.BackupSchedule = &v +} + +// GetFlavorId returns the FlavorId field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetFlavorId() string { + if o == nil || IsNil(o.FlavorId) { + var ret string + return ret + } + return *o.FlavorId +} + +// GetFlavorIdOk returns a tuple with the FlavorId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetFlavorIdOk() (*string, bool) { + if o == nil || IsNil(o.FlavorId) { + return nil, false + } + return o.FlavorId, true +} + +// HasFlavorId returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasFlavorId() bool { + if o != nil && !IsNil(o.FlavorId) { + return true + } + + return false +} + +// SetFlavorId gets a reference to the given string and assigns it to the FlavorId field. +func (o *PartialUpdateInstancePayload) SetFlavorId(v string) { + o.FlavorId = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetLabels() map[string]string { + if o == nil || IsNil(o.Labels) { + var ret map[string]string + return ret + } + return *o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Labels) { + return nil, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *PartialUpdateInstancePayload) SetLabels(v map[string]string) { + o.Labels = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PartialUpdateInstancePayload) SetName(v string) { + o.Name = &v +} + +// GetNetwork returns the Network field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetNetwork() InstanceNetworkOpt { + if o == nil || IsNil(o.Network) { + var ret InstanceNetworkOpt + return ret + } + return *o.Network +} + +// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetNetworkOk() (*InstanceNetworkOpt, bool) { + if o == nil || IsNil(o.Network) { + return nil, false + } + return o.Network, true +} + +// HasNetwork returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasNetwork() bool { + if o != nil && !IsNil(o.Network) { + return true + } + + return false +} + +// SetNetwork gets a reference to the given InstanceNetworkOpt and assigns it to the Network field. +func (o *PartialUpdateInstancePayload) SetNetwork(v InstanceNetworkOpt) { + o.Network = &v +} + +// GetRetentionDays returns the RetentionDays field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetRetentionDays() int32 { + if o == nil || IsNil(o.RetentionDays) { + var ret int32 + return ret + } + return *o.RetentionDays +} + +// GetRetentionDaysOk returns a tuple with the RetentionDays field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetRetentionDaysOk() (*int32, bool) { + if o == nil || IsNil(o.RetentionDays) { + return nil, false + } + return o.RetentionDays, true +} + +// HasRetentionDays returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasRetentionDays() bool { + if o != nil && !IsNil(o.RetentionDays) { + return true + } + + return false +} + +// SetRetentionDays gets a reference to the given int32 and assigns it to the RetentionDays field. +func (o *PartialUpdateInstancePayload) SetRetentionDays(v int32) { + o.RetentionDays = &v +} + +// GetStorage returns the Storage field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetStorage() StorageUpdate { + if o == nil || IsNil(o.Storage) { + var ret StorageUpdate + return ret + } + return *o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetStorageOk() (*StorageUpdate, bool) { + if o == nil || IsNil(o.Storage) { + return nil, false + } + return o.Storage, true +} + +// HasStorage returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasStorage() bool { + if o != nil && !IsNil(o.Storage) { + return true + } + + return false +} + +// SetStorage gets a reference to the given StorageUpdate and assigns it to the Storage field. +func (o *PartialUpdateInstancePayload) SetStorage(v StorageUpdate) { + o.Storage = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *PartialUpdateInstancePayload) SetVersion(v string) { + o.Version = &v +} + +func (o PartialUpdateInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BackupSchedule) { + toSerialize["backupSchedule"] = o.BackupSchedule + } + if !IsNil(o.FlavorId) { + toSerialize["flavorId"] = o.FlavorId + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Network) { + toSerialize["network"] = o.Network + } + if !IsNil(o.RetentionDays) { + toSerialize["retentionDays"] = o.RetentionDays + } + if !IsNil(o.Storage) { + toSerialize["storage"] = o.Storage + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PartialUpdateInstancePayload) UnmarshalJSON(data []byte) (err error) { + varPartialUpdateInstancePayload := _PartialUpdateInstancePayload{} + + err = json.Unmarshal(data, &varPartialUpdateInstancePayload) + + if err != nil { + return err + } + + *o = PartialUpdateInstancePayload(varPartialUpdateInstancePayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "backupSchedule") + delete(additionalProperties, "flavorId") + delete(additionalProperties, "labels") + delete(additionalProperties, "name") + delete(additionalProperties, "network") + delete(additionalProperties, "retentionDays") + delete(additionalProperties, "storage") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePartialUpdateInstancePayload struct { + value *PartialUpdateInstancePayload + isSet bool +} + +func (v NullablePartialUpdateInstancePayload) Get() *PartialUpdateInstancePayload { + return v.value +} + +func (v *NullablePartialUpdateInstancePayload) Set(val *PartialUpdateInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateInstancePayload(val *PartialUpdateInstancePayload) *NullablePartialUpdateInstancePayload { + return &NullablePartialUpdateInstancePayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_partial_update_user_payload.go b/services/postgresflex/v3api/model_partial_update_user_payload.go new file mode 100644 index 000000000..fd2daf6bc --- /dev/null +++ b/services/postgresflex/v3api/model_partial_update_user_payload.go @@ -0,0 +1,193 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateUserPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateUserPayload{} + +// PartialUpdateUserPayload struct for PartialUpdateUserPayload +type PartialUpdateUserPayload struct { + // The name of the user. + Name *string `json:"name,omitempty"` + // A list containing the user roles for the instance. Please refer to the List Roles endpoint for a list of all available Roles. + Roles []string `json:"roles,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PartialUpdateUserPayload PartialUpdateUserPayload + +// NewPartialUpdateUserPayload instantiates a new PartialUpdateUserPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateUserPayload() *PartialUpdateUserPayload { + this := PartialUpdateUserPayload{} + return &this +} + +// NewPartialUpdateUserPayloadWithDefaults instantiates a new PartialUpdateUserPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateUserPayloadWithDefaults() *PartialUpdateUserPayload { + this := PartialUpdateUserPayload{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PartialUpdateUserPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateUserPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PartialUpdateUserPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PartialUpdateUserPayload) SetName(v string) { + o.Name = &v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *PartialUpdateUserPayload) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateUserPayload) GetRolesOk() ([]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *PartialUpdateUserPayload) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *PartialUpdateUserPayload) SetRoles(v []string) { + o.Roles = v +} + +func (o PartialUpdateUserPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateUserPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PartialUpdateUserPayload) UnmarshalJSON(data []byte) (err error) { + varPartialUpdateUserPayload := _PartialUpdateUserPayload{} + + err = json.Unmarshal(data, &varPartialUpdateUserPayload) + + if err != nil { + return err + } + + *o = PartialUpdateUserPayload(varPartialUpdateUserPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "roles") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePartialUpdateUserPayload struct { + value *PartialUpdateUserPayload + isSet bool +} + +func (v NullablePartialUpdateUserPayload) Get() *PartialUpdateUserPayload { + return v.value +} + +func (v *NullablePartialUpdateUserPayload) Set(val *PartialUpdateUserPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateUserPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateUserPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateUserPayload(val *PartialUpdateUserPayload) *NullablePartialUpdateUserPayload { + return &NullablePartialUpdateUserPayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateUserPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateUserPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_reset_user_password_response.go b/services/postgresflex/v3api/model_reset_user_password_response.go new file mode 100644 index 000000000..3b4dda0a5 --- /dev/null +++ b/services/postgresflex/v3api/model_reset_user_password_response.go @@ -0,0 +1,228 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ResetUserPasswordResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResetUserPasswordResponse{} + +// ResetUserPasswordResponse struct for ResetUserPasswordResponse +type ResetUserPasswordResponse struct { + // The name of the user. + Name string `json:"name"` + // The password for the user. + Password string `json:"password"` + // The current state of the user. + State string `json:"state"` + AdditionalProperties map[string]interface{} +} + +type _ResetUserPasswordResponse ResetUserPasswordResponse + +// NewResetUserPasswordResponse instantiates a new ResetUserPasswordResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResetUserPasswordResponse(name string, password string, state string) *ResetUserPasswordResponse { + this := ResetUserPasswordResponse{} + this.Name = name + this.Password = password + this.State = state + return &this +} + +// NewResetUserPasswordResponseWithDefaults instantiates a new ResetUserPasswordResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResetUserPasswordResponseWithDefaults() *ResetUserPasswordResponse { + this := ResetUserPasswordResponse{} + return &this +} + +// GetName returns the Name field value +func (o *ResetUserPasswordResponse) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ResetUserPasswordResponse) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ResetUserPasswordResponse) SetName(v string) { + o.Name = v +} + +// GetPassword returns the Password field value +func (o *ResetUserPasswordResponse) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *ResetUserPasswordResponse) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *ResetUserPasswordResponse) SetPassword(v string) { + o.Password = v +} + +// GetState returns the State field value +func (o *ResetUserPasswordResponse) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *ResetUserPasswordResponse) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *ResetUserPasswordResponse) SetState(v string) { + o.State = v +} + +func (o ResetUserPasswordResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ResetUserPasswordResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["password"] = o.Password + toSerialize["state"] = o.State + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ResetUserPasswordResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "password", + "state", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varResetUserPasswordResponse := _ResetUserPasswordResponse{} + + err = json.Unmarshal(data, &varResetUserPasswordResponse) + + if err != nil { + return err + } + + *o = ResetUserPasswordResponse(varResetUserPasswordResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "password") + delete(additionalProperties, "state") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableResetUserPasswordResponse struct { + value *ResetUserPasswordResponse + isSet bool +} + +func (v NullableResetUserPasswordResponse) Get() *ResetUserPasswordResponse { + return v.value +} + +func (v *NullableResetUserPasswordResponse) Set(val *ResetUserPasswordResponse) { + v.value = val + v.isSet = true +} + +func (v NullableResetUserPasswordResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableResetUserPasswordResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResetUserPasswordResponse(val *ResetUserPasswordResponse) *NullableResetUserPasswordResponse { + return &NullableResetUserPasswordResponse{value: val, isSet: true} +} + +func (v NullableResetUserPasswordResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResetUserPasswordResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_state.go b/services/postgresflex/v3api/model_state.go new file mode 100644 index 000000000..11594dd26 --- /dev/null +++ b/services/postgresflex/v3api/model_state.go @@ -0,0 +1,122 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// State The current state of the instance. +type State string + +// List of state +const ( + STATE_READY State = "READY" + STATE_PENDING State = "PENDING" + STATE_PROGRESSING State = "PROGRESSING" + STATE_FAILURE State = "FAILURE" + STATE_UNKNOWN State = "UNKNOWN" + STATE_TERMINATING State = "TERMINATING" + STATE_UNKNOWN_DEFAULT_OPEN_API State = "unknown_default_open_api" +) + +// All allowed values of State enum +var AllowedStateEnumValues = []State{ + "READY", + "PENDING", + "PROGRESSING", + "FAILURE", + "UNKNOWN", + "TERMINATING", + "unknown_default_open_api", +} + +func (v *State) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := State(value) + for _, existing := range AllowedStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = STATE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewStateFromValue returns a pointer to a valid State +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewStateFromValue(v string) (*State, error) { + ev := State(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for State: valid values are %v", v, AllowedStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v State) IsValid() bool { + for _, existing := range AllowedStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to state value +func (v State) Ptr() *State { + return &v +} + +type NullableState struct { + value *State + isSet bool +} + +func (v NullableState) Get() *State { + return v.value +} + +func (v *NullableState) Set(val *State) { + v.value = val + v.isSet = true +} + +func (v NullableState) IsSet() bool { + return v.isSet +} + +func (v *NullableState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableState(val *State) *NullableState { + return &NullableState{value: val, isSet: true} +} + +func (v NullableState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_storage.go b/services/postgresflex/v3api/model_storage.go new file mode 100644 index 000000000..ea69d52fa --- /dev/null +++ b/services/postgresflex/v3api/model_storage.go @@ -0,0 +1,193 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" +) + +// checks if the Storage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Storage{} + +// Storage The object containing information about the storage size and class. +type Storage struct { + // The storage class for the storage. + Class *string `json:"class,omitempty"` + // The storage size in Gigabytes. + Size *int64 `json:"size,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Storage Storage + +// NewStorage instantiates a new Storage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStorage() *Storage { + this := Storage{} + return &this +} + +// NewStorageWithDefaults instantiates a new Storage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStorageWithDefaults() *Storage { + this := Storage{} + return &this +} + +// GetClass returns the Class field value if set, zero value otherwise. +func (o *Storage) GetClass() string { + if o == nil || IsNil(o.Class) { + var ret string + return ret + } + return *o.Class +} + +// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Storage) GetClassOk() (*string, bool) { + if o == nil || IsNil(o.Class) { + return nil, false + } + return o.Class, true +} + +// HasClass returns a boolean if a field has been set. +func (o *Storage) HasClass() bool { + if o != nil && !IsNil(o.Class) { + return true + } + + return false +} + +// SetClass gets a reference to the given string and assigns it to the Class field. +func (o *Storage) SetClass(v string) { + o.Class = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Storage) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Storage) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Storage) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *Storage) SetSize(v int64) { + o.Size = &v +} + +func (o Storage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Storage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Class) { + toSerialize["class"] = o.Class + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Storage) UnmarshalJSON(data []byte) (err error) { + varStorage := _Storage{} + + err = json.Unmarshal(data, &varStorage) + + if err != nil { + return err + } + + *o = Storage(varStorage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "class") + delete(additionalProperties, "size") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableStorage struct { + value *Storage + isSet bool +} + +func (v NullableStorage) Get() *Storage { + return v.value +} + +func (v *NullableStorage) Set(val *Storage) { + v.value = val + v.isSet = true +} + +func (v NullableStorage) IsSet() bool { + return v.isSet +} + +func (v *NullableStorage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStorage(val *Storage) *NullableStorage { + return &NullableStorage{value: val, isSet: true} +} + +func (v NullableStorage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStorage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_storage_create.go b/services/postgresflex/v3api/model_storage_create.go new file mode 100644 index 000000000..810220b65 --- /dev/null +++ b/services/postgresflex/v3api/model_storage_create.go @@ -0,0 +1,206 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the StorageCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StorageCreate{} + +// StorageCreate The object containing information about the storage size and class. +type StorageCreate struct { + // The storage class for the storage. + Class *string `json:"class,omitempty"` + // The storage size in Gigabytes. + Size int64 `json:"size"` + AdditionalProperties map[string]interface{} +} + +type _StorageCreate StorageCreate + +// NewStorageCreate instantiates a new StorageCreate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStorageCreate(size int64) *StorageCreate { + this := StorageCreate{} + this.Size = size + return &this +} + +// NewStorageCreateWithDefaults instantiates a new StorageCreate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStorageCreateWithDefaults() *StorageCreate { + this := StorageCreate{} + return &this +} + +// GetClass returns the Class field value if set, zero value otherwise. +func (o *StorageCreate) GetClass() string { + if o == nil || IsNil(o.Class) { + var ret string + return ret + } + return *o.Class +} + +// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StorageCreate) GetClassOk() (*string, bool) { + if o == nil || IsNil(o.Class) { + return nil, false + } + return o.Class, true +} + +// HasClass returns a boolean if a field has been set. +func (o *StorageCreate) HasClass() bool { + if o != nil && !IsNil(o.Class) { + return true + } + + return false +} + +// SetClass gets a reference to the given string and assigns it to the Class field. +func (o *StorageCreate) SetClass(v string) { + o.Class = &v +} + +// GetSize returns the Size field value +func (o *StorageCreate) GetSize() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *StorageCreate) GetSizeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *StorageCreate) SetSize(v int64) { + o.Size = v +} + +func (o StorageCreate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StorageCreate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Class) { + toSerialize["class"] = o.Class + } + toSerialize["size"] = o.Size + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *StorageCreate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "size", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varStorageCreate := _StorageCreate{} + + err = json.Unmarshal(data, &varStorageCreate) + + if err != nil { + return err + } + + *o = StorageCreate(varStorageCreate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "class") + delete(additionalProperties, "size") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableStorageCreate struct { + value *StorageCreate + isSet bool +} + +func (v NullableStorageCreate) Get() *StorageCreate { + return v.value +} + +func (v *NullableStorageCreate) Set(val *StorageCreate) { + v.value = val + v.isSet = true +} + +func (v NullableStorageCreate) IsSet() bool { + return v.isSet +} + +func (v *NullableStorageCreate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStorageCreate(val *StorageCreate) *NullableStorageCreate { + return &NullableStorageCreate{value: val, isSet: true} +} + +func (v NullableStorageCreate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStorageCreate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_storage_update.go b/services/postgresflex/v3api/model_storage_update.go new file mode 100644 index 000000000..8ac1885e6 --- /dev/null +++ b/services/postgresflex/v3api/model_storage_update.go @@ -0,0 +1,155 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" +) + +// checks if the StorageUpdate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StorageUpdate{} + +// StorageUpdate The object containing information about the storage size and class. +type StorageUpdate struct { + // The storage size in Gigabytes. + Size *int64 `json:"size,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _StorageUpdate StorageUpdate + +// NewStorageUpdate instantiates a new StorageUpdate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStorageUpdate() *StorageUpdate { + this := StorageUpdate{} + return &this +} + +// NewStorageUpdateWithDefaults instantiates a new StorageUpdate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStorageUpdateWithDefaults() *StorageUpdate { + this := StorageUpdate{} + return &this +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *StorageUpdate) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StorageUpdate) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *StorageUpdate) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *StorageUpdate) SetSize(v int64) { + o.Size = &v +} + +func (o StorageUpdate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StorageUpdate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *StorageUpdate) UnmarshalJSON(data []byte) (err error) { + varStorageUpdate := _StorageUpdate{} + + err = json.Unmarshal(data, &varStorageUpdate) + + if err != nil { + return err + } + + *o = StorageUpdate(varStorageUpdate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "size") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableStorageUpdate struct { + value *StorageUpdate + isSet bool +} + +func (v NullableStorageUpdate) Get() *StorageUpdate { + return v.value +} + +func (v *NullableStorageUpdate) Set(val *StorageUpdate) { + v.value = val + v.isSet = true +} + +func (v NullableStorageUpdate) IsSet() bool { + return v.isSet +} + +func (v *NullableStorageUpdate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStorageUpdate(val *StorageUpdate) *NullableStorageUpdate { + return &NullableStorageUpdate{value: val, isSet: true} +} + +func (v NullableStorageUpdate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStorageUpdate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_update_database_partially_response.go b/services/postgresflex/v3api/model_update_database_partially_response.go new file mode 100644 index 000000000..892bf1143 --- /dev/null +++ b/services/postgresflex/v3api/model_update_database_partially_response.go @@ -0,0 +1,167 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateDatabasePartiallyResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateDatabasePartiallyResponse{} + +// UpdateDatabasePartiallyResponse struct for UpdateDatabasePartiallyResponse +type UpdateDatabasePartiallyResponse struct { + Database ListDatabase `json:"database"` + AdditionalProperties map[string]interface{} +} + +type _UpdateDatabasePartiallyResponse UpdateDatabasePartiallyResponse + +// NewUpdateDatabasePartiallyResponse instantiates a new UpdateDatabasePartiallyResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateDatabasePartiallyResponse(database ListDatabase) *UpdateDatabasePartiallyResponse { + this := UpdateDatabasePartiallyResponse{} + this.Database = database + return &this +} + +// NewUpdateDatabasePartiallyResponseWithDefaults instantiates a new UpdateDatabasePartiallyResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateDatabasePartiallyResponseWithDefaults() *UpdateDatabasePartiallyResponse { + this := UpdateDatabasePartiallyResponse{} + return &this +} + +// GetDatabase returns the Database field value +func (o *UpdateDatabasePartiallyResponse) GetDatabase() ListDatabase { + if o == nil { + var ret ListDatabase + return ret + } + + return o.Database +} + +// GetDatabaseOk returns a tuple with the Database field value +// and a boolean to check if the value has been set. +func (o *UpdateDatabasePartiallyResponse) GetDatabaseOk() (*ListDatabase, bool) { + if o == nil { + return nil, false + } + return &o.Database, true +} + +// SetDatabase sets field value +func (o *UpdateDatabasePartiallyResponse) SetDatabase(v ListDatabase) { + o.Database = v +} + +func (o UpdateDatabasePartiallyResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateDatabasePartiallyResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["database"] = o.Database + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateDatabasePartiallyResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "database", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateDatabasePartiallyResponse := _UpdateDatabasePartiallyResponse{} + + err = json.Unmarshal(data, &varUpdateDatabasePartiallyResponse) + + if err != nil { + return err + } + + *o = UpdateDatabasePartiallyResponse(varUpdateDatabasePartiallyResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "database") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateDatabasePartiallyResponse struct { + value *UpdateDatabasePartiallyResponse + isSet bool +} + +func (v NullableUpdateDatabasePartiallyResponse) Get() *UpdateDatabasePartiallyResponse { + return v.value +} + +func (v *NullableUpdateDatabasePartiallyResponse) Set(val *UpdateDatabasePartiallyResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateDatabasePartiallyResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateDatabasePartiallyResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateDatabasePartiallyResponse(val *UpdateDatabasePartiallyResponse) *NullableUpdateDatabasePartiallyResponse { + return &NullableUpdateDatabasePartiallyResponse{value: val, isSet: true} +} + +func (v NullableUpdateDatabasePartiallyResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateDatabasePartiallyResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_update_database_payload.go b/services/postgresflex/v3api/model_update_database_payload.go new file mode 100644 index 000000000..37b9a2cfe --- /dev/null +++ b/services/postgresflex/v3api/model_update_database_payload.go @@ -0,0 +1,198 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateDatabasePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateDatabasePayload{} + +// UpdateDatabasePayload struct for UpdateDatabasePayload +type UpdateDatabasePayload struct { + // The name of the database. + Name string `json:"name"` + // The owner of the database. + Owner string `json:"owner"` + AdditionalProperties map[string]interface{} +} + +type _UpdateDatabasePayload UpdateDatabasePayload + +// NewUpdateDatabasePayload instantiates a new UpdateDatabasePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateDatabasePayload(name string, owner string) *UpdateDatabasePayload { + this := UpdateDatabasePayload{} + this.Name = name + this.Owner = owner + return &this +} + +// NewUpdateDatabasePayloadWithDefaults instantiates a new UpdateDatabasePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateDatabasePayloadWithDefaults() *UpdateDatabasePayload { + this := UpdateDatabasePayload{} + return &this +} + +// GetName returns the Name field value +func (o *UpdateDatabasePayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *UpdateDatabasePayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UpdateDatabasePayload) SetName(v string) { + o.Name = v +} + +// GetOwner returns the Owner field value +func (o *UpdateDatabasePayload) GetOwner() string { + if o == nil { + var ret string + return ret + } + + return o.Owner +} + +// GetOwnerOk returns a tuple with the Owner field value +// and a boolean to check if the value has been set. +func (o *UpdateDatabasePayload) GetOwnerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Owner, true +} + +// SetOwner sets field value +func (o *UpdateDatabasePayload) SetOwner(v string) { + o.Owner = v +} + +func (o UpdateDatabasePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateDatabasePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["owner"] = o.Owner + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateDatabasePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "owner", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateDatabasePayload := _UpdateDatabasePayload{} + + err = json.Unmarshal(data, &varUpdateDatabasePayload) + + if err != nil { + return err + } + + *o = UpdateDatabasePayload(varUpdateDatabasePayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "owner") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateDatabasePayload struct { + value *UpdateDatabasePayload + isSet bool +} + +func (v NullableUpdateDatabasePayload) Get() *UpdateDatabasePayload { + return v.value +} + +func (v *NullableUpdateDatabasePayload) Set(val *UpdateDatabasePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateDatabasePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateDatabasePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateDatabasePayload(val *UpdateDatabasePayload) *NullableUpdateDatabasePayload { + return &NullableUpdateDatabasePayload{value: val, isSet: true} +} + +func (v NullableUpdateDatabasePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateDatabasePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_update_database_response.go b/services/postgresflex/v3api/model_update_database_response.go new file mode 100644 index 000000000..ce6b0bf95 --- /dev/null +++ b/services/postgresflex/v3api/model_update_database_response.go @@ -0,0 +1,167 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateDatabaseResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateDatabaseResponse{} + +// UpdateDatabaseResponse struct for UpdateDatabaseResponse +type UpdateDatabaseResponse struct { + Database ListDatabase `json:"database"` + AdditionalProperties map[string]interface{} +} + +type _UpdateDatabaseResponse UpdateDatabaseResponse + +// NewUpdateDatabaseResponse instantiates a new UpdateDatabaseResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateDatabaseResponse(database ListDatabase) *UpdateDatabaseResponse { + this := UpdateDatabaseResponse{} + this.Database = database + return &this +} + +// NewUpdateDatabaseResponseWithDefaults instantiates a new UpdateDatabaseResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateDatabaseResponseWithDefaults() *UpdateDatabaseResponse { + this := UpdateDatabaseResponse{} + return &this +} + +// GetDatabase returns the Database field value +func (o *UpdateDatabaseResponse) GetDatabase() ListDatabase { + if o == nil { + var ret ListDatabase + return ret + } + + return o.Database +} + +// GetDatabaseOk returns a tuple with the Database field value +// and a boolean to check if the value has been set. +func (o *UpdateDatabaseResponse) GetDatabaseOk() (*ListDatabase, bool) { + if o == nil { + return nil, false + } + return &o.Database, true +} + +// SetDatabase sets field value +func (o *UpdateDatabaseResponse) SetDatabase(v ListDatabase) { + o.Database = v +} + +func (o UpdateDatabaseResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateDatabaseResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["database"] = o.Database + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateDatabaseResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "database", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateDatabaseResponse := _UpdateDatabaseResponse{} + + err = json.Unmarshal(data, &varUpdateDatabaseResponse) + + if err != nil { + return err + } + + *o = UpdateDatabaseResponse(varUpdateDatabaseResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "database") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateDatabaseResponse struct { + value *UpdateDatabaseResponse + isSet bool +} + +func (v NullableUpdateDatabaseResponse) Get() *UpdateDatabaseResponse { + return v.value +} + +func (v *NullableUpdateDatabaseResponse) Set(val *UpdateDatabaseResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateDatabaseResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateDatabaseResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateDatabaseResponse(val *UpdateDatabaseResponse) *NullableUpdateDatabaseResponse { + return &NullableUpdateDatabaseResponse{value: val, isSet: true} +} + +func (v NullableUpdateDatabaseResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateDatabaseResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_update_instance_payload.go b/services/postgresflex/v3api/model_update_instance_payload.go new file mode 100644 index 000000000..cf9b3d1cb --- /dev/null +++ b/services/postgresflex/v3api/model_update_instance_payload.go @@ -0,0 +1,386 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateInstancePayload{} + +// UpdateInstancePayload struct for UpdateInstancePayload +type UpdateInstancePayload struct { + // 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. + BackupSchedule string `json:"backupSchedule"` + // The id of the instance flavor. + FlavorId string `json:"flavorId"` + // 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. + Labels *map[string]string `json:"labels,omitempty"` + // The name of the instance. + Name string `json:"name"` + Network InstanceNetworkUpdate `json:"network"` + // How long backups are retained. The value can only be between 32 and 90 days. + RetentionDays NullableInt32 `json:"retentionDays"` + Storage StorageUpdate `json:"storage"` + // The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3#tag/Version) for supported version parameters. + Version string `json:"version"` + AdditionalProperties map[string]interface{} +} + +type _UpdateInstancePayload UpdateInstancePayload + +// NewUpdateInstancePayload instantiates a new UpdateInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateInstancePayload(backupSchedule string, flavorId string, name string, network InstanceNetworkUpdate, retentionDays NullableInt32, storage StorageUpdate, version string) *UpdateInstancePayload { + this := UpdateInstancePayload{} + this.BackupSchedule = backupSchedule + this.FlavorId = flavorId + this.Name = name + this.Network = network + this.RetentionDays = retentionDays + this.Storage = storage + this.Version = version + return &this +} + +// NewUpdateInstancePayloadWithDefaults instantiates a new UpdateInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateInstancePayloadWithDefaults() *UpdateInstancePayload { + this := UpdateInstancePayload{} + return &this +} + +// GetBackupSchedule returns the BackupSchedule field value +func (o *UpdateInstancePayload) GetBackupSchedule() string { + if o == nil { + var ret string + return ret + } + + return o.BackupSchedule +} + +// GetBackupScheduleOk returns a tuple with the BackupSchedule field value +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetBackupScheduleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BackupSchedule, true +} + +// SetBackupSchedule sets field value +func (o *UpdateInstancePayload) SetBackupSchedule(v string) { + o.BackupSchedule = v +} + +// GetFlavorId returns the FlavorId field value +func (o *UpdateInstancePayload) GetFlavorId() string { + if o == nil { + var ret string + return ret + } + + return o.FlavorId +} + +// GetFlavorIdOk returns a tuple with the FlavorId field value +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetFlavorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FlavorId, true +} + +// SetFlavorId sets field value +func (o *UpdateInstancePayload) SetFlavorId(v string) { + o.FlavorId = v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateInstancePayload) GetLabels() map[string]string { + if o == nil || IsNil(o.Labels) { + var ret map[string]string + return ret + } + return *o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Labels) { + return nil, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateInstancePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. +func (o *UpdateInstancePayload) SetLabels(v map[string]string) { + o.Labels = &v +} + +// GetName returns the Name field value +func (o *UpdateInstancePayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UpdateInstancePayload) SetName(v string) { + o.Name = v +} + +// GetNetwork returns the Network field value +func (o *UpdateInstancePayload) GetNetwork() InstanceNetworkUpdate { + if o == nil { + var ret InstanceNetworkUpdate + return ret + } + + return o.Network +} + +// GetNetworkOk returns a tuple with the Network field value +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetNetworkOk() (*InstanceNetworkUpdate, bool) { + if o == nil { + return nil, false + } + return &o.Network, true +} + +// SetNetwork sets field value +func (o *UpdateInstancePayload) SetNetwork(v InstanceNetworkUpdate) { + o.Network = v +} + +// GetRetentionDays returns the RetentionDays field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *UpdateInstancePayload) GetRetentionDays() int32 { + if o == nil || o.RetentionDays.Get() == nil { + var ret int32 + return ret + } + + return *o.RetentionDays.Get() +} + +// GetRetentionDaysOk returns a tuple with the RetentionDays field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateInstancePayload) GetRetentionDaysOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.RetentionDays.Get(), o.RetentionDays.IsSet() +} + +// SetRetentionDays sets field value +func (o *UpdateInstancePayload) SetRetentionDays(v int32) { + o.RetentionDays.Set(&v) +} + +// GetStorage returns the Storage field value +func (o *UpdateInstancePayload) GetStorage() StorageUpdate { + if o == nil { + var ret StorageUpdate + return ret + } + + return o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetStorageOk() (*StorageUpdate, bool) { + if o == nil { + return nil, false + } + return &o.Storage, true +} + +// SetStorage sets field value +func (o *UpdateInstancePayload) SetStorage(v StorageUpdate) { + o.Storage = v +} + +// GetVersion returns the Version field value +func (o *UpdateInstancePayload) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *UpdateInstancePayload) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *UpdateInstancePayload) SetVersion(v string) { + o.Version = v +} + +func (o UpdateInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backupSchedule"] = o.BackupSchedule + toSerialize["flavorId"] = o.FlavorId + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + toSerialize["network"] = o.Network + toSerialize["retentionDays"] = o.RetentionDays.Get() + toSerialize["storage"] = o.Storage + toSerialize["version"] = o.Version + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateInstancePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backupSchedule", + "flavorId", + "name", + "network", + "retentionDays", + "storage", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateInstancePayload := _UpdateInstancePayload{} + + err = json.Unmarshal(data, &varUpdateInstancePayload) + + if err != nil { + return err + } + + *o = UpdateInstancePayload(varUpdateInstancePayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "backupSchedule") + delete(additionalProperties, "flavorId") + delete(additionalProperties, "labels") + delete(additionalProperties, "name") + delete(additionalProperties, "network") + delete(additionalProperties, "retentionDays") + delete(additionalProperties, "storage") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateInstancePayload struct { + value *UpdateInstancePayload + isSet bool +} + +func (v NullableUpdateInstancePayload) Get() *UpdateInstancePayload { + return v.value +} + +func (v *NullableUpdateInstancePayload) Set(val *UpdateInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateInstancePayload(val *UpdateInstancePayload) *NullableUpdateInstancePayload { + return &NullableUpdateInstancePayload{value: val, isSet: true} +} + +func (v NullableUpdateInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_update_instance_protection_payload.go b/services/postgresflex/v3api/model_update_instance_protection_payload.go new file mode 100644 index 000000000..981aa6404 --- /dev/null +++ b/services/postgresflex/v3api/model_update_instance_protection_payload.go @@ -0,0 +1,168 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateInstanceProtectionPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateInstanceProtectionPayload{} + +// UpdateInstanceProtectionPayload struct for UpdateInstanceProtectionPayload +type UpdateInstanceProtectionPayload struct { + // Protect instance from deletion. + IsDeletable bool `json:"isDeletable"` + AdditionalProperties map[string]interface{} +} + +type _UpdateInstanceProtectionPayload UpdateInstanceProtectionPayload + +// NewUpdateInstanceProtectionPayload instantiates a new UpdateInstanceProtectionPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateInstanceProtectionPayload(isDeletable bool) *UpdateInstanceProtectionPayload { + this := UpdateInstanceProtectionPayload{} + this.IsDeletable = isDeletable + return &this +} + +// NewUpdateInstanceProtectionPayloadWithDefaults instantiates a new UpdateInstanceProtectionPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateInstanceProtectionPayloadWithDefaults() *UpdateInstanceProtectionPayload { + this := UpdateInstanceProtectionPayload{} + return &this +} + +// GetIsDeletable returns the IsDeletable field value +func (o *UpdateInstanceProtectionPayload) GetIsDeletable() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsDeletable +} + +// GetIsDeletableOk returns a tuple with the IsDeletable field value +// and a boolean to check if the value has been set. +func (o *UpdateInstanceProtectionPayload) GetIsDeletableOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsDeletable, true +} + +// SetIsDeletable sets field value +func (o *UpdateInstanceProtectionPayload) SetIsDeletable(v bool) { + o.IsDeletable = v +} + +func (o UpdateInstanceProtectionPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateInstanceProtectionPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["isDeletable"] = o.IsDeletable + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateInstanceProtectionPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "isDeletable", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateInstanceProtectionPayload := _UpdateInstanceProtectionPayload{} + + err = json.Unmarshal(data, &varUpdateInstanceProtectionPayload) + + if err != nil { + return err + } + + *o = UpdateInstanceProtectionPayload(varUpdateInstanceProtectionPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "isDeletable") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateInstanceProtectionPayload struct { + value *UpdateInstanceProtectionPayload + isSet bool +} + +func (v NullableUpdateInstanceProtectionPayload) Get() *UpdateInstanceProtectionPayload { + return v.value +} + +func (v *NullableUpdateInstanceProtectionPayload) Set(val *UpdateInstanceProtectionPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateInstanceProtectionPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateInstanceProtectionPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateInstanceProtectionPayload(val *UpdateInstanceProtectionPayload) *NullableUpdateInstanceProtectionPayload { + return &NullableUpdateInstanceProtectionPayload{value: val, isSet: true} +} + +func (v NullableUpdateInstanceProtectionPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateInstanceProtectionPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_update_instance_protection_response.go b/services/postgresflex/v3api/model_update_instance_protection_response.go new file mode 100644 index 000000000..dc74239bb --- /dev/null +++ b/services/postgresflex/v3api/model_update_instance_protection_response.go @@ -0,0 +1,168 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateInstanceProtectionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateInstanceProtectionResponse{} + +// UpdateInstanceProtectionResponse struct for UpdateInstanceProtectionResponse +type UpdateInstanceProtectionResponse struct { + // Protect instance from deletion. + IsDeletable bool `json:"isDeletable"` + AdditionalProperties map[string]interface{} +} + +type _UpdateInstanceProtectionResponse UpdateInstanceProtectionResponse + +// NewUpdateInstanceProtectionResponse instantiates a new UpdateInstanceProtectionResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateInstanceProtectionResponse(isDeletable bool) *UpdateInstanceProtectionResponse { + this := UpdateInstanceProtectionResponse{} + this.IsDeletable = isDeletable + return &this +} + +// NewUpdateInstanceProtectionResponseWithDefaults instantiates a new UpdateInstanceProtectionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateInstanceProtectionResponseWithDefaults() *UpdateInstanceProtectionResponse { + this := UpdateInstanceProtectionResponse{} + return &this +} + +// GetIsDeletable returns the IsDeletable field value +func (o *UpdateInstanceProtectionResponse) GetIsDeletable() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsDeletable +} + +// GetIsDeletableOk returns a tuple with the IsDeletable field value +// and a boolean to check if the value has been set. +func (o *UpdateInstanceProtectionResponse) GetIsDeletableOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsDeletable, true +} + +// SetIsDeletable sets field value +func (o *UpdateInstanceProtectionResponse) SetIsDeletable(v bool) { + o.IsDeletable = v +} + +func (o UpdateInstanceProtectionResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateInstanceProtectionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["isDeletable"] = o.IsDeletable + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateInstanceProtectionResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "isDeletable", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateInstanceProtectionResponse := _UpdateInstanceProtectionResponse{} + + err = json.Unmarshal(data, &varUpdateInstanceProtectionResponse) + + if err != nil { + return err + } + + *o = UpdateInstanceProtectionResponse(varUpdateInstanceProtectionResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "isDeletable") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateInstanceProtectionResponse struct { + value *UpdateInstanceProtectionResponse + isSet bool +} + +func (v NullableUpdateInstanceProtectionResponse) Get() *UpdateInstanceProtectionResponse { + return v.value +} + +func (v *NullableUpdateInstanceProtectionResponse) Set(val *UpdateInstanceProtectionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateInstanceProtectionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateInstanceProtectionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateInstanceProtectionResponse(val *UpdateInstanceProtectionResponse) *NullableUpdateInstanceProtectionResponse { + return &NullableUpdateInstanceProtectionResponse{value: val, isSet: true} +} + +func (v NullableUpdateInstanceProtectionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateInstanceProtectionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_update_user_payload.go b/services/postgresflex/v3api/model_update_user_payload.go new file mode 100644 index 000000000..43cf38fea --- /dev/null +++ b/services/postgresflex/v3api/model_update_user_payload.go @@ -0,0 +1,206 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateUserPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateUserPayload{} + +// UpdateUserPayload struct for UpdateUserPayload +type UpdateUserPayload struct { + // The name of the user. + Name *string `json:"name,omitempty"` + // A list containing the user roles for the instance. Please refer to the List Roles endpoint for a list of all available Roles. + Roles []string `json:"roles"` + AdditionalProperties map[string]interface{} +} + +type _UpdateUserPayload UpdateUserPayload + +// NewUpdateUserPayload instantiates a new UpdateUserPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateUserPayload(roles []string) *UpdateUserPayload { + this := UpdateUserPayload{} + this.Roles = roles + return &this +} + +// NewUpdateUserPayloadWithDefaults instantiates a new UpdateUserPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateUserPayloadWithDefaults() *UpdateUserPayload { + this := UpdateUserPayload{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateUserPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateUserPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateUserPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateUserPayload) SetName(v string) { + o.Name = &v +} + +// GetRoles returns the Roles field value +func (o *UpdateUserPayload) GetRoles() []string { + if o == nil { + var ret []string + return ret + } + + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value +// and a boolean to check if the value has been set. +func (o *UpdateUserPayload) GetRolesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Roles, true +} + +// SetRoles sets field value +func (o *UpdateUserPayload) SetRoles(v []string) { + o.Roles = v +} + +func (o UpdateUserPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateUserPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["roles"] = o.Roles + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateUserPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "roles", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateUserPayload := _UpdateUserPayload{} + + err = json.Unmarshal(data, &varUpdateUserPayload) + + if err != nil { + return err + } + + *o = UpdateUserPayload(varUpdateUserPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "roles") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateUserPayload struct { + value *UpdateUserPayload + isSet bool +} + +func (v NullableUpdateUserPayload) Get() *UpdateUserPayload { + return v.value +} + +func (v *NullableUpdateUserPayload) Set(val *UpdateUserPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateUserPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateUserPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateUserPayload(val *UpdateUserPayload) *NullableUpdateUserPayload { + return &NullableUpdateUserPayload{value: val, isSet: true} +} + +func (v NullableUpdateUserPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateUserPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_user_sort.go b/services/postgresflex/v3api/model_user_sort.go new file mode 100644 index 000000000..f14a1b500 --- /dev/null +++ b/services/postgresflex/v3api/model_user_sort.go @@ -0,0 +1,122 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// UserSort the model 'UserSort' +type UserSort string + +// List of user.sort +const ( + USERSORT_ID_ASC UserSort = "id.asc" + USERSORT_ID_DESC UserSort = "id.desc" + USERSORT_NAME_DESC UserSort = "name.desc" + USERSORT_NAME_ASC UserSort = "name.asc" + USERSORT_STATE_DESC UserSort = "state.desc" + USERSORT_STATE_ASC UserSort = "state.asc" + USERSORT_UNKNOWN_DEFAULT_OPEN_API UserSort = "unknown_default_open_api" +) + +// All allowed values of UserSort enum +var AllowedUserSortEnumValues = []UserSort{ + "id.asc", + "id.desc", + "name.desc", + "name.asc", + "state.desc", + "state.asc", + "unknown_default_open_api", +} + +func (v *UserSort) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UserSort(value) + for _, existing := range AllowedUserSortEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = USERSORT_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewUserSortFromValue returns a pointer to a valid UserSort +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUserSortFromValue(v string) (*UserSort, error) { + ev := UserSort(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UserSort: valid values are %v", v, AllowedUserSortEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UserSort) IsValid() bool { + for _, existing := range AllowedUserSortEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to user.sort value +func (v UserSort) Ptr() *UserSort { + return &v +} + +type NullableUserSort struct { + value *UserSort + isSet bool +} + +func (v NullableUserSort) Get() *UserSort { + return v.value +} + +func (v *NullableUserSort) Set(val *UserSort) { + v.value = val + v.isSet = true +} + +func (v NullableUserSort) IsSet() bool { + return v.isSet +} + +func (v *NullableUserSort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserSort(val *UserSort) *NullableUserSort { + return &NullableUserSort{value: val, isSet: true} +} + +func (v NullableUserSort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserSort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_validation_error.go b/services/postgresflex/v3api/model_validation_error.go new file mode 100644 index 000000000..ea9bba778 --- /dev/null +++ b/services/postgresflex/v3api/model_validation_error.go @@ -0,0 +1,198 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ValidationError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ValidationError{} + +// ValidationError struct for ValidationError +type ValidationError struct { + // the http error should be always 422 for validationError + Code int32 `json:"code"` + // errors for all fields where the error happened + Validation []ValidationErrorValidationInner `json:"validation"` + AdditionalProperties map[string]interface{} +} + +type _ValidationError ValidationError + +// NewValidationError instantiates a new ValidationError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewValidationError(code int32, validation []ValidationErrorValidationInner) *ValidationError { + this := ValidationError{} + this.Code = code + this.Validation = validation + return &this +} + +// NewValidationErrorWithDefaults instantiates a new ValidationError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewValidationErrorWithDefaults() *ValidationError { + this := ValidationError{} + return &this +} + +// GetCode returns the Code field value +func (o *ValidationError) GetCode() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *ValidationError) GetCodeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value +func (o *ValidationError) SetCode(v int32) { + o.Code = v +} + +// GetValidation returns the Validation field value +func (o *ValidationError) GetValidation() []ValidationErrorValidationInner { + if o == nil { + var ret []ValidationErrorValidationInner + return ret + } + + return o.Validation +} + +// GetValidationOk returns a tuple with the Validation field value +// and a boolean to check if the value has been set. +func (o *ValidationError) GetValidationOk() ([]ValidationErrorValidationInner, bool) { + if o == nil { + return nil, false + } + return o.Validation, true +} + +// SetValidation sets field value +func (o *ValidationError) SetValidation(v []ValidationErrorValidationInner) { + o.Validation = v +} + +func (o ValidationError) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ValidationError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["code"] = o.Code + toSerialize["validation"] = o.Validation + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ValidationError) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "code", + "validation", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varValidationError := _ValidationError{} + + err = json.Unmarshal(data, &varValidationError) + + if err != nil { + return err + } + + *o = ValidationError(varValidationError) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "code") + delete(additionalProperties, "validation") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableValidationError struct { + value *ValidationError + isSet bool +} + +func (v NullableValidationError) Get() *ValidationError { + return v.value +} + +func (v *NullableValidationError) Set(val *ValidationError) { + v.value = val + v.isSet = true +} + +func (v NullableValidationError) IsSet() bool { + return v.isSet +} + +func (v *NullableValidationError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableValidationError(val *ValidationError) *NullableValidationError { + return &NullableValidationError{value: val, isSet: true} +} + +func (v NullableValidationError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableValidationError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_validation_error_validation_inner.go b/services/postgresflex/v3api/model_validation_error_validation_inner.go new file mode 100644 index 000000000..f3fe378c0 --- /dev/null +++ b/services/postgresflex/v3api/model_validation_error_validation_inner.go @@ -0,0 +1,196 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ValidationErrorValidationInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ValidationErrorValidationInner{} + +// ValidationErrorValidationInner struct for ValidationErrorValidationInner +type ValidationErrorValidationInner struct { + Field string `json:"field"` + Message string `json:"message"` + AdditionalProperties map[string]interface{} +} + +type _ValidationErrorValidationInner ValidationErrorValidationInner + +// NewValidationErrorValidationInner instantiates a new ValidationErrorValidationInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewValidationErrorValidationInner(field string, message string) *ValidationErrorValidationInner { + this := ValidationErrorValidationInner{} + this.Field = field + this.Message = message + return &this +} + +// NewValidationErrorValidationInnerWithDefaults instantiates a new ValidationErrorValidationInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewValidationErrorValidationInnerWithDefaults() *ValidationErrorValidationInner { + this := ValidationErrorValidationInner{} + return &this +} + +// GetField returns the Field field value +func (o *ValidationErrorValidationInner) GetField() string { + if o == nil { + var ret string + return ret + } + + return o.Field +} + +// GetFieldOk returns a tuple with the Field field value +// and a boolean to check if the value has been set. +func (o *ValidationErrorValidationInner) GetFieldOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Field, true +} + +// SetField sets field value +func (o *ValidationErrorValidationInner) SetField(v string) { + o.Field = v +} + +// GetMessage returns the Message field value +func (o *ValidationErrorValidationInner) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ValidationErrorValidationInner) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ValidationErrorValidationInner) SetMessage(v string) { + o.Message = v +} + +func (o ValidationErrorValidationInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ValidationErrorValidationInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["field"] = o.Field + toSerialize["message"] = o.Message + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ValidationErrorValidationInner) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "field", + "message", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varValidationErrorValidationInner := _ValidationErrorValidationInner{} + + err = json.Unmarshal(data, &varValidationErrorValidationInner) + + if err != nil { + return err + } + + *o = ValidationErrorValidationInner(varValidationErrorValidationInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "field") + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableValidationErrorValidationInner struct { + value *ValidationErrorValidationInner + isSet bool +} + +func (v NullableValidationErrorValidationInner) Get() *ValidationErrorValidationInner { + return v.value +} + +func (v *NullableValidationErrorValidationInner) Set(val *ValidationErrorValidationInner) { + v.value = val + v.isSet = true +} + +func (v NullableValidationErrorValidationInner) IsSet() bool { + return v.isSet +} + +func (v *NullableValidationErrorValidationInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableValidationErrorValidationInner(val *ValidationErrorValidationInner) *NullableValidationErrorValidationInner { + return &NullableValidationErrorValidationInner{value: val, isSet: true} +} + +func (v NullableValidationErrorValidationInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableValidationErrorValidationInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/model_version.go b/services/postgresflex/v3api/model_version.go new file mode 100644 index 000000000..653e348e6 --- /dev/null +++ b/services/postgresflex/v3api/model_version.go @@ -0,0 +1,258 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Version type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Version{} + +// Version The version of the postgres instance and more details. +type Version struct { + // Flag if the version is a beta version. If set the version may contain bugs and is not fully tested. + Beta bool `json:"beta"` + // Timestamp in RFC3339 format which says when the version will no longer be supported by STACKIT. + Deprecated string `json:"deprecated"` + // Flag if the version is recommend by the STACKIT Team. + Recommend bool `json:"recommend"` + // The postgres version used for the instance. + Version string `json:"version"` + AdditionalProperties map[string]interface{} +} + +type _Version Version + +// NewVersion instantiates a new Version object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVersion(beta bool, deprecated string, recommend bool, version string) *Version { + this := Version{} + this.Beta = beta + this.Deprecated = deprecated + this.Recommend = recommend + this.Version = version + return &this +} + +// NewVersionWithDefaults instantiates a new Version object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVersionWithDefaults() *Version { + this := Version{} + return &this +} + +// GetBeta returns the Beta field value +func (o *Version) GetBeta() bool { + if o == nil { + var ret bool + return ret + } + + return o.Beta +} + +// GetBetaOk returns a tuple with the Beta field value +// and a boolean to check if the value has been set. +func (o *Version) GetBetaOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Beta, true +} + +// SetBeta sets field value +func (o *Version) SetBeta(v bool) { + o.Beta = v +} + +// GetDeprecated returns the Deprecated field value +func (o *Version) GetDeprecated() string { + if o == nil { + var ret string + return ret + } + + return o.Deprecated +} + +// GetDeprecatedOk returns a tuple with the Deprecated field value +// and a boolean to check if the value has been set. +func (o *Version) GetDeprecatedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Deprecated, true +} + +// SetDeprecated sets field value +func (o *Version) SetDeprecated(v string) { + o.Deprecated = v +} + +// GetRecommend returns the Recommend field value +func (o *Version) GetRecommend() bool { + if o == nil { + var ret bool + return ret + } + + return o.Recommend +} + +// GetRecommendOk returns a tuple with the Recommend field value +// and a boolean to check if the value has been set. +func (o *Version) GetRecommendOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Recommend, true +} + +// SetRecommend sets field value +func (o *Version) SetRecommend(v bool) { + o.Recommend = v +} + +// GetVersion returns the Version field value +func (o *Version) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *Version) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *Version) SetVersion(v string) { + o.Version = v +} + +func (o Version) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Version) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["beta"] = o.Beta + toSerialize["deprecated"] = o.Deprecated + toSerialize["recommend"] = o.Recommend + toSerialize["version"] = o.Version + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Version) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "beta", + "deprecated", + "recommend", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVersion := _Version{} + + err = json.Unmarshal(data, &varVersion) + + if err != nil { + return err + } + + *o = Version(varVersion) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "beta") + delete(additionalProperties, "deprecated") + delete(additionalProperties, "recommend") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVersion struct { + value *Version + isSet bool +} + +func (v NullableVersion) Get() *Version { + return v.value +} + +func (v *NullableVersion) Set(val *Version) { + v.value = val + v.isSet = true +} + +func (v NullableVersion) IsSet() bool { + return v.isSet +} + +func (v *NullableVersion) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVersion(val *Version) *NullableVersion { + return &NullableVersion{value: val, isSet: true} +} + +func (v NullableVersion) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVersion) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/postgresflex/v3api/response.go b/services/postgresflex/v3api/response.go new file mode 100644 index 000000000..dfa9ae4a2 --- /dev/null +++ b/services/postgresflex/v3api/response.go @@ -0,0 +1,48 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/services/postgresflex/v3api/utils.go b/services/postgresflex/v3api/utils.go new file mode 100644 index 000000000..14664cd76 --- /dev/null +++ b/services/postgresflex/v3api/utils.go @@ -0,0 +1,362 @@ +/* +STACKIT PostgreSQL Flex API + +This is the documentation for the STACKIT Postgres Flex service + +API version: 3.0.0 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3api + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +}