diff --git a/services/postgresflex/oas_commit b/services/postgresflex/oas_commit index 550a77c4e3..c887ec4598 100644 --- a/services/postgresflex/oas_commit +++ b/services/postgresflex/oas_commit @@ -1 +1 @@ -46de1033aa6379af6341423c3ff0e4cfb54f8350 +bfed6fb6db9c08b932c04ec996eb958e25ca4604 diff --git a/services/postgresflex/v1api/api_default.go b/services/postgresflex/v1api/api_default.go deleted file mode 100644 index 653f3f5e03..0000000000 --- a/services/postgresflex/v1api/api_default.go +++ /dev/null @@ -1,3995 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package v1api - -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 an existing instance of a postgres database to a new destination instance - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param instanceId Instance ID - @return ApiCloneInstanceRequest - */ - CloneInstance(ctx context.Context, projectId 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 Project ID - @param instanceId Instance ID - @return ApiCreateDatabaseRequest - */ - CreateDatabase(ctx context.Context, projectId string, instanceId string) ApiCreateDatabaseRequest - - // CreateDatabaseExecute executes the request - // @return InstanceCreateDatabaseResponse - CreateDatabaseExecute(r ApiCreateDatabaseRequest) (*InstanceCreateDatabaseResponse, error) - - /* - CreateInstance Create Instance - - Create a new 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 - @return ApiCreateInstanceRequest - */ - CreateInstance(ctx context.Context, projectId 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 Project ID - @param instanceId Instance ID - @return ApiCreateUserRequest - */ - CreateUser(ctx context.Context, projectId 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 Project ID - @param instanceId Instance ID - @param databaseId Database ID - @return ApiDeleteDatabaseRequest - */ - DeleteDatabase(ctx context.Context, projectId string, instanceId string, databaseId string) ApiDeleteDatabaseRequest - - // DeleteDatabaseExecute executes the request - DeleteDatabaseExecute(r ApiDeleteDatabaseRequest) error - - /* - DeleteInstance Delete Instance - - Delete 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 instanceId Instance ID - @return ApiDeleteInstanceRequest - */ - DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest - - // DeleteInstanceExecute executes the request - DeleteInstanceExecute(r ApiDeleteInstanceRequest) error - - /* - DeleteUser Delete User - - Delete 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 instanceId Instance ID - @param userId User ID - @return ApiDeleteUserRequest - */ - DeleteUser(ctx context.Context, projectId string, instanceId string, userId string) ApiDeleteUserRequest - - // DeleteUserExecute executes the request - DeleteUserExecute(r ApiDeleteUserRequest) error - - /* - ForceDeleteInstance Force delete instance - - Forces the deletion of an delayed deleted instance - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param instanceId Instance ID - @return ApiForceDeleteInstanceRequest - */ - ForceDeleteInstance(ctx context.Context, projectId string, instanceId string) ApiForceDeleteInstanceRequest - - // ForceDeleteInstanceExecute executes the request - ForceDeleteInstanceExecute(r ApiForceDeleteInstanceRequest) error - - /* - GetBackup Get specific backup - - Get specific available backup - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param instanceId Instance ID - @param backupId Backup ID - @return ApiGetBackupRequest - */ - GetBackup(ctx context.Context, projectId string, instanceId string, backupId string) ApiGetBackupRequest - - // GetBackupExecute executes the request - // @return GetBackupResponse - GetBackupExecute(r ApiGetBackupRequest) (*GetBackupResponse, error) - - /* - GetInstance Get specific instance - - Get specific available instances - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param instanceId Instance ID - @return ApiGetInstanceRequest - */ - GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest - - // GetInstanceExecute executes the request - // @return InstanceResponse - GetInstanceExecute(r ApiGetInstanceRequest) (*InstanceResponse, error) - - /* - GetUser Get User - - Get 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 instanceId Instance ID - @param userId User ID - @return ApiGetUserRequest - */ - GetUser(ctx context.Context, projectId string, instanceId string, userId string) 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 Project ID - @param instanceId Instance ID - @return ApiListBackupsRequest - */ - ListBackups(ctx context.Context, projectId string, instanceId string) ApiListBackupsRequest - - // ListBackupsExecute executes the request - // @return ListBackupsResponse - ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) - - /* - ListDatabaseParameters List Databases parameter - - List available databases parameter - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param instanceId Instance ID - @return ApiListDatabaseParametersRequest - */ - ListDatabaseParameters(ctx context.Context, projectId string, instanceId string) ApiListDatabaseParametersRequest - - // ListDatabaseParametersExecute executes the request - // @return PostgresDatabaseParameterResponse - ListDatabaseParametersExecute(r ApiListDatabaseParametersRequest) (*PostgresDatabaseParameterResponse, 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 Project ID - @param instanceId Instance ID - @return ApiListDatabasesRequest - */ - ListDatabases(ctx context.Context, projectId string, instanceId string) ApiListDatabasesRequest - - // ListDatabasesExecute executes the request - // @return InstanceListDatabasesResponse - ListDatabasesExecute(r ApiListDatabasesRequest) (*InstanceListDatabasesResponse, error) - - /* - ListFlavors Get Flavors - - Get available flavors for a specific projectID - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @return ApiListFlavorsRequest - */ - ListFlavors(ctx context.Context, projectId string) ApiListFlavorsRequest - - // ListFlavorsExecute executes the request - // @return ListFlavorsResponse - ListFlavorsExecute(r ApiListFlavorsRequest) (*ListFlavorsResponse, error) - - /* - ListInstances List Instances - - List available instances - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @return ApiListInstancesRequest - */ - ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest - - // ListInstancesExecute executes the request - // @return ListInstancesResponse - ListInstancesExecute(r ApiListInstancesRequest) (*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 connections and disk-use. If you provide start time, you have to provide end time as well and vice versa. - - @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 instanceId The UUID of the instance. - @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'disk-use', 'disk-size' and 'connections'. - @return ApiListMetricsRequest - */ - ListMetrics(ctx context.Context, projectId string, instanceId string, metric string) ApiListMetricsRequest - - // ListMetricsExecute executes the request - // @return InstanceMetricsResponse - ListMetricsExecute(r ApiListMetricsRequest) (*InstanceMetricsResponse, error) - - /* - ListStorages Get Storages - - Get available storages for a specific flavor - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param flavorId Flavor ID - @return ApiListStoragesRequest - */ - ListStorages(ctx context.Context, projectId string, flavorId string) ApiListStoragesRequest - - // ListStoragesExecute executes the request - // @return ListStoragesResponse - ListStoragesExecute(r ApiListStoragesRequest) (*ListStoragesResponse, 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 Project ID - @param instanceId Instance ID - @return ApiListUsersRequest - */ - ListUsers(ctx context.Context, projectId string, instanceId string) ApiListUsersRequest - - // ListUsersExecute executes the request - // @return ListUsersResponse - ListUsersExecute(r ApiListUsersRequest) (*ListUsersResponse, error) - - /* - ListVersions Get Versions - - Get available versions for postgres database - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @return ApiListVersionsRequest - */ - ListVersions(ctx context.Context, projectId string) ApiListVersionsRequest - - // ListVersionsExecute executes the request - // @return ListVersionsResponse - ListVersionsExecute(r ApiListVersionsRequest) (*ListVersionsResponse, error) - - /* - PartialUpdateInstance Update Instance - - Update available instance of a postgres database. Supported Versions are 12, 13, 14, 15 -- only upgrades are allowed! - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param instanceId Instance ID - @return ApiPartialUpdateInstanceRequest - */ - PartialUpdateInstance(ctx context.Context, projectId string, instanceId string) ApiPartialUpdateInstanceRequest - - // PartialUpdateInstanceExecute executes the request - // @return PartialUpdateInstanceResponse - PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) (*PartialUpdateInstanceResponse, error) - - /* - PartialUpdateUser Update User - - Update user for an instance. Only the roles are updatable. - - @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 instanceId The ID of the instance - @param userId The ID of the user in the database - @return ApiPartialUpdateUserRequest - */ - PartialUpdateUser(ctx context.Context, projectId string, instanceId string, userId string) ApiPartialUpdateUserRequest - - // PartialUpdateUserExecute executes the request - PartialUpdateUserExecute(r ApiPartialUpdateUserRequest) error - - /* - ResetUser Reset User - - Reset user password for a 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 instanceId Instance ID - @param userId user ID - @return ApiResetUserRequest - */ - ResetUser(ctx context.Context, projectId string, instanceId string, userId string) ApiResetUserRequest - - // ResetUserExecute executes the request - // @return ResetUserResponse - ResetUserExecute(r ApiResetUserRequest) (*ResetUserResponse, error) - - /* - UpdateBackupSchedule Update Backup Schedule - - Update backup schedule - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param instanceId Instance ID - @return ApiUpdateBackupScheduleRequest - */ - UpdateBackupSchedule(ctx context.Context, projectId string, instanceId string) ApiUpdateBackupScheduleRequest - - // UpdateBackupScheduleExecute executes the request - UpdateBackupScheduleExecute(r ApiUpdateBackupScheduleRequest) error - - /* - UpdateInstance Update Instance - - Update available instance of a postgres database. Supported Versions are 12, 13, 14, 15 -- only upgrades are allowed! - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param instanceId Instance ID - @return ApiUpdateInstanceRequest - */ - UpdateInstance(ctx context.Context, projectId string, instanceId string) ApiUpdateInstanceRequest - - // UpdateInstanceExecute executes the request - // @return PartialUpdateInstanceResponse - UpdateInstanceExecute(r ApiUpdateInstanceRequest) (*PartialUpdateInstanceResponse, error) - - /* - UpdateUser Update User - - Update user for an instance. Only the roles are updatable. - - @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 instanceId The ID of the instance - @param userId The ID of the user in the database - @return ApiUpdateUserRequest - */ - UpdateUser(ctx context.Context, projectId string, instanceId string, userId string) 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 - instanceId string - cloneInstancePayload *CloneInstancePayload -} - -// Body -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 an existing instance of a postgres database to a new destination instance - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param instanceId Instance ID - @return ApiCloneInstanceRequest -*/ -func (a *DefaultAPIService) CloneInstance(ctx context.Context, projectId string, instanceId string) ApiCloneInstanceRequest { - return ApiCloneInstanceRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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 + "/v1/projects/{projectId}/instances/{instanceId}/clone" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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.cloneInstancePayload == nil { - return localVarReturnValue, reportError("cloneInstancePayload 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.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 - } - 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 - instanceId string - createDatabasePayload *CreateDatabasePayload -} - -// body -func (r ApiCreateDatabaseRequest) CreateDatabasePayload(createDatabasePayload CreateDatabasePayload) ApiCreateDatabaseRequest { - r.createDatabasePayload = &createDatabasePayload - return r -} - -func (r ApiCreateDatabaseRequest) Execute() (*InstanceCreateDatabaseResponse, 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 Project ID - @param instanceId Instance ID - @return ApiCreateDatabaseRequest -*/ -func (a *DefaultAPIService) CreateDatabase(ctx context.Context, projectId string, instanceId string) ApiCreateDatabaseRequest { - return ApiCreateDatabaseRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - instanceId: instanceId, - } -} - -// Execute executes the request -// -// @return InstanceCreateDatabaseResponse -func (a *DefaultAPIService) CreateDatabaseExecute(r ApiCreateDatabaseRequest) (*InstanceCreateDatabaseResponse, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *InstanceCreateDatabaseResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateDatabase") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/databases" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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 - } - 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 - createInstancePayload *CreateInstancePayload -} - -// Body -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 - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @return ApiCreateInstanceRequest -*/ -func (a *DefaultAPIService) CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest { - return ApiCreateInstanceRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// 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 + "/v1/projects/{projectId}/instances" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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 - } - 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 - instanceId string - createUserPayload *CreateUserPayload -} - -// body -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 Project ID - @param instanceId Instance ID - @return ApiCreateUserRequest -*/ -func (a *DefaultAPIService) CreateUser(ctx context.Context, projectId string, instanceId string) ApiCreateUserRequest { - return ApiCreateUserRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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 + "/v1/projects/{projectId}/instances/{instanceId}/users" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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 - } - 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 - instanceId string - databaseId string -} - -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 Project ID - @param instanceId Instance ID - @param databaseId Database ID - @return ApiDeleteDatabaseRequest -*/ -func (a *DefaultAPIService) DeleteDatabase(ctx context.Context, projectId string, instanceId string, databaseId string) ApiDeleteDatabaseRequest { - return ApiDeleteDatabaseRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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 + "/v1/projects/{projectId}/instances/{instanceId}/databases/{databaseId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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 - } - return newErr - } - - return nil -} - -type ApiDeleteInstanceRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - instanceId string -} - -func (r ApiDeleteInstanceRequest) Execute() error { - return r.ApiService.DeleteInstanceExecute(r) -} - -/* -DeleteInstance Delete Instance - -Delete 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 instanceId Instance ID - @return ApiDeleteInstanceRequest -*/ -func (a *DefaultAPIService) DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest { - return ApiDeleteInstanceRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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 + "/v1/projects/{projectId}/instances/{instanceId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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 == 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 == 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 - } - - return nil -} - -type ApiDeleteUserRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - instanceId string - userId string -} - -func (r ApiDeleteUserRequest) Execute() error { - return r.ApiService.DeleteUserExecute(r) -} - -/* -DeleteUser Delete User - -Delete 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 instanceId Instance ID - @param userId User ID - @return ApiDeleteUserRequest -*/ -func (a *DefaultAPIService) DeleteUser(ctx context.Context, projectId string, instanceId string, userId string) ApiDeleteUserRequest { - return ApiDeleteUserRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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 + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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 - } - return newErr - } - - return nil -} - -type ApiForceDeleteInstanceRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - instanceId string -} - -func (r ApiForceDeleteInstanceRequest) Execute() error { - return r.ApiService.ForceDeleteInstanceExecute(r) -} - -/* -ForceDeleteInstance Force delete instance - -Forces the deletion of an delayed deleted instance - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param instanceId Instance ID - @return ApiForceDeleteInstanceRequest -*/ -func (a *DefaultAPIService) ForceDeleteInstance(ctx context.Context, projectId string, instanceId string) ApiForceDeleteInstanceRequest { - return ApiForceDeleteInstanceRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - instanceId: instanceId, - } -} - -// Execute executes the request -func (a *DefaultAPIService) ForceDeleteInstanceExecute(r ApiForceDeleteInstanceRequest) error { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ForceDeleteInstance") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/force" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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 == 406 { - 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 - } - - return nil -} - -type ApiGetBackupRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - instanceId string - backupId string -} - -func (r ApiGetBackupRequest) Execute() (*GetBackupResponse, error) { - return r.ApiService.GetBackupExecute(r) -} - -/* -GetBackup Get specific backup - -Get specific available backup - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param instanceId Instance ID - @param backupId Backup ID - @return ApiGetBackupRequest -*/ -func (a *DefaultAPIService) GetBackup(ctx context.Context, projectId string, instanceId string, backupId string) ApiGetBackupRequest { - return ApiGetBackupRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - instanceId: instanceId, - backupId: backupId, - } -} - -// Execute executes the request -// -// @return GetBackupResponse -func (a *DefaultAPIService) GetBackupExecute(r ApiGetBackupRequest) (*GetBackupResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *GetBackupResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetBackup") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups/{backupId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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 - } - 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 - instanceId string -} - -func (r ApiGetInstanceRequest) Execute() (*InstanceResponse, error) { - return r.ApiService.GetInstanceExecute(r) -} - -/* -GetInstance Get specific instance - -Get specific available instances - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param instanceId Instance ID - @return ApiGetInstanceRequest -*/ -func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest { - return ApiGetInstanceRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - instanceId: instanceId, - } -} - -// Execute executes the request -// -// @return InstanceResponse -func (a *DefaultAPIService) GetInstanceExecute(r ApiGetInstanceRequest) (*InstanceResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *InstanceResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetInstance") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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 - } - 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 - instanceId string - userId string -} - -func (r ApiGetUserRequest) Execute() (*GetUserResponse, error) { - return r.ApiService.GetUserExecute(r) -} - -/* -GetUser Get User - -Get 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 instanceId Instance ID - @param userId User ID - @return ApiGetUserRequest -*/ -func (a *DefaultAPIService) GetUser(ctx context.Context, projectId string, instanceId string, userId string) ApiGetUserRequest { - return ApiGetUserRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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 + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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 - } - 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 - instanceId string -} - -func (r ApiListBackupsRequest) Execute() (*ListBackupsResponse, 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 Project ID - @param instanceId Instance ID - @return ApiListBackupsRequest -*/ -func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, instanceId string) ApiListBackupsRequest { - return ApiListBackupsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - instanceId: instanceId, - } -} - -// Execute executes the request -// -// @return ListBackupsResponse -func (a *DefaultAPIService) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListBackupsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListBackups") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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 - } - 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 ApiListDatabaseParametersRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - instanceId string -} - -func (r ApiListDatabaseParametersRequest) Execute() (*PostgresDatabaseParameterResponse, error) { - return r.ApiService.ListDatabaseParametersExecute(r) -} - -/* -ListDatabaseParameters List Databases parameter - -List available databases parameter - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param instanceId Instance ID - @return ApiListDatabaseParametersRequest -*/ -func (a *DefaultAPIService) ListDatabaseParameters(ctx context.Context, projectId string, instanceId string) ApiListDatabaseParametersRequest { - return ApiListDatabaseParametersRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - instanceId: instanceId, - } -} - -// Execute executes the request -// -// @return PostgresDatabaseParameterResponse -func (a *DefaultAPIService) ListDatabaseParametersExecute(r ApiListDatabaseParametersRequest) (*PostgresDatabaseParameterResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *PostgresDatabaseParameterResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListDatabaseParameters") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/parameter" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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 - } - 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 - instanceId string -} - -func (r ApiListDatabasesRequest) Execute() (*InstanceListDatabasesResponse, 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 Project ID - @param instanceId Instance ID - @return ApiListDatabasesRequest -*/ -func (a *DefaultAPIService) ListDatabases(ctx context.Context, projectId string, instanceId string) ApiListDatabasesRequest { - return ApiListDatabasesRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - instanceId: instanceId, - } -} - -// Execute executes the request -// -// @return InstanceListDatabasesResponse -func (a *DefaultAPIService) ListDatabasesExecute(r ApiListDatabasesRequest) (*InstanceListDatabasesResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *InstanceListDatabasesResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListDatabases") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/databases" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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 - } - 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 -} - -func (r ApiListFlavorsRequest) Execute() (*ListFlavorsResponse, error) { - return r.ApiService.ListFlavorsExecute(r) -} - -/* -ListFlavors Get Flavors - -Get available flavors for a specific projectID - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @return ApiListFlavorsRequest -*/ -func (a *DefaultAPIService) ListFlavors(ctx context.Context, projectId string) ApiListFlavorsRequest { - return ApiListFlavorsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// 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 + "/v1/projects/{projectId}/flavors" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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 - } - 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 -} - -func (r ApiListInstancesRequest) Execute() (*ListInstancesResponse, error) { - return r.ApiService.ListInstancesExecute(r) -} - -/* -ListInstances List Instances - -List available instances - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @return ApiListInstancesRequest -*/ -func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest { - return ApiListInstancesRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// 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 + "/v1/projects/{projectId}/instances" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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 - } - 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 ApiListMetricsRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - instanceId string - metric string - granularity *string - period *string - start *string - end *string -} - -// The granularity in ISO8601 e.g. 5 minutes are 'PT5M'. -func (r ApiListMetricsRequest) Granularity(granularity string) ApiListMetricsRequest { - r.granularity = &granularity - return r -} - -// The period in ISO8601 format e.g. 5 minutes are 'PT5M'. If no period is provided, the standard value of 5 minutes is used. -func (r ApiListMetricsRequest) Period(period string) ApiListMetricsRequest { - r.period = &period - 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. -func (r ApiListMetricsRequest) Start(start string) ApiListMetricsRequest { - r.start = &start - return r -} - -// The end of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. -func (r ApiListMetricsRequest) End(end string) ApiListMetricsRequest { - r.end = &end - return r -} - -func (r ApiListMetricsRequest) Execute() (*InstanceMetricsResponse, error) { - return r.ApiService.ListMetricsExecute(r) -} - -/* -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 connections and disk-use. If you provide start time, you have to provide end time as well and vice versa. - - @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 instanceId The UUID of the instance. - @param metric The name of the metric. Valid metrics are 'cpu', 'memory', 'disk-use', 'disk-size' and 'connections'. - @return ApiListMetricsRequest -*/ -func (a *DefaultAPIService) ListMetrics(ctx context.Context, projectId string, instanceId string, metric string) ApiListMetricsRequest { - return ApiListMetricsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - instanceId: instanceId, - metric: metric, - } -} - -// Execute executes the request -// -// @return InstanceMetricsResponse -func (a *DefaultAPIService) ListMetricsExecute(r ApiListMetricsRequest) (*InstanceMetricsResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *InstanceMetricsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListMetrics") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/metrics/{metric}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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, reportError("granularity is required and must be specified") - } - - parameterAddToHeaderOrQuery(localVarQueryParams, "granularity", r.granularity, "form", "") - if r.period != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "period", r.period, "form", "") - } - if r.start != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "start", r.start, "form", "") - } - if r.end != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "end", r.end, "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 == 405 { - 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 - } - - 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 ApiListStoragesRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - flavorId string -} - -func (r ApiListStoragesRequest) Execute() (*ListStoragesResponse, error) { - return r.ApiService.ListStoragesExecute(r) -} - -/* -ListStorages Get Storages - -Get available storages for a specific flavor - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param flavorId Flavor ID - @return ApiListStoragesRequest -*/ -func (a *DefaultAPIService) ListStorages(ctx context.Context, projectId string, flavorId string) ApiListStoragesRequest { - return ApiListStoragesRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - flavorId: flavorId, - } -} - -// Execute executes the request -// -// @return ListStoragesResponse -func (a *DefaultAPIService) ListStoragesExecute(r ApiListStoragesRequest) (*ListStoragesResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListStoragesResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListStorages") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/storages/{flavorId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"flavorId"+"}", url.PathEscape(parameterValueToString(r.flavorId, "flavorId")), -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 - } - 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 - instanceId string -} - -func (r ApiListUsersRequest) Execute() (*ListUsersResponse, 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 Project ID - @param instanceId Instance ID - @return ApiListUsersRequest -*/ -func (a *DefaultAPIService) ListUsers(ctx context.Context, projectId string, instanceId string) ApiListUsersRequest { - return ApiListUsersRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - instanceId: instanceId, - } -} - -// Execute executes the request -// -// @return ListUsersResponse -func (a *DefaultAPIService) ListUsersExecute(r ApiListUsersRequest) (*ListUsersResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListUsersResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListUsers") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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 - } - 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 - instanceId *string -} - -// Instance ID -func (r ApiListVersionsRequest) InstanceId(instanceId string) ApiListVersionsRequest { - r.instanceId = &instanceId - return r -} - -func (r ApiListVersionsRequest) Execute() (*ListVersionsResponse, error) { - return r.ApiService.ListVersionsExecute(r) -} - -/* -ListVersions Get Versions - -Get available versions for postgres database - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @return ApiListVersionsRequest -*/ -func (a *DefaultAPIService) ListVersions(ctx context.Context, projectId string) ApiListVersionsRequest { - return ApiListVersionsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// Execute executes the request -// -// @return ListVersionsResponse -func (a *DefaultAPIService) ListVersionsExecute(r ApiListVersionsRequest) (*ListVersionsResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListVersionsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListVersions") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/versions" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.instanceId != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "instanceId", r.instanceId, "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 - } - 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 ApiPartialUpdateInstanceRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - instanceId string - partialUpdateInstancePayload *PartialUpdateInstancePayload -} - -// Body -func (r ApiPartialUpdateInstanceRequest) PartialUpdateInstancePayload(partialUpdateInstancePayload PartialUpdateInstancePayload) ApiPartialUpdateInstanceRequest { - r.partialUpdateInstancePayload = &partialUpdateInstancePayload - return r -} - -func (r ApiPartialUpdateInstanceRequest) Execute() (*PartialUpdateInstanceResponse, error) { - return r.ApiService.PartialUpdateInstanceExecute(r) -} - -/* -PartialUpdateInstance Update Instance - -Update available instance of a postgres database. Supported Versions are 12, 13, 14, 15 -- only upgrades are allowed! - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param instanceId Instance ID - @return ApiPartialUpdateInstanceRequest -*/ -func (a *DefaultAPIService) PartialUpdateInstance(ctx context.Context, projectId string, instanceId string) ApiPartialUpdateInstanceRequest { - return ApiPartialUpdateInstanceRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - instanceId: instanceId, - } -} - -// Execute executes the request -// -// @return PartialUpdateInstanceResponse -func (a *DefaultAPIService) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) (*PartialUpdateInstanceResponse, error) { - var ( - localVarHTTPMethod = http.MethodPatch - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *PartialUpdateInstanceResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateInstance") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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 localVarReturnValue, 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 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 - } - 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 ApiPartialUpdateUserRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - instanceId string - userId string - partialUpdateUserPayload *PartialUpdateUserPayload -} - -// 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 -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 - -Update user for an instance. Only the roles are updatable. - - @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 instanceId The ID of the instance - @param userId The ID of the user in the database - @return ApiPartialUpdateUserRequest -*/ -func (a *DefaultAPIService) PartialUpdateUser(ctx context.Context, projectId string, instanceId string, userId string) ApiPartialUpdateUserRequest { - return ApiPartialUpdateUserRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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 + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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 == 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 - } - - return nil -} - -type ApiResetUserRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - instanceId string - userId string -} - -func (r ApiResetUserRequest) Execute() (*ResetUserResponse, error) { - return r.ApiService.ResetUserExecute(r) -} - -/* -ResetUser Reset User - -Reset user password for a 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 instanceId Instance ID - @param userId user ID - @return ApiResetUserRequest -*/ -func (a *DefaultAPIService) ResetUser(ctx context.Context, projectId string, instanceId string, userId string) ApiResetUserRequest { - return ApiResetUserRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - instanceId: instanceId, - userId: userId, - } -} - -// Execute executes the request -// -// @return ResetUserResponse -func (a *DefaultAPIService) ResetUserExecute(r ApiResetUserRequest) (*ResetUserResponse, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ResetUserResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ResetUser") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}/reset" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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 == 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 - } - - 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 ApiUpdateBackupScheduleRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - instanceId string - updateBackupSchedulePayload *UpdateBackupSchedulePayload -} - -// Body -func (r ApiUpdateBackupScheduleRequest) UpdateBackupSchedulePayload(updateBackupSchedulePayload UpdateBackupSchedulePayload) ApiUpdateBackupScheduleRequest { - r.updateBackupSchedulePayload = &updateBackupSchedulePayload - return r -} - -func (r ApiUpdateBackupScheduleRequest) Execute() error { - return r.ApiService.UpdateBackupScheduleExecute(r) -} - -/* -UpdateBackupSchedule Update Backup Schedule - -Update backup schedule - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param instanceId Instance ID - @return ApiUpdateBackupScheduleRequest -*/ -func (a *DefaultAPIService) UpdateBackupSchedule(ctx context.Context, projectId string, instanceId string) ApiUpdateBackupScheduleRequest { - return ApiUpdateBackupScheduleRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - instanceId: instanceId, - } -} - -// Execute executes the request -func (a *DefaultAPIService) UpdateBackupScheduleExecute(r ApiUpdateBackupScheduleRequest) error { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateBackupSchedule") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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.updateBackupSchedulePayload == nil { - return reportError("updateBackupSchedulePayload 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.updateBackupSchedulePayload - 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 - } - return newErr - } - - return nil -} - -type ApiUpdateInstanceRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - instanceId string - updateInstancePayload *UpdateInstancePayload -} - -// Body -func (r ApiUpdateInstanceRequest) UpdateInstancePayload(updateInstancePayload UpdateInstancePayload) ApiUpdateInstanceRequest { - r.updateInstancePayload = &updateInstancePayload - return r -} - -func (r ApiUpdateInstanceRequest) Execute() (*PartialUpdateInstanceResponse, error) { - return r.ApiService.UpdateInstanceExecute(r) -} - -/* -UpdateInstance Update Instance - -Update available instance of a postgres database. Supported Versions are 12, 13, 14, 15 -- only upgrades are allowed! - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param instanceId Instance ID - @return ApiUpdateInstanceRequest -*/ -func (a *DefaultAPIService) UpdateInstance(ctx context.Context, projectId string, instanceId string) ApiUpdateInstanceRequest { - return ApiUpdateInstanceRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - instanceId: instanceId, - } -} - -// Execute executes the request -// -// @return PartialUpdateInstanceResponse -func (a *DefaultAPIService) UpdateInstanceExecute(r ApiUpdateInstanceRequest) (*PartialUpdateInstanceResponse, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *PartialUpdateInstanceResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateInstance") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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 localVarReturnValue, 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 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 - } - 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 - instanceId string - userId string - 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 -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. Only the roles are updatable. - - @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 instanceId The ID of the instance - @param userId The ID of the user in the database - @return ApiUpdateUserRequest -*/ -func (a *DefaultAPIService) UpdateUser(ctx context.Context, projectId string, instanceId string, userId string) ApiUpdateUserRequest { - return ApiUpdateUserRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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 + "/v1/projects/{projectId}/instances/{instanceId}/users/{userId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -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.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 == 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 - } - - return nil -} diff --git a/services/postgresflex/v1api/api_default_mock.go b/services/postgresflex/v1api/api_default_mock.go deleted file mode 100644 index e33909c66c..0000000000 --- a/services/postgresflex/v1api/api_default_mock.go +++ /dev/null @@ -1,567 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -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) (*InstanceCreateDatabaseResponse, 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 - // ForceDeleteInstanceExecuteMock can be populated to implement the behavior of the ForceDeleteInstanceExecute function of this mock - ForceDeleteInstanceExecuteMock *func(r ApiForceDeleteInstanceRequest) error - // GetBackupExecuteMock can be populated to implement the behavior of the GetBackupExecute function of this mock - GetBackupExecuteMock *func(r ApiGetBackupRequest) (*GetBackupResponse, error) - // GetInstanceExecuteMock can be populated to implement the behavior of the GetInstanceExecute function of this mock - GetInstanceExecuteMock *func(r ApiGetInstanceRequest) (*InstanceResponse, 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) (*ListBackupsResponse, error) - // ListDatabaseParametersExecuteMock can be populated to implement the behavior of the ListDatabaseParametersExecute function of this mock - ListDatabaseParametersExecuteMock *func(r ApiListDatabaseParametersRequest) (*PostgresDatabaseParameterResponse, error) - // ListDatabasesExecuteMock can be populated to implement the behavior of the ListDatabasesExecute function of this mock - ListDatabasesExecuteMock *func(r ApiListDatabasesRequest) (*InstanceListDatabasesResponse, 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) - // ListMetricsExecuteMock can be populated to implement the behavior of the ListMetricsExecute function of this mock - ListMetricsExecuteMock *func(r ApiListMetricsRequest) (*InstanceMetricsResponse, error) - // ListStoragesExecuteMock can be populated to implement the behavior of the ListStoragesExecute function of this mock - ListStoragesExecuteMock *func(r ApiListStoragesRequest) (*ListStoragesResponse, error) - // ListUsersExecuteMock can be populated to implement the behavior of the ListUsersExecute function of this mock - ListUsersExecuteMock *func(r ApiListUsersRequest) (*ListUsersResponse, error) - // ListVersionsExecuteMock can be populated to implement the behavior of the ListVersionsExecute function of this mock - ListVersionsExecuteMock *func(r ApiListVersionsRequest) (*ListVersionsResponse, error) - // PartialUpdateInstanceExecuteMock can be populated to implement the behavior of the PartialUpdateInstanceExecute function of this mock - PartialUpdateInstanceExecuteMock *func(r ApiPartialUpdateInstanceRequest) (*PartialUpdateInstanceResponse, error) - // PartialUpdateUserExecuteMock can be populated to implement the behavior of the PartialUpdateUserExecute function of this mock - PartialUpdateUserExecuteMock *func(r ApiPartialUpdateUserRequest) error - // ResetUserExecuteMock can be populated to implement the behavior of the ResetUserExecute function of this mock - ResetUserExecuteMock *func(r ApiResetUserRequest) (*ResetUserResponse, error) - // UpdateBackupScheduleExecuteMock can be populated to implement the behavior of the UpdateBackupScheduleExecute function of this mock - UpdateBackupScheduleExecuteMock *func(r ApiUpdateBackupScheduleRequest) error - // UpdateInstanceExecuteMock can be populated to implement the behavior of the UpdateInstanceExecute function of this mock - UpdateInstanceExecuteMock *func(r ApiUpdateInstanceRequest) (*PartialUpdateInstanceResponse, 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, instanceId string) ApiCloneInstanceRequest { - return ApiCloneInstanceRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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, instanceId string) ApiCreateDatabaseRequest { - return ApiCreateDatabaseRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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) (*InstanceCreateDatabaseResponse, error) { - if a.CreateDatabaseExecuteMock == nil { - var localVarReturnValue *InstanceCreateDatabaseResponse - return localVarReturnValue, nil - } - - return (*a.CreateDatabaseExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest { - return ApiCreateInstanceRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// 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, instanceId string) ApiCreateUserRequest { - return ApiCreateUserRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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, instanceId string, databaseId string) ApiDeleteDatabaseRequest { - return ApiDeleteDatabaseRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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, instanceId string) ApiDeleteInstanceRequest { - return ApiDeleteInstanceRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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, instanceId string, userId string) ApiDeleteUserRequest { - return ApiDeleteUserRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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) ForceDeleteInstance(ctx context.Context, projectId string, instanceId string) ApiForceDeleteInstanceRequest { - return ApiForceDeleteInstanceRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - instanceId: instanceId, - } -} - -// ForceDeleteInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ForceDeleteInstanceExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) ForceDeleteInstanceExecute(r ApiForceDeleteInstanceRequest) error { - if a.ForceDeleteInstanceExecuteMock == nil { - return nil - } - - return (*a.ForceDeleteInstanceExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) GetBackup(ctx context.Context, projectId string, instanceId string, backupId string) ApiGetBackupRequest { - return ApiGetBackupRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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) (*GetBackupResponse, error) { - if a.GetBackupExecuteMock == nil { - var localVarReturnValue *GetBackupResponse - return localVarReturnValue, nil - } - - return (*a.GetBackupExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest { - return ApiGetInstanceRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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) (*InstanceResponse, error) { - if a.GetInstanceExecuteMock == nil { - var localVarReturnValue *InstanceResponse - return localVarReturnValue, nil - } - - return (*a.GetInstanceExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) GetUser(ctx context.Context, projectId string, instanceId string, userId string) ApiGetUserRequest { - return ApiGetUserRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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, instanceId string) ApiListBackupsRequest { - return ApiListBackupsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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) (*ListBackupsResponse, error) { - if a.ListBackupsExecuteMock == nil { - var localVarReturnValue *ListBackupsResponse - return localVarReturnValue, nil - } - - return (*a.ListBackupsExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) ListDatabaseParameters(ctx context.Context, projectId string, instanceId string) ApiListDatabaseParametersRequest { - return ApiListDatabaseParametersRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - instanceId: instanceId, - } -} - -// ListDatabaseParametersExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListDatabaseParametersExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) ListDatabaseParametersExecute(r ApiListDatabaseParametersRequest) (*PostgresDatabaseParameterResponse, error) { - if a.ListDatabaseParametersExecuteMock == nil { - var localVarReturnValue *PostgresDatabaseParameterResponse - return localVarReturnValue, nil - } - - return (*a.ListDatabaseParametersExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) ListDatabases(ctx context.Context, projectId string, instanceId string) ApiListDatabasesRequest { - return ApiListDatabasesRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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) (*InstanceListDatabasesResponse, error) { - if a.ListDatabasesExecuteMock == nil { - var localVarReturnValue *InstanceListDatabasesResponse - return localVarReturnValue, nil - } - - return (*a.ListDatabasesExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) ListFlavors(ctx context.Context, projectId string) ApiListFlavorsRequest { - return ApiListFlavorsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// 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) ApiListInstancesRequest { - return ApiListInstancesRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// 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) ListMetrics(ctx context.Context, projectId string, instanceId string, metric string) ApiListMetricsRequest { - return ApiListMetricsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - instanceId: instanceId, - metric: metric, - } -} - -// ListMetricsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListMetricsExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) ListMetricsExecute(r ApiListMetricsRequest) (*InstanceMetricsResponse, error) { - if a.ListMetricsExecuteMock == nil { - var localVarReturnValue *InstanceMetricsResponse - return localVarReturnValue, nil - } - - return (*a.ListMetricsExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) ListStorages(ctx context.Context, projectId string, flavorId string) ApiListStoragesRequest { - return ApiListStoragesRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - flavorId: flavorId, - } -} - -// ListStoragesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListStoragesExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) ListStoragesExecute(r ApiListStoragesRequest) (*ListStoragesResponse, error) { - if a.ListStoragesExecuteMock == nil { - var localVarReturnValue *ListStoragesResponse - return localVarReturnValue, nil - } - - return (*a.ListStoragesExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) ListUsers(ctx context.Context, projectId string, instanceId string) ApiListUsersRequest { - return ApiListUsersRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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) (*ListUsersResponse, error) { - if a.ListUsersExecuteMock == nil { - var localVarReturnValue *ListUsersResponse - return localVarReturnValue, nil - } - - return (*a.ListUsersExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) ListVersions(ctx context.Context, projectId string) ApiListVersionsRequest { - return ApiListVersionsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - } -} - -// 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) (*ListVersionsResponse, error) { - if a.ListVersionsExecuteMock == nil { - var localVarReturnValue *ListVersionsResponse - return localVarReturnValue, nil - } - - return (*a.ListVersionsExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) PartialUpdateInstance(ctx context.Context, projectId string, instanceId string) ApiPartialUpdateInstanceRequest { - return ApiPartialUpdateInstanceRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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) (*PartialUpdateInstanceResponse, error) { - if a.PartialUpdateInstanceExecuteMock == nil { - var localVarReturnValue *PartialUpdateInstanceResponse - return localVarReturnValue, nil - } - - return (*a.PartialUpdateInstanceExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) PartialUpdateUser(ctx context.Context, projectId string, instanceId string, userId string) ApiPartialUpdateUserRequest { - return ApiPartialUpdateUserRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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) ResetUser(ctx context.Context, projectId string, instanceId string, userId string) ApiResetUserRequest { - return ApiResetUserRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - instanceId: instanceId, - userId: userId, - } -} - -// ResetUserExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ResetUserExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) ResetUserExecute(r ApiResetUserRequest) (*ResetUserResponse, error) { - if a.ResetUserExecuteMock == nil { - var localVarReturnValue *ResetUserResponse - return localVarReturnValue, nil - } - - return (*a.ResetUserExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) UpdateBackupSchedule(ctx context.Context, projectId string, instanceId string) ApiUpdateBackupScheduleRequest { - return ApiUpdateBackupScheduleRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - instanceId: instanceId, - } -} - -// UpdateBackupScheduleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateBackupScheduleExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) UpdateBackupScheduleExecute(r ApiUpdateBackupScheduleRequest) error { - if a.UpdateBackupScheduleExecuteMock == nil { - return nil - } - - return (*a.UpdateBackupScheduleExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) UpdateInstance(ctx context.Context, projectId string, instanceId string) ApiUpdateInstanceRequest { - return ApiUpdateInstanceRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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) (*PartialUpdateInstanceResponse, error) { - if a.UpdateInstanceExecuteMock == nil { - var localVarReturnValue *PartialUpdateInstanceResponse - return localVarReturnValue, nil - } - - return (*a.UpdateInstanceExecuteMock)(r) -} - -func (a DefaultAPIServiceMock) UpdateUser(ctx context.Context, projectId string, instanceId string, userId string) ApiUpdateUserRequest { - return ApiUpdateUserRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - 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/v1api/client.go b/services/postgresflex/v1api/client.go deleted file mode 100644 index f1e05d5ac2..0000000000 --- a/services/postgresflex/v1api/client.go +++ /dev/null @@ -1,668 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package v1api - -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 (deprecated) API v1.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 r, ok := v.(*io.Reader); ok { - *r = bytes.NewReader(b) - return nil - } - // Must stay before the JSON branch: json.Unmarshal would base64-decode into *[]byte. - if p, ok := v.(*[]byte); ok { - *p = 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/v1api/configuration.go b/services/postgresflex/v1api/configuration.go deleted file mode 100644 index 4befa1c48a..0000000000 --- a/services/postgresflex/v1api/configuration.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package v1api - -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.{region}stackit.cloud", - Description: "No description provided", - Variables: map[string]config.ServerVariable{ - "region": { - Description: "No description provided", - DefaultValue: "eu01.", - EnumValues: []string{ - "eu01.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - return cfg -} diff --git a/services/postgresflex/v1api/model_acl.go b/services/postgresflex/v1api/model_acl.go deleted file mode 100644 index b7de719b8f..0000000000 --- a/services/postgresflex/v1api/model_acl.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the ACL type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ACL{} - -// ACL struct for ACL -type ACL struct { - Items []string `json:"items,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ACL ACL - -// NewACL instantiates a new ACL 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 NewACL() *ACL { - this := ACL{} - return &this -} - -// NewACLWithDefaults instantiates a new ACL 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 NewACLWithDefaults() *ACL { - this := ACL{} - return &this -} - -// GetItems returns the Items field value if set, zero value otherwise. -func (o *ACL) GetItems() []string { - if o == nil || IsNil(o.Items) { - var ret []string - return ret - } - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ACL) GetItemsOk() ([]string, bool) { - if o == nil || IsNil(o.Items) { - return nil, false - } - return o.Items, true -} - -// HasItems returns a boolean if a field has been set. -func (o *ACL) HasItems() bool { - if o != nil && !IsNil(o.Items) { - return true - } - - return false -} - -// SetItems gets a reference to the given []string and assigns it to the Items field. -func (o *ACL) SetItems(v []string) { - o.Items = v -} - -func (o ACL) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ACL) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Items) { - toSerialize["items"] = o.Items - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ACL) UnmarshalJSON(data []byte) (err error) { - varACL := _ACL{} - - err = json.Unmarshal(data, &varACL) - - if err != nil { - return err - } - - *o = ACL(varACL) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "items") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableACL struct { - value *ACL - isSet bool -} - -func (v NullableACL) Get() *ACL { - return v.value -} - -func (v *NullableACL) Set(val *ACL) { - v.value = val - v.isSet = true -} - -func (v NullableACL) IsSet() bool { - return v.isSet -} - -func (v *NullableACL) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableACL(val *ACL) *NullableACL { - return &NullableACL{value: val, isSet: true} -} - -func (v NullableACL) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableACL) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_api_configuration.go b/services/postgresflex/v1api/model_api_configuration.go deleted file mode 100644 index 4d8d4d1bff..0000000000 --- a/services/postgresflex/v1api/model_api_configuration.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the ApiConfiguration type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ApiConfiguration{} - -// ApiConfiguration struct for ApiConfiguration -type ApiConfiguration struct { - Name *string `json:"name,omitempty"` - Setting *string `json:"setting,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ApiConfiguration ApiConfiguration - -// NewApiConfiguration instantiates a new ApiConfiguration 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 NewApiConfiguration() *ApiConfiguration { - this := ApiConfiguration{} - return &this -} - -// NewApiConfigurationWithDefaults instantiates a new ApiConfiguration 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 NewApiConfigurationWithDefaults() *ApiConfiguration { - this := ApiConfiguration{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *ApiConfiguration) 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 *ApiConfiguration) 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 *ApiConfiguration) 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 *ApiConfiguration) SetName(v string) { - o.Name = &v -} - -// GetSetting returns the Setting field value if set, zero value otherwise. -func (o *ApiConfiguration) GetSetting() string { - if o == nil || IsNil(o.Setting) { - var ret string - return ret - } - return *o.Setting -} - -// GetSettingOk returns a tuple with the Setting field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ApiConfiguration) GetSettingOk() (*string, bool) { - if o == nil || IsNil(o.Setting) { - return nil, false - } - return o.Setting, true -} - -// HasSetting returns a boolean if a field has been set. -func (o *ApiConfiguration) HasSetting() bool { - if o != nil && !IsNil(o.Setting) { - return true - } - - return false -} - -// SetSetting gets a reference to the given string and assigns it to the Setting field. -func (o *ApiConfiguration) SetSetting(v string) { - o.Setting = &v -} - -func (o ApiConfiguration) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ApiConfiguration) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.Setting) { - toSerialize["setting"] = o.Setting - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ApiConfiguration) UnmarshalJSON(data []byte) (err error) { - varApiConfiguration := _ApiConfiguration{} - - err = json.Unmarshal(data, &varApiConfiguration) - - if err != nil { - return err - } - - *o = ApiConfiguration(varApiConfiguration) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "name") - delete(additionalProperties, "setting") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableApiConfiguration struct { - value *ApiConfiguration - isSet bool -} - -func (v NullableApiConfiguration) Get() *ApiConfiguration { - return v.value -} - -func (v *NullableApiConfiguration) Set(val *ApiConfiguration) { - v.value = val - v.isSet = true -} - -func (v NullableApiConfiguration) IsSet() bool { - return v.isSet -} - -func (v *NullableApiConfiguration) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableApiConfiguration(val *ApiConfiguration) *NullableApiConfiguration { - return &NullableApiConfiguration{value: val, isSet: true} -} - -func (v NullableApiConfiguration) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableApiConfiguration) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_api_extension_config_load_response.go b/services/postgresflex/v1api/model_api_extension_config_load_response.go deleted file mode 100644 index ccd0685517..0000000000 --- a/services/postgresflex/v1api/model_api_extension_config_load_response.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the ApiExtensionConfigLoadResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ApiExtensionConfigLoadResponse{} - -// ApiExtensionConfigLoadResponse struct for ApiExtensionConfigLoadResponse -type ApiExtensionConfigLoadResponse struct { - // Returns marshalled JSON of the new configuration of whatever extension is called - Configuration []ApiConfiguration `json:"configuration,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ApiExtensionConfigLoadResponse ApiExtensionConfigLoadResponse - -// 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 -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 -func NewApiExtensionConfigLoadResponseWithDefaults() *ApiExtensionConfigLoadResponse { - this := ApiExtensionConfigLoadResponse{} - return &this -} - -// GetConfiguration returns the Configuration field value if set, zero value otherwise. -func (o *ApiExtensionConfigLoadResponse) GetConfiguration() []ApiConfiguration { - if o == nil || IsNil(o.Configuration) { - var ret []ApiConfiguration - return ret - } - return o.Configuration -} - -// GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ApiExtensionConfigLoadResponse) GetConfigurationOk() ([]ApiConfiguration, bool) { - if o == nil || IsNil(o.Configuration) { - return nil, false - } - return o.Configuration, true -} - -// HasConfiguration returns a boolean if a field has been set. -func (o *ApiExtensionConfigLoadResponse) HasConfiguration() bool { - if o != nil && !IsNil(o.Configuration) { - return true - } - - return false -} - -// SetConfiguration gets a reference to the given []ApiConfiguration and assigns it to the Configuration field. -func (o *ApiExtensionConfigLoadResponse) SetConfiguration(v []ApiConfiguration) { - o.Configuration = v -} - -func (o ApiExtensionConfigLoadResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ApiExtensionConfigLoadResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Configuration) { - toSerialize["configuration"] = o.Configuration - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ApiExtensionConfigLoadResponse) UnmarshalJSON(data []byte) (err error) { - varApiExtensionConfigLoadResponse := _ApiExtensionConfigLoadResponse{} - - err = json.Unmarshal(data, &varApiExtensionConfigLoadResponse) - - if err != nil { - return err - } - - *o = ApiExtensionConfigLoadResponse(varApiExtensionConfigLoadResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "configuration") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableApiExtensionConfigLoadResponse struct { - value *ApiExtensionConfigLoadResponse - isSet bool -} - -func (v NullableApiExtensionConfigLoadResponse) Get() *ApiExtensionConfigLoadResponse { - return v.value -} - -func (v *NullableApiExtensionConfigLoadResponse) Set(val *ApiExtensionConfigLoadResponse) { - v.value = val - v.isSet = true -} - -func (v NullableApiExtensionConfigLoadResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableApiExtensionConfigLoadResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableApiExtensionConfigLoadResponse(val *ApiExtensionConfigLoadResponse) *NullableApiExtensionConfigLoadResponse { - return &NullableApiExtensionConfigLoadResponse{value: val, isSet: true} -} - -func (v NullableApiExtensionConfigLoadResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableApiExtensionConfigLoadResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_api_extension_configure_response.go b/services/postgresflex/v1api/model_api_extension_configure_response.go deleted file mode 100644 index 4795aaa2f4..0000000000 --- a/services/postgresflex/v1api/model_api_extension_configure_response.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the ApiExtensionConfigureResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ApiExtensionConfigureResponse{} - -// ApiExtensionConfigureResponse struct for ApiExtensionConfigureResponse -type ApiExtensionConfigureResponse struct { - // Returns marshalled JSON of the new configuration of whatever extension is called - Configuration []ApiConfiguration `json:"configuration,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ApiExtensionConfigureResponse ApiExtensionConfigureResponse - -// 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 -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 -func NewApiExtensionConfigureResponseWithDefaults() *ApiExtensionConfigureResponse { - this := ApiExtensionConfigureResponse{} - return &this -} - -// GetConfiguration returns the Configuration field value if set, zero value otherwise. -func (o *ApiExtensionConfigureResponse) GetConfiguration() []ApiConfiguration { - if o == nil || IsNil(o.Configuration) { - var ret []ApiConfiguration - return ret - } - return o.Configuration -} - -// GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ApiExtensionConfigureResponse) GetConfigurationOk() ([]ApiConfiguration, bool) { - if o == nil || IsNil(o.Configuration) { - return nil, false - } - return o.Configuration, true -} - -// HasConfiguration returns a boolean if a field has been set. -func (o *ApiExtensionConfigureResponse) HasConfiguration() bool { - if o != nil && !IsNil(o.Configuration) { - return true - } - - return false -} - -// SetConfiguration gets a reference to the given []ApiConfiguration and assigns it to the Configuration field. -func (o *ApiExtensionConfigureResponse) SetConfiguration(v []ApiConfiguration) { - o.Configuration = v -} - -func (o ApiExtensionConfigureResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ApiExtensionConfigureResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Configuration) { - toSerialize["configuration"] = o.Configuration - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ApiExtensionConfigureResponse) UnmarshalJSON(data []byte) (err error) { - varApiExtensionConfigureResponse := _ApiExtensionConfigureResponse{} - - err = json.Unmarshal(data, &varApiExtensionConfigureResponse) - - if err != nil { - return err - } - - *o = ApiExtensionConfigureResponse(varApiExtensionConfigureResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "configuration") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableApiExtensionConfigureResponse struct { - value *ApiExtensionConfigureResponse - isSet bool -} - -func (v NullableApiExtensionConfigureResponse) Get() *ApiExtensionConfigureResponse { - return v.value -} - -func (v *NullableApiExtensionConfigureResponse) Set(val *ApiExtensionConfigureResponse) { - v.value = val - v.isSet = true -} - -func (v NullableApiExtensionConfigureResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableApiExtensionConfigureResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableApiExtensionConfigureResponse(val *ApiExtensionConfigureResponse) *NullableApiExtensionConfigureResponse { - return &NullableApiExtensionConfigureResponse{value: val, isSet: true} -} - -func (v NullableApiExtensionConfigureResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableApiExtensionConfigureResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_api_extension_delete_response.go b/services/postgresflex/v1api/model_api_extension_delete_response.go deleted file mode 100644 index d72f77cb77..0000000000 --- a/services/postgresflex/v1api/model_api_extension_delete_response.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the ApiExtensionDeleteResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ApiExtensionDeleteResponse{} - -// ApiExtensionDeleteResponse struct for ApiExtensionDeleteResponse -type ApiExtensionDeleteResponse struct { - IsSucceded *bool `json:"isSucceded,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ApiExtensionDeleteResponse ApiExtensionDeleteResponse - -// NewApiExtensionDeleteResponse instantiates a new ApiExtensionDeleteResponse 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 NewApiExtensionDeleteResponse() *ApiExtensionDeleteResponse { - this := ApiExtensionDeleteResponse{} - return &this -} - -// NewApiExtensionDeleteResponseWithDefaults instantiates a new ApiExtensionDeleteResponse 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 NewApiExtensionDeleteResponseWithDefaults() *ApiExtensionDeleteResponse { - this := ApiExtensionDeleteResponse{} - return &this -} - -// GetIsSucceded returns the IsSucceded field value if set, zero value otherwise. -func (o *ApiExtensionDeleteResponse) GetIsSucceded() bool { - if o == nil || IsNil(o.IsSucceded) { - var ret bool - return ret - } - return *o.IsSucceded -} - -// GetIsSuccededOk returns a tuple with the IsSucceded field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ApiExtensionDeleteResponse) GetIsSuccededOk() (*bool, bool) { - if o == nil || IsNil(o.IsSucceded) { - return nil, false - } - return o.IsSucceded, true -} - -// HasIsSucceded returns a boolean if a field has been set. -func (o *ApiExtensionDeleteResponse) HasIsSucceded() bool { - if o != nil && !IsNil(o.IsSucceded) { - return true - } - - return false -} - -// SetIsSucceded gets a reference to the given bool and assigns it to the IsSucceded field. -func (o *ApiExtensionDeleteResponse) SetIsSucceded(v bool) { - o.IsSucceded = &v -} - -func (o ApiExtensionDeleteResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ApiExtensionDeleteResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.IsSucceded) { - toSerialize["isSucceded"] = o.IsSucceded - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ApiExtensionDeleteResponse) UnmarshalJSON(data []byte) (err error) { - varApiExtensionDeleteResponse := _ApiExtensionDeleteResponse{} - - err = json.Unmarshal(data, &varApiExtensionDeleteResponse) - - if err != nil { - return err - } - - *o = ApiExtensionDeleteResponse(varApiExtensionDeleteResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "isSucceded") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableApiExtensionDeleteResponse struct { - value *ApiExtensionDeleteResponse - isSet bool -} - -func (v NullableApiExtensionDeleteResponse) Get() *ApiExtensionDeleteResponse { - return v.value -} - -func (v *NullableApiExtensionDeleteResponse) Set(val *ApiExtensionDeleteResponse) { - v.value = val - v.isSet = true -} - -func (v NullableApiExtensionDeleteResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableApiExtensionDeleteResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableApiExtensionDeleteResponse(val *ApiExtensionDeleteResponse) *NullableApiExtensionDeleteResponse { - return &NullableApiExtensionDeleteResponse{value: val, isSet: true} -} - -func (v NullableApiExtensionDeleteResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableApiExtensionDeleteResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_api_extension_list.go b/services/postgresflex/v1api/model_api_extension_list.go deleted file mode 100644 index 95f0222018..0000000000 --- a/services/postgresflex/v1api/model_api_extension_list.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the ApiExtensionList type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ApiExtensionList{} - -// ApiExtensionList struct for ApiExtensionList -type ApiExtensionList struct { - ID *int32 `json:"ID,omitempty"` - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ApiExtensionList ApiExtensionList - -// NewApiExtensionList instantiates a new ApiExtensionList 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 NewApiExtensionList() *ApiExtensionList { - this := ApiExtensionList{} - return &this -} - -// NewApiExtensionListWithDefaults instantiates a new ApiExtensionList 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 NewApiExtensionListWithDefaults() *ApiExtensionList { - this := ApiExtensionList{} - return &this -} - -// GetID returns the ID field value if set, zero value otherwise. -func (o *ApiExtensionList) GetID() int32 { - if o == nil || IsNil(o.ID) { - var ret int32 - return ret - } - return *o.ID -} - -// GetIDOk returns a tuple with the ID field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ApiExtensionList) GetIDOk() (*int32, bool) { - if o == nil || IsNil(o.ID) { - return nil, false - } - return o.ID, true -} - -// HasID returns a boolean if a field has been set. -func (o *ApiExtensionList) HasID() bool { - if o != nil && !IsNil(o.ID) { - return true - } - - return false -} - -// SetID gets a reference to the given int32 and assigns it to the ID field. -func (o *ApiExtensionList) SetID(v int32) { - o.ID = &v -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *ApiExtensionList) GetDescription() string { - if o == nil || IsNil(o.Description) { - var ret string - return ret - } - return *o.Description -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ApiExtensionList) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *ApiExtensionList) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *ApiExtensionList) SetDescription(v string) { - o.Description = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *ApiExtensionList) 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 *ApiExtensionList) 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 *ApiExtensionList) 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 *ApiExtensionList) SetName(v string) { - o.Name = &v -} - -func (o ApiExtensionList) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ApiExtensionList) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.ID) { - toSerialize["ID"] = o.ID - } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ApiExtensionList) UnmarshalJSON(data []byte) (err error) { - varApiExtensionList := _ApiExtensionList{} - - err = json.Unmarshal(data, &varApiExtensionList) - - if err != nil { - return err - } - - *o = ApiExtensionList(varApiExtensionList) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "ID") - delete(additionalProperties, "description") - delete(additionalProperties, "name") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableApiExtensionList struct { - value *ApiExtensionList - isSet bool -} - -func (v NullableApiExtensionList) Get() *ApiExtensionList { - return v.value -} - -func (v *NullableApiExtensionList) Set(val *ApiExtensionList) { - v.value = val - v.isSet = true -} - -func (v NullableApiExtensionList) IsSet() bool { - return v.isSet -} - -func (v *NullableApiExtensionList) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableApiExtensionList(val *ApiExtensionList) *NullableApiExtensionList { - return &NullableApiExtensionList{value: val, isSet: true} -} - -func (v NullableApiExtensionList) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableApiExtensionList) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_api_extension_load_response.go b/services/postgresflex/v1api/model_api_extension_load_response.go deleted file mode 100644 index 4725eecf34..0000000000 --- a/services/postgresflex/v1api/model_api_extension_load_response.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the ApiExtensionLoadResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ApiExtensionLoadResponse{} - -// ApiExtensionLoadResponse struct for ApiExtensionLoadResponse -type ApiExtensionLoadResponse struct { - Extension *ApiExtensionList `json:"extension,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ApiExtensionLoadResponse ApiExtensionLoadResponse - -// 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 -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 -func NewApiExtensionLoadResponseWithDefaults() *ApiExtensionLoadResponse { - this := ApiExtensionLoadResponse{} - return &this -} - -// GetExtension returns the Extension field value if set, zero value otherwise. -func (o *ApiExtensionLoadResponse) GetExtension() ApiExtensionList { - if o == nil || IsNil(o.Extension) { - var ret ApiExtensionList - return ret - } - return *o.Extension -} - -// GetExtensionOk returns a tuple with the Extension field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ApiExtensionLoadResponse) GetExtensionOk() (*ApiExtensionList, bool) { - if o == nil || IsNil(o.Extension) { - return nil, false - } - return o.Extension, true -} - -// HasExtension returns a boolean if a field has been set. -func (o *ApiExtensionLoadResponse) HasExtension() bool { - if o != nil && !IsNil(o.Extension) { - return true - } - - return false -} - -// SetExtension gets a reference to the given ApiExtensionList and assigns it to the Extension field. -func (o *ApiExtensionLoadResponse) SetExtension(v ApiExtensionList) { - o.Extension = &v -} - -func (o ApiExtensionLoadResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ApiExtensionLoadResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Extension) { - toSerialize["extension"] = o.Extension - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ApiExtensionLoadResponse) UnmarshalJSON(data []byte) (err error) { - varApiExtensionLoadResponse := _ApiExtensionLoadResponse{} - - err = json.Unmarshal(data, &varApiExtensionLoadResponse) - - if err != nil { - return err - } - - *o = ApiExtensionLoadResponse(varApiExtensionLoadResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "extension") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableApiExtensionLoadResponse struct { - value *ApiExtensionLoadResponse - isSet bool -} - -func (v NullableApiExtensionLoadResponse) Get() *ApiExtensionLoadResponse { - return v.value -} - -func (v *NullableApiExtensionLoadResponse) Set(val *ApiExtensionLoadResponse) { - v.value = val - v.isSet = true -} - -func (v NullableApiExtensionLoadResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableApiExtensionLoadResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableApiExtensionLoadResponse(val *ApiExtensionLoadResponse) *NullableApiExtensionLoadResponse { - return &NullableApiExtensionLoadResponse{value: val, isSet: true} -} - -func (v NullableApiExtensionLoadResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableApiExtensionLoadResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_api_install_response.go b/services/postgresflex/v1api/model_api_install_response.go deleted file mode 100644 index dfadc1dcba..0000000000 --- a/services/postgresflex/v1api/model_api_install_response.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the ApiInstallResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ApiInstallResponse{} - -// ApiInstallResponse struct for ApiInstallResponse -type ApiInstallResponse struct { - Extension *ApiExtensionList `json:"extension,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ApiInstallResponse ApiInstallResponse - -// NewApiInstallResponse instantiates a new ApiInstallResponse 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 NewApiInstallResponse() *ApiInstallResponse { - this := ApiInstallResponse{} - return &this -} - -// NewApiInstallResponseWithDefaults instantiates a new ApiInstallResponse 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 NewApiInstallResponseWithDefaults() *ApiInstallResponse { - this := ApiInstallResponse{} - return &this -} - -// GetExtension returns the Extension field value if set, zero value otherwise. -func (o *ApiInstallResponse) GetExtension() ApiExtensionList { - if o == nil || IsNil(o.Extension) { - var ret ApiExtensionList - return ret - } - return *o.Extension -} - -// GetExtensionOk returns a tuple with the Extension field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ApiInstallResponse) GetExtensionOk() (*ApiExtensionList, bool) { - if o == nil || IsNil(o.Extension) { - return nil, false - } - return o.Extension, true -} - -// HasExtension returns a boolean if a field has been set. -func (o *ApiInstallResponse) HasExtension() bool { - if o != nil && !IsNil(o.Extension) { - return true - } - - return false -} - -// SetExtension gets a reference to the given ApiExtensionList and assigns it to the Extension field. -func (o *ApiInstallResponse) SetExtension(v ApiExtensionList) { - o.Extension = &v -} - -func (o ApiInstallResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ApiInstallResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Extension) { - toSerialize["extension"] = o.Extension - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ApiInstallResponse) UnmarshalJSON(data []byte) (err error) { - varApiInstallResponse := _ApiInstallResponse{} - - err = json.Unmarshal(data, &varApiInstallResponse) - - if err != nil { - return err - } - - *o = ApiInstallResponse(varApiInstallResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "extension") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableApiInstallResponse struct { - value *ApiInstallResponse - isSet bool -} - -func (v NullableApiInstallResponse) Get() *ApiInstallResponse { - return v.value -} - -func (v *NullableApiInstallResponse) Set(val *ApiInstallResponse) { - v.value = val - v.isSet = true -} - -func (v NullableApiInstallResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableApiInstallResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableApiInstallResponse(val *ApiInstallResponse) *NullableApiInstallResponse { - return &NullableApiInstallResponse{value: val, isSet: true} -} - -func (v NullableApiInstallResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableApiInstallResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_api_installed_list_response.go b/services/postgresflex/v1api/model_api_installed_list_response.go deleted file mode 100644 index 7e1e0d571b..0000000000 --- a/services/postgresflex/v1api/model_api_installed_list_response.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the ApiInstalledListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ApiInstalledListResponse{} - -// ApiInstalledListResponse struct for ApiInstalledListResponse -type ApiInstalledListResponse struct { - Installed []ApiExtensionList `json:"installed,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ApiInstalledListResponse ApiInstalledListResponse - -// 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 -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 -func NewApiInstalledListResponseWithDefaults() *ApiInstalledListResponse { - this := ApiInstalledListResponse{} - return &this -} - -// GetInstalled returns the Installed field value if set, zero value otherwise. -func (o *ApiInstalledListResponse) GetInstalled() []ApiExtensionList { - if o == nil || IsNil(o.Installed) { - var ret []ApiExtensionList - return ret - } - return o.Installed -} - -// GetInstalledOk returns a tuple with the Installed field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ApiInstalledListResponse) GetInstalledOk() ([]ApiExtensionList, bool) { - if o == nil || IsNil(o.Installed) { - return nil, false - } - return o.Installed, true -} - -// HasInstalled returns a boolean if a field has been set. -func (o *ApiInstalledListResponse) HasInstalled() bool { - if o != nil && !IsNil(o.Installed) { - return true - } - - return false -} - -// SetInstalled gets a reference to the given []ApiExtensionList and assigns it to the Installed field. -func (o *ApiInstalledListResponse) SetInstalled(v []ApiExtensionList) { - o.Installed = v -} - -func (o ApiInstalledListResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ApiInstalledListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Installed) { - toSerialize["installed"] = o.Installed - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ApiInstalledListResponse) UnmarshalJSON(data []byte) (err error) { - varApiInstalledListResponse := _ApiInstalledListResponse{} - - err = json.Unmarshal(data, &varApiInstalledListResponse) - - if err != nil { - return err - } - - *o = ApiInstalledListResponse(varApiInstalledListResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "installed") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableApiInstalledListResponse struct { - value *ApiInstalledListResponse - isSet bool -} - -func (v NullableApiInstalledListResponse) Get() *ApiInstalledListResponse { - return v.value -} - -func (v *NullableApiInstalledListResponse) Set(val *ApiInstalledListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableApiInstalledListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableApiInstalledListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableApiInstalledListResponse(val *ApiInstalledListResponse) *NullableApiInstalledListResponse { - return &NullableApiInstalledListResponse{value: val, isSet: true} -} - -func (v NullableApiInstalledListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableApiInstalledListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_backup.go b/services/postgresflex/v1api/model_backup.go deleted file mode 100644 index c6698fa104..0000000000 --- a/services/postgresflex/v1api/model_backup.go +++ /dev/null @@ -1,413 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the Backup type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Backup{} - -// Backup struct for Backup -type Backup struct { - EndTime *string `json:"endTime,omitempty"` - Error *string `json:"error,omitempty"` - Id *string `json:"id,omitempty"` - Labels []string `json:"labels,omitempty"` - Name *string `json:"name,omitempty"` - Options *map[string]string `json:"options,omitempty"` - Size *int32 `json:"size,omitempty"` - StartTime *string `json:"startTime,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _Backup Backup - -// NewBackup instantiates a new Backup 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 NewBackup() *Backup { - this := Backup{} - return &this -} - -// NewBackupWithDefaults instantiates a new Backup 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 NewBackupWithDefaults() *Backup { - this := Backup{} - return &this -} - -// GetEndTime returns the EndTime field value if set, zero value otherwise. -func (o *Backup) GetEndTime() string { - if o == nil || IsNil(o.EndTime) { - var ret string - return ret - } - return *o.EndTime -} - -// GetEndTimeOk returns a tuple with the EndTime field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Backup) GetEndTimeOk() (*string, bool) { - if o == nil || IsNil(o.EndTime) { - return nil, false - } - return o.EndTime, true -} - -// HasEndTime returns a boolean if a field has been set. -func (o *Backup) HasEndTime() bool { - if o != nil && !IsNil(o.EndTime) { - return true - } - - return false -} - -// SetEndTime gets a reference to the given string and assigns it to the EndTime field. -func (o *Backup) SetEndTime(v string) { - o.EndTime = &v -} - -// GetError returns the Error field value if set, zero value otherwise. -func (o *Backup) GetError() string { - if o == nil || IsNil(o.Error) { - var ret string - return ret - } - return *o.Error -} - -// GetErrorOk returns a tuple with the Error field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Backup) GetErrorOk() (*string, bool) { - if o == nil || IsNil(o.Error) { - return nil, false - } - return o.Error, true -} - -// HasError returns a boolean if a field has been set. -func (o *Backup) HasError() bool { - if o != nil && !IsNil(o.Error) { - return true - } - - return false -} - -// SetError gets a reference to the given string and assigns it to the Error field. -func (o *Backup) SetError(v string) { - o.Error = &v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *Backup) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Backup) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *Backup) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *Backup) SetId(v string) { - o.Id = &v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *Backup) GetLabels() []string { - if o == nil || IsNil(o.Labels) { - var ret []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 *Backup) GetLabelsOk() ([]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 *Backup) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given []string and assigns it to the Labels field. -func (o *Backup) SetLabels(v []string) { - o.Labels = v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *Backup) 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 *Backup) 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 *Backup) 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 *Backup) SetName(v string) { - o.Name = &v -} - -// GetOptions returns the Options field value if set, zero value otherwise. -func (o *Backup) GetOptions() map[string]string { - if o == nil || IsNil(o.Options) { - var ret map[string]string - return ret - } - return *o.Options -} - -// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Backup) GetOptionsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Options) { - return nil, false - } - return o.Options, true -} - -// HasOptions returns a boolean if a field has been set. -func (o *Backup) HasOptions() bool { - if o != nil && !IsNil(o.Options) { - return true - } - - return false -} - -// SetOptions gets a reference to the given map[string]string and assigns it to the Options field. -func (o *Backup) SetOptions(v map[string]string) { - o.Options = &v -} - -// GetSize returns the Size field value if set, zero value otherwise. -func (o *Backup) GetSize() int32 { - if o == nil || IsNil(o.Size) { - var ret int32 - 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 *Backup) GetSizeOk() (*int32, 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 *Backup) HasSize() bool { - if o != nil && !IsNil(o.Size) { - return true - } - - return false -} - -// SetSize gets a reference to the given int32 and assigns it to the Size field. -func (o *Backup) SetSize(v int32) { - o.Size = &v -} - -// GetStartTime returns the StartTime field value if set, zero value otherwise. -func (o *Backup) GetStartTime() string { - if o == nil || IsNil(o.StartTime) { - var ret string - return ret - } - return *o.StartTime -} - -// GetStartTimeOk returns a tuple with the StartTime field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Backup) GetStartTimeOk() (*string, bool) { - if o == nil || IsNil(o.StartTime) { - return nil, false - } - return o.StartTime, true -} - -// HasStartTime returns a boolean if a field has been set. -func (o *Backup) HasStartTime() bool { - if o != nil && !IsNil(o.StartTime) { - return true - } - - return false -} - -// SetStartTime gets a reference to the given string and assigns it to the StartTime field. -func (o *Backup) SetStartTime(v string) { - o.StartTime = &v -} - -func (o Backup) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Backup) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.EndTime) { - toSerialize["endTime"] = o.EndTime - } - if !IsNil(o.Error) { - toSerialize["error"] = o.Error - } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.Options) { - toSerialize["options"] = o.Options - } - if !IsNil(o.Size) { - toSerialize["size"] = o.Size - } - if !IsNil(o.StartTime) { - toSerialize["startTime"] = o.StartTime - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *Backup) UnmarshalJSON(data []byte) (err error) { - varBackup := _Backup{} - - err = json.Unmarshal(data, &varBackup) - - if err != nil { - return err - } - - *o = Backup(varBackup) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "endTime") - delete(additionalProperties, "error") - delete(additionalProperties, "id") - delete(additionalProperties, "labels") - delete(additionalProperties, "name") - delete(additionalProperties, "options") - delete(additionalProperties, "size") - delete(additionalProperties, "startTime") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableBackup struct { - value *Backup - isSet bool -} - -func (v NullableBackup) Get() *Backup { - return v.value -} - -func (v *NullableBackup) Set(val *Backup) { - v.value = val - v.isSet = true -} - -func (v NullableBackup) IsSet() bool { - return v.isSet -} - -func (v *NullableBackup) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBackup(val *Backup) *NullableBackup { - return &NullableBackup{value: val, isSet: true} -} - -func (v NullableBackup) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBackup) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_clone_instance_payload.go b/services/postgresflex/v1api/model_clone_instance_payload.go deleted file mode 100644 index 46adab9dd1..0000000000 --- a/services/postgresflex/v1api/model_clone_instance_payload.go +++ /dev/null @@ -1,229 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the CloneInstancePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CloneInstancePayload{} - -// CloneInstancePayload struct for CloneInstancePayload -type CloneInstancePayload struct { - Class *string `json:"class,omitempty"` - Size *int32 `json:"size,omitempty"` - // The timestamp should be specified in UTC time following the format provided in the example. - Timestamp *string `json:"timestamp,omitempty"` - 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() *CloneInstancePayload { - this := CloneInstancePayload{} - 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 -} - -// GetClass returns the Class field value if set, zero value otherwise. -func (o *CloneInstancePayload) 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 *CloneInstancePayload) 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 *CloneInstancePayload) 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 *CloneInstancePayload) SetClass(v string) { - o.Class = &v -} - -// GetSize returns the Size field value if set, zero value otherwise. -func (o *CloneInstancePayload) GetSize() int32 { - if o == nil || IsNil(o.Size) { - var ret int32 - 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 *CloneInstancePayload) GetSizeOk() (*int32, 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 *CloneInstancePayload) HasSize() bool { - if o != nil && !IsNil(o.Size) { - return true - } - - return false -} - -// SetSize gets a reference to the given int32 and assigns it to the Size field. -func (o *CloneInstancePayload) SetSize(v int32) { - o.Size = &v -} - -// GetTimestamp returns the Timestamp field value if set, zero value otherwise. -func (o *CloneInstancePayload) GetTimestamp() string { - if o == nil || IsNil(o.Timestamp) { - var ret string - return ret - } - return *o.Timestamp -} - -// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CloneInstancePayload) GetTimestampOk() (*string, bool) { - if o == nil || IsNil(o.Timestamp) { - return nil, false - } - return o.Timestamp, true -} - -// HasTimestamp returns a boolean if a field has been set. -func (o *CloneInstancePayload) HasTimestamp() bool { - if o != nil && !IsNil(o.Timestamp) { - return true - } - - return false -} - -// SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. -func (o *CloneInstancePayload) SetTimestamp(v string) { - o.Timestamp = &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{}{} - if !IsNil(o.Class) { - toSerialize["class"] = o.Class - } - if !IsNil(o.Size) { - toSerialize["size"] = o.Size - } - if !IsNil(o.Timestamp) { - toSerialize["timestamp"] = o.Timestamp - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *CloneInstancePayload) UnmarshalJSON(data []byte) (err error) { - 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, "class") - delete(additionalProperties, "size") - delete(additionalProperties, "timestamp") - 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/v1api/model_clone_instance_response.go b/services/postgresflex/v1api/model_clone_instance_response.go deleted file mode 100644 index dbca412113..0000000000 --- a/services/postgresflex/v1api/model_clone_instance_response.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the CloneInstanceResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CloneInstanceResponse{} - -// CloneInstanceResponse struct for CloneInstanceResponse -type CloneInstanceResponse struct { - InstanceId *string `json:"instanceId,omitempty"` - 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() *CloneInstanceResponse { - this := CloneInstanceResponse{} - 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 -} - -// GetInstanceId returns the InstanceId field value if set, zero value otherwise. -func (o *CloneInstanceResponse) GetInstanceId() string { - if o == nil || IsNil(o.InstanceId) { - var ret string - return ret - } - return *o.InstanceId -} - -// GetInstanceIdOk returns a tuple with the InstanceId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CloneInstanceResponse) GetInstanceIdOk() (*string, bool) { - if o == nil || IsNil(o.InstanceId) { - return nil, false - } - return o.InstanceId, true -} - -// HasInstanceId returns a boolean if a field has been set. -func (o *CloneInstanceResponse) HasInstanceId() bool { - if o != nil && !IsNil(o.InstanceId) { - return true - } - - return false -} - -// SetInstanceId gets a reference to the given string and assigns it to the InstanceId field. -func (o *CloneInstanceResponse) SetInstanceId(v string) { - o.InstanceId = &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{}{} - if !IsNil(o.InstanceId) { - toSerialize["instanceId"] = o.InstanceId - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *CloneInstanceResponse) UnmarshalJSON(data []byte) (err error) { - 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, "instanceId") - 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/v1api/model_create_database_payload.go b/services/postgresflex/v1api/model_create_database_payload.go deleted file mode 100644 index d0307856fe..0000000000 --- a/services/postgresflex/v1api/model_create_database_payload.go +++ /dev/null @@ -1,192 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the CreateDatabasePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateDatabasePayload{} - -// CreateDatabasePayload struct for CreateDatabasePayload -type CreateDatabasePayload struct { - Name *string `json:"name,omitempty"` - // Database specific options - Options *map[string]string `json:"options,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() *CreateDatabasePayload { - this := CreateDatabasePayload{} - 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 if set, zero value otherwise. -func (o *CreateDatabasePayload) 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 *CreateDatabasePayload) 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 *CreateDatabasePayload) 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 *CreateDatabasePayload) SetName(v string) { - o.Name = &v -} - -// GetOptions returns the Options field value if set, zero value otherwise. -func (o *CreateDatabasePayload) GetOptions() map[string]string { - if o == nil || IsNil(o.Options) { - var ret map[string]string - return ret - } - return *o.Options -} - -// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDatabasePayload) GetOptionsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Options) { - return nil, false - } - return o.Options, true -} - -// HasOptions returns a boolean if a field has been set. -func (o *CreateDatabasePayload) HasOptions() bool { - if o != nil && !IsNil(o.Options) { - return true - } - - return false -} - -// SetOptions gets a reference to the given map[string]string and assigns it to the Options field. -func (o *CreateDatabasePayload) SetOptions(v map[string]string) { - o.Options = &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{}{} - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.Options) { - toSerialize["options"] = o.Options - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *CreateDatabasePayload) UnmarshalJSON(data []byte) (err error) { - 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, "options") - 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/v1api/model_create_instance_payload.go b/services/postgresflex/v1api/model_create_instance_payload.go deleted file mode 100644 index 877474d7f4..0000000000 --- a/services/postgresflex/v1api/model_create_instance_payload.go +++ /dev/null @@ -1,408 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -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 { - Acl ACL `json:"acl"` - BackupSchedule string `json:"backupSchedule"` - FlavorId string `json:"flavorId"` - // Labels field is not certain/clear - Labels *map[string]string `json:"labels,omitempty"` - Name string `json:"name"` - Options map[string]string `json:"options"` - Replicas int32 `json:"replicas"` - Storage Storage `json:"storage"` - 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(acl ACL, backupSchedule string, flavorId string, name string, options map[string]string, replicas int32, storage Storage, version string) *CreateInstancePayload { - this := CreateInstancePayload{} - this.Acl = acl - this.BackupSchedule = backupSchedule - this.FlavorId = flavorId - this.Name = name - this.Options = options - this.Replicas = replicas - 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 -} - -// GetAcl returns the Acl field value -func (o *CreateInstancePayload) GetAcl() ACL { - if o == nil { - var ret ACL - 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 *CreateInstancePayload) GetAclOk() (*ACL, bool) { - if o == nil { - return nil, false - } - return &o.Acl, true -} - -// SetAcl sets field value -func (o *CreateInstancePayload) SetAcl(v ACL) { - o.Acl = v -} - -// 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 -} - -// 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 -} - -// GetOptions returns the Options field value -func (o *CreateInstancePayload) GetOptions() map[string]string { - if o == nil { - var ret map[string]string - return ret - } - - return o.Options -} - -// GetOptionsOk returns a tuple with the Options field value -// and a boolean to check if the value has been set. -func (o *CreateInstancePayload) GetOptionsOk() (*map[string]string, bool) { - if o == nil { - return nil, false - } - return &o.Options, true -} - -// SetOptions sets field value -func (o *CreateInstancePayload) SetOptions(v map[string]string) { - o.Options = v -} - -// GetReplicas returns the Replicas field value -func (o *CreateInstancePayload) GetReplicas() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Replicas -} - -// GetReplicasOk returns a tuple with the Replicas field value -// and a boolean to check if the value has been set. -func (o *CreateInstancePayload) GetReplicasOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Replicas, true -} - -// SetReplicas sets field value -func (o *CreateInstancePayload) SetReplicas(v int32) { - o.Replicas = v -} - -// GetStorage returns the Storage field value -func (o *CreateInstancePayload) 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 *CreateInstancePayload) GetStorageOk() (*Storage, bool) { - if o == nil { - return nil, false - } - return &o.Storage, true -} - -// SetStorage sets field value -func (o *CreateInstancePayload) SetStorage(v Storage) { - 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["acl"] = o.Acl - toSerialize["backupSchedule"] = o.BackupSchedule - toSerialize["flavorId"] = o.FlavorId - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - toSerialize["name"] = o.Name - toSerialize["options"] = o.Options - toSerialize["replicas"] = o.Replicas - 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{ - "acl", - "backupSchedule", - "flavorId", - "name", - "options", - "replicas", - "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, "acl") - delete(additionalProperties, "backupSchedule") - delete(additionalProperties, "flavorId") - delete(additionalProperties, "labels") - delete(additionalProperties, "name") - delete(additionalProperties, "options") - delete(additionalProperties, "replicas") - 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/v1api/model_create_instance_response.go b/services/postgresflex/v1api/model_create_instance_response.go deleted file mode 100644 index 9ddded44bd..0000000000 --- a/services/postgresflex/v1api/model_create_instance_response.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the CreateInstanceResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateInstanceResponse{} - -// CreateInstanceResponse struct for CreateInstanceResponse -type CreateInstanceResponse struct { - Id *string `json:"id,omitempty"` - 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() *CreateInstanceResponse { - this := CreateInstanceResponse{} - 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 if set, zero value otherwise. -func (o *CreateInstanceResponse) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateInstanceResponse) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *CreateInstanceResponse) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -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{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *CreateInstanceResponse) UnmarshalJSON(data []byte) (err error) { - 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/v1api/model_create_user_payload.go b/services/postgresflex/v1api/model_create_user_payload.go deleted file mode 100644 index 76e5edcaba..0000000000 --- a/services/postgresflex/v1api/model_create_user_payload.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the CreateUserPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateUserPayload{} - -// CreateUserPayload struct for CreateUserPayload -type CreateUserPayload struct { - Roles []string `json:"roles,omitempty"` - Username *string `json:"username,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() *CreateUserPayload { - this := CreateUserPayload{} - 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 -} - -// 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 -} - -// GetUsername returns the Username field value if set, zero value otherwise. -func (o *CreateUserPayload) GetUsername() string { - if o == nil || IsNil(o.Username) { - var ret string - return ret - } - return *o.Username -} - -// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateUserPayload) GetUsernameOk() (*string, bool) { - if o == nil || IsNil(o.Username) { - return nil, false - } - return o.Username, true -} - -// HasUsername returns a boolean if a field has been set. -func (o *CreateUserPayload) HasUsername() bool { - if o != nil && !IsNil(o.Username) { - return true - } - - return false -} - -// SetUsername gets a reference to the given string and assigns it to the Username field. -func (o *CreateUserPayload) SetUsername(v string) { - o.Username = &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{}{} - if !IsNil(o.Roles) { - toSerialize["roles"] = o.Roles - } - if !IsNil(o.Username) { - toSerialize["username"] = o.Username - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *CreateUserPayload) UnmarshalJSON(data []byte) (err error) { - 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, "roles") - delete(additionalProperties, "username") - 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/v1api/model_create_user_response.go b/services/postgresflex/v1api/model_create_user_response.go deleted file mode 100644 index 688f551b2c..0000000000 --- a/services/postgresflex/v1api/model_create_user_response.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the CreateUserResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateUserResponse{} - -// CreateUserResponse struct for CreateUserResponse -type CreateUserResponse struct { - Item *User `json:"item,omitempty"` - 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() *CreateUserResponse { - this := CreateUserResponse{} - 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 -} - -// GetItem returns the Item field value if set, zero value otherwise. -func (o *CreateUserResponse) GetItem() User { - if o == nil || IsNil(o.Item) { - var ret User - return ret - } - return *o.Item -} - -// GetItemOk returns a tuple with the Item field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateUserResponse) GetItemOk() (*User, bool) { - if o == nil || IsNil(o.Item) { - return nil, false - } - return o.Item, true -} - -// HasItem returns a boolean if a field has been set. -func (o *CreateUserResponse) HasItem() bool { - if o != nil && !IsNil(o.Item) { - return true - } - - return false -} - -// SetItem gets a reference to the given User and assigns it to the Item field. -func (o *CreateUserResponse) SetItem(v User) { - o.Item = &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{}{} - if !IsNil(o.Item) { - toSerialize["item"] = o.Item - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *CreateUserResponse) UnmarshalJSON(data []byte) (err error) { - 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, "item") - 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/v1api/model_error.go b/services/postgresflex/v1api/model_error.go deleted file mode 100644 index e8d2c6b88d..0000000000 --- a/services/postgresflex/v1api/model_error.go +++ /dev/null @@ -1,265 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the Error type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Error{} - -// Error struct for Error -type Error struct { - Code *int32 `json:"code,omitempty"` - Fields *map[string][]string `json:"fields,omitempty"` - Message *string `json:"message,omitempty"` - Type *string `json:"type,omitempty"` - 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() *Error { - this := Error{} - 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 if set, zero value otherwise. -func (o *Error) GetCode() int32 { - if o == nil || IsNil(o.Code) { - var ret int32 - return ret - } - return *o.Code -} - -// GetCodeOk returns a tuple with the Code field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Error) GetCodeOk() (*int32, bool) { - if o == nil || IsNil(o.Code) { - return nil, false - } - return o.Code, true -} - -// HasCode returns a boolean if a field has been set. -func (o *Error) HasCode() bool { - if o != nil && !IsNil(o.Code) { - return true - } - - return false -} - -// SetCode gets a reference to the given int32 and assigns it to the Code field. -func (o *Error) SetCode(v int32) { - o.Code = &v -} - -// GetFields returns the Fields field value if set, zero value otherwise. -func (o *Error) GetFields() map[string][]string { - if o == nil || IsNil(o.Fields) { - var ret map[string][]string - return ret - } - return *o.Fields -} - -// GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Error) GetFieldsOk() (*map[string][]string, bool) { - if o == nil || IsNil(o.Fields) { - return nil, false - } - return o.Fields, true -} - -// HasFields returns a boolean if a field has been set. -func (o *Error) HasFields() bool { - if o != nil && !IsNil(o.Fields) { - return true - } - - return false -} - -// SetFields gets a reference to the given map[string][]string and assigns it to the Fields field. -func (o *Error) SetFields(v map[string][]string) { - o.Fields = &v -} - -// GetMessage returns the Message field value if set, zero value otherwise. -func (o *Error) GetMessage() string { - if o == nil || IsNil(o.Message) { - var ret string - return ret - } - return *o.Message -} - -// GetMessageOk returns a tuple with the Message field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Error) GetMessageOk() (*string, bool) { - if o == nil || IsNil(o.Message) { - return nil, false - } - return o.Message, true -} - -// HasMessage returns a boolean if a field has been set. -func (o *Error) HasMessage() bool { - if o != nil && !IsNil(o.Message) { - return true - } - - return false -} - -// SetMessage gets a reference to the given string and assigns it to the Message field. -func (o *Error) SetMessage(v string) { - o.Message = &v -} - -// GetType returns the Type field value if set, zero value otherwise. -func (o *Error) GetType() string { - if o == nil || IsNil(o.Type) { - var ret string - return ret - } - return *o.Type -} - -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Error) GetTypeOk() (*string, bool) { - if o == nil || IsNil(o.Type) { - return nil, false - } - return o.Type, true -} - -// HasType returns a boolean if a field has been set. -func (o *Error) HasType() bool { - if o != nil && !IsNil(o.Type) { - return true - } - - return false -} - -// SetType gets a reference to the given string and assigns it to the Type field. -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{}{} - if !IsNil(o.Code) { - toSerialize["code"] = o.Code - } - if !IsNil(o.Fields) { - toSerialize["fields"] = o.Fields - } - if !IsNil(o.Message) { - toSerialize["message"] = o.Message - } - if !IsNil(o.Type) { - toSerialize["type"] = o.Type - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *Error) UnmarshalJSON(data []byte) (err error) { - 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, "fields") - delete(additionalProperties, "message") - 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/v1api/model_extensions_configuration.go b/services/postgresflex/v1api/model_extensions_configuration.go deleted file mode 100644 index 86d93d0f07..0000000000 --- a/services/postgresflex/v1api/model_extensions_configuration.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the ExtensionsConfiguration type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ExtensionsConfiguration{} - -// ExtensionsConfiguration struct for ExtensionsConfiguration -type ExtensionsConfiguration struct { - Name *string `json:"name,omitempty"` - Setting *string `json:"setting,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ExtensionsConfiguration ExtensionsConfiguration - -// NewExtensionsConfiguration instantiates a new ExtensionsConfiguration 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 NewExtensionsConfiguration() *ExtensionsConfiguration { - this := ExtensionsConfiguration{} - return &this -} - -// NewExtensionsConfigurationWithDefaults instantiates a new ExtensionsConfiguration 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 NewExtensionsConfigurationWithDefaults() *ExtensionsConfiguration { - this := ExtensionsConfiguration{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *ExtensionsConfiguration) 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 *ExtensionsConfiguration) 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 *ExtensionsConfiguration) 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 *ExtensionsConfiguration) SetName(v string) { - o.Name = &v -} - -// GetSetting returns the Setting field value if set, zero value otherwise. -func (o *ExtensionsConfiguration) GetSetting() string { - if o == nil || IsNil(o.Setting) { - var ret string - return ret - } - return *o.Setting -} - -// GetSettingOk returns a tuple with the Setting field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ExtensionsConfiguration) GetSettingOk() (*string, bool) { - if o == nil || IsNil(o.Setting) { - return nil, false - } - return o.Setting, true -} - -// HasSetting returns a boolean if a field has been set. -func (o *ExtensionsConfiguration) HasSetting() bool { - if o != nil && !IsNil(o.Setting) { - return true - } - - return false -} - -// SetSetting gets a reference to the given string and assigns it to the Setting field. -func (o *ExtensionsConfiguration) SetSetting(v string) { - o.Setting = &v -} - -func (o ExtensionsConfiguration) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ExtensionsConfiguration) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.Setting) { - toSerialize["setting"] = o.Setting - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ExtensionsConfiguration) UnmarshalJSON(data []byte) (err error) { - varExtensionsConfiguration := _ExtensionsConfiguration{} - - err = json.Unmarshal(data, &varExtensionsConfiguration) - - if err != nil { - return err - } - - *o = ExtensionsConfiguration(varExtensionsConfiguration) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "name") - delete(additionalProperties, "setting") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableExtensionsConfiguration struct { - value *ExtensionsConfiguration - isSet bool -} - -func (v NullableExtensionsConfiguration) Get() *ExtensionsConfiguration { - return v.value -} - -func (v *NullableExtensionsConfiguration) Set(val *ExtensionsConfiguration) { - v.value = val - v.isSet = true -} - -func (v NullableExtensionsConfiguration) IsSet() bool { - return v.isSet -} - -func (v *NullableExtensionsConfiguration) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableExtensionsConfiguration(val *ExtensionsConfiguration) *NullableExtensionsConfiguration { - return &NullableExtensionsConfiguration{value: val, isSet: true} -} - -func (v NullableExtensionsConfiguration) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableExtensionsConfiguration) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_extensions_extension_list_response.go b/services/postgresflex/v1api/model_extensions_extension_list_response.go deleted file mode 100644 index 5e48e6ab0f..0000000000 --- a/services/postgresflex/v1api/model_extensions_extension_list_response.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the ExtensionsExtensionListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ExtensionsExtensionListResponse{} - -// ExtensionsExtensionListResponse struct for ExtensionsExtensionListResponse -type ExtensionsExtensionListResponse struct { - List []ApiExtensionList `json:"list,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ExtensionsExtensionListResponse ExtensionsExtensionListResponse - -// NewExtensionsExtensionListResponse instantiates a new ExtensionsExtensionListResponse 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 NewExtensionsExtensionListResponse() *ExtensionsExtensionListResponse { - this := ExtensionsExtensionListResponse{} - return &this -} - -// NewExtensionsExtensionListResponseWithDefaults instantiates a new ExtensionsExtensionListResponse 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 NewExtensionsExtensionListResponseWithDefaults() *ExtensionsExtensionListResponse { - this := ExtensionsExtensionListResponse{} - return &this -} - -// GetList returns the List field value if set, zero value otherwise. -func (o *ExtensionsExtensionListResponse) GetList() []ApiExtensionList { - if o == nil || IsNil(o.List) { - var ret []ApiExtensionList - return ret - } - return o.List -} - -// GetListOk returns a tuple with the List field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ExtensionsExtensionListResponse) GetListOk() ([]ApiExtensionList, bool) { - if o == nil || IsNil(o.List) { - return nil, false - } - return o.List, true -} - -// HasList returns a boolean if a field has been set. -func (o *ExtensionsExtensionListResponse) HasList() bool { - if o != nil && !IsNil(o.List) { - return true - } - - return false -} - -// SetList gets a reference to the given []ApiExtensionList and assigns it to the List field. -func (o *ExtensionsExtensionListResponse) SetList(v []ApiExtensionList) { - o.List = v -} - -func (o ExtensionsExtensionListResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ExtensionsExtensionListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.List) { - toSerialize["list"] = o.List - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ExtensionsExtensionListResponse) UnmarshalJSON(data []byte) (err error) { - varExtensionsExtensionListResponse := _ExtensionsExtensionListResponse{} - - err = json.Unmarshal(data, &varExtensionsExtensionListResponse) - - if err != nil { - return err - } - - *o = ExtensionsExtensionListResponse(varExtensionsExtensionListResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "list") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableExtensionsExtensionListResponse struct { - value *ExtensionsExtensionListResponse - isSet bool -} - -func (v NullableExtensionsExtensionListResponse) Get() *ExtensionsExtensionListResponse { - return v.value -} - -func (v *NullableExtensionsExtensionListResponse) Set(val *ExtensionsExtensionListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableExtensionsExtensionListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableExtensionsExtensionListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableExtensionsExtensionListResponse(val *ExtensionsExtensionListResponse) *NullableExtensionsExtensionListResponse { - return &NullableExtensionsExtensionListResponse{value: val, isSet: true} -} - -func (v NullableExtensionsExtensionListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableExtensionsExtensionListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_extensions_new_config.go b/services/postgresflex/v1api/model_extensions_new_config.go deleted file mode 100644 index 8a6264669e..0000000000 --- a/services/postgresflex/v1api/model_extensions_new_config.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the ExtensionsNewConfig type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ExtensionsNewConfig{} - -// ExtensionsNewConfig struct for ExtensionsNewConfig -type ExtensionsNewConfig struct { - Configuration []ExtensionsConfiguration `json:"configuration,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ExtensionsNewConfig ExtensionsNewConfig - -// 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 -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 -func NewExtensionsNewConfigWithDefaults() *ExtensionsNewConfig { - this := ExtensionsNewConfig{} - return &this -} - -// GetConfiguration returns the Configuration field value if set, zero value otherwise. -func (o *ExtensionsNewConfig) GetConfiguration() []ExtensionsConfiguration { - if o == nil || IsNil(o.Configuration) { - var ret []ExtensionsConfiguration - return ret - } - return o.Configuration -} - -// GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ExtensionsNewConfig) GetConfigurationOk() ([]ExtensionsConfiguration, bool) { - if o == nil || IsNil(o.Configuration) { - return nil, false - } - return o.Configuration, true -} - -// HasConfiguration returns a boolean if a field has been set. -func (o *ExtensionsNewConfig) HasConfiguration() bool { - if o != nil && !IsNil(o.Configuration) { - return true - } - - return false -} - -// SetConfiguration gets a reference to the given []ExtensionsConfiguration and assigns it to the Configuration field. -func (o *ExtensionsNewConfig) SetConfiguration(v []ExtensionsConfiguration) { - o.Configuration = v -} - -func (o ExtensionsNewConfig) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ExtensionsNewConfig) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Configuration) { - toSerialize["configuration"] = o.Configuration - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ExtensionsNewConfig) UnmarshalJSON(data []byte) (err error) { - varExtensionsNewConfig := _ExtensionsNewConfig{} - - err = json.Unmarshal(data, &varExtensionsNewConfig) - - if err != nil { - return err - } - - *o = ExtensionsNewConfig(varExtensionsNewConfig) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "configuration") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableExtensionsNewConfig struct { - value *ExtensionsNewConfig - isSet bool -} - -func (v NullableExtensionsNewConfig) Get() *ExtensionsNewConfig { - return v.value -} - -func (v *NullableExtensionsNewConfig) Set(val *ExtensionsNewConfig) { - v.value = val - v.isSet = true -} - -func (v NullableExtensionsNewConfig) IsSet() bool { - return v.isSet -} - -func (v *NullableExtensionsNewConfig) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableExtensionsNewConfig(val *ExtensionsNewConfig) *NullableExtensionsNewConfig { - return &NullableExtensionsNewConfig{value: val, isSet: true} -} - -func (v NullableExtensionsNewConfig) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableExtensionsNewConfig) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_flavor.go b/services/postgresflex/v1api/model_flavor.go deleted file mode 100644 index 13fba34a42..0000000000 --- a/services/postgresflex/v1api/model_flavor.go +++ /dev/null @@ -1,265 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the Flavor type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Flavor{} - -// Flavor struct for Flavor -type Flavor struct { - Cpu *int32 `json:"cpu,omitempty"` - Description *string `json:"description,omitempty"` - Id *string `json:"id,omitempty"` - Memory *int32 `json:"memory,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _Flavor Flavor - -// NewFlavor instantiates a new Flavor 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 NewFlavor() *Flavor { - this := Flavor{} - return &this -} - -// NewFlavorWithDefaults instantiates a new Flavor 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 NewFlavorWithDefaults() *Flavor { - this := Flavor{} - return &this -} - -// GetCpu returns the Cpu field value if set, zero value otherwise. -func (o *Flavor) GetCpu() int32 { - if o == nil || IsNil(o.Cpu) { - var ret int32 - return ret - } - return *o.Cpu -} - -// GetCpuOk returns a tuple with the Cpu field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Flavor) GetCpuOk() (*int32, bool) { - if o == nil || IsNil(o.Cpu) { - return nil, false - } - return o.Cpu, true -} - -// HasCpu returns a boolean if a field has been set. -func (o *Flavor) HasCpu() bool { - if o != nil && !IsNil(o.Cpu) { - return true - } - - return false -} - -// SetCpu gets a reference to the given int32 and assigns it to the Cpu field. -func (o *Flavor) SetCpu(v int32) { - o.Cpu = &v -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *Flavor) GetDescription() string { - if o == nil || IsNil(o.Description) { - var ret string - return ret - } - return *o.Description -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Flavor) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *Flavor) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *Flavor) SetDescription(v string) { - o.Description = &v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *Flavor) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Flavor) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *Flavor) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *Flavor) SetId(v string) { - o.Id = &v -} - -// GetMemory returns the Memory field value if set, zero value otherwise. -func (o *Flavor) GetMemory() int32 { - if o == nil || IsNil(o.Memory) { - var ret int32 - return ret - } - return *o.Memory -} - -// GetMemoryOk returns a tuple with the Memory field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Flavor) GetMemoryOk() (*int32, bool) { - if o == nil || IsNil(o.Memory) { - return nil, false - } - return o.Memory, true -} - -// HasMemory returns a boolean if a field has been set. -func (o *Flavor) HasMemory() bool { - if o != nil && !IsNil(o.Memory) { - return true - } - - return false -} - -// SetMemory gets a reference to the given int32 and assigns it to the Memory field. -func (o *Flavor) SetMemory(v int32) { - o.Memory = &v -} - -func (o Flavor) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Flavor) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Cpu) { - toSerialize["cpu"] = o.Cpu - } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description - } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Memory) { - toSerialize["memory"] = o.Memory - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *Flavor) UnmarshalJSON(data []byte) (err error) { - varFlavor := _Flavor{} - - err = json.Unmarshal(data, &varFlavor) - - if err != nil { - return err - } - - *o = Flavor(varFlavor) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "cpu") - delete(additionalProperties, "description") - delete(additionalProperties, "id") - delete(additionalProperties, "memory") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableFlavor struct { - value *Flavor - isSet bool -} - -func (v NullableFlavor) Get() *Flavor { - return v.value -} - -func (v *NullableFlavor) Set(val *Flavor) { - v.value = val - v.isSet = true -} - -func (v NullableFlavor) IsSet() bool { - return v.isSet -} - -func (v *NullableFlavor) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFlavor(val *Flavor) *NullableFlavor { - return &NullableFlavor{value: val, isSet: true} -} - -func (v NullableFlavor) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFlavor) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_get_backup_response.go b/services/postgresflex/v1api/model_get_backup_response.go deleted file mode 100644 index 7f8d70ea32..0000000000 --- a/services/postgresflex/v1api/model_get_backup_response.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the GetBackupResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetBackupResponse{} - -// GetBackupResponse struct for GetBackupResponse -type GetBackupResponse struct { - Item *Backup `json:"item,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _GetBackupResponse GetBackupResponse - -// NewGetBackupResponse instantiates a new GetBackupResponse 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 NewGetBackupResponse() *GetBackupResponse { - this := GetBackupResponse{} - return &this -} - -// NewGetBackupResponseWithDefaults instantiates a new GetBackupResponse 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 NewGetBackupResponseWithDefaults() *GetBackupResponse { - this := GetBackupResponse{} - return &this -} - -// GetItem returns the Item field value if set, zero value otherwise. -func (o *GetBackupResponse) GetItem() Backup { - if o == nil || IsNil(o.Item) { - var ret Backup - return ret - } - return *o.Item -} - -// GetItemOk returns a tuple with the Item field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetBackupResponse) GetItemOk() (*Backup, bool) { - if o == nil || IsNil(o.Item) { - return nil, false - } - return o.Item, true -} - -// HasItem returns a boolean if a field has been set. -func (o *GetBackupResponse) HasItem() bool { - if o != nil && !IsNil(o.Item) { - return true - } - - return false -} - -// SetItem gets a reference to the given Backup and assigns it to the Item field. -func (o *GetBackupResponse) SetItem(v Backup) { - o.Item = &v -} - -func (o GetBackupResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetBackupResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Item) { - toSerialize["item"] = o.Item - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetBackupResponse) UnmarshalJSON(data []byte) (err error) { - varGetBackupResponse := _GetBackupResponse{} - - err = json.Unmarshal(data, &varGetBackupResponse) - - if err != nil { - return err - } - - *o = GetBackupResponse(varGetBackupResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "item") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableGetBackupResponse struct { - value *GetBackupResponse - isSet bool -} - -func (v NullableGetBackupResponse) Get() *GetBackupResponse { - return v.value -} - -func (v *NullableGetBackupResponse) Set(val *GetBackupResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGetBackupResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGetBackupResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetBackupResponse(val *GetBackupResponse) *NullableGetBackupResponse { - return &NullableGetBackupResponse{value: val, isSet: true} -} - -func (v NullableGetBackupResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetBackupResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_get_user_response.go b/services/postgresflex/v1api/model_get_user_response.go deleted file mode 100644 index db593a43c7..0000000000 --- a/services/postgresflex/v1api/model_get_user_response.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the GetUserResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetUserResponse{} - -// GetUserResponse struct for GetUserResponse -type GetUserResponse struct { - Item *UserResponse `json:"item,omitempty"` - 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() *GetUserResponse { - this := GetUserResponse{} - 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 -} - -// GetItem returns the Item field value if set, zero value otherwise. -func (o *GetUserResponse) GetItem() UserResponse { - if o == nil || IsNil(o.Item) { - var ret UserResponse - return ret - } - return *o.Item -} - -// GetItemOk returns a tuple with the Item field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetUserResponse) GetItemOk() (*UserResponse, bool) { - if o == nil || IsNil(o.Item) { - return nil, false - } - return o.Item, true -} - -// HasItem returns a boolean if a field has been set. -func (o *GetUserResponse) HasItem() bool { - if o != nil && !IsNil(o.Item) { - return true - } - - return false -} - -// SetItem gets a reference to the given UserResponse and assigns it to the Item field. -func (o *GetUserResponse) SetItem(v UserResponse) { - o.Item = &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{}{} - if !IsNil(o.Item) { - toSerialize["item"] = o.Item - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *GetUserResponse) UnmarshalJSON(data []byte) (err error) { - 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, "item") - 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/v1api/model_instance.go b/services/postgresflex/v1api/model_instance.go deleted file mode 100644 index 34dcdb1736..0000000000 --- a/services/postgresflex/v1api/model_instance.go +++ /dev/null @@ -1,487 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the Instance type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Instance{} - -// Instance struct for Instance -type Instance struct { - Acl *ACL `json:"acl,omitempty"` - BackupSchedule *string `json:"backupSchedule,omitempty"` - Flavor *Flavor `json:"flavor,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Options *map[string]string `json:"options,omitempty"` - Replicas *int32 `json:"replicas,omitempty"` - Status *string `json:"status,omitempty"` - Storage *Storage `json:"storage,omitempty"` - Version *string `json:"version,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _Instance Instance - -// 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 -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 -func NewInstanceWithDefaults() *Instance { - this := Instance{} - return &this -} - -// GetAcl returns the Acl field value if set, zero value otherwise. -func (o *Instance) GetAcl() ACL { - if o == nil || IsNil(o.Acl) { - var ret ACL - 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 *Instance) GetAclOk() (*ACL, 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 *Instance) HasAcl() bool { - if o != nil && !IsNil(o.Acl) { - return true - } - - return false -} - -// SetAcl gets a reference to the given ACL and assigns it to the Acl field. -func (o *Instance) SetAcl(v ACL) { - o.Acl = &v -} - -// GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. -func (o *Instance) 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 *Instance) 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 *Instance) 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 *Instance) SetBackupSchedule(v string) { - o.BackupSchedule = &v -} - -// GetFlavor returns the Flavor field value if set, zero value otherwise. -func (o *Instance) GetFlavor() Flavor { - if o == nil || IsNil(o.Flavor) { - var ret Flavor - return ret - } - return *o.Flavor -} - -// GetFlavorOk returns a tuple with the Flavor field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Instance) GetFlavorOk() (*Flavor, bool) { - if o == nil || IsNil(o.Flavor) { - return nil, false - } - return o.Flavor, true -} - -// HasFlavor returns a boolean if a field has been set. -func (o *Instance) HasFlavor() bool { - if o != nil && !IsNil(o.Flavor) { - return true - } - - return false -} - -// SetFlavor gets a reference to the given Flavor and assigns it to the Flavor field. -func (o *Instance) SetFlavor(v Flavor) { - o.Flavor = &v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *Instance) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Instance) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *Instance) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *Instance) SetId(v string) { - o.Id = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *Instance) 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 *Instance) 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 *Instance) 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 *Instance) SetName(v string) { - o.Name = &v -} - -// GetOptions returns the Options field value if set, zero value otherwise. -func (o *Instance) GetOptions() map[string]string { - if o == nil || IsNil(o.Options) { - var ret map[string]string - return ret - } - return *o.Options -} - -// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Instance) GetOptionsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Options) { - return nil, false - } - return o.Options, true -} - -// HasOptions returns a boolean if a field has been set. -func (o *Instance) HasOptions() bool { - if o != nil && !IsNil(o.Options) { - return true - } - - return false -} - -// SetOptions gets a reference to the given map[string]string and assigns it to the Options field. -func (o *Instance) SetOptions(v map[string]string) { - o.Options = &v -} - -// GetReplicas returns the Replicas field value if set, zero value otherwise. -func (o *Instance) GetReplicas() int32 { - if o == nil || IsNil(o.Replicas) { - var ret int32 - return ret - } - return *o.Replicas -} - -// GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Instance) GetReplicasOk() (*int32, bool) { - if o == nil || IsNil(o.Replicas) { - return nil, false - } - return o.Replicas, true -} - -// HasReplicas returns a boolean if a field has been set. -func (o *Instance) HasReplicas() bool { - if o != nil && !IsNil(o.Replicas) { - return true - } - - return false -} - -// SetReplicas gets a reference to the given int32 and assigns it to the Replicas field. -func (o *Instance) SetReplicas(v int32) { - o.Replicas = &v -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *Instance) GetStatus() string { - if o == nil || IsNil(o.Status) { - var ret string - return ret - } - return *o.Status -} - -// GetStatusOk returns a tuple with the Status field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Instance) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true -} - -// HasStatus returns a boolean if a field has been set. -func (o *Instance) HasStatus() bool { - if o != nil && !IsNil(o.Status) { - return true - } - - return false -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Instance) SetStatus(v string) { - o.Status = &v -} - -// GetStorage returns the Storage field value if set, zero value otherwise. -func (o *Instance) GetStorage() Storage { - if o == nil || IsNil(o.Storage) { - var ret Storage - 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 *Instance) GetStorageOk() (*Storage, 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 *Instance) HasStorage() bool { - if o != nil && !IsNil(o.Storage) { - return true - } - - return false -} - -// SetStorage gets a reference to the given Storage and assigns it to the Storage field. -func (o *Instance) SetStorage(v Storage) { - o.Storage = &v -} - -// GetVersion returns the Version field value if set, zero value otherwise. -func (o *Instance) 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 *Instance) 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 *Instance) 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 *Instance) SetVersion(v string) { - o.Version = &v -} - -func (o Instance) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Instance) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Acl) { - toSerialize["acl"] = o.Acl - } - if !IsNil(o.BackupSchedule) { - toSerialize["backupSchedule"] = o.BackupSchedule - } - if !IsNil(o.Flavor) { - toSerialize["flavor"] = o.Flavor - } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.Options) { - toSerialize["options"] = o.Options - } - if !IsNil(o.Replicas) { - toSerialize["replicas"] = o.Replicas - } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status - } - 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 *Instance) UnmarshalJSON(data []byte) (err error) { - varInstance := _Instance{} - - err = json.Unmarshal(data, &varInstance) - - if err != nil { - return err - } - - *o = Instance(varInstance) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "acl") - delete(additionalProperties, "backupSchedule") - delete(additionalProperties, "flavor") - delete(additionalProperties, "id") - delete(additionalProperties, "name") - delete(additionalProperties, "options") - delete(additionalProperties, "replicas") - delete(additionalProperties, "status") - delete(additionalProperties, "storage") - delete(additionalProperties, "version") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableInstance struct { - value *Instance - isSet bool -} - -func (v NullableInstance) Get() *Instance { - return v.value -} - -func (v *NullableInstance) Set(val *Instance) { - v.value = val - v.isSet = true -} - -func (v NullableInstance) IsSet() bool { - return v.isSet -} - -func (v *NullableInstance) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInstance(val *Instance) *NullableInstance { - return &NullableInstance{value: val, isSet: true} -} - -func (v NullableInstance) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInstance) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_instance_create_database_response.go b/services/postgresflex/v1api/model_instance_create_database_response.go deleted file mode 100644 index 0a2cdfa141..0000000000 --- a/services/postgresflex/v1api/model_instance_create_database_response.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the InstanceCreateDatabaseResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &InstanceCreateDatabaseResponse{} - -// InstanceCreateDatabaseResponse struct for InstanceCreateDatabaseResponse -type InstanceCreateDatabaseResponse struct { - Id *string `json:"id,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _InstanceCreateDatabaseResponse InstanceCreateDatabaseResponse - -// 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 -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 -func NewInstanceCreateDatabaseResponseWithDefaults() *InstanceCreateDatabaseResponse { - this := InstanceCreateDatabaseResponse{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *InstanceCreateDatabaseResponse) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InstanceCreateDatabaseResponse) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *InstanceCreateDatabaseResponse) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *InstanceCreateDatabaseResponse) SetId(v string) { - o.Id = &v -} - -func (o InstanceCreateDatabaseResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o InstanceCreateDatabaseResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *InstanceCreateDatabaseResponse) UnmarshalJSON(data []byte) (err error) { - varInstanceCreateDatabaseResponse := _InstanceCreateDatabaseResponse{} - - err = json.Unmarshal(data, &varInstanceCreateDatabaseResponse) - - if err != nil { - return err - } - - *o = InstanceCreateDatabaseResponse(varInstanceCreateDatabaseResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "id") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableInstanceCreateDatabaseResponse struct { - value *InstanceCreateDatabaseResponse - isSet bool -} - -func (v NullableInstanceCreateDatabaseResponse) Get() *InstanceCreateDatabaseResponse { - return v.value -} - -func (v *NullableInstanceCreateDatabaseResponse) Set(val *InstanceCreateDatabaseResponse) { - v.value = val - v.isSet = true -} - -func (v NullableInstanceCreateDatabaseResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableInstanceCreateDatabaseResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInstanceCreateDatabaseResponse(val *InstanceCreateDatabaseResponse) *NullableInstanceCreateDatabaseResponse { - return &NullableInstanceCreateDatabaseResponse{value: val, isSet: true} -} - -func (v NullableInstanceCreateDatabaseResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInstanceCreateDatabaseResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_instance_data_point.go b/services/postgresflex/v1api/model_instance_data_point.go deleted file mode 100644 index 64e3ddc645..0000000000 --- a/services/postgresflex/v1api/model_instance_data_point.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the InstanceDataPoint type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &InstanceDataPoint{} - -// InstanceDataPoint struct for InstanceDataPoint -type InstanceDataPoint struct { - Timestamp *string `json:"timestamp,omitempty"` - Value *float32 `json:"value,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _InstanceDataPoint InstanceDataPoint - -// NewInstanceDataPoint instantiates a new InstanceDataPoint 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 NewInstanceDataPoint() *InstanceDataPoint { - this := InstanceDataPoint{} - return &this -} - -// NewInstanceDataPointWithDefaults instantiates a new InstanceDataPoint 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 NewInstanceDataPointWithDefaults() *InstanceDataPoint { - this := InstanceDataPoint{} - return &this -} - -// GetTimestamp returns the Timestamp field value if set, zero value otherwise. -func (o *InstanceDataPoint) GetTimestamp() string { - if o == nil || IsNil(o.Timestamp) { - var ret string - return ret - } - return *o.Timestamp -} - -// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InstanceDataPoint) GetTimestampOk() (*string, bool) { - if o == nil || IsNil(o.Timestamp) { - return nil, false - } - return o.Timestamp, true -} - -// HasTimestamp returns a boolean if a field has been set. -func (o *InstanceDataPoint) HasTimestamp() bool { - if o != nil && !IsNil(o.Timestamp) { - return true - } - - return false -} - -// SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. -func (o *InstanceDataPoint) SetTimestamp(v string) { - o.Timestamp = &v -} - -// GetValue returns the Value field value if set, zero value otherwise. -func (o *InstanceDataPoint) GetValue() float32 { - if o == nil || IsNil(o.Value) { - var ret float32 - return ret - } - return *o.Value -} - -// GetValueOk returns a tuple with the Value field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InstanceDataPoint) GetValueOk() (*float32, bool) { - if o == nil || IsNil(o.Value) { - return nil, false - } - return o.Value, true -} - -// HasValue returns a boolean if a field has been set. -func (o *InstanceDataPoint) HasValue() bool { - if o != nil && !IsNil(o.Value) { - return true - } - - return false -} - -// SetValue gets a reference to the given float32 and assigns it to the Value field. -func (o *InstanceDataPoint) SetValue(v float32) { - o.Value = &v -} - -func (o InstanceDataPoint) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o InstanceDataPoint) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Timestamp) { - toSerialize["timestamp"] = o.Timestamp - } - if !IsNil(o.Value) { - toSerialize["value"] = o.Value - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *InstanceDataPoint) UnmarshalJSON(data []byte) (err error) { - varInstanceDataPoint := _InstanceDataPoint{} - - err = json.Unmarshal(data, &varInstanceDataPoint) - - if err != nil { - return err - } - - *o = InstanceDataPoint(varInstanceDataPoint) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "timestamp") - delete(additionalProperties, "value") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableInstanceDataPoint struct { - value *InstanceDataPoint - isSet bool -} - -func (v NullableInstanceDataPoint) Get() *InstanceDataPoint { - return v.value -} - -func (v *NullableInstanceDataPoint) Set(val *InstanceDataPoint) { - v.value = val - v.isSet = true -} - -func (v NullableInstanceDataPoint) IsSet() bool { - return v.isSet -} - -func (v *NullableInstanceDataPoint) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInstanceDataPoint(val *InstanceDataPoint) *NullableInstanceDataPoint { - return &NullableInstanceDataPoint{value: val, isSet: true} -} - -func (v NullableInstanceDataPoint) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInstanceDataPoint) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_instance_database.go b/services/postgresflex/v1api/model_instance_database.go deleted file mode 100644 index b548fc22f2..0000000000 --- a/services/postgresflex/v1api/model_instance_database.go +++ /dev/null @@ -1,229 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the InstanceDatabase type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &InstanceDatabase{} - -// InstanceDatabase struct for InstanceDatabase -type InstanceDatabase struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - // Database specific options - Options map[string]interface{} `json:"options,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _InstanceDatabase InstanceDatabase - -// NewInstanceDatabase instantiates a new InstanceDatabase 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 NewInstanceDatabase() *InstanceDatabase { - this := InstanceDatabase{} - return &this -} - -// NewInstanceDatabaseWithDefaults instantiates a new InstanceDatabase 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 NewInstanceDatabaseWithDefaults() *InstanceDatabase { - this := InstanceDatabase{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *InstanceDatabase) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InstanceDatabase) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *InstanceDatabase) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *InstanceDatabase) SetId(v string) { - o.Id = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *InstanceDatabase) 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 *InstanceDatabase) 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 *InstanceDatabase) 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 *InstanceDatabase) SetName(v string) { - o.Name = &v -} - -// GetOptions returns the Options field value if set, zero value otherwise. -func (o *InstanceDatabase) GetOptions() map[string]interface{} { - if o == nil || IsNil(o.Options) { - var ret map[string]interface{} - return ret - } - return o.Options -} - -// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InstanceDatabase) GetOptionsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Options) { - return map[string]interface{}{}, false - } - return o.Options, true -} - -// HasOptions returns a boolean if a field has been set. -func (o *InstanceDatabase) HasOptions() bool { - if o != nil && !IsNil(o.Options) { - return true - } - - return false -} - -// SetOptions gets a reference to the given map[string]interface{} and assigns it to the Options field. -func (o *InstanceDatabase) SetOptions(v map[string]interface{}) { - o.Options = v -} - -func (o InstanceDatabase) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o InstanceDatabase) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.Options) { - toSerialize["options"] = o.Options - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *InstanceDatabase) UnmarshalJSON(data []byte) (err error) { - varInstanceDatabase := _InstanceDatabase{} - - err = json.Unmarshal(data, &varInstanceDatabase) - - if err != nil { - return err - } - - *o = InstanceDatabase(varInstanceDatabase) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "id") - delete(additionalProperties, "name") - delete(additionalProperties, "options") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableInstanceDatabase struct { - value *InstanceDatabase - isSet bool -} - -func (v NullableInstanceDatabase) Get() *InstanceDatabase { - return v.value -} - -func (v *NullableInstanceDatabase) Set(val *InstanceDatabase) { - v.value = val - v.isSet = true -} - -func (v NullableInstanceDatabase) IsSet() bool { - return v.isSet -} - -func (v *NullableInstanceDatabase) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInstanceDatabase(val *InstanceDatabase) *NullableInstanceDatabase { - return &NullableInstanceDatabase{value: val, isSet: true} -} - -func (v NullableInstanceDatabase) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInstanceDatabase) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_instance_host.go b/services/postgresflex/v1api/model_instance_host.go deleted file mode 100644 index a4d3e57979..0000000000 --- a/services/postgresflex/v1api/model_instance_host.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the InstanceHost type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &InstanceHost{} - -// InstanceHost struct for InstanceHost -type InstanceHost struct { - HostMetrics []InstanceHostMetric `json:"hostMetrics,omitempty"` - Id *string `json:"id,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _InstanceHost InstanceHost - -// NewInstanceHost instantiates a new InstanceHost 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 NewInstanceHost() *InstanceHost { - this := InstanceHost{} - return &this -} - -// NewInstanceHostWithDefaults instantiates a new InstanceHost 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 NewInstanceHostWithDefaults() *InstanceHost { - this := InstanceHost{} - return &this -} - -// GetHostMetrics returns the HostMetrics field value if set, zero value otherwise. -func (o *InstanceHost) GetHostMetrics() []InstanceHostMetric { - if o == nil || IsNil(o.HostMetrics) { - var ret []InstanceHostMetric - return ret - } - return o.HostMetrics -} - -// GetHostMetricsOk returns a tuple with the HostMetrics field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InstanceHost) GetHostMetricsOk() ([]InstanceHostMetric, bool) { - if o == nil || IsNil(o.HostMetrics) { - return nil, false - } - return o.HostMetrics, true -} - -// HasHostMetrics returns a boolean if a field has been set. -func (o *InstanceHost) HasHostMetrics() bool { - if o != nil && !IsNil(o.HostMetrics) { - return true - } - - return false -} - -// SetHostMetrics gets a reference to the given []InstanceHostMetric and assigns it to the HostMetrics field. -func (o *InstanceHost) SetHostMetrics(v []InstanceHostMetric) { - o.HostMetrics = v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *InstanceHost) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InstanceHost) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *InstanceHost) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *InstanceHost) SetId(v string) { - o.Id = &v -} - -func (o InstanceHost) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o InstanceHost) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.HostMetrics) { - toSerialize["hostMetrics"] = o.HostMetrics - } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *InstanceHost) UnmarshalJSON(data []byte) (err error) { - varInstanceHost := _InstanceHost{} - - err = json.Unmarshal(data, &varInstanceHost) - - if err != nil { - return err - } - - *o = InstanceHost(varInstanceHost) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "hostMetrics") - delete(additionalProperties, "id") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableInstanceHost struct { - value *InstanceHost - isSet bool -} - -func (v NullableInstanceHost) Get() *InstanceHost { - return v.value -} - -func (v *NullableInstanceHost) Set(val *InstanceHost) { - v.value = val - v.isSet = true -} - -func (v NullableInstanceHost) IsSet() bool { - return v.isSet -} - -func (v *NullableInstanceHost) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInstanceHost(val *InstanceHost) *NullableInstanceHost { - return &NullableInstanceHost{value: val, isSet: true} -} - -func (v NullableInstanceHost) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInstanceHost) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_instance_host_metric.go b/services/postgresflex/v1api/model_instance_host_metric.go deleted file mode 100644 index 85c263be60..0000000000 --- a/services/postgresflex/v1api/model_instance_host_metric.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the InstanceHostMetric type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &InstanceHostMetric{} - -// InstanceHostMetric struct for InstanceHostMetric -type InstanceHostMetric struct { - Datapoints []InstanceDataPoint `json:"datapoints,omitempty"` - Name *string `json:"name,omitempty"` - Units *string `json:"units,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _InstanceHostMetric InstanceHostMetric - -// NewInstanceHostMetric instantiates a new InstanceHostMetric 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 NewInstanceHostMetric() *InstanceHostMetric { - this := InstanceHostMetric{} - return &this -} - -// NewInstanceHostMetricWithDefaults instantiates a new InstanceHostMetric 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 NewInstanceHostMetricWithDefaults() *InstanceHostMetric { - this := InstanceHostMetric{} - return &this -} - -// GetDatapoints returns the Datapoints field value if set, zero value otherwise. -func (o *InstanceHostMetric) GetDatapoints() []InstanceDataPoint { - if o == nil || IsNil(o.Datapoints) { - var ret []InstanceDataPoint - return ret - } - return o.Datapoints -} - -// GetDatapointsOk returns a tuple with the Datapoints field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InstanceHostMetric) GetDatapointsOk() ([]InstanceDataPoint, bool) { - if o == nil || IsNil(o.Datapoints) { - return nil, false - } - return o.Datapoints, true -} - -// HasDatapoints returns a boolean if a field has been set. -func (o *InstanceHostMetric) HasDatapoints() bool { - if o != nil && !IsNil(o.Datapoints) { - return true - } - - return false -} - -// SetDatapoints gets a reference to the given []InstanceDataPoint and assigns it to the Datapoints field. -func (o *InstanceHostMetric) SetDatapoints(v []InstanceDataPoint) { - o.Datapoints = v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *InstanceHostMetric) 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 *InstanceHostMetric) 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 *InstanceHostMetric) 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 *InstanceHostMetric) SetName(v string) { - o.Name = &v -} - -// GetUnits returns the Units field value if set, zero value otherwise. -func (o *InstanceHostMetric) GetUnits() string { - if o == nil || IsNil(o.Units) { - var ret string - return ret - } - return *o.Units -} - -// GetUnitsOk returns a tuple with the Units field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InstanceHostMetric) GetUnitsOk() (*string, bool) { - if o == nil || IsNil(o.Units) { - return nil, false - } - return o.Units, true -} - -// HasUnits returns a boolean if a field has been set. -func (o *InstanceHostMetric) HasUnits() bool { - if o != nil && !IsNil(o.Units) { - return true - } - - return false -} - -// SetUnits gets a reference to the given string and assigns it to the Units field. -func (o *InstanceHostMetric) SetUnits(v string) { - o.Units = &v -} - -func (o InstanceHostMetric) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o InstanceHostMetric) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Datapoints) { - toSerialize["datapoints"] = o.Datapoints - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.Units) { - toSerialize["units"] = o.Units - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *InstanceHostMetric) UnmarshalJSON(data []byte) (err error) { - varInstanceHostMetric := _InstanceHostMetric{} - - err = json.Unmarshal(data, &varInstanceHostMetric) - - if err != nil { - return err - } - - *o = InstanceHostMetric(varInstanceHostMetric) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "datapoints") - delete(additionalProperties, "name") - delete(additionalProperties, "units") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableInstanceHostMetric struct { - value *InstanceHostMetric - isSet bool -} - -func (v NullableInstanceHostMetric) Get() *InstanceHostMetric { - return v.value -} - -func (v *NullableInstanceHostMetric) Set(val *InstanceHostMetric) { - v.value = val - v.isSet = true -} - -func (v NullableInstanceHostMetric) IsSet() bool { - return v.isSet -} - -func (v *NullableInstanceHostMetric) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInstanceHostMetric(val *InstanceHostMetric) *NullableInstanceHostMetric { - return &NullableInstanceHostMetric{value: val, isSet: true} -} - -func (v NullableInstanceHostMetric) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInstanceHostMetric) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_instance_list_databases_response.go b/services/postgresflex/v1api/model_instance_list_databases_response.go deleted file mode 100644 index acda24814b..0000000000 --- a/services/postgresflex/v1api/model_instance_list_databases_response.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the InstanceListDatabasesResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &InstanceListDatabasesResponse{} - -// InstanceListDatabasesResponse struct for InstanceListDatabasesResponse -type InstanceListDatabasesResponse struct { - Databases []InstanceDatabase `json:"databases,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _InstanceListDatabasesResponse InstanceListDatabasesResponse - -// 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 -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 -func NewInstanceListDatabasesResponseWithDefaults() *InstanceListDatabasesResponse { - this := InstanceListDatabasesResponse{} - return &this -} - -// GetDatabases returns the Databases field value if set, zero value otherwise. -func (o *InstanceListDatabasesResponse) GetDatabases() []InstanceDatabase { - if o == nil || IsNil(o.Databases) { - var ret []InstanceDatabase - return ret - } - return o.Databases -} - -// GetDatabasesOk returns a tuple with the Databases field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InstanceListDatabasesResponse) GetDatabasesOk() ([]InstanceDatabase, bool) { - if o == nil || IsNil(o.Databases) { - return nil, false - } - return o.Databases, true -} - -// HasDatabases returns a boolean if a field has been set. -func (o *InstanceListDatabasesResponse) HasDatabases() bool { - if o != nil && !IsNil(o.Databases) { - return true - } - - return false -} - -// SetDatabases gets a reference to the given []InstanceDatabase and assigns it to the Databases field. -func (o *InstanceListDatabasesResponse) SetDatabases(v []InstanceDatabase) { - o.Databases = v -} - -func (o InstanceListDatabasesResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o InstanceListDatabasesResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Databases) { - toSerialize["databases"] = o.Databases - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *InstanceListDatabasesResponse) UnmarshalJSON(data []byte) (err error) { - varInstanceListDatabasesResponse := _InstanceListDatabasesResponse{} - - err = json.Unmarshal(data, &varInstanceListDatabasesResponse) - - if err != nil { - return err - } - - *o = InstanceListDatabasesResponse(varInstanceListDatabasesResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "databases") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableInstanceListDatabasesResponse struct { - value *InstanceListDatabasesResponse - isSet bool -} - -func (v NullableInstanceListDatabasesResponse) Get() *InstanceListDatabasesResponse { - return v.value -} - -func (v *NullableInstanceListDatabasesResponse) Set(val *InstanceListDatabasesResponse) { - v.value = val - v.isSet = true -} - -func (v NullableInstanceListDatabasesResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableInstanceListDatabasesResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInstanceListDatabasesResponse(val *InstanceListDatabasesResponse) *NullableInstanceListDatabasesResponse { - return &NullableInstanceListDatabasesResponse{value: val, isSet: true} -} - -func (v NullableInstanceListDatabasesResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInstanceListDatabasesResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_instance_list_instance.go b/services/postgresflex/v1api/model_instance_list_instance.go deleted file mode 100644 index ffe8605a92..0000000000 --- a/services/postgresflex/v1api/model_instance_list_instance.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the InstanceListInstance type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &InstanceListInstance{} - -// InstanceListInstance struct for InstanceListInstance -type InstanceListInstance struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Status *string `json:"status,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _InstanceListInstance InstanceListInstance - -// NewInstanceListInstance instantiates a new InstanceListInstance 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 NewInstanceListInstance() *InstanceListInstance { - this := InstanceListInstance{} - return &this -} - -// NewInstanceListInstanceWithDefaults instantiates a new InstanceListInstance 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 NewInstanceListInstanceWithDefaults() *InstanceListInstance { - this := InstanceListInstance{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *InstanceListInstance) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InstanceListInstance) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *InstanceListInstance) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *InstanceListInstance) SetId(v string) { - o.Id = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *InstanceListInstance) 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 *InstanceListInstance) 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 *InstanceListInstance) 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 *InstanceListInstance) SetName(v string) { - o.Name = &v -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *InstanceListInstance) GetStatus() string { - if o == nil || IsNil(o.Status) { - var ret string - return ret - } - return *o.Status -} - -// GetStatusOk returns a tuple with the Status field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InstanceListInstance) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true -} - -// HasStatus returns a boolean if a field has been set. -func (o *InstanceListInstance) HasStatus() bool { - if o != nil && !IsNil(o.Status) { - return true - } - - return false -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *InstanceListInstance) SetStatus(v string) { - o.Status = &v -} - -func (o InstanceListInstance) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o InstanceListInstance) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *InstanceListInstance) UnmarshalJSON(data []byte) (err error) { - varInstanceListInstance := _InstanceListInstance{} - - err = json.Unmarshal(data, &varInstanceListInstance) - - if err != nil { - return err - } - - *o = InstanceListInstance(varInstanceListInstance) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "id") - delete(additionalProperties, "name") - delete(additionalProperties, "status") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableInstanceListInstance struct { - value *InstanceListInstance - isSet bool -} - -func (v NullableInstanceListInstance) Get() *InstanceListInstance { - return v.value -} - -func (v *NullableInstanceListInstance) Set(val *InstanceListInstance) { - v.value = val - v.isSet = true -} - -func (v NullableInstanceListInstance) IsSet() bool { - return v.isSet -} - -func (v *NullableInstanceListInstance) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInstanceListInstance(val *InstanceListInstance) *NullableInstanceListInstance { - return &NullableInstanceListInstance{value: val, isSet: true} -} - -func (v NullableInstanceListInstance) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInstanceListInstance) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_instance_metrics_response.go b/services/postgresflex/v1api/model_instance_metrics_response.go deleted file mode 100644 index 5812d515ca..0000000000 --- a/services/postgresflex/v1api/model_instance_metrics_response.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the InstanceMetricsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &InstanceMetricsResponse{} - -// InstanceMetricsResponse struct for InstanceMetricsResponse -type InstanceMetricsResponse struct { - Hosts []InstanceHost `json:"hosts,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _InstanceMetricsResponse InstanceMetricsResponse - -// NewInstanceMetricsResponse instantiates a new InstanceMetricsResponse 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 NewInstanceMetricsResponse() *InstanceMetricsResponse { - this := InstanceMetricsResponse{} - return &this -} - -// NewInstanceMetricsResponseWithDefaults instantiates a new InstanceMetricsResponse 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 NewInstanceMetricsResponseWithDefaults() *InstanceMetricsResponse { - this := InstanceMetricsResponse{} - return &this -} - -// GetHosts returns the Hosts field value if set, zero value otherwise. -func (o *InstanceMetricsResponse) GetHosts() []InstanceHost { - if o == nil || IsNil(o.Hosts) { - var ret []InstanceHost - return ret - } - return o.Hosts -} - -// GetHostsOk returns a tuple with the Hosts field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InstanceMetricsResponse) GetHostsOk() ([]InstanceHost, bool) { - if o == nil || IsNil(o.Hosts) { - return nil, false - } - return o.Hosts, true -} - -// HasHosts returns a boolean if a field has been set. -func (o *InstanceMetricsResponse) HasHosts() bool { - if o != nil && !IsNil(o.Hosts) { - return true - } - - return false -} - -// SetHosts gets a reference to the given []InstanceHost and assigns it to the Hosts field. -func (o *InstanceMetricsResponse) SetHosts(v []InstanceHost) { - o.Hosts = v -} - -func (o InstanceMetricsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o InstanceMetricsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Hosts) { - toSerialize["hosts"] = o.Hosts - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *InstanceMetricsResponse) UnmarshalJSON(data []byte) (err error) { - varInstanceMetricsResponse := _InstanceMetricsResponse{} - - err = json.Unmarshal(data, &varInstanceMetricsResponse) - - if err != nil { - return err - } - - *o = InstanceMetricsResponse(varInstanceMetricsResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "hosts") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableInstanceMetricsResponse struct { - value *InstanceMetricsResponse - isSet bool -} - -func (v NullableInstanceMetricsResponse) Get() *InstanceMetricsResponse { - return v.value -} - -func (v *NullableInstanceMetricsResponse) Set(val *InstanceMetricsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableInstanceMetricsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableInstanceMetricsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInstanceMetricsResponse(val *InstanceMetricsResponse) *NullableInstanceMetricsResponse { - return &NullableInstanceMetricsResponse{value: val, isSet: true} -} - -func (v NullableInstanceMetricsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInstanceMetricsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_instance_response.go b/services/postgresflex/v1api/model_instance_response.go deleted file mode 100644 index 36a8fa5984..0000000000 --- a/services/postgresflex/v1api/model_instance_response.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the InstanceResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &InstanceResponse{} - -// InstanceResponse struct for InstanceResponse -type InstanceResponse struct { - Item *Instance `json:"item,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _InstanceResponse InstanceResponse - -// NewInstanceResponse instantiates a new InstanceResponse 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 NewInstanceResponse() *InstanceResponse { - this := InstanceResponse{} - return &this -} - -// NewInstanceResponseWithDefaults instantiates a new InstanceResponse 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 NewInstanceResponseWithDefaults() *InstanceResponse { - this := InstanceResponse{} - return &this -} - -// GetItem returns the Item field value if set, zero value otherwise. -func (o *InstanceResponse) GetItem() Instance { - if o == nil || IsNil(o.Item) { - var ret Instance - return ret - } - return *o.Item -} - -// GetItemOk returns a tuple with the Item field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InstanceResponse) GetItemOk() (*Instance, bool) { - if o == nil || IsNil(o.Item) { - return nil, false - } - return o.Item, true -} - -// HasItem returns a boolean if a field has been set. -func (o *InstanceResponse) HasItem() bool { - if o != nil && !IsNil(o.Item) { - return true - } - - return false -} - -// SetItem gets a reference to the given Instance and assigns it to the Item field. -func (o *InstanceResponse) SetItem(v Instance) { - o.Item = &v -} - -func (o InstanceResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o InstanceResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Item) { - toSerialize["item"] = o.Item - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *InstanceResponse) UnmarshalJSON(data []byte) (err error) { - varInstanceResponse := _InstanceResponse{} - - err = json.Unmarshal(data, &varInstanceResponse) - - if err != nil { - return err - } - - *o = InstanceResponse(varInstanceResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "item") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableInstanceResponse struct { - value *InstanceResponse - isSet bool -} - -func (v NullableInstanceResponse) Get() *InstanceResponse { - return v.value -} - -func (v *NullableInstanceResponse) Set(val *InstanceResponse) { - v.value = val - v.isSet = true -} - -func (v NullableInstanceResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableInstanceResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInstanceResponse(val *InstanceResponse) *NullableInstanceResponse { - return &NullableInstanceResponse{value: val, isSet: true} -} - -func (v NullableInstanceResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInstanceResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_list_backups_response.go b/services/postgresflex/v1api/model_list_backups_response.go deleted file mode 100644 index 2e8db4d18d..0000000000 --- a/services/postgresflex/v1api/model_list_backups_response.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the ListBackupsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListBackupsResponse{} - -// ListBackupsResponse struct for ListBackupsResponse -type ListBackupsResponse struct { - Count *int32 `json:"count,omitempty"` - Items []Backup `json:"items,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ListBackupsResponse ListBackupsResponse - -// NewListBackupsResponse instantiates a new ListBackupsResponse 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 NewListBackupsResponse() *ListBackupsResponse { - this := ListBackupsResponse{} - return &this -} - -// NewListBackupsResponseWithDefaults instantiates a new ListBackupsResponse 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 NewListBackupsResponseWithDefaults() *ListBackupsResponse { - this := ListBackupsResponse{} - return &this -} - -// GetCount returns the Count field value if set, zero value otherwise. -func (o *ListBackupsResponse) GetCount() int32 { - if o == nil || IsNil(o.Count) { - var ret int32 - return ret - } - return *o.Count -} - -// GetCountOk returns a tuple with the Count field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListBackupsResponse) GetCountOk() (*int32, bool) { - if o == nil || IsNil(o.Count) { - return nil, false - } - return o.Count, true -} - -// HasCount returns a boolean if a field has been set. -func (o *ListBackupsResponse) HasCount() bool { - if o != nil && !IsNil(o.Count) { - return true - } - - return false -} - -// SetCount gets a reference to the given int32 and assigns it to the Count field. -func (o *ListBackupsResponse) SetCount(v int32) { - o.Count = &v -} - -// GetItems returns the Items field value if set, zero value otherwise. -func (o *ListBackupsResponse) GetItems() []Backup { - if o == nil || IsNil(o.Items) { - var ret []Backup - return ret - } - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListBackupsResponse) GetItemsOk() ([]Backup, bool) { - if o == nil || IsNil(o.Items) { - return nil, false - } - return o.Items, true -} - -// HasItems returns a boolean if a field has been set. -func (o *ListBackupsResponse) HasItems() bool { - if o != nil && !IsNil(o.Items) { - return true - } - - return false -} - -// SetItems gets a reference to the given []Backup and assigns it to the Items field. -func (o *ListBackupsResponse) SetItems(v []Backup) { - o.Items = v -} - -func (o ListBackupsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListBackupsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Count) { - toSerialize["count"] = o.Count - } - if !IsNil(o.Items) { - toSerialize["items"] = o.Items - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ListBackupsResponse) UnmarshalJSON(data []byte) (err error) { - varListBackupsResponse := _ListBackupsResponse{} - - err = json.Unmarshal(data, &varListBackupsResponse) - - if err != nil { - return err - } - - *o = ListBackupsResponse(varListBackupsResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "count") - delete(additionalProperties, "items") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableListBackupsResponse struct { - value *ListBackupsResponse - isSet bool -} - -func (v NullableListBackupsResponse) Get() *ListBackupsResponse { - return v.value -} - -func (v *NullableListBackupsResponse) Set(val *ListBackupsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListBackupsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListBackupsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListBackupsResponse(val *ListBackupsResponse) *NullableListBackupsResponse { - return &NullableListBackupsResponse{value: val, isSet: true} -} - -func (v NullableListBackupsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListBackupsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_list_flavors_response.go b/services/postgresflex/v1api/model_list_flavors_response.go deleted file mode 100644 index b48ef0185a..0000000000 --- a/services/postgresflex/v1api/model_list_flavors_response.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the ListFlavorsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListFlavorsResponse{} - -// ListFlavorsResponse struct for ListFlavorsResponse -type ListFlavorsResponse struct { - Flavors []Flavor `json:"flavors,omitempty"` - 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() *ListFlavorsResponse { - this := ListFlavorsResponse{} - 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 if set, zero value otherwise. -func (o *ListFlavorsResponse) GetFlavors() []Flavor { - if o == nil || IsNil(o.Flavors) { - var ret []Flavor - return ret - } - return o.Flavors -} - -// GetFlavorsOk returns a tuple with the Flavors field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListFlavorsResponse) GetFlavorsOk() ([]Flavor, bool) { - if o == nil || IsNil(o.Flavors) { - return nil, false - } - return o.Flavors, true -} - -// HasFlavors returns a boolean if a field has been set. -func (o *ListFlavorsResponse) HasFlavors() bool { - if o != nil && !IsNil(o.Flavors) { - return true - } - - return false -} - -// SetFlavors gets a reference to the given []Flavor and assigns it to the Flavors field. -func (o *ListFlavorsResponse) SetFlavors(v []Flavor) { - o.Flavors = 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{}{} - if !IsNil(o.Flavors) { - toSerialize["flavors"] = o.Flavors - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ListFlavorsResponse) UnmarshalJSON(data []byte) (err error) { - 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") - 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/v1api/model_list_instances_response.go b/services/postgresflex/v1api/model_list_instances_response.go deleted file mode 100644 index 63308763b3..0000000000 --- a/services/postgresflex/v1api/model_list_instances_response.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the ListInstancesResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListInstancesResponse{} - -// ListInstancesResponse struct for ListInstancesResponse -type ListInstancesResponse struct { - Count *int32 `json:"count,omitempty"` - Items []InstanceListInstance `json:"items,omitempty"` - 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() *ListInstancesResponse { - this := ListInstancesResponse{} - 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 -} - -// GetCount returns the Count field value if set, zero value otherwise. -func (o *ListInstancesResponse) GetCount() int32 { - if o == nil || IsNil(o.Count) { - var ret int32 - return ret - } - return *o.Count -} - -// GetCountOk returns a tuple with the Count field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListInstancesResponse) GetCountOk() (*int32, bool) { - if o == nil || IsNil(o.Count) { - return nil, false - } - return o.Count, true -} - -// HasCount returns a boolean if a field has been set. -func (o *ListInstancesResponse) HasCount() bool { - if o != nil && !IsNil(o.Count) { - return true - } - - return false -} - -// SetCount gets a reference to the given int32 and assigns it to the Count field. -func (o *ListInstancesResponse) SetCount(v int32) { - o.Count = &v -} - -// GetItems returns the Items field value if set, zero value otherwise. -func (o *ListInstancesResponse) GetItems() []InstanceListInstance { - if o == nil || IsNil(o.Items) { - var ret []InstanceListInstance - return ret - } - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListInstancesResponse) GetItemsOk() ([]InstanceListInstance, bool) { - if o == nil || IsNil(o.Items) { - return nil, false - } - return o.Items, true -} - -// HasItems returns a boolean if a field has been set. -func (o *ListInstancesResponse) HasItems() bool { - if o != nil && !IsNil(o.Items) { - return true - } - - return false -} - -// SetItems gets a reference to the given []InstanceListInstance and assigns it to the Items field. -func (o *ListInstancesResponse) SetItems(v []InstanceListInstance) { - o.Items = 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{}{} - if !IsNil(o.Count) { - toSerialize["count"] = o.Count - } - if !IsNil(o.Items) { - toSerialize["items"] = o.Items - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ListInstancesResponse) UnmarshalJSON(data []byte) (err error) { - 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, "count") - delete(additionalProperties, "items") - 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/v1api/model_list_storages_response.go b/services/postgresflex/v1api/model_list_storages_response.go deleted file mode 100644 index f6b8a3caf3..0000000000 --- a/services/postgresflex/v1api/model_list_storages_response.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the ListStoragesResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListStoragesResponse{} - -// ListStoragesResponse struct for ListStoragesResponse -type ListStoragesResponse struct { - StorageClasses []string `json:"storageClasses,omitempty"` - StorageRange *StorageRange `json:"storageRange,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ListStoragesResponse ListStoragesResponse - -// 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 -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 -func NewListStoragesResponseWithDefaults() *ListStoragesResponse { - this := ListStoragesResponse{} - return &this -} - -// GetStorageClasses returns the StorageClasses field value if set, zero value otherwise. -func (o *ListStoragesResponse) GetStorageClasses() []string { - if o == nil || IsNil(o.StorageClasses) { - var ret []string - return ret - } - return o.StorageClasses -} - -// GetStorageClassesOk returns a tuple with the StorageClasses field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListStoragesResponse) GetStorageClassesOk() ([]string, bool) { - if o == nil || IsNil(o.StorageClasses) { - return nil, false - } - return o.StorageClasses, true -} - -// HasStorageClasses returns a boolean if a field has been set. -func (o *ListStoragesResponse) HasStorageClasses() bool { - if o != nil && !IsNil(o.StorageClasses) { - return true - } - - return false -} - -// SetStorageClasses gets a reference to the given []string and assigns it to the StorageClasses field. -func (o *ListStoragesResponse) SetStorageClasses(v []string) { - o.StorageClasses = v -} - -// GetStorageRange returns the StorageRange field value if set, zero value otherwise. -func (o *ListStoragesResponse) GetStorageRange() StorageRange { - if o == nil || IsNil(o.StorageRange) { - var ret StorageRange - return ret - } - return *o.StorageRange -} - -// GetStorageRangeOk returns a tuple with the StorageRange field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListStoragesResponse) GetStorageRangeOk() (*StorageRange, bool) { - if o == nil || IsNil(o.StorageRange) { - return nil, false - } - return o.StorageRange, true -} - -// HasStorageRange returns a boolean if a field has been set. -func (o *ListStoragesResponse) HasStorageRange() bool { - if o != nil && !IsNil(o.StorageRange) { - return true - } - - return false -} - -// SetStorageRange gets a reference to the given StorageRange and assigns it to the StorageRange field. -func (o *ListStoragesResponse) SetStorageRange(v StorageRange) { - o.StorageRange = &v -} - -func (o ListStoragesResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListStoragesResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.StorageClasses) { - toSerialize["storageClasses"] = o.StorageClasses - } - if !IsNil(o.StorageRange) { - toSerialize["storageRange"] = o.StorageRange - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ListStoragesResponse) UnmarshalJSON(data []byte) (err error) { - varListStoragesResponse := _ListStoragesResponse{} - - err = json.Unmarshal(data, &varListStoragesResponse) - - if err != nil { - return err - } - - *o = ListStoragesResponse(varListStoragesResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "storageClasses") - delete(additionalProperties, "storageRange") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableListStoragesResponse struct { - value *ListStoragesResponse - isSet bool -} - -func (v NullableListStoragesResponse) Get() *ListStoragesResponse { - return v.value -} - -func (v *NullableListStoragesResponse) Set(val *ListStoragesResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListStoragesResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListStoragesResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListStoragesResponse(val *ListStoragesResponse) *NullableListStoragesResponse { - return &NullableListStoragesResponse{value: val, isSet: true} -} - -func (v NullableListStoragesResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListStoragesResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_list_users_response.go b/services/postgresflex/v1api/model_list_users_response.go deleted file mode 100644 index 2aa81b94a6..0000000000 --- a/services/postgresflex/v1api/model_list_users_response.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the ListUsersResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListUsersResponse{} - -// ListUsersResponse struct for ListUsersResponse -type ListUsersResponse struct { - Count *int32 `json:"count,omitempty"` - Items []ListUsersResponseItem `json:"items,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ListUsersResponse ListUsersResponse - -// NewListUsersResponse instantiates a new ListUsersResponse 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 NewListUsersResponse() *ListUsersResponse { - this := ListUsersResponse{} - return &this -} - -// NewListUsersResponseWithDefaults instantiates a new ListUsersResponse 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 NewListUsersResponseWithDefaults() *ListUsersResponse { - this := ListUsersResponse{} - return &this -} - -// GetCount returns the Count field value if set, zero value otherwise. -func (o *ListUsersResponse) GetCount() int32 { - if o == nil || IsNil(o.Count) { - var ret int32 - return ret - } - return *o.Count -} - -// GetCountOk returns a tuple with the Count field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListUsersResponse) GetCountOk() (*int32, bool) { - if o == nil || IsNil(o.Count) { - return nil, false - } - return o.Count, true -} - -// HasCount returns a boolean if a field has been set. -func (o *ListUsersResponse) HasCount() bool { - if o != nil && !IsNil(o.Count) { - return true - } - - return false -} - -// SetCount gets a reference to the given int32 and assigns it to the Count field. -func (o *ListUsersResponse) SetCount(v int32) { - o.Count = &v -} - -// GetItems returns the Items field value if set, zero value otherwise. -func (o *ListUsersResponse) GetItems() []ListUsersResponseItem { - if o == nil || IsNil(o.Items) { - var ret []ListUsersResponseItem - return ret - } - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListUsersResponse) GetItemsOk() ([]ListUsersResponseItem, bool) { - if o == nil || IsNil(o.Items) { - return nil, false - } - return o.Items, true -} - -// HasItems returns a boolean if a field has been set. -func (o *ListUsersResponse) HasItems() bool { - if o != nil && !IsNil(o.Items) { - return true - } - - return false -} - -// SetItems gets a reference to the given []ListUsersResponseItem and assigns it to the Items field. -func (o *ListUsersResponse) SetItems(v []ListUsersResponseItem) { - o.Items = v -} - -func (o ListUsersResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListUsersResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Count) { - toSerialize["count"] = o.Count - } - if !IsNil(o.Items) { - toSerialize["items"] = o.Items - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ListUsersResponse) UnmarshalJSON(data []byte) (err error) { - varListUsersResponse := _ListUsersResponse{} - - err = json.Unmarshal(data, &varListUsersResponse) - - if err != nil { - return err - } - - *o = ListUsersResponse(varListUsersResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "count") - delete(additionalProperties, "items") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableListUsersResponse struct { - value *ListUsersResponse - isSet bool -} - -func (v NullableListUsersResponse) Get() *ListUsersResponse { - return v.value -} - -func (v *NullableListUsersResponse) Set(val *ListUsersResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListUsersResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListUsersResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListUsersResponse(val *ListUsersResponse) *NullableListUsersResponse { - return &NullableListUsersResponse{value: val, isSet: true} -} - -func (v NullableListUsersResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListUsersResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_list_users_response_item.go b/services/postgresflex/v1api/model_list_users_response_item.go deleted file mode 100644 index e216ba1c5a..0000000000 --- a/services/postgresflex/v1api/model_list_users_response_item.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the ListUsersResponseItem type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListUsersResponseItem{} - -// ListUsersResponseItem struct for ListUsersResponseItem -type ListUsersResponseItem struct { - Id *string `json:"id,omitempty"` - Username *string `json:"username,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ListUsersResponseItem ListUsersResponseItem - -// NewListUsersResponseItem instantiates a new ListUsersResponseItem 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 NewListUsersResponseItem() *ListUsersResponseItem { - this := ListUsersResponseItem{} - return &this -} - -// NewListUsersResponseItemWithDefaults instantiates a new ListUsersResponseItem 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 NewListUsersResponseItemWithDefaults() *ListUsersResponseItem { - this := ListUsersResponseItem{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *ListUsersResponseItem) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListUsersResponseItem) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *ListUsersResponseItem) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *ListUsersResponseItem) SetId(v string) { - o.Id = &v -} - -// GetUsername returns the Username field value if set, zero value otherwise. -func (o *ListUsersResponseItem) GetUsername() string { - if o == nil || IsNil(o.Username) { - var ret string - return ret - } - return *o.Username -} - -// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListUsersResponseItem) GetUsernameOk() (*string, bool) { - if o == nil || IsNil(o.Username) { - return nil, false - } - return o.Username, true -} - -// HasUsername returns a boolean if a field has been set. -func (o *ListUsersResponseItem) HasUsername() bool { - if o != nil && !IsNil(o.Username) { - return true - } - - return false -} - -// SetUsername gets a reference to the given string and assigns it to the Username field. -func (o *ListUsersResponseItem) SetUsername(v string) { - o.Username = &v -} - -func (o ListUsersResponseItem) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListUsersResponseItem) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Username) { - toSerialize["username"] = o.Username - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ListUsersResponseItem) UnmarshalJSON(data []byte) (err error) { - varListUsersResponseItem := _ListUsersResponseItem{} - - err = json.Unmarshal(data, &varListUsersResponseItem) - - if err != nil { - return err - } - - *o = ListUsersResponseItem(varListUsersResponseItem) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "id") - delete(additionalProperties, "username") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableListUsersResponseItem struct { - value *ListUsersResponseItem - isSet bool -} - -func (v NullableListUsersResponseItem) Get() *ListUsersResponseItem { - return v.value -} - -func (v *NullableListUsersResponseItem) Set(val *ListUsersResponseItem) { - v.value = val - v.isSet = true -} - -func (v NullableListUsersResponseItem) IsSet() bool { - return v.isSet -} - -func (v *NullableListUsersResponseItem) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListUsersResponseItem(val *ListUsersResponseItem) *NullableListUsersResponseItem { - return &NullableListUsersResponseItem{value: val, isSet: true} -} - -func (v NullableListUsersResponseItem) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListUsersResponseItem) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_list_versions_response.go b/services/postgresflex/v1api/model_list_versions_response.go deleted file mode 100644 index cec8e5dae9..0000000000 --- a/services/postgresflex/v1api/model_list_versions_response.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the ListVersionsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListVersionsResponse{} - -// ListVersionsResponse struct for ListVersionsResponse -type ListVersionsResponse struct { - Versions []string `json:"versions,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ListVersionsResponse ListVersionsResponse - -// NewListVersionsResponse instantiates a new ListVersionsResponse 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 NewListVersionsResponse() *ListVersionsResponse { - this := ListVersionsResponse{} - return &this -} - -// NewListVersionsResponseWithDefaults instantiates a new ListVersionsResponse 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 NewListVersionsResponseWithDefaults() *ListVersionsResponse { - this := ListVersionsResponse{} - return &this -} - -// GetVersions returns the Versions field value if set, zero value otherwise. -func (o *ListVersionsResponse) GetVersions() []string { - if o == nil || IsNil(o.Versions) { - var ret []string - return ret - } - return o.Versions -} - -// GetVersionsOk returns a tuple with the Versions field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListVersionsResponse) GetVersionsOk() ([]string, bool) { - if o == nil || IsNil(o.Versions) { - return nil, false - } - return o.Versions, true -} - -// HasVersions returns a boolean if a field has been set. -func (o *ListVersionsResponse) HasVersions() bool { - if o != nil && !IsNil(o.Versions) { - return true - } - - return false -} - -// SetVersions gets a reference to the given []string and assigns it to the Versions field. -func (o *ListVersionsResponse) SetVersions(v []string) { - o.Versions = v -} - -func (o ListVersionsResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ListVersionsResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Versions) { - toSerialize["versions"] = o.Versions - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ListVersionsResponse) UnmarshalJSON(data []byte) (err error) { - varListVersionsResponse := _ListVersionsResponse{} - - err = json.Unmarshal(data, &varListVersionsResponse) - - if err != nil { - return err - } - - *o = ListVersionsResponse(varListVersionsResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "versions") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableListVersionsResponse struct { - value *ListVersionsResponse - isSet bool -} - -func (v NullableListVersionsResponse) Get() *ListVersionsResponse { - return v.value -} - -func (v *NullableListVersionsResponse) Set(val *ListVersionsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableListVersionsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableListVersionsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListVersionsResponse(val *ListVersionsResponse) *NullableListVersionsResponse { - return &NullableListVersionsResponse{value: val, isSet: true} -} - -func (v NullableListVersionsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListVersionsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_partial_update_instance_payload.go b/services/postgresflex/v1api/model_partial_update_instance_payload.go deleted file mode 100644 index 350a507388..0000000000 --- a/services/postgresflex/v1api/model_partial_update_instance_payload.go +++ /dev/null @@ -1,451 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -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 { - Acl *ACL `json:"acl,omitempty"` - BackupSchedule *string `json:"backupSchedule,omitempty"` - FlavorId *string `json:"flavorId,omitempty"` - // Labels field is not certain/clear - Labels *map[string]string `json:"labels,omitempty"` - Name *string `json:"name,omitempty"` - Options *map[string]string `json:"options,omitempty"` - Replicas *int32 `json:"replicas,omitempty"` - Storage *StorageUpdate `json:"storage,omitempty"` - 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 -} - -// GetAcl returns the Acl field value if set, zero value otherwise. -func (o *PartialUpdateInstancePayload) GetAcl() ACL { - if o == nil || IsNil(o.Acl) { - var ret ACL - 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 *PartialUpdateInstancePayload) GetAclOk() (*ACL, 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 *PartialUpdateInstancePayload) HasAcl() bool { - if o != nil && !IsNil(o.Acl) { - return true - } - - return false -} - -// SetAcl gets a reference to the given ACL and assigns it to the Acl field. -func (o *PartialUpdateInstancePayload) SetAcl(v ACL) { - o.Acl = &v -} - -// 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 -} - -// GetOptions returns the Options field value if set, zero value otherwise. -func (o *PartialUpdateInstancePayload) GetOptions() map[string]string { - if o == nil || IsNil(o.Options) { - var ret map[string]string - return ret - } - return *o.Options -} - -// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PartialUpdateInstancePayload) GetOptionsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Options) { - return nil, false - } - return o.Options, true -} - -// HasOptions returns a boolean if a field has been set. -func (o *PartialUpdateInstancePayload) HasOptions() bool { - if o != nil && !IsNil(o.Options) { - return true - } - - return false -} - -// SetOptions gets a reference to the given map[string]string and assigns it to the Options field. -func (o *PartialUpdateInstancePayload) SetOptions(v map[string]string) { - o.Options = &v -} - -// GetReplicas returns the Replicas field value if set, zero value otherwise. -func (o *PartialUpdateInstancePayload) GetReplicas() int32 { - if o == nil || IsNil(o.Replicas) { - var ret int32 - return ret - } - return *o.Replicas -} - -// GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PartialUpdateInstancePayload) GetReplicasOk() (*int32, bool) { - if o == nil || IsNil(o.Replicas) { - return nil, false - } - return o.Replicas, true -} - -// HasReplicas returns a boolean if a field has been set. -func (o *PartialUpdateInstancePayload) HasReplicas() bool { - if o != nil && !IsNil(o.Replicas) { - return true - } - - return false -} - -// SetReplicas gets a reference to the given int32 and assigns it to the Replicas field. -func (o *PartialUpdateInstancePayload) SetReplicas(v int32) { - o.Replicas = &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.Acl) { - toSerialize["acl"] = o.Acl - } - 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.Options) { - toSerialize["options"] = o.Options - } - if !IsNil(o.Replicas) { - toSerialize["replicas"] = o.Replicas - } - 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, "acl") - delete(additionalProperties, "backupSchedule") - delete(additionalProperties, "flavorId") - delete(additionalProperties, "labels") - delete(additionalProperties, "name") - delete(additionalProperties, "options") - delete(additionalProperties, "replicas") - 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/v1api/model_partial_update_instance_response.go b/services/postgresflex/v1api/model_partial_update_instance_response.go deleted file mode 100644 index 9bda4f607c..0000000000 --- a/services/postgresflex/v1api/model_partial_update_instance_response.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the PartialUpdateInstanceResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PartialUpdateInstanceResponse{} - -// PartialUpdateInstanceResponse struct for PartialUpdateInstanceResponse -type PartialUpdateInstanceResponse struct { - Item *Instance `json:"item,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _PartialUpdateInstanceResponse PartialUpdateInstanceResponse - -// 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 -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 -func NewPartialUpdateInstanceResponseWithDefaults() *PartialUpdateInstanceResponse { - this := PartialUpdateInstanceResponse{} - return &this -} - -// GetItem returns the Item field value if set, zero value otherwise. -func (o *PartialUpdateInstanceResponse) GetItem() Instance { - if o == nil || IsNil(o.Item) { - var ret Instance - return ret - } - return *o.Item -} - -// GetItemOk returns a tuple with the Item field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PartialUpdateInstanceResponse) GetItemOk() (*Instance, bool) { - if o == nil || IsNil(o.Item) { - return nil, false - } - return o.Item, true -} - -// HasItem returns a boolean if a field has been set. -func (o *PartialUpdateInstanceResponse) HasItem() bool { - if o != nil && !IsNil(o.Item) { - return true - } - - return false -} - -// SetItem gets a reference to the given Instance and assigns it to the Item field. -func (o *PartialUpdateInstanceResponse) SetItem(v Instance) { - o.Item = &v -} - -func (o PartialUpdateInstanceResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PartialUpdateInstanceResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Item) { - toSerialize["item"] = o.Item - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *PartialUpdateInstanceResponse) UnmarshalJSON(data []byte) (err error) { - varPartialUpdateInstanceResponse := _PartialUpdateInstanceResponse{} - - err = json.Unmarshal(data, &varPartialUpdateInstanceResponse) - - if err != nil { - return err - } - - *o = PartialUpdateInstanceResponse(varPartialUpdateInstanceResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "item") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePartialUpdateInstanceResponse struct { - value *PartialUpdateInstanceResponse - isSet bool -} - -func (v NullablePartialUpdateInstanceResponse) Get() *PartialUpdateInstanceResponse { - return v.value -} - -func (v *NullablePartialUpdateInstanceResponse) Set(val *PartialUpdateInstanceResponse) { - v.value = val - v.isSet = true -} - -func (v NullablePartialUpdateInstanceResponse) IsSet() bool { - return v.isSet -} - -func (v *NullablePartialUpdateInstanceResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePartialUpdateInstanceResponse(val *PartialUpdateInstanceResponse) *NullablePartialUpdateInstanceResponse { - return &NullablePartialUpdateInstanceResponse{value: val, isSet: true} -} - -func (v NullablePartialUpdateInstanceResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePartialUpdateInstanceResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_partial_update_user_payload.go b/services/postgresflex/v1api/model_partial_update_user_payload.go deleted file mode 100644 index e310319e24..0000000000 --- a/services/postgresflex/v1api/model_partial_update_user_payload.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -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 { - Database *string `json:"database,omitempty"` - 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 -} - -// GetDatabase returns the Database field value if set, zero value otherwise. -func (o *PartialUpdateUserPayload) GetDatabase() string { - if o == nil || IsNil(o.Database) { - var ret string - return ret - } - return *o.Database -} - -// GetDatabaseOk returns a tuple with the Database field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PartialUpdateUserPayload) GetDatabaseOk() (*string, bool) { - if o == nil || IsNil(o.Database) { - return nil, false - } - return o.Database, true -} - -// HasDatabase returns a boolean if a field has been set. -func (o *PartialUpdateUserPayload) HasDatabase() bool { - if o != nil && !IsNil(o.Database) { - return true - } - - return false -} - -// SetDatabase gets a reference to the given string and assigns it to the Database field. -func (o *PartialUpdateUserPayload) SetDatabase(v string) { - o.Database = &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.Database) { - toSerialize["database"] = o.Database - } - 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, "database") - 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/v1api/model_postgres_database_parameter.go b/services/postgresflex/v1api/model_postgres_database_parameter.go deleted file mode 100644 index 573920a8ae..0000000000 --- a/services/postgresflex/v1api/model_postgres_database_parameter.go +++ /dev/null @@ -1,573 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the PostgresDatabaseParameter type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PostgresDatabaseParameter{} - -// PostgresDatabaseParameter struct for PostgresDatabaseParameter -type PostgresDatabaseParameter struct { - // Context of the parameter. - Context *string `json:"context,omitempty"` - // Datatype describes the type of data that is used in the Value field. - DataType *string `json:"dataType,omitempty"` - // DefaultValue for the value field. - DefaultValue *string `json:"defaultValue,omitempty"` - // Description of the parameter. - Description *string `json:"description,omitempty"` - // Edit shows if the user can change this value. - Edit *bool `json:"edit,omitempty"` - // MaxValue describes the highest possible value that can be set. - MaxValue *string `json:"maxValue,omitempty"` - // MinValue describes the lowest possible value that can be set. - MinValue *string `json:"minValue,omitempty"` - // Name of the parameter. - Name *string `json:"name,omitempty"` - // PendingRestart describes if a parameter change requires a restart of the server. - PendingRestart *bool `json:"pendingRestart,omitempty"` - // ResetValue for the value field af.ter a reset. - ResetValue *string `json:"resetValue,omitempty"` - // Unit if the parameter has a unit if not empty. - Unit *string `json:"unit,omitempty"` - // Value of this parameter. - Value *string `json:"value,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _PostgresDatabaseParameter PostgresDatabaseParameter - -// 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 -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 -func NewPostgresDatabaseParameterWithDefaults() *PostgresDatabaseParameter { - this := PostgresDatabaseParameter{} - return &this -} - -// GetContext returns the Context field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetContext() string { - if o == nil || IsNil(o.Context) { - var ret string - return ret - } - return *o.Context -} - -// GetContextOk returns a tuple with the Context field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameter) GetContextOk() (*string, bool) { - if o == nil || IsNil(o.Context) { - return nil, false - } - return o.Context, true -} - -// HasContext returns a boolean if a field has been set. -func (o *PostgresDatabaseParameter) HasContext() bool { - if o != nil && !IsNil(o.Context) { - return true - } - - return false -} - -// SetContext gets a reference to the given string and assigns it to the Context field. -func (o *PostgresDatabaseParameter) SetContext(v string) { - o.Context = &v -} - -// GetDataType returns the DataType field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetDataType() string { - if o == nil || IsNil(o.DataType) { - var ret string - return ret - } - return *o.DataType -} - -// GetDataTypeOk returns a tuple with the DataType field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameter) GetDataTypeOk() (*string, bool) { - if o == nil || IsNil(o.DataType) { - return nil, false - } - return o.DataType, true -} - -// HasDataType returns a boolean if a field has been set. -func (o *PostgresDatabaseParameter) HasDataType() bool { - if o != nil && !IsNil(o.DataType) { - return true - } - - return false -} - -// SetDataType gets a reference to the given string and assigns it to the DataType field. -func (o *PostgresDatabaseParameter) SetDataType(v string) { - o.DataType = &v -} - -// GetDefaultValue returns the DefaultValue field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetDefaultValue() string { - if o == nil || IsNil(o.DefaultValue) { - var ret string - return ret - } - return *o.DefaultValue -} - -// GetDefaultValueOk returns a tuple with the DefaultValue field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameter) GetDefaultValueOk() (*string, bool) { - if o == nil || IsNil(o.DefaultValue) { - return nil, false - } - return o.DefaultValue, true -} - -// HasDefaultValue returns a boolean if a field has been set. -func (o *PostgresDatabaseParameter) HasDefaultValue() bool { - if o != nil && !IsNil(o.DefaultValue) { - return true - } - - return false -} - -// SetDefaultValue gets a reference to the given string and assigns it to the DefaultValue field. -func (o *PostgresDatabaseParameter) SetDefaultValue(v string) { - o.DefaultValue = &v -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetDescription() string { - if o == nil || IsNil(o.Description) { - var ret string - return ret - } - return *o.Description -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameter) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *PostgresDatabaseParameter) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *PostgresDatabaseParameter) SetDescription(v string) { - o.Description = &v -} - -// GetEdit returns the Edit field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetEdit() bool { - if o == nil || IsNil(o.Edit) { - var ret bool - return ret - } - return *o.Edit -} - -// GetEditOk returns a tuple with the Edit field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameter) GetEditOk() (*bool, bool) { - if o == nil || IsNil(o.Edit) { - return nil, false - } - return o.Edit, true -} - -// HasEdit returns a boolean if a field has been set. -func (o *PostgresDatabaseParameter) HasEdit() bool { - if o != nil && !IsNil(o.Edit) { - return true - } - - return false -} - -// SetEdit gets a reference to the given bool and assigns it to the Edit field. -func (o *PostgresDatabaseParameter) SetEdit(v bool) { - o.Edit = &v -} - -// GetMaxValue returns the MaxValue field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetMaxValue() string { - if o == nil || IsNil(o.MaxValue) { - var ret string - return ret - } - return *o.MaxValue -} - -// GetMaxValueOk returns a tuple with the MaxValue field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameter) GetMaxValueOk() (*string, bool) { - if o == nil || IsNil(o.MaxValue) { - return nil, false - } - return o.MaxValue, true -} - -// HasMaxValue returns a boolean if a field has been set. -func (o *PostgresDatabaseParameter) HasMaxValue() bool { - if o != nil && !IsNil(o.MaxValue) { - return true - } - - return false -} - -// SetMaxValue gets a reference to the given string and assigns it to the MaxValue field. -func (o *PostgresDatabaseParameter) SetMaxValue(v string) { - o.MaxValue = &v -} - -// GetMinValue returns the MinValue field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetMinValue() string { - if o == nil || IsNil(o.MinValue) { - var ret string - return ret - } - return *o.MinValue -} - -// GetMinValueOk returns a tuple with the MinValue field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameter) GetMinValueOk() (*string, bool) { - if o == nil || IsNil(o.MinValue) { - return nil, false - } - return o.MinValue, true -} - -// HasMinValue returns a boolean if a field has been set. -func (o *PostgresDatabaseParameter) HasMinValue() bool { - if o != nil && !IsNil(o.MinValue) { - return true - } - - return false -} - -// SetMinValue gets a reference to the given string and assigns it to the MinValue field. -func (o *PostgresDatabaseParameter) SetMinValue(v string) { - o.MinValue = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) 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 *PostgresDatabaseParameter) 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 *PostgresDatabaseParameter) 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 *PostgresDatabaseParameter) SetName(v string) { - o.Name = &v -} - -// GetPendingRestart returns the PendingRestart field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetPendingRestart() bool { - if o == nil || IsNil(o.PendingRestart) { - var ret bool - return ret - } - return *o.PendingRestart -} - -// GetPendingRestartOk returns a tuple with the PendingRestart field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameter) GetPendingRestartOk() (*bool, bool) { - if o == nil || IsNil(o.PendingRestart) { - return nil, false - } - return o.PendingRestart, true -} - -// HasPendingRestart returns a boolean if a field has been set. -func (o *PostgresDatabaseParameter) HasPendingRestart() bool { - if o != nil && !IsNil(o.PendingRestart) { - return true - } - - return false -} - -// SetPendingRestart gets a reference to the given bool and assigns it to the PendingRestart field. -func (o *PostgresDatabaseParameter) SetPendingRestart(v bool) { - o.PendingRestart = &v -} - -// GetResetValue returns the ResetValue field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetResetValue() string { - if o == nil || IsNil(o.ResetValue) { - var ret string - return ret - } - return *o.ResetValue -} - -// GetResetValueOk returns a tuple with the ResetValue field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameter) GetResetValueOk() (*string, bool) { - if o == nil || IsNil(o.ResetValue) { - return nil, false - } - return o.ResetValue, true -} - -// HasResetValue returns a boolean if a field has been set. -func (o *PostgresDatabaseParameter) HasResetValue() bool { - if o != nil && !IsNil(o.ResetValue) { - return true - } - - return false -} - -// SetResetValue gets a reference to the given string and assigns it to the ResetValue field. -func (o *PostgresDatabaseParameter) SetResetValue(v string) { - o.ResetValue = &v -} - -// GetUnit returns the Unit field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetUnit() string { - if o == nil || IsNil(o.Unit) { - var ret string - return ret - } - return *o.Unit -} - -// GetUnitOk returns a tuple with the Unit field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameter) GetUnitOk() (*string, bool) { - if o == nil || IsNil(o.Unit) { - return nil, false - } - return o.Unit, true -} - -// HasUnit returns a boolean if a field has been set. -func (o *PostgresDatabaseParameter) HasUnit() bool { - if o != nil && !IsNil(o.Unit) { - return true - } - - return false -} - -// SetUnit gets a reference to the given string and assigns it to the Unit field. -func (o *PostgresDatabaseParameter) SetUnit(v string) { - o.Unit = &v -} - -// GetValue returns the Value field value if set, zero value otherwise. -func (o *PostgresDatabaseParameter) GetValue() string { - if o == nil || IsNil(o.Value) { - var ret string - return ret - } - return *o.Value -} - -// GetValueOk returns a tuple with the Value field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameter) GetValueOk() (*string, bool) { - if o == nil || IsNil(o.Value) { - return nil, false - } - return o.Value, true -} - -// HasValue returns a boolean if a field has been set. -func (o *PostgresDatabaseParameter) HasValue() bool { - if o != nil && !IsNil(o.Value) { - return true - } - - return false -} - -// SetValue gets a reference to the given string and assigns it to the Value field. -func (o *PostgresDatabaseParameter) SetValue(v string) { - o.Value = &v -} - -func (o PostgresDatabaseParameter) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PostgresDatabaseParameter) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Context) { - toSerialize["context"] = o.Context - } - if !IsNil(o.DataType) { - toSerialize["dataType"] = o.DataType - } - if !IsNil(o.DefaultValue) { - toSerialize["defaultValue"] = o.DefaultValue - } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description - } - if !IsNil(o.Edit) { - toSerialize["edit"] = o.Edit - } - if !IsNil(o.MaxValue) { - toSerialize["maxValue"] = o.MaxValue - } - if !IsNil(o.MinValue) { - toSerialize["minValue"] = o.MinValue - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.PendingRestart) { - toSerialize["pendingRestart"] = o.PendingRestart - } - if !IsNil(o.ResetValue) { - toSerialize["resetValue"] = o.ResetValue - } - if !IsNil(o.Unit) { - toSerialize["unit"] = o.Unit - } - if !IsNil(o.Value) { - toSerialize["value"] = o.Value - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *PostgresDatabaseParameter) UnmarshalJSON(data []byte) (err error) { - varPostgresDatabaseParameter := _PostgresDatabaseParameter{} - - err = json.Unmarshal(data, &varPostgresDatabaseParameter) - - if err != nil { - return err - } - - *o = PostgresDatabaseParameter(varPostgresDatabaseParameter) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "context") - delete(additionalProperties, "dataType") - delete(additionalProperties, "defaultValue") - delete(additionalProperties, "description") - delete(additionalProperties, "edit") - delete(additionalProperties, "maxValue") - delete(additionalProperties, "minValue") - delete(additionalProperties, "name") - delete(additionalProperties, "pendingRestart") - delete(additionalProperties, "resetValue") - delete(additionalProperties, "unit") - delete(additionalProperties, "value") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePostgresDatabaseParameter struct { - value *PostgresDatabaseParameter - isSet bool -} - -func (v NullablePostgresDatabaseParameter) Get() *PostgresDatabaseParameter { - return v.value -} - -func (v *NullablePostgresDatabaseParameter) Set(val *PostgresDatabaseParameter) { - v.value = val - v.isSet = true -} - -func (v NullablePostgresDatabaseParameter) IsSet() bool { - return v.isSet -} - -func (v *NullablePostgresDatabaseParameter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePostgresDatabaseParameter(val *PostgresDatabaseParameter) *NullablePostgresDatabaseParameter { - return &NullablePostgresDatabaseParameter{value: val, isSet: true} -} - -func (v NullablePostgresDatabaseParameter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePostgresDatabaseParameter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_postgres_database_parameter_response.go b/services/postgresflex/v1api/model_postgres_database_parameter_response.go deleted file mode 100644 index 3f24aca092..0000000000 --- a/services/postgresflex/v1api/model_postgres_database_parameter_response.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the PostgresDatabaseParameterResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PostgresDatabaseParameterResponse{} - -// PostgresDatabaseParameterResponse struct for PostgresDatabaseParameterResponse -type PostgresDatabaseParameterResponse struct { - // List of the parameter - Parameter []PostgresDatabaseParameter `json:"parameter,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _PostgresDatabaseParameterResponse PostgresDatabaseParameterResponse - -// 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 -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 -func NewPostgresDatabaseParameterResponseWithDefaults() *PostgresDatabaseParameterResponse { - this := PostgresDatabaseParameterResponse{} - return &this -} - -// GetParameter returns the Parameter field value if set, zero value otherwise. -func (o *PostgresDatabaseParameterResponse) GetParameter() []PostgresDatabaseParameter { - if o == nil || IsNil(o.Parameter) { - var ret []PostgresDatabaseParameter - return ret - } - return o.Parameter -} - -// GetParameterOk returns a tuple with the Parameter field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PostgresDatabaseParameterResponse) GetParameterOk() ([]PostgresDatabaseParameter, bool) { - if o == nil || IsNil(o.Parameter) { - return nil, false - } - return o.Parameter, true -} - -// HasParameter returns a boolean if a field has been set. -func (o *PostgresDatabaseParameterResponse) HasParameter() bool { - if o != nil && !IsNil(o.Parameter) { - return true - } - - return false -} - -// SetParameter gets a reference to the given []PostgresDatabaseParameter and assigns it to the Parameter field. -func (o *PostgresDatabaseParameterResponse) SetParameter(v []PostgresDatabaseParameter) { - o.Parameter = v -} - -func (o PostgresDatabaseParameterResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PostgresDatabaseParameterResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Parameter) { - toSerialize["parameter"] = o.Parameter - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *PostgresDatabaseParameterResponse) UnmarshalJSON(data []byte) (err error) { - varPostgresDatabaseParameterResponse := _PostgresDatabaseParameterResponse{} - - err = json.Unmarshal(data, &varPostgresDatabaseParameterResponse) - - if err != nil { - return err - } - - *o = PostgresDatabaseParameterResponse(varPostgresDatabaseParameterResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "parameter") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePostgresDatabaseParameterResponse struct { - value *PostgresDatabaseParameterResponse - isSet bool -} - -func (v NullablePostgresDatabaseParameterResponse) Get() *PostgresDatabaseParameterResponse { - return v.value -} - -func (v *NullablePostgresDatabaseParameterResponse) Set(val *PostgresDatabaseParameterResponse) { - v.value = val - v.isSet = true -} - -func (v NullablePostgresDatabaseParameterResponse) IsSet() bool { - return v.isSet -} - -func (v *NullablePostgresDatabaseParameterResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePostgresDatabaseParameterResponse(val *PostgresDatabaseParameterResponse) *NullablePostgresDatabaseParameterResponse { - return &NullablePostgresDatabaseParameterResponse{value: val, isSet: true} -} - -func (v NullablePostgresDatabaseParameterResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePostgresDatabaseParameterResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_reset_user_response.go b/services/postgresflex/v1api/model_reset_user_response.go deleted file mode 100644 index 90cede8792..0000000000 --- a/services/postgresflex/v1api/model_reset_user_response.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the ResetUserResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ResetUserResponse{} - -// ResetUserResponse struct for ResetUserResponse -type ResetUserResponse struct { - Item *User `json:"item,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ResetUserResponse ResetUserResponse - -// NewResetUserResponse instantiates a new ResetUserResponse 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 NewResetUserResponse() *ResetUserResponse { - this := ResetUserResponse{} - return &this -} - -// NewResetUserResponseWithDefaults instantiates a new ResetUserResponse 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 NewResetUserResponseWithDefaults() *ResetUserResponse { - this := ResetUserResponse{} - return &this -} - -// GetItem returns the Item field value if set, zero value otherwise. -func (o *ResetUserResponse) GetItem() User { - if o == nil || IsNil(o.Item) { - var ret User - return ret - } - return *o.Item -} - -// GetItemOk returns a tuple with the Item field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ResetUserResponse) GetItemOk() (*User, bool) { - if o == nil || IsNil(o.Item) { - return nil, false - } - return o.Item, true -} - -// HasItem returns a boolean if a field has been set. -func (o *ResetUserResponse) HasItem() bool { - if o != nil && !IsNil(o.Item) { - return true - } - - return false -} - -// SetItem gets a reference to the given User and assigns it to the Item field. -func (o *ResetUserResponse) SetItem(v User) { - o.Item = &v -} - -func (o ResetUserResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ResetUserResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Item) { - toSerialize["item"] = o.Item - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ResetUserResponse) UnmarshalJSON(data []byte) (err error) { - varResetUserResponse := _ResetUserResponse{} - - err = json.Unmarshal(data, &varResetUserResponse) - - if err != nil { - return err - } - - *o = ResetUserResponse(varResetUserResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "item") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableResetUserResponse struct { - value *ResetUserResponse - isSet bool -} - -func (v NullableResetUserResponse) Get() *ResetUserResponse { - return v.value -} - -func (v *NullableResetUserResponse) Set(val *ResetUserResponse) { - v.value = val - v.isSet = true -} - -func (v NullableResetUserResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableResetUserResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableResetUserResponse(val *ResetUserResponse) *NullableResetUserResponse { - return &NullableResetUserResponse{value: val, isSet: true} -} - -func (v NullableResetUserResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableResetUserResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_storage.go b/services/postgresflex/v1api/model_storage.go deleted file mode 100644 index be183ec1cb..0000000000 --- a/services/postgresflex/v1api/model_storage.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the Storage type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Storage{} - -// Storage struct for Storage -type Storage struct { - Class *string `json:"class,omitempty"` - 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/v1api/model_storage_range.go b/services/postgresflex/v1api/model_storage_range.go deleted file mode 100644 index 48b7b48878..0000000000 --- a/services/postgresflex/v1api/model_storage_range.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the StorageRange type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &StorageRange{} - -// StorageRange struct for StorageRange -type StorageRange struct { - Max *int32 `json:"max,omitempty"` - Min *int32 `json:"min,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _StorageRange StorageRange - -// NewStorageRange instantiates a new StorageRange 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 NewStorageRange() *StorageRange { - this := StorageRange{} - return &this -} - -// NewStorageRangeWithDefaults instantiates a new StorageRange 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 NewStorageRangeWithDefaults() *StorageRange { - this := StorageRange{} - return &this -} - -// GetMax returns the Max field value if set, zero value otherwise. -func (o *StorageRange) GetMax() int32 { - if o == nil || IsNil(o.Max) { - var ret int32 - return ret - } - return *o.Max -} - -// GetMaxOk returns a tuple with the Max field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *StorageRange) GetMaxOk() (*int32, bool) { - if o == nil || IsNil(o.Max) { - return nil, false - } - return o.Max, true -} - -// HasMax returns a boolean if a field has been set. -func (o *StorageRange) HasMax() bool { - if o != nil && !IsNil(o.Max) { - return true - } - - return false -} - -// SetMax gets a reference to the given int32 and assigns it to the Max field. -func (o *StorageRange) SetMax(v int32) { - o.Max = &v -} - -// GetMin returns the Min field value if set, zero value otherwise. -func (o *StorageRange) GetMin() int32 { - if o == nil || IsNil(o.Min) { - var ret int32 - return ret - } - return *o.Min -} - -// GetMinOk returns a tuple with the Min field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *StorageRange) GetMinOk() (*int32, bool) { - if o == nil || IsNil(o.Min) { - return nil, false - } - return o.Min, true -} - -// HasMin returns a boolean if a field has been set. -func (o *StorageRange) HasMin() bool { - if o != nil && !IsNil(o.Min) { - return true - } - - return false -} - -// SetMin gets a reference to the given int32 and assigns it to the Min field. -func (o *StorageRange) SetMin(v int32) { - o.Min = &v -} - -func (o StorageRange) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o StorageRange) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Max) { - toSerialize["max"] = o.Max - } - if !IsNil(o.Min) { - toSerialize["min"] = o.Min - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *StorageRange) UnmarshalJSON(data []byte) (err error) { - varStorageRange := _StorageRange{} - - err = json.Unmarshal(data, &varStorageRange) - - if err != nil { - return err - } - - *o = StorageRange(varStorageRange) - - 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 NullableStorageRange struct { - value *StorageRange - isSet bool -} - -func (v NullableStorageRange) Get() *StorageRange { - return v.value -} - -func (v *NullableStorageRange) Set(val *StorageRange) { - v.value = val - v.isSet = true -} - -func (v NullableStorageRange) IsSet() bool { - return v.isSet -} - -func (v *NullableStorageRange) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableStorageRange(val *StorageRange) *NullableStorageRange { - return &NullableStorageRange{value: val, isSet: true} -} - -func (v NullableStorageRange) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableStorageRange) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_storage_update.go b/services/postgresflex/v1api/model_storage_update.go deleted file mode 100644 index f277a58b7a..0000000000 --- a/services/postgresflex/v1api/model_storage_update.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the StorageUpdate type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &StorageUpdate{} - -// StorageUpdate struct for StorageUpdate -type StorageUpdate struct { - // ⚠️ **DEPRECATED AND NON-FUNCTIONAL:** Updating the performance class field is not possible. - // Deprecated - Class *string `json:"class,omitempty"` - 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 -} - -// GetClass returns the Class field value if set, zero value otherwise. -// Deprecated -func (o *StorageUpdate) 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. -// Deprecated -func (o *StorageUpdate) 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 *StorageUpdate) 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. -// Deprecated -func (o *StorageUpdate) SetClass(v string) { - o.Class = &v -} - -// 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.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 *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, "class") - 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/v1api/model_update_backup_schedule_payload.go b/services/postgresflex/v1api/model_update_backup_schedule_payload.go deleted file mode 100644 index 3e2345e1dd..0000000000 --- a/services/postgresflex/v1api/model_update_backup_schedule_payload.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the UpdateBackupSchedulePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateBackupSchedulePayload{} - -// UpdateBackupSchedulePayload struct for UpdateBackupSchedulePayload -type UpdateBackupSchedulePayload struct { - BackupSchedule string `json:"backupSchedule"` - AdditionalProperties map[string]interface{} -} - -type _UpdateBackupSchedulePayload UpdateBackupSchedulePayload - -// NewUpdateBackupSchedulePayload instantiates a new UpdateBackupSchedulePayload 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 NewUpdateBackupSchedulePayload(backupSchedule string) *UpdateBackupSchedulePayload { - this := UpdateBackupSchedulePayload{} - this.BackupSchedule = backupSchedule - return &this -} - -// NewUpdateBackupSchedulePayloadWithDefaults instantiates a new UpdateBackupSchedulePayload 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 NewUpdateBackupSchedulePayloadWithDefaults() *UpdateBackupSchedulePayload { - this := UpdateBackupSchedulePayload{} - return &this -} - -// GetBackupSchedule returns the BackupSchedule field value -func (o *UpdateBackupSchedulePayload) 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 *UpdateBackupSchedulePayload) GetBackupScheduleOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.BackupSchedule, true -} - -// SetBackupSchedule sets field value -func (o *UpdateBackupSchedulePayload) SetBackupSchedule(v string) { - o.BackupSchedule = v -} - -func (o UpdateBackupSchedulePayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateBackupSchedulePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["backupSchedule"] = o.BackupSchedule - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *UpdateBackupSchedulePayload) 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", - } - - 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) - } - } - - varUpdateBackupSchedulePayload := _UpdateBackupSchedulePayload{} - - err = json.Unmarshal(data, &varUpdateBackupSchedulePayload) - - if err != nil { - return err - } - - *o = UpdateBackupSchedulePayload(varUpdateBackupSchedulePayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "backupSchedule") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableUpdateBackupSchedulePayload struct { - value *UpdateBackupSchedulePayload - isSet bool -} - -func (v NullableUpdateBackupSchedulePayload) Get() *UpdateBackupSchedulePayload { - return v.value -} - -func (v *NullableUpdateBackupSchedulePayload) Set(val *UpdateBackupSchedulePayload) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateBackupSchedulePayload) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateBackupSchedulePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateBackupSchedulePayload(val *UpdateBackupSchedulePayload) *NullableUpdateBackupSchedulePayload { - return &NullableUpdateBackupSchedulePayload{value: val, isSet: true} -} - -func (v NullableUpdateBackupSchedulePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateBackupSchedulePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_update_instance_payload.go b/services/postgresflex/v1api/model_update_instance_payload.go deleted file mode 100644 index 980c4e68f9..0000000000 --- a/services/postgresflex/v1api/model_update_instance_payload.go +++ /dev/null @@ -1,451 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the UpdateInstancePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateInstancePayload{} - -// UpdateInstancePayload struct for UpdateInstancePayload -type UpdateInstancePayload struct { - Acl *ACL `json:"acl,omitempty"` - BackupSchedule *string `json:"backupSchedule,omitempty"` - FlavorId *string `json:"flavorId,omitempty"` - // Labels field is not certain/clear - Labels *map[string]string `json:"labels,omitempty"` - Name *string `json:"name,omitempty"` - Options *map[string]string `json:"options,omitempty"` - Replicas *int32 `json:"replicas,omitempty"` - Storage *StorageUpdate `json:"storage,omitempty"` - Version *string `json:"version,omitempty"` - 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() *UpdateInstancePayload { - this := UpdateInstancePayload{} - 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 -} - -// GetAcl returns the Acl field value if set, zero value otherwise. -func (o *UpdateInstancePayload) GetAcl() ACL { - if o == nil || IsNil(o.Acl) { - var ret ACL - 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 *UpdateInstancePayload) GetAclOk() (*ACL, 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 *UpdateInstancePayload) HasAcl() bool { - if o != nil && !IsNil(o.Acl) { - return true - } - - return false -} - -// SetAcl gets a reference to the given ACL and assigns it to the Acl field. -func (o *UpdateInstancePayload) SetAcl(v ACL) { - o.Acl = &v -} - -// GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. -func (o *UpdateInstancePayload) 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 *UpdateInstancePayload) 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 *UpdateInstancePayload) 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 *UpdateInstancePayload) SetBackupSchedule(v string) { - o.BackupSchedule = &v -} - -// GetFlavorId returns the FlavorId field value if set, zero value otherwise. -func (o *UpdateInstancePayload) 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 *UpdateInstancePayload) 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 *UpdateInstancePayload) 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 *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 if set, zero value otherwise. -func (o *UpdateInstancePayload) 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 *UpdateInstancePayload) 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 *UpdateInstancePayload) 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 *UpdateInstancePayload) SetName(v string) { - o.Name = &v -} - -// GetOptions returns the Options field value if set, zero value otherwise. -func (o *UpdateInstancePayload) GetOptions() map[string]string { - if o == nil || IsNil(o.Options) { - var ret map[string]string - return ret - } - return *o.Options -} - -// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateInstancePayload) GetOptionsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Options) { - return nil, false - } - return o.Options, true -} - -// HasOptions returns a boolean if a field has been set. -func (o *UpdateInstancePayload) HasOptions() bool { - if o != nil && !IsNil(o.Options) { - return true - } - - return false -} - -// SetOptions gets a reference to the given map[string]string and assigns it to the Options field. -func (o *UpdateInstancePayload) SetOptions(v map[string]string) { - o.Options = &v -} - -// GetReplicas returns the Replicas field value if set, zero value otherwise. -func (o *UpdateInstancePayload) GetReplicas() int32 { - if o == nil || IsNil(o.Replicas) { - var ret int32 - return ret - } - return *o.Replicas -} - -// GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateInstancePayload) GetReplicasOk() (*int32, bool) { - if o == nil || IsNil(o.Replicas) { - return nil, false - } - return o.Replicas, true -} - -// HasReplicas returns a boolean if a field has been set. -func (o *UpdateInstancePayload) HasReplicas() bool { - if o != nil && !IsNil(o.Replicas) { - return true - } - - return false -} - -// SetReplicas gets a reference to the given int32 and assigns it to the Replicas field. -func (o *UpdateInstancePayload) SetReplicas(v int32) { - o.Replicas = &v -} - -// GetStorage returns the Storage field value if set, zero value otherwise. -func (o *UpdateInstancePayload) 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 *UpdateInstancePayload) 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 *UpdateInstancePayload) 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 *UpdateInstancePayload) SetStorage(v StorageUpdate) { - o.Storage = &v -} - -// GetVersion returns the Version field value if set, zero value otherwise. -func (o *UpdateInstancePayload) 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 *UpdateInstancePayload) 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 *UpdateInstancePayload) 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 *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{}{} - if !IsNil(o.Acl) { - toSerialize["acl"] = o.Acl - } - 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.Options) { - toSerialize["options"] = o.Options - } - if !IsNil(o.Replicas) { - toSerialize["replicas"] = o.Replicas - } - 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 *UpdateInstancePayload) UnmarshalJSON(data []byte) (err error) { - 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, "acl") - delete(additionalProperties, "backupSchedule") - delete(additionalProperties, "flavorId") - delete(additionalProperties, "labels") - delete(additionalProperties, "name") - delete(additionalProperties, "options") - delete(additionalProperties, "replicas") - 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/v1api/model_update_user_payload.go b/services/postgresflex/v1api/model_update_user_payload.go deleted file mode 100644 index 97e2c5b74f..0000000000 --- a/services/postgresflex/v1api/model_update_user_payload.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the UpdateUserPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateUserPayload{} - -// UpdateUserPayload struct for UpdateUserPayload -type UpdateUserPayload struct { - Database *string `json:"database,omitempty"` - Roles []string `json:"roles,omitempty"` - 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() *UpdateUserPayload { - this := UpdateUserPayload{} - 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 -} - -// GetDatabase returns the Database field value if set, zero value otherwise. -func (o *UpdateUserPayload) GetDatabase() string { - if o == nil || IsNil(o.Database) { - var ret string - return ret - } - return *o.Database -} - -// GetDatabaseOk returns a tuple with the Database field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateUserPayload) GetDatabaseOk() (*string, bool) { - if o == nil || IsNil(o.Database) { - return nil, false - } - return o.Database, true -} - -// HasDatabase returns a boolean if a field has been set. -func (o *UpdateUserPayload) HasDatabase() bool { - if o != nil && !IsNil(o.Database) { - return true - } - - return false -} - -// SetDatabase gets a reference to the given string and assigns it to the Database field. -func (o *UpdateUserPayload) SetDatabase(v string) { - o.Database = &v -} - -// GetRoles returns the Roles field value if set, zero value otherwise. -func (o *UpdateUserPayload) 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 *UpdateUserPayload) 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 *UpdateUserPayload) 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 *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.Database) { - toSerialize["database"] = o.Database - } - if !IsNil(o.Roles) { - toSerialize["roles"] = o.Roles - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *UpdateUserPayload) UnmarshalJSON(data []byte) (err error) { - 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, "database") - 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/v1api/model_user.go b/services/postgresflex/v1api/model_user.go deleted file mode 100644 index 9db9bc72f6..0000000000 --- a/services/postgresflex/v1api/model_user.go +++ /dev/null @@ -1,413 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the User type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &User{} - -// User struct for User -type User struct { - Database *string `json:"database,omitempty"` - Host *string `json:"host,omitempty"` - Id *string `json:"id,omitempty"` - Password *string `json:"password,omitempty"` - Port *int32 `json:"port,omitempty"` - Roles []string `json:"roles,omitempty"` - Uri *string `json:"uri,omitempty"` - Username *string `json:"username,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _User User - -// 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 -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 -func NewUserWithDefaults() *User { - this := User{} - return &this -} - -// GetDatabase returns the Database field value if set, zero value otherwise. -func (o *User) GetDatabase() string { - if o == nil || IsNil(o.Database) { - var ret string - return ret - } - return *o.Database -} - -// GetDatabaseOk returns a tuple with the Database field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetDatabaseOk() (*string, bool) { - if o == nil || IsNil(o.Database) { - return nil, false - } - return o.Database, true -} - -// HasDatabase returns a boolean if a field has been set. -func (o *User) HasDatabase() bool { - if o != nil && !IsNil(o.Database) { - return true - } - - return false -} - -// SetDatabase gets a reference to the given string and assigns it to the Database field. -func (o *User) SetDatabase(v string) { - o.Database = &v -} - -// GetHost returns the Host field value if set, zero value otherwise. -func (o *User) GetHost() string { - if o == nil || IsNil(o.Host) { - var ret string - return ret - } - return *o.Host -} - -// GetHostOk returns a tuple with the Host field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetHostOk() (*string, bool) { - if o == nil || IsNil(o.Host) { - return nil, false - } - return o.Host, true -} - -// HasHost returns a boolean if a field has been set. -func (o *User) HasHost() bool { - if o != nil && !IsNil(o.Host) { - return true - } - - return false -} - -// SetHost gets a reference to the given string and assigns it to the Host field. -func (o *User) SetHost(v string) { - o.Host = &v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *User) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *User) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *User) SetId(v string) { - o.Id = &v -} - -// GetPassword returns the Password field value if set, zero value otherwise. -func (o *User) GetPassword() string { - if o == nil || IsNil(o.Password) { - var ret string - return ret - } - return *o.Password -} - -// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetPasswordOk() (*string, bool) { - if o == nil || IsNil(o.Password) { - return nil, false - } - return o.Password, true -} - -// HasPassword returns a boolean if a field has been set. -func (o *User) HasPassword() bool { - if o != nil && !IsNil(o.Password) { - return true - } - - return false -} - -// SetPassword gets a reference to the given string and assigns it to the Password field. -func (o *User) SetPassword(v string) { - o.Password = &v -} - -// GetPort returns the Port field value if set, zero value otherwise. -func (o *User) GetPort() int32 { - if o == nil || IsNil(o.Port) { - var ret int32 - return ret - } - return *o.Port -} - -// GetPortOk returns a tuple with the Port field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetPortOk() (*int32, bool) { - if o == nil || IsNil(o.Port) { - return nil, false - } - return o.Port, true -} - -// HasPort returns a boolean if a field has been set. -func (o *User) HasPort() bool { - if o != nil && !IsNil(o.Port) { - return true - } - - return false -} - -// SetPort gets a reference to the given int32 and assigns it to the Port field. -func (o *User) SetPort(v int32) { - o.Port = &v -} - -// GetRoles returns the Roles field value if set, zero value otherwise. -func (o *User) 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 *User) 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 *User) 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 *User) SetRoles(v []string) { - o.Roles = v -} - -// GetUri returns the Uri field value if set, zero value otherwise. -func (o *User) GetUri() string { - if o == nil || IsNil(o.Uri) { - var ret string - return ret - } - return *o.Uri -} - -// GetUriOk returns a tuple with the Uri field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetUriOk() (*string, bool) { - if o == nil || IsNil(o.Uri) { - return nil, false - } - return o.Uri, true -} - -// HasUri returns a boolean if a field has been set. -func (o *User) HasUri() bool { - if o != nil && !IsNil(o.Uri) { - return true - } - - return false -} - -// SetUri gets a reference to the given string and assigns it to the Uri field. -func (o *User) SetUri(v string) { - o.Uri = &v -} - -// GetUsername returns the Username field value if set, zero value otherwise. -func (o *User) GetUsername() string { - if o == nil || IsNil(o.Username) { - var ret string - return ret - } - return *o.Username -} - -// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetUsernameOk() (*string, bool) { - if o == nil || IsNil(o.Username) { - return nil, false - } - return o.Username, true -} - -// HasUsername returns a boolean if a field has been set. -func (o *User) HasUsername() bool { - if o != nil && !IsNil(o.Username) { - return true - } - - return false -} - -// SetUsername gets a reference to the given string and assigns it to the Username field. -func (o *User) SetUsername(v string) { - o.Username = &v -} - -func (o User) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o User) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Database) { - toSerialize["database"] = o.Database - } - if !IsNil(o.Host) { - toSerialize["host"] = o.Host - } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Password) { - toSerialize["password"] = o.Password - } - if !IsNil(o.Port) { - toSerialize["port"] = o.Port - } - if !IsNil(o.Roles) { - toSerialize["roles"] = o.Roles - } - if !IsNil(o.Uri) { - toSerialize["uri"] = o.Uri - } - if !IsNil(o.Username) { - toSerialize["username"] = o.Username - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *User) UnmarshalJSON(data []byte) (err error) { - varUser := _User{} - - err = json.Unmarshal(data, &varUser) - - if err != nil { - return err - } - - *o = User(varUser) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "database") - delete(additionalProperties, "host") - delete(additionalProperties, "id") - delete(additionalProperties, "password") - delete(additionalProperties, "port") - delete(additionalProperties, "roles") - delete(additionalProperties, "uri") - delete(additionalProperties, "username") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableUser struct { - value *User - isSet bool -} - -func (v NullableUser) Get() *User { - return v.value -} - -func (v *NullableUser) Set(val *User) { - v.value = val - v.isSet = true -} - -func (v NullableUser) IsSet() bool { - return v.isSet -} - -func (v *NullableUser) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUser(val *User) *NullableUser { - return &NullableUser{value: val, isSet: true} -} - -func (v NullableUser) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUser) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/model_user_response.go b/services/postgresflex/v1api/model_user_response.go deleted file mode 100644 index fbbd4a3a3a..0000000000 --- a/services/postgresflex/v1api/model_user_response.go +++ /dev/null @@ -1,302 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" -) - -// checks if the UserResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UserResponse{} - -// UserResponse struct for UserResponse -type UserResponse struct { - Host *string `json:"host,omitempty"` - Id *string `json:"id,omitempty"` - Port *int32 `json:"port,omitempty"` - Roles []string `json:"roles,omitempty"` - Username *string `json:"username,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _UserResponse UserResponse - -// NewUserResponse instantiates a new UserResponse 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 NewUserResponse() *UserResponse { - this := UserResponse{} - return &this -} - -// NewUserResponseWithDefaults instantiates a new UserResponse 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 NewUserResponseWithDefaults() *UserResponse { - this := UserResponse{} - return &this -} - -// GetHost returns the Host field value if set, zero value otherwise. -func (o *UserResponse) GetHost() string { - if o == nil || IsNil(o.Host) { - var ret string - return ret - } - return *o.Host -} - -// GetHostOk returns a tuple with the Host field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UserResponse) GetHostOk() (*string, bool) { - if o == nil || IsNil(o.Host) { - return nil, false - } - return o.Host, true -} - -// HasHost returns a boolean if a field has been set. -func (o *UserResponse) HasHost() bool { - if o != nil && !IsNil(o.Host) { - return true - } - - return false -} - -// SetHost gets a reference to the given string and assigns it to the Host field. -func (o *UserResponse) SetHost(v string) { - o.Host = &v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *UserResponse) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UserResponse) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *UserResponse) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *UserResponse) SetId(v string) { - o.Id = &v -} - -// GetPort returns the Port field value if set, zero value otherwise. -func (o *UserResponse) GetPort() int32 { - if o == nil || IsNil(o.Port) { - var ret int32 - return ret - } - return *o.Port -} - -// GetPortOk returns a tuple with the Port field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UserResponse) GetPortOk() (*int32, bool) { - if o == nil || IsNil(o.Port) { - return nil, false - } - return o.Port, true -} - -// HasPort returns a boolean if a field has been set. -func (o *UserResponse) HasPort() bool { - if o != nil && !IsNil(o.Port) { - return true - } - - return false -} - -// SetPort gets a reference to the given int32 and assigns it to the Port field. -func (o *UserResponse) SetPort(v int32) { - o.Port = &v -} - -// GetRoles returns the Roles field value if set, zero value otherwise. -func (o *UserResponse) 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 *UserResponse) 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 *UserResponse) 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 *UserResponse) SetRoles(v []string) { - o.Roles = v -} - -// GetUsername returns the Username field value if set, zero value otherwise. -func (o *UserResponse) GetUsername() string { - if o == nil || IsNil(o.Username) { - var ret string - return ret - } - return *o.Username -} - -// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UserResponse) GetUsernameOk() (*string, bool) { - if o == nil || IsNil(o.Username) { - return nil, false - } - return o.Username, true -} - -// HasUsername returns a boolean if a field has been set. -func (o *UserResponse) HasUsername() bool { - if o != nil && !IsNil(o.Username) { - return true - } - - return false -} - -// SetUsername gets a reference to the given string and assigns it to the Username field. -func (o *UserResponse) SetUsername(v string) { - o.Username = &v -} - -func (o UserResponse) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UserResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Host) { - toSerialize["host"] = o.Host - } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Port) { - toSerialize["port"] = o.Port - } - if !IsNil(o.Roles) { - toSerialize["roles"] = o.Roles - } - if !IsNil(o.Username) { - toSerialize["username"] = o.Username - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *UserResponse) UnmarshalJSON(data []byte) (err error) { - varUserResponse := _UserResponse{} - - err = json.Unmarshal(data, &varUserResponse) - - if err != nil { - return err - } - - *o = UserResponse(varUserResponse) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "host") - delete(additionalProperties, "id") - delete(additionalProperties, "port") - delete(additionalProperties, "roles") - delete(additionalProperties, "username") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableUserResponse struct { - value *UserResponse - isSet bool -} - -func (v NullableUserResponse) Get() *UserResponse { - return v.value -} - -func (v *NullableUserResponse) Set(val *UserResponse) { - v.value = val - v.isSet = true -} - -func (v NullableUserResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableUserResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUserResponse(val *UserResponse) *NullableUserResponse { - return &NullableUserResponse{value: val, isSet: true} -} - -func (v NullableUserResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUserResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/postgresflex/v1api/response.go b/services/postgresflex/v1api/response.go deleted file mode 100644 index 3d52748d84..0000000000 --- a/services/postgresflex/v1api/response.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -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/v1api/utils.go b/services/postgresflex/v1api/utils.go deleted file mode 100644 index 0ea859d504..0000000000 --- a/services/postgresflex/v1api/utils.go +++ /dev/null @@ -1,362 +0,0 @@ -/* -STACKIT PostgreSQL Flex API (deprecated) - -⚠️ This API is deprecated. It will be retired on 01.07.2027. Please use the STACKIT PostgreSQL Flex API v2 instead. - -API version: 1.0.0 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -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...) -}