diff --git a/services/sqlserverflex/oas_commit b/services/sqlserverflex/oas_commit index 733a533b0..7f8e0b897 100644 --- a/services/sqlserverflex/oas_commit +++ b/services/sqlserverflex/oas_commit @@ -1 +1 @@ -9062b80c83aedd5f1885726c3a5c73ed7c7e9c2c +9ab112b2ac55fe7e2ca5ccbc13edd3764f5e2c18 diff --git a/services/sqlserverflex/v3beta2api/api_default.go b/services/sqlserverflex/v3beta2api/api_default.go index 14f31759c..0c6ab4fa7 100644 --- a/services/sqlserverflex/v3beta2api/api_default.go +++ b/services/sqlserverflex/v3beta2api/api_default.go @@ -142,23 +142,6 @@ type DefaultAPI interface { // @return GetBackupResponse GetBackupExecute(r ApiGetBackupRequest) (*GetBackupResponse, error) - /* - GetCollations Get database collation list - - Returns a list of collations for an instance - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT project ID. - @param region The region which should be addressed - @param instanceId The ID of the instance. - @return ApiGetCollationsRequest - */ - GetCollations(ctx context.Context, projectId string, region string, instanceId string) ApiGetCollationsRequest - - // GetCollationsExecute executes the request - // @return GetCollationsResponse - GetCollationsExecute(r ApiGetCollationsRequest) (*GetCollationsResponse, error) - /* GetDatabase Get Database @@ -210,23 +193,6 @@ type DefaultAPI interface { // @return GetInstanceResponse GetInstanceExecute(r ApiGetInstanceRequest) (*GetInstanceResponse, error) - /* - GetStorages 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 The STACKIT project ID. - @param region The region which should be addressed - @param flavorId The id of an instance flavor. - @return ApiGetStoragesRequest - */ - GetStorages(ctx context.Context, projectId string, region string, flavorId string) ApiGetStoragesRequest - - // GetStoragesExecute executes the request - // @return GetStoragesResponse - GetStoragesExecute(r ApiGetStoragesRequest) (*GetStoragesResponse, error) - /* GetUser Get User @@ -246,37 +212,38 @@ type DefaultAPI interface { GetUserExecute(r ApiGetUserRequest) (*GetUserResponse, error) /* - GetVersions Get Versions + ListBackups List backups - Get the sqlserver available versions for the project. + List all backups which are available for a specific instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The STACKIT project ID. @param region The region which should be addressed - @return ApiGetVersionsRequest + @param instanceId The ID of the instance. + @return ApiListBackupsRequest */ - GetVersions(ctx context.Context, projectId string, region string) ApiGetVersionsRequest + ListBackups(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequest - // GetVersionsExecute executes the request - // @return GetVersionsResponse - GetVersionsExecute(r ApiGetVersionsRequest) (*GetVersionsResponse, error) + // ListBackupsExecute executes the request + // @return ListBackupResponse + ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupResponse, error) /* - ListBackups List backups + ListCollations Get database collation list - List all backups which are available for a specific instance. + Returns a list of collations for an instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The STACKIT project ID. @param region The region which should be addressed @param instanceId The ID of the instance. - @return ApiListBackupsRequest + @return ApiListCollationsRequest */ - ListBackups(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequest + ListCollations(ctx context.Context, projectId string, region string, instanceId string) ApiListCollationsRequest - // ListBackupsExecute executes the request - // @return ListBackupResponse - ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupResponse, error) + // ListCollationsExecute executes the request + // @return ListCollationsResponse + ListCollationsExecute(r ApiListCollationsRequest) (*ListCollationsResponse, error) /* ListCompatibilities Get database compatibility list @@ -362,6 +329,23 @@ type DefaultAPI interface { // @return ListRolesResponse ListRolesExecute(r ApiListRolesRequest) (*ListRolesResponse, 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 The STACKIT project ID. + @param region The region which should be addressed + @param flavorId The id of an instance flavor. + @return ApiListStoragesRequest + */ + ListStorages(ctx context.Context, projectId string, region string, flavorId string) ApiListStoragesRequest + + // ListStoragesExecute executes the request + // @return ListStoragesResponse + ListStoragesExecute(r ApiListStoragesRequest) (*ListStoragesResponse, error) + /* ListUsers List Users @@ -380,21 +364,39 @@ type DefaultAPI interface { ListUsersExecute(r ApiListUsersRequest) (*ListUserResponse, error) /* - ProtectInstance Protect Instance + ListVersions Get Versions - Toggle the deletion protection for an instance. + Get the sqlserver available versions for the project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId The ID of the instance. - @return ApiProtectInstanceRequest + @return ApiListVersionsRequest + */ + ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest + + // ListVersionsExecute executes the request + // @return ListVersionsResponse + ListVersionsExecute(r ApiListVersionsRequest) (*ListVersionsResponse, error) + + /* + PartialUpdateInstance Update Instance Partially + + Update an available instance of a mssql database. No fields are required. + + **Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex Instance.** + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiPartialUpdateInstanceRequest */ - ProtectInstance(ctx context.Context, projectId string, region string, instanceId string) ApiProtectInstanceRequest + PartialUpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiPartialUpdateInstanceRequest - // ProtectInstanceExecute executes the request - // @return ProtectInstanceResponse - ProtectInstanceExecute(r ApiProtectInstanceRequest) (*ProtectInstanceResponse, error) + // PartialUpdateInstanceExecute executes the request + PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error /* ResetUser Reset User @@ -487,23 +489,21 @@ type DefaultAPI interface { UpdateInstanceExecute(r ApiUpdateInstanceRequest) error /* - UpdateInstancePartially Update Instance Partially - - Update an available instance of a mssql database. No fields are required. - - **Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex Instance.** + UpdateInstanceProtection Protect Instance + Toggle the deletion protection for an instance. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT project ID. - @param region The region which should be addressed - @param instanceId The ID of the instance. - @return ApiUpdateInstancePartiallyRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT project ID. + @param region The region which should be addressed + @param instanceId The ID of the instance. + @return ApiUpdateInstanceProtectionRequest */ - UpdateInstancePartially(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstancePartiallyRequest + UpdateInstanceProtection(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceProtectionRequest - // UpdateInstancePartiallyExecute executes the request - UpdateInstancePartiallyExecute(r ApiUpdateInstancePartiallyRequest) error + // UpdateInstanceProtectionExecute executes the request + // @return UpdateInstanceProtectionResponse + UpdateInstanceProtectionExecute(r ApiUpdateInstanceProtectionRequest) (*UpdateInstanceProtectionResponse, error) } // DefaultAPIService DefaultAPI service @@ -1797,59 +1797,63 @@ func (a *DefaultAPIService) GetBackupExecute(r ApiGetBackupRequest) (*GetBackupR return localVarReturnValue, nil } -type ApiGetCollationsRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - region string - instanceId string +type ApiGetDatabaseRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + databaseName string } -func (r ApiGetCollationsRequest) Execute() (*GetCollationsResponse, error) { - return r.ApiService.GetCollationsExecute(r) +func (r ApiGetDatabaseRequest) Execute() (*GetDatabaseResponse, error) { + return r.ApiService.GetDatabaseExecute(r) } /* -GetCollations Get database collation list +GetDatabase Get Database -Returns a list of collations for an instance +Get specific available database @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The STACKIT project ID. @param region The region which should be addressed @param instanceId The ID of the instance. - @return ApiGetCollationsRequest + @param databaseName The name of the database. + @return ApiGetDatabaseRequest */ -func (a *DefaultAPIService) GetCollations(ctx context.Context, projectId string, region string, instanceId string) ApiGetCollationsRequest { - return ApiGetCollationsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - instanceId: instanceId, +func (a *DefaultAPIService) GetDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiGetDatabaseRequest { + return ApiGetDatabaseRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + databaseName: databaseName, } } // Execute executes the request // -// @return GetCollationsResponse -func (a *DefaultAPIService) GetCollationsExecute(r ApiGetCollationsRequest) (*GetCollationsResponse, error) { +// @return GetDatabaseResponse +func (a *DefaultAPIService) GetDatabaseExecute(r ApiGetDatabaseRequest) (*GetDatabaseResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetCollationsResponse + localVarReturnValue *GetDatabaseResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetCollations") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetDatabase") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}/collations" + localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseName}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"databaseName"+"}", url.PathEscape(parameterValueToString(r.databaseName, "databaseName")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1985,68 +1989,98 @@ func (a *DefaultAPIService) GetCollationsExecute(r ApiGetCollationsRequest) (*Ge return localVarReturnValue, nil } -type ApiGetDatabaseRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - region string - instanceId string - databaseName string +type ApiGetFlavorsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + page *int64 + size *int64 + sort *FlavorSort } -func (r ApiGetDatabaseRequest) Execute() (*GetDatabaseResponse, error) { - return r.ApiService.GetDatabaseExecute(r) +// Number of the page of items list to be returned. +func (r ApiGetFlavorsRequest) Page(page int64) ApiGetFlavorsRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiGetFlavorsRequest) Size(size int64) ApiGetFlavorsRequest { + r.size = &size + return r +} + +// Sorting of the flavors to be returned on each page. +func (r ApiGetFlavorsRequest) Sort(sort FlavorSort) ApiGetFlavorsRequest { + r.sort = &sort + return r +} + +func (r ApiGetFlavorsRequest) Execute() (*GetFlavorsResponse, error) { + return r.ApiService.GetFlavorsExecute(r) } /* -GetDatabase Get Database +GetFlavors Get Flavors -Get specific available database +Get all available flavors for a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId The ID of the instance. - @param databaseName The name of the database. - @return ApiGetDatabaseRequest + @return ApiGetFlavorsRequest */ -func (a *DefaultAPIService) GetDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiGetDatabaseRequest { - return ApiGetDatabaseRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - instanceId: instanceId, - databaseName: databaseName, +func (a *DefaultAPIService) GetFlavors(ctx context.Context, projectId string, region string) ApiGetFlavorsRequest { + return ApiGetFlavorsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, } } // Execute executes the request // -// @return GetDatabaseResponse -func (a *DefaultAPIService) GetDatabaseExecute(r ApiGetDatabaseRequest) (*GetDatabaseResponse, error) { +// @return GetFlavorsResponse +func (a *DefaultAPIService) GetFlavorsExecute(r ApiGetFlavorsRequest) (*GetFlavorsResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetDatabaseResponse + localVarReturnValue *GetFlavorsResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetDatabase") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetFlavors") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases/{databaseName}" + localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/flavors" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"databaseName"+"}", url.PathEscape(parameterValueToString(r.databaseName, "databaseName")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } else { + var defaultValue int64 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int64 = 10 + parameterAddToHeaderOrQuery(localVarQueryParams, "size", defaultValue, "form", "") + r.size = &defaultValue + } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "form", "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2177,98 +2211,64 @@ func (a *DefaultAPIService) GetDatabaseExecute(r ApiGetDatabaseRequest) (*GetDat return localVarReturnValue, nil } -type ApiGetFlavorsRequest struct { +type ApiGetInstanceRequest struct { ctx context.Context ApiService DefaultAPI projectId string region string - page *int64 - size *int64 - sort *FlavorSort -} - -// Number of the page of items list to be returned. -func (r ApiGetFlavorsRequest) Page(page int64) ApiGetFlavorsRequest { - r.page = &page - return r -} - -// Number of items to be returned on each page. -func (r ApiGetFlavorsRequest) Size(size int64) ApiGetFlavorsRequest { - r.size = &size - return r -} - -// Sorting of the flavors to be returned on each page. -func (r ApiGetFlavorsRequest) Sort(sort FlavorSort) ApiGetFlavorsRequest { - r.sort = &sort - return r + instanceId string } -func (r ApiGetFlavorsRequest) Execute() (*GetFlavorsResponse, error) { - return r.ApiService.GetFlavorsExecute(r) +func (r ApiGetInstanceRequest) Execute() (*GetInstanceResponse, error) { + return r.ApiService.GetInstanceExecute(r) } /* -GetFlavors Get Flavors +GetInstance Get Specific Instance -Get all available flavors for a project. +Get information about a specific available instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The STACKIT project ID. @param region The region which should be addressed - @return ApiGetFlavorsRequest + @param instanceId The ID of the instance. + @return ApiGetInstanceRequest */ -func (a *DefaultAPIService) GetFlavors(ctx context.Context, projectId string, region string) ApiGetFlavorsRequest { - return ApiGetFlavorsRequest{ +func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ ApiService: a, ctx: ctx, projectId: projectId, region: region, + instanceId: instanceId, } } // Execute executes the request // -// @return GetFlavorsResponse -func (a *DefaultAPIService) GetFlavorsExecute(r ApiGetFlavorsRequest) (*GetFlavorsResponse, error) { +// @return GetInstanceResponse +func (a *DefaultAPIService) GetInstanceExecute(r ApiGetInstanceRequest) (*GetInstanceResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetFlavorsResponse + localVarReturnValue *GetInstanceResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetFlavors") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetInstance") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/flavors" + localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.page != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") - } else { - var defaultValue int64 = 1 - parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") - r.page = &defaultValue - } - if r.size != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") - } else { - var defaultValue int64 = 10 - parameterAddToHeaderOrQuery(localVarQueryParams, "size", defaultValue, "form", "") - r.size = &defaultValue - } - if r.sort != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "form", "") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2371,17 +2371,6 @@ func (a *DefaultAPIService) GetFlavorsExecute(r ApiGetFlavorsRequest) (*GetFlavo } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 501 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v } return localVarReturnValue, newErr } @@ -2399,59 +2388,63 @@ func (a *DefaultAPIService) GetFlavorsExecute(r ApiGetFlavorsRequest) (*GetFlavo return localVarReturnValue, nil } -type ApiGetInstanceRequest struct { +type ApiGetUserRequest struct { ctx context.Context ApiService DefaultAPI projectId string region string instanceId string + userId int64 } -func (r ApiGetInstanceRequest) Execute() (*GetInstanceResponse, error) { - return r.ApiService.GetInstanceExecute(r) +func (r ApiGetUserRequest) Execute() (*GetUserResponse, error) { + return r.ApiService.GetUserExecute(r) } /* -GetInstance Get Specific Instance +GetUser Get User -Get information about a specific available instance +Get a specific available user for an instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The STACKIT project ID. @param region The region which should be addressed @param instanceId The ID of the instance. - @return ApiGetInstanceRequest + @param userId The ID of the user. + @return ApiGetUserRequest */ -func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, region string, instanceId string) ApiGetInstanceRequest { - return ApiGetInstanceRequest{ +func (a *DefaultAPIService) GetUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiGetUserRequest { + return ApiGetUserRequest{ ApiService: a, ctx: ctx, projectId: projectId, region: region, instanceId: instanceId, + userId: userId, } } // Execute executes the request // -// @return GetInstanceResponse -func (a *DefaultAPIService) GetInstanceExecute(r ApiGetInstanceRequest) (*GetInstanceResponse, error) { +// @return GetUserResponse +func (a *DefaultAPIService) GetUserExecute(r ApiGetUserRequest) (*GetUserResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetInstanceResponse + localVarReturnValue *GetUserResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetInstance") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetUser") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}" + localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2576,64 +2569,102 @@ func (a *DefaultAPIService) GetInstanceExecute(r ApiGetInstanceRequest) (*GetIns return localVarReturnValue, nil } -type ApiGetStoragesRequest struct { +type ApiListBackupsRequest struct { ctx context.Context ApiService DefaultAPI projectId string region string - flavorId string + instanceId string + page *int64 + size *int64 + sort *BackupSort +} + +// Number of the page of items list to be returned. +func (r ApiListBackupsRequest) Page(page int64) ApiListBackupsRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiListBackupsRequest) Size(size int64) ApiListBackupsRequest { + r.size = &size + return r +} + +// Sorting of the backups to be returned on each page. +func (r ApiListBackupsRequest) Sort(sort BackupSort) ApiListBackupsRequest { + r.sort = &sort + return r } -func (r ApiGetStoragesRequest) Execute() (*GetStoragesResponse, error) { - return r.ApiService.GetStoragesExecute(r) +func (r ApiListBackupsRequest) Execute() (*ListBackupResponse, error) { + return r.ApiService.ListBackupsExecute(r) } /* -GetStorages Get Storages +ListBackups List backups -Get available storages for a specific flavor +List all backups which are available for a specific instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The STACKIT project ID. @param region The region which should be addressed - @param flavorId The id of an instance flavor. - @return ApiGetStoragesRequest + @param instanceId The ID of the instance. + @return ApiListBackupsRequest */ -func (a *DefaultAPIService) GetStorages(ctx context.Context, projectId string, region string, flavorId string) ApiGetStoragesRequest { - return ApiGetStoragesRequest{ +func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ ApiService: a, ctx: ctx, projectId: projectId, region: region, - flavorId: flavorId, + instanceId: instanceId, } } // Execute executes the request // -// @return GetStoragesResponse -func (a *DefaultAPIService) GetStoragesExecute(r ApiGetStoragesRequest) (*GetStoragesResponse, error) { +// @return ListBackupResponse +func (a *DefaultAPIService) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetStoragesResponse + localVarReturnValue *ListBackupResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetStorages") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListBackups") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/storages/{flavorId}" + localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"flavorId"+"}", url.PathEscape(parameterValueToString(r.flavorId, "flavorId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } else { + var defaultValue int64 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int64 = 10 + parameterAddToHeaderOrQuery(localVarQueryParams, "size", defaultValue, "form", "") + r.size = &defaultValue + } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "form", "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2736,6 +2767,17 @@ func (a *DefaultAPIService) GetStoragesExecute(r ApiGetStoragesRequest) (*GetSto } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -2753,63 +2795,59 @@ func (a *DefaultAPIService) GetStoragesExecute(r ApiGetStoragesRequest) (*GetSto return localVarReturnValue, nil } -type ApiGetUserRequest struct { +type ApiListCollationsRequest struct { ctx context.Context ApiService DefaultAPI projectId string region string instanceId string - userId int64 } -func (r ApiGetUserRequest) Execute() (*GetUserResponse, error) { - return r.ApiService.GetUserExecute(r) +func (r ApiListCollationsRequest) Execute() (*ListCollationsResponse, error) { + return r.ApiService.ListCollationsExecute(r) } /* -GetUser Get User +ListCollations Get database collation list -Get a specific available user for an instance. +Returns a list of collations for an instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The STACKIT project ID. @param region The region which should be addressed @param instanceId The ID of the instance. - @param userId The ID of the user. - @return ApiGetUserRequest + @return ApiListCollationsRequest */ -func (a *DefaultAPIService) GetUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiGetUserRequest { - return ApiGetUserRequest{ +func (a *DefaultAPIService) ListCollations(ctx context.Context, projectId string, region string, instanceId string) ApiListCollationsRequest { + return ApiListCollationsRequest{ ApiService: a, ctx: ctx, projectId: projectId, region: region, instanceId: instanceId, - userId: userId, } } // Execute executes the request // -// @return GetUserResponse -func (a *DefaultAPIService) GetUserExecute(r ApiGetUserRequest) (*GetUserResponse, error) { +// @return ListCollationsResponse +func (a *DefaultAPIService) ListCollationsExecute(r ApiListCollationsRequest) (*ListCollationsResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetUserResponse + localVarReturnValue *ListCollationsResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetUser") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCollations") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}/users/{userId}" + localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}/collations" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2917,6 +2955,17 @@ func (a *DefaultAPIService) GetUserExecute(r ApiGetUserRequest) (*GetUserRespons } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -2934,55 +2983,59 @@ func (a *DefaultAPIService) GetUserExecute(r ApiGetUserRequest) (*GetUserRespons return localVarReturnValue, nil } -type ApiGetVersionsRequest struct { +type ApiListCompatibilitiesRequest struct { ctx context.Context ApiService DefaultAPI projectId string region string + instanceId string } -func (r ApiGetVersionsRequest) Execute() (*GetVersionsResponse, error) { - return r.ApiService.GetVersionsExecute(r) +func (r ApiListCompatibilitiesRequest) Execute() (*ListCompatibilityResponse, error) { + return r.ApiService.ListCompatibilitiesExecute(r) } /* -GetVersions Get Versions +ListCompatibilities Get database compatibility list -Get the sqlserver available versions for the project. +Returns a list of compatibility levels for creating a new database @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The STACKIT project ID. @param region The region which should be addressed - @return ApiGetVersionsRequest + @param instanceId The ID of the instance. + @return ApiListCompatibilitiesRequest */ -func (a *DefaultAPIService) GetVersions(ctx context.Context, projectId string, region string) ApiGetVersionsRequest { - return ApiGetVersionsRequest{ +func (a *DefaultAPIService) ListCompatibilities(ctx context.Context, projectId string, region string, instanceId string) ApiListCompatibilitiesRequest { + return ApiListCompatibilitiesRequest{ ApiService: a, ctx: ctx, projectId: projectId, region: region, + instanceId: instanceId, } } // Execute executes the request // -// @return GetVersionsResponse -func (a *DefaultAPIService) GetVersionsExecute(r ApiGetVersionsRequest) (*GetVersionsResponse, error) { +// @return ListCompatibilityResponse +func (a *DefaultAPIService) ListCompatibilitiesExecute(r ApiListCompatibilitiesRequest) (*ListCompatibilityResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetVersionsResponse + localVarReturnValue *ListCompatibilityResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetVersions") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCompatibilities") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/versions" + localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}/compatibility" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3118,52 +3171,31 @@ func (a *DefaultAPIService) GetVersionsExecute(r ApiGetVersionsRequest) (*GetVer return localVarReturnValue, nil } -type ApiListBackupsRequest struct { +type ApiListCurrentRunningRestoreJobsRequest struct { ctx context.Context ApiService DefaultAPI projectId string region string instanceId string - page *int64 - size *int64 - sort *BackupSort -} - -// Number of the page of items list to be returned. -func (r ApiListBackupsRequest) Page(page int64) ApiListBackupsRequest { - r.page = &page - return r } -// Number of items to be returned on each page. -func (r ApiListBackupsRequest) Size(size int64) ApiListBackupsRequest { - r.size = &size - return r -} - -// Sorting of the backups to be returned on each page. -func (r ApiListBackupsRequest) Sort(sort BackupSort) ApiListBackupsRequest { - r.sort = &sort - return r -} - -func (r ApiListBackupsRequest) Execute() (*ListBackupResponse, error) { - return r.ApiService.ListBackupsExecute(r) +func (r ApiListCurrentRunningRestoreJobsRequest) Execute() (*ListCurrentRunningRestoreJobs, error) { + return r.ApiService.ListCurrentRunningRestoreJobsExecute(r) } /* -ListBackups List backups +ListCurrentRunningRestoreJobs List current running restore jobs -List all backups which are available for a specific instance. +List all currently running restore jobs which are available for a specific instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The STACKIT project ID. @param region The region which should be addressed @param instanceId The ID of the instance. - @return ApiListBackupsRequest + @return ApiListCurrentRunningRestoreJobsRequest */ -func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequest { - return ApiListBackupsRequest{ +func (a *DefaultAPIService) ListCurrentRunningRestoreJobs(ctx context.Context, projectId string, region string, instanceId string) ApiListCurrentRunningRestoreJobsRequest { + return ApiListCurrentRunningRestoreJobsRequest{ ApiService: a, ctx: ctx, projectId: projectId, @@ -3174,21 +3206,21 @@ func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, r // Execute executes the request // -// @return ListBackupResponse -func (a *DefaultAPIService) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupResponse, error) { +// @return ListCurrentRunningRestoreJobs +func (a *DefaultAPIService) ListCurrentRunningRestoreJobsExecute(r ApiListCurrentRunningRestoreJobsRequest) (*ListCurrentRunningRestoreJobs, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListBackupResponse + localVarReturnValue *ListCurrentRunningRestoreJobs ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListBackups") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCurrentRunningRestoreJobs") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}/backups" + localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}/restore-jobs" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) @@ -3197,23 +3229,6 @@ func (a *DefaultAPIService) ListBackupsExecute(r ApiListBackupsRequest) (*ListBa localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.page != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") - } else { - var defaultValue int64 = 1 - parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") - r.page = &defaultValue - } - if r.size != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") - } else { - var defaultValue int64 = 10 - parameterAddToHeaderOrQuery(localVarQueryParams, "size", defaultValue, "form", "") - r.size = &defaultValue - } - if r.sort != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "form", "") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -3344,31 +3359,52 @@ func (a *DefaultAPIService) ListBackupsExecute(r ApiListBackupsRequest) (*ListBa return localVarReturnValue, nil } -type ApiListCompatibilitiesRequest struct { +type ApiListDatabasesRequest struct { ctx context.Context ApiService DefaultAPI projectId string region string instanceId string + page *int64 + size *int64 + sort *DatabaseSort } -func (r ApiListCompatibilitiesRequest) Execute() (*ListCompatibilityResponse, error) { - return r.ApiService.ListCompatibilitiesExecute(r) +// Number of the page of items list to be returned. +func (r ApiListDatabasesRequest) Page(page int64) ApiListDatabasesRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiListDatabasesRequest) Size(size int64) ApiListDatabasesRequest { + r.size = &size + return r +} + +// Sorting of the databases to be returned on each page. +func (r ApiListDatabasesRequest) Sort(sort DatabaseSort) ApiListDatabasesRequest { + r.sort = &sort + return r +} + +func (r ApiListDatabasesRequest) Execute() (*ListDatabasesResponse, error) { + return r.ApiService.ListDatabasesExecute(r) } /* -ListCompatibilities Get database compatibility list +ListDatabases List Databases -Returns a list of compatibility levels for creating a new database +List available databases for an instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The STACKIT project ID. @param region The region which should be addressed @param instanceId The ID of the instance. - @return ApiListCompatibilitiesRequest + @return ApiListDatabasesRequest */ -func (a *DefaultAPIService) ListCompatibilities(ctx context.Context, projectId string, region string, instanceId string) ApiListCompatibilitiesRequest { - return ApiListCompatibilitiesRequest{ +func (a *DefaultAPIService) ListDatabases(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequest { + return ApiListDatabasesRequest{ ApiService: a, ctx: ctx, projectId: projectId, @@ -3379,21 +3415,21 @@ func (a *DefaultAPIService) ListCompatibilities(ctx context.Context, projectId s // Execute executes the request // -// @return ListCompatibilityResponse -func (a *DefaultAPIService) ListCompatibilitiesExecute(r ApiListCompatibilitiesRequest) (*ListCompatibilityResponse, error) { +// @return ListDatabasesResponse +func (a *DefaultAPIService) ListDatabasesExecute(r ApiListDatabasesRequest) (*ListDatabasesResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListCompatibilityResponse + localVarReturnValue *ListDatabasesResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCompatibilities") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListDatabases") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}/compatibility" + localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) @@ -3402,6 +3438,23 @@ func (a *DefaultAPIService) ListCompatibilitiesExecute(r ApiListCompatibilitiesR localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } else { + var defaultValue int64 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int64 = 10 + parameterAddToHeaderOrQuery(localVarQueryParams, "size", defaultValue, "form", "") + r.size = &defaultValue + } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "form", "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -3504,17 +3557,6 @@ func (a *DefaultAPIService) ListCompatibilitiesExecute(r ApiListCompatibilitiesR } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 501 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v } return localVarReturnValue, newErr } @@ -3532,64 +3574,98 @@ func (a *DefaultAPIService) ListCompatibilitiesExecute(r ApiListCompatibilitiesR return localVarReturnValue, nil } -type ApiListCurrentRunningRestoreJobsRequest struct { +type ApiListInstancesRequest struct { ctx context.Context ApiService DefaultAPI projectId string region string - instanceId string + page *int64 + size *int64 + sort *InstanceSort } -func (r ApiListCurrentRunningRestoreJobsRequest) Execute() (*ListCurrentRunningRestoreJobs, error) { - return r.ApiService.ListCurrentRunningRestoreJobsExecute(r) +// Number of the page of items list to be returned. +func (r ApiListInstancesRequest) Page(page int64) ApiListInstancesRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiListInstancesRequest) Size(size int64) ApiListInstancesRequest { + r.size = &size + return r +} + +// Sorting of the items to be returned on each page. +func (r ApiListInstancesRequest) Sort(sort InstanceSort) ApiListInstancesRequest { + r.sort = &sort + return r +} + +func (r ApiListInstancesRequest) Execute() (*ListInstancesResponse, error) { + return r.ApiService.ListInstancesExecute(r) } /* -ListCurrentRunningRestoreJobs List current running restore jobs +ListInstances List Instances -List all currently running restore jobs which are available for a specific instance +List all available instances for your project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId The ID of the instance. - @return ApiListCurrentRunningRestoreJobsRequest + @return ApiListInstancesRequest */ -func (a *DefaultAPIService) ListCurrentRunningRestoreJobs(ctx context.Context, projectId string, region string, instanceId string) ApiListCurrentRunningRestoreJobsRequest { - return ApiListCurrentRunningRestoreJobsRequest{ +func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest { + return ApiListInstancesRequest{ ApiService: a, ctx: ctx, projectId: projectId, region: region, - instanceId: instanceId, } } // Execute executes the request // -// @return ListCurrentRunningRestoreJobs -func (a *DefaultAPIService) ListCurrentRunningRestoreJobsExecute(r ApiListCurrentRunningRestoreJobsRequest) (*ListCurrentRunningRestoreJobs, error) { +// @return ListInstancesResponse +func (a *DefaultAPIService) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListCurrentRunningRestoreJobs + localVarReturnValue *ListInstancesResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCurrentRunningRestoreJobs") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListInstances") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}/restore-jobs" + localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } else { + var defaultValue int64 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int64 = 10 + parameterAddToHeaderOrQuery(localVarQueryParams, "size", defaultValue, "form", "") + r.size = &defaultValue + } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "form", "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -3692,17 +3768,6 @@ func (a *DefaultAPIService) ListCurrentRunningRestoreJobsExecute(r ApiListCurren } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 501 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v } return localVarReturnValue, newErr } @@ -3720,52 +3785,31 @@ func (a *DefaultAPIService) ListCurrentRunningRestoreJobsExecute(r ApiListCurren return localVarReturnValue, nil } -type ApiListDatabasesRequest struct { +type ApiListRolesRequest struct { ctx context.Context ApiService DefaultAPI projectId string region string instanceId string - page *int64 - size *int64 - sort *DatabaseSort -} - -// Number of the page of items list to be returned. -func (r ApiListDatabasesRequest) Page(page int64) ApiListDatabasesRequest { - r.page = &page - return r -} - -// Number of items to be returned on each page. -func (r ApiListDatabasesRequest) Size(size int64) ApiListDatabasesRequest { - r.size = &size - return r } -// Sorting of the databases to be returned on each page. -func (r ApiListDatabasesRequest) Sort(sort DatabaseSort) ApiListDatabasesRequest { - r.sort = &sort - return r -} - -func (r ApiListDatabasesRequest) Execute() (*ListDatabasesResponse, error) { - return r.ApiService.ListDatabasesExecute(r) +func (r ApiListRolesRequest) Execute() (*ListRolesResponse, error) { + return r.ApiService.ListRolesExecute(r) } /* -ListDatabases List Databases +ListRoles List Roles -List available databases for an instance. +List available roles for an instance that can be assigned to a user @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The STACKIT project ID. @param region The region which should be addressed @param instanceId The ID of the instance. - @return ApiListDatabasesRequest + @return ApiListRolesRequest */ -func (a *DefaultAPIService) ListDatabases(ctx context.Context, projectId string, region string, instanceId string) ApiListDatabasesRequest { - return ApiListDatabasesRequest{ +func (a *DefaultAPIService) ListRoles(ctx context.Context, projectId string, region string, instanceId string) ApiListRolesRequest { + return ApiListRolesRequest{ ApiService: a, ctx: ctx, projectId: projectId, @@ -3776,21 +3820,21 @@ func (a *DefaultAPIService) ListDatabases(ctx context.Context, projectId string, // Execute executes the request // -// @return ListDatabasesResponse -func (a *DefaultAPIService) ListDatabasesExecute(r ApiListDatabasesRequest) (*ListDatabasesResponse, error) { +// @return ListRolesResponse +func (a *DefaultAPIService) ListRolesExecute(r ApiListRolesRequest) (*ListRolesResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListDatabasesResponse + localVarReturnValue *ListRolesResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListDatabases") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRoles") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}/databases" + localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}/roles" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) @@ -3799,23 +3843,6 @@ func (a *DefaultAPIService) ListDatabasesExecute(r ApiListDatabasesRequest) (*Li localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.page != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") - } else { - var defaultValue int64 = 1 - parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") - r.page = &defaultValue - } - if r.size != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") - } else { - var defaultValue int64 = 10 - parameterAddToHeaderOrQuery(localVarQueryParams, "size", defaultValue, "form", "") - r.size = &defaultValue - } - if r.sort != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "form", "") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -3918,6 +3945,17 @@ func (a *DefaultAPIService) ListDatabasesExecute(r ApiListDatabasesRequest) (*Li } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -3935,98 +3973,64 @@ func (a *DefaultAPIService) ListDatabasesExecute(r ApiListDatabasesRequest) (*Li return localVarReturnValue, nil } -type ApiListInstancesRequest struct { +type ApiListStoragesRequest struct { ctx context.Context ApiService DefaultAPI projectId string region string - page *int64 - size *int64 - sort *InstanceSort -} - -// Number of the page of items list to be returned. -func (r ApiListInstancesRequest) Page(page int64) ApiListInstancesRequest { - r.page = &page - return r -} - -// Number of items to be returned on each page. -func (r ApiListInstancesRequest) Size(size int64) ApiListInstancesRequest { - r.size = &size - return r -} - -// Sorting of the items to be returned on each page. -func (r ApiListInstancesRequest) Sort(sort InstanceSort) ApiListInstancesRequest { - r.sort = &sort - return r + flavorId string } -func (r ApiListInstancesRequest) Execute() (*ListInstancesResponse, error) { - return r.ApiService.ListInstancesExecute(r) +func (r ApiListStoragesRequest) Execute() (*ListStoragesResponse, error) { + return r.ApiService.ListStoragesExecute(r) } /* -ListInstances List Instances +ListStorages Get Storages -List all available instances for your project. +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 The STACKIT project ID. @param region The region which should be addressed - @return ApiListInstancesRequest + @param flavorId The id of an instance flavor. + @return ApiListStoragesRequest */ -func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string, region string) ApiListInstancesRequest { - return ApiListInstancesRequest{ +func (a *DefaultAPIService) ListStorages(ctx context.Context, projectId string, region string, flavorId string) ApiListStoragesRequest { + return ApiListStoragesRequest{ ApiService: a, ctx: ctx, projectId: projectId, region: region, + flavorId: flavorId, } } // Execute executes the request // -// @return ListInstancesResponse -func (a *DefaultAPIService) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) { +// @return ListStoragesResponse +func (a *DefaultAPIService) ListStoragesExecute(r ApiListStoragesRequest) (*ListStoragesResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListInstancesResponse + localVarReturnValue *ListStoragesResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListInstances") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListStorages") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances" + localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/storages/{flavorId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"flavorId"+"}", url.PathEscape(parameterValueToString(r.flavorId, "flavorId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.page != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") - } else { - var defaultValue int64 = 1 - parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") - r.page = &defaultValue - } - if r.size != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") - } else { - var defaultValue int64 = 10 - parameterAddToHeaderOrQuery(localVarQueryParams, "size", defaultValue, "form", "") - r.size = &defaultValue - } - if r.sort != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "form", "") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -4146,31 +4150,52 @@ func (a *DefaultAPIService) ListInstancesExecute(r ApiListInstancesRequest) (*Li return localVarReturnValue, nil } -type ApiListRolesRequest struct { +type ApiListUsersRequest struct { ctx context.Context ApiService DefaultAPI projectId string region string instanceId string + page *int64 + size *int64 + sort *UserSort } -func (r ApiListRolesRequest) Execute() (*ListRolesResponse, error) { - return r.ApiService.ListRolesExecute(r) +// Number of the page of items list to be returned. +func (r ApiListUsersRequest) Page(page int64) ApiListUsersRequest { + r.page = &page + return r +} + +// Number of items to be returned on each page. +func (r ApiListUsersRequest) Size(size int64) ApiListUsersRequest { + r.size = &size + return r +} + +// Sorting of the users to be returned on each page. +func (r ApiListUsersRequest) Sort(sort UserSort) ApiListUsersRequest { + r.sort = &sort + return r +} + +func (r ApiListUsersRequest) Execute() (*ListUserResponse, error) { + return r.ApiService.ListUsersExecute(r) } /* -ListRoles List Roles +ListUsers List Users -List available roles for an instance that can be assigned to a user +List available users for an instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The STACKIT project ID. @param region The region which should be addressed @param instanceId The ID of the instance. - @return ApiListRolesRequest + @return ApiListUsersRequest */ -func (a *DefaultAPIService) ListRoles(ctx context.Context, projectId string, region string, instanceId string) ApiListRolesRequest { - return ApiListRolesRequest{ +func (a *DefaultAPIService) ListUsers(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequest { + return ApiListUsersRequest{ ApiService: a, ctx: ctx, projectId: projectId, @@ -4181,21 +4206,21 @@ func (a *DefaultAPIService) ListRoles(ctx context.Context, projectId string, reg // Execute executes the request // -// @return ListRolesResponse -func (a *DefaultAPIService) ListRolesExecute(r ApiListRolesRequest) (*ListRolesResponse, error) { +// @return ListUserResponse +func (a *DefaultAPIService) ListUsersExecute(r ApiListUsersRequest) (*ListUserResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListRolesResponse + localVarReturnValue *ListUserResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRoles") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListUsers") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}/roles" + localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}/users" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) @@ -4204,6 +4229,23 @@ func (a *DefaultAPIService) ListRolesExecute(r ApiListRolesRequest) (*ListRolesR localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } else { + var defaultValue int64 = 1 + parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") + r.page = &defaultValue + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") + } else { + var defaultValue int64 = 10 + parameterAddToHeaderOrQuery(localVarQueryParams, "size", defaultValue, "form", "") + r.size = &defaultValue + } + if r.sort != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "form", "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -4306,17 +4348,6 @@ func (a *DefaultAPIService) ListRolesExecute(r ApiListRolesRequest) (*ListRolesR } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 501 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v } return localVarReturnValue, newErr } @@ -4334,102 +4365,60 @@ func (a *DefaultAPIService) ListRolesExecute(r ApiListRolesRequest) (*ListRolesR return localVarReturnValue, nil } -type ApiListUsersRequest struct { +type ApiListVersionsRequest struct { ctx context.Context ApiService DefaultAPI projectId string region string - instanceId string - page *int64 - size *int64 - sort *UserSort -} - -// Number of the page of items list to be returned. -func (r ApiListUsersRequest) Page(page int64) ApiListUsersRequest { - r.page = &page - return r -} - -// Number of items to be returned on each page. -func (r ApiListUsersRequest) Size(size int64) ApiListUsersRequest { - r.size = &size - return r -} - -// Sorting of the users to be returned on each page. -func (r ApiListUsersRequest) Sort(sort UserSort) ApiListUsersRequest { - r.sort = &sort - return r } -func (r ApiListUsersRequest) Execute() (*ListUserResponse, error) { - return r.ApiService.ListUsersExecute(r) +func (r ApiListVersionsRequest) Execute() (*ListVersionsResponse, error) { + return r.ApiService.ListVersionsExecute(r) } /* -ListUsers List Users +ListVersions Get Versions -List available users for an instance. +Get the sqlserver available versions for the project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The STACKIT project ID. @param region The region which should be addressed - @param instanceId The ID of the instance. - @return ApiListUsersRequest + @return ApiListVersionsRequest */ -func (a *DefaultAPIService) ListUsers(ctx context.Context, projectId string, region string, instanceId string) ApiListUsersRequest { - return ApiListUsersRequest{ +func (a *DefaultAPIService) ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest { + return ApiListVersionsRequest{ ApiService: a, ctx: ctx, projectId: projectId, region: region, - instanceId: instanceId, } } // Execute executes the request // -// @return ListUserResponse -func (a *DefaultAPIService) ListUsersExecute(r ApiListUsersRequest) (*ListUserResponse, error) { +// @return ListVersionsResponse +func (a *DefaultAPIService) ListVersionsExecute(r ApiListVersionsRequest) (*ListVersionsResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListUserResponse + localVarReturnValue *ListVersionsResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListUsers") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListVersions") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}/users" + localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/versions" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.page != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") - } else { - var defaultValue int64 = 1 - parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "form", "") - r.page = &defaultValue - } - if r.size != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "form", "") - } else { - var defaultValue int64 = 10 - parameterAddToHeaderOrQuery(localVarQueryParams, "size", defaultValue, "form", "") - r.size = &defaultValue - } - if r.sort != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "sort", r.sort, "form", "") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -4532,6 +4521,17 @@ func (a *DefaultAPIService) ListUsersExecute(r ApiListUsersRequest) (*ListUserRe } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v } return localVarReturnValue, newErr } @@ -4549,38 +4549,40 @@ func (a *DefaultAPIService) ListUsersExecute(r ApiListUsersRequest) (*ListUserRe return localVarReturnValue, nil } -type ApiProtectInstanceRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - region string - instanceId string - protectInstancePayload *ProtectInstancePayload +type ApiPartialUpdateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + partialUpdateInstancePayload *PartialUpdateInstancePayload } -// The request body with flag isDeletable. Parameter is required. -func (r ApiProtectInstanceRequest) ProtectInstancePayload(protectInstancePayload ProtectInstancePayload) ApiProtectInstanceRequest { - r.protectInstancePayload = &protectInstancePayload +// The request body with the parameters for updating the instance. +func (r ApiPartialUpdateInstanceRequest) PartialUpdateInstancePayload(partialUpdateInstancePayload PartialUpdateInstancePayload) ApiPartialUpdateInstanceRequest { + r.partialUpdateInstancePayload = &partialUpdateInstancePayload return r } -func (r ApiProtectInstanceRequest) Execute() (*ProtectInstanceResponse, error) { - return r.ApiService.ProtectInstanceExecute(r) +func (r ApiPartialUpdateInstanceRequest) Execute() error { + return r.ApiService.PartialUpdateInstanceExecute(r) } /* -ProtectInstance Protect Instance +PartialUpdateInstance Update Instance Partially -Toggle the deletion protection for an instance. +Update an available instance of a mssql database. No fields are required. + +**Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex Instance.** @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The STACKIT project ID. @param region The region which should be addressed @param instanceId The ID of the instance. - @return ApiProtectInstanceRequest + @return ApiPartialUpdateInstanceRequest */ -func (a *DefaultAPIService) ProtectInstance(ctx context.Context, projectId string, region string, instanceId string) ApiProtectInstanceRequest { - return ApiProtectInstanceRequest{ +func (a *DefaultAPIService) PartialUpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiPartialUpdateInstanceRequest { + return ApiPartialUpdateInstanceRequest{ ApiService: a, ctx: ctx, projectId: projectId, @@ -4590,22 +4592,19 @@ func (a *DefaultAPIService) ProtectInstance(ctx context.Context, projectId strin } // Execute executes the request -// -// @return ProtectInstanceResponse -func (a *DefaultAPIService) ProtectInstanceExecute(r ApiProtectInstanceRequest) (*ProtectInstanceResponse, error) { +func (a *DefaultAPIService) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error { var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ProtectInstanceResponse + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ProtectInstance") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateInstance") if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}/protections" + localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) @@ -4613,8 +4612,8 @@ func (a *DefaultAPIService) ProtectInstanceExecute(r ApiProtectInstanceRequest) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.protectInstancePayload == nil { - return localVarReturnValue, reportError("protectInstancePayload is required and must be specified") + if r.partialUpdateInstancePayload == nil { + return reportError("partialUpdateInstancePayload is required and must be specified") } // to determine the Content-Type header @@ -4635,10 +4634,10 @@ func (a *DefaultAPIService) ProtectInstanceExecute(r ApiProtectInstanceRequest) localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.protectInstancePayload + localVarPostBody = r.partialUpdateInstancePayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, err + return err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -4652,14 +4651,14 @@ func (a *DefaultAPIService) ProtectInstanceExecute(r ApiProtectInstanceRequest) *contextHTTPResponse = localVarHTTPResponse } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err + return err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, err + return err } if localVarHTTPResponse.StatusCode >= 300 { @@ -4673,91 +4672,70 @@ func (a *DefaultAPIService) ProtectInstanceExecute(r ApiProtectInstanceRequest) err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + 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 localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 422 { var v ValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + 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 localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 501 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return 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 newErr } - return localVarReturnValue, nil + return nil } type ApiResetUserRequest struct { @@ -5719,40 +5697,38 @@ func (a *DefaultAPIService) UpdateInstanceExecute(r ApiUpdateInstanceRequest) er return nil } -type ApiUpdateInstancePartiallyRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - region string - instanceId string - updateInstancePartiallyPayload *UpdateInstancePartiallyPayload +type ApiUpdateInstanceProtectionRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + instanceId string + updateInstanceProtectionPayload *UpdateInstanceProtectionPayload } -// The request body with the parameters for updating the instance. -func (r ApiUpdateInstancePartiallyRequest) UpdateInstancePartiallyPayload(updateInstancePartiallyPayload UpdateInstancePartiallyPayload) ApiUpdateInstancePartiallyRequest { - r.updateInstancePartiallyPayload = &updateInstancePartiallyPayload +// The request body with flag isDeletable. Parameter is required. +func (r ApiUpdateInstanceProtectionRequest) UpdateInstanceProtectionPayload(updateInstanceProtectionPayload UpdateInstanceProtectionPayload) ApiUpdateInstanceProtectionRequest { + r.updateInstanceProtectionPayload = &updateInstanceProtectionPayload return r } -func (r ApiUpdateInstancePartiallyRequest) Execute() error { - return r.ApiService.UpdateInstancePartiallyExecute(r) +func (r ApiUpdateInstanceProtectionRequest) Execute() (*UpdateInstanceProtectionResponse, error) { + return r.ApiService.UpdateInstanceProtectionExecute(r) } /* -UpdateInstancePartially Update Instance Partially +UpdateInstanceProtection Protect Instance -Update an available instance of a mssql database. No fields are required. - -**Please note that any changes applied via PUT or PATCH requests will initiate a reboot of the SQL Server Flex Instance.** +Toggle the deletion protection for an instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The STACKIT project ID. @param region The region which should be addressed @param instanceId The ID of the instance. - @return ApiUpdateInstancePartiallyRequest + @return ApiUpdateInstanceProtectionRequest */ -func (a *DefaultAPIService) UpdateInstancePartially(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstancePartiallyRequest { - return ApiUpdateInstancePartiallyRequest{ +func (a *DefaultAPIService) UpdateInstanceProtection(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceProtectionRequest { + return ApiUpdateInstanceProtectionRequest{ ApiService: a, ctx: ctx, projectId: projectId, @@ -5762,19 +5738,22 @@ func (a *DefaultAPIService) UpdateInstancePartially(ctx context.Context, project } // Execute executes the request -func (a *DefaultAPIService) UpdateInstancePartiallyExecute(r ApiUpdateInstancePartiallyRequest) error { +// +// @return UpdateInstanceProtectionResponse +func (a *DefaultAPIService) UpdateInstanceProtectionExecute(r ApiUpdateInstanceProtectionRequest) (*UpdateInstanceProtectionResponse, error) { var ( - localVarHTTPMethod = http.MethodPatch - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateInstanceProtectionResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateInstancePartially") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateInstanceProtection") if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}" + localVarPath := localBasePath + "/v3beta2/projects/{projectId}/regions/{region}/instances/{instanceId}/protections" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) @@ -5782,8 +5761,8 @@ func (a *DefaultAPIService) UpdateInstancePartiallyExecute(r ApiUpdateInstancePa localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.updateInstancePartiallyPayload == nil { - return reportError("updateInstancePartiallyPayload is required and must be specified") + if r.updateInstanceProtectionPayload == nil { + return localVarReturnValue, reportError("updateInstanceProtectionPayload is required and must be specified") } // to determine the Content-Type header @@ -5804,10 +5783,10 @@ func (a *DefaultAPIService) UpdateInstancePartiallyExecute(r ApiUpdateInstancePa localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateInstancePartiallyPayload + localVarPostBody = r.updateInstanceProtectionPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return err + return localVarReturnValue, err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -5821,14 +5800,14 @@ func (a *DefaultAPIService) UpdateInstancePartiallyExecute(r ApiUpdateInstancePa *contextHTTPResponse = localVarHTTPResponse } if err != nil || localVarHTTPResponse == nil { - return err + return localVarReturnValue, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return err + return localVarReturnValue, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -5842,68 +5821,89 @@ func (a *DefaultAPIService) UpdateInstancePartiallyExecute(r ApiUpdateInstancePa err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + 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 newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 422 { var v ValidationError err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + 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 newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr } - return newErr + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr } - return nil + 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 } diff --git a/services/sqlserverflex/v3beta2api/api_default_mock.go b/services/sqlserverflex/v3beta2api/api_default_mock.go index ab3c6aa0c..6ea492f33 100644 --- a/services/sqlserverflex/v3beta2api/api_default_mock.go +++ b/services/sqlserverflex/v3beta2api/api_default_mock.go @@ -35,22 +35,18 @@ type DefaultAPIServiceMock struct { DeleteUserExecuteMock *func(r ApiDeleteUserRequest) error // GetBackupExecuteMock can be populated to implement the behavior of the GetBackupExecute function of this mock GetBackupExecuteMock *func(r ApiGetBackupRequest) (*GetBackupResponse, error) - // GetCollationsExecuteMock can be populated to implement the behavior of the GetCollationsExecute function of this mock - GetCollationsExecuteMock *func(r ApiGetCollationsRequest) (*GetCollationsResponse, error) // GetDatabaseExecuteMock can be populated to implement the behavior of the GetDatabaseExecute function of this mock GetDatabaseExecuteMock *func(r ApiGetDatabaseRequest) (*GetDatabaseResponse, error) // GetFlavorsExecuteMock can be populated to implement the behavior of the GetFlavorsExecute function of this mock GetFlavorsExecuteMock *func(r ApiGetFlavorsRequest) (*GetFlavorsResponse, error) // GetInstanceExecuteMock can be populated to implement the behavior of the GetInstanceExecute function of this mock GetInstanceExecuteMock *func(r ApiGetInstanceRequest) (*GetInstanceResponse, error) - // GetStoragesExecuteMock can be populated to implement the behavior of the GetStoragesExecute function of this mock - GetStoragesExecuteMock *func(r ApiGetStoragesRequest) (*GetStoragesResponse, error) // GetUserExecuteMock can be populated to implement the behavior of the GetUserExecute function of this mock GetUserExecuteMock *func(r ApiGetUserRequest) (*GetUserResponse, error) - // GetVersionsExecuteMock can be populated to implement the behavior of the GetVersionsExecute function of this mock - GetVersionsExecuteMock *func(r ApiGetVersionsRequest) (*GetVersionsResponse, error) // ListBackupsExecuteMock can be populated to implement the behavior of the ListBackupsExecute function of this mock ListBackupsExecuteMock *func(r ApiListBackupsRequest) (*ListBackupResponse, error) + // ListCollationsExecuteMock can be populated to implement the behavior of the ListCollationsExecute function of this mock + ListCollationsExecuteMock *func(r ApiListCollationsRequest) (*ListCollationsResponse, error) // ListCompatibilitiesExecuteMock can be populated to implement the behavior of the ListCompatibilitiesExecute function of this mock ListCompatibilitiesExecuteMock *func(r ApiListCompatibilitiesRequest) (*ListCompatibilityResponse, error) // ListCurrentRunningRestoreJobsExecuteMock can be populated to implement the behavior of the ListCurrentRunningRestoreJobsExecute function of this mock @@ -61,10 +57,14 @@ type DefaultAPIServiceMock struct { ListInstancesExecuteMock *func(r ApiListInstancesRequest) (*ListInstancesResponse, error) // ListRolesExecuteMock can be populated to implement the behavior of the ListRolesExecute function of this mock ListRolesExecuteMock *func(r ApiListRolesRequest) (*ListRolesResponse, error) + // 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) (*ListUserResponse, error) - // ProtectInstanceExecuteMock can be populated to implement the behavior of the ProtectInstanceExecute function of this mock - ProtectInstanceExecuteMock *func(r ApiProtectInstanceRequest) (*ProtectInstanceResponse, 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) error // ResetUserExecuteMock can be populated to implement the behavior of the ResetUserExecute function of this mock ResetUserExecuteMock *func(r ApiResetUserRequest) (*ResetUserResponse, error) // RestoreDatabaseFromBackupExecuteMock can be populated to implement the behavior of the RestoreDatabaseFromBackupExecute function of this mock @@ -75,8 +75,8 @@ type DefaultAPIServiceMock struct { TriggerRestoreExecuteMock *func(r ApiTriggerRestoreRequest) error // UpdateInstanceExecuteMock can be populated to implement the behavior of the UpdateInstanceExecute function of this mock UpdateInstanceExecuteMock *func(r ApiUpdateInstanceRequest) error - // UpdateInstancePartiallyExecuteMock can be populated to implement the behavior of the UpdateInstancePartiallyExecute function of this mock - UpdateInstancePartiallyExecuteMock *func(r ApiUpdateInstancePartiallyRequest) error + // UpdateInstanceProtectionExecuteMock can be populated to implement the behavior of the UpdateInstanceProtectionExecute function of this mock + UpdateInstanceProtectionExecuteMock *func(r ApiUpdateInstanceProtectionRequest) (*UpdateInstanceProtectionResponse, error) } func (a DefaultAPIServiceMock) CreateDatabase(ctx context.Context, projectId string, region string, instanceId string) ApiCreateDatabaseRequest { @@ -218,26 +218,6 @@ func (a DefaultAPIServiceMock) GetBackupExecute(r ApiGetBackupRequest) (*GetBack return (*a.GetBackupExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetCollations(ctx context.Context, projectId string, region string, instanceId string) ApiGetCollationsRequest { - return ApiGetCollationsRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - instanceId: instanceId, - } -} - -// GetCollationsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetCollationsExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetCollationsExecute(r ApiGetCollationsRequest) (*GetCollationsResponse, error) { - if a.GetCollationsExecuteMock == nil { - var localVarReturnValue *GetCollationsResponse - return localVarReturnValue, nil - } - - return (*a.GetCollationsExecuteMock)(r) -} - func (a DefaultAPIServiceMock) GetDatabase(ctx context.Context, projectId string, region string, instanceId string, databaseName string) ApiGetDatabaseRequest { return ApiGetDatabaseRequest{ ApiService: a, @@ -298,26 +278,6 @@ func (a DefaultAPIServiceMock) GetInstanceExecute(r ApiGetInstanceRequest) (*Get return (*a.GetInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetStorages(ctx context.Context, projectId string, region string, flavorId string) ApiGetStoragesRequest { - return ApiGetStoragesRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - flavorId: flavorId, - } -} - -// GetStoragesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetStoragesExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetStoragesExecute(r ApiGetStoragesRequest) (*GetStoragesResponse, error) { - if a.GetStoragesExecuteMock == nil { - var localVarReturnValue *GetStoragesResponse - return localVarReturnValue, nil - } - - return (*a.GetStoragesExecuteMock)(r) -} - func (a DefaultAPIServiceMock) GetUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiGetUserRequest { return ApiGetUserRequest{ ApiService: a, @@ -339,27 +299,28 @@ func (a DefaultAPIServiceMock) GetUserExecute(r ApiGetUserRequest) (*GetUserResp return (*a.GetUserExecuteMock)(r) } -func (a DefaultAPIServiceMock) GetVersions(ctx context.Context, projectId string, region string) ApiGetVersionsRequest { - return ApiGetVersionsRequest{ +func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ ApiService: a, ctx: ctx, projectId: projectId, region: region, + instanceId: instanceId, } } -// GetVersionsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetVersionsExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) GetVersionsExecute(r ApiGetVersionsRequest) (*GetVersionsResponse, error) { - if a.GetVersionsExecuteMock == nil { - var localVarReturnValue *GetVersionsResponse +// ListBackupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListBackupsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupResponse, error) { + if a.ListBackupsExecuteMock == nil { + var localVarReturnValue *ListBackupResponse return localVarReturnValue, nil } - return (*a.GetVersionsExecuteMock)(r) + return (*a.ListBackupsExecuteMock)(r) } -func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, region string, instanceId string) ApiListBackupsRequest { - return ApiListBackupsRequest{ +func (a DefaultAPIServiceMock) ListCollations(ctx context.Context, projectId string, region string, instanceId string) ApiListCollationsRequest { + return ApiListCollationsRequest{ ApiService: a, ctx: ctx, projectId: projectId, @@ -368,14 +329,14 @@ func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string } } -// ListBackupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListBackupsExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupResponse, error) { - if a.ListBackupsExecuteMock == nil { - var localVarReturnValue *ListBackupResponse +// ListCollationsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListCollationsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListCollationsExecute(r ApiListCollationsRequest) (*ListCollationsResponse, error) { + if a.ListCollationsExecuteMock == nil { + var localVarReturnValue *ListCollationsResponse return localVarReturnValue, nil } - return (*a.ListBackupsExecuteMock)(r) + return (*a.ListCollationsExecuteMock)(r) } func (a DefaultAPIServiceMock) ListCompatibilities(ctx context.Context, projectId string, region string, instanceId string) ApiListCompatibilitiesRequest { @@ -477,6 +438,26 @@ func (a DefaultAPIServiceMock) ListRolesExecute(r ApiListRolesRequest) (*ListRol return (*a.ListRolesExecuteMock)(r) } +func (a DefaultAPIServiceMock) ListStorages(ctx context.Context, projectId string, region string, flavorId string) ApiListStoragesRequest { + return ApiListStoragesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + 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, region string, instanceId string) ApiListUsersRequest { return ApiListUsersRequest{ ApiService: a, @@ -497,24 +478,42 @@ func (a DefaultAPIServiceMock) ListUsersExecute(r ApiListUsersRequest) (*ListUse return (*a.ListUsersExecuteMock)(r) } -func (a DefaultAPIServiceMock) ProtectInstance(ctx context.Context, projectId string, region string, instanceId string) ApiProtectInstanceRequest { - return ApiProtectInstanceRequest{ +func (a DefaultAPIServiceMock) ListVersions(ctx context.Context, projectId string, region string) ApiListVersionsRequest { + return ApiListVersionsRequest{ ApiService: a, ctx: ctx, projectId: projectId, region: region, - instanceId: instanceId, } } -// ProtectInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ProtectInstanceExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) ProtectInstanceExecute(r ApiProtectInstanceRequest) (*ProtectInstanceResponse, error) { - if a.ProtectInstanceExecuteMock == nil { - var localVarReturnValue *ProtectInstanceResponse +// 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.ProtectInstanceExecuteMock)(r) + return (*a.ListVersionsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PartialUpdateInstance(ctx context.Context, projectId string, region string, instanceId string) ApiPartialUpdateInstanceRequest { + return ApiPartialUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + instanceId: instanceId, + } +} + +// PartialUpdateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error { + if a.PartialUpdateInstanceExecuteMock == nil { + return nil + } + + return (*a.PartialUpdateInstanceExecuteMock)(r) } func (a DefaultAPIServiceMock) ResetUser(ctx context.Context, projectId string, region string, instanceId string, userId int64) ApiResetUserRequest { @@ -616,8 +615,8 @@ func (a DefaultAPIServiceMock) UpdateInstanceExecute(r ApiUpdateInstanceRequest) return (*a.UpdateInstanceExecuteMock)(r) } -func (a DefaultAPIServiceMock) UpdateInstancePartially(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstancePartiallyRequest { - return ApiUpdateInstancePartiallyRequest{ +func (a DefaultAPIServiceMock) UpdateInstanceProtection(ctx context.Context, projectId string, region string, instanceId string) ApiUpdateInstanceProtectionRequest { + return ApiUpdateInstanceProtectionRequest{ ApiService: a, ctx: ctx, projectId: projectId, @@ -626,11 +625,12 @@ func (a DefaultAPIServiceMock) UpdateInstancePartially(ctx context.Context, proj } } -// UpdateInstancePartiallyExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateInstancePartiallyExecuteMock field in the DefaultAPIServiceMock struct. -func (a DefaultAPIServiceMock) UpdateInstancePartiallyExecute(r ApiUpdateInstancePartiallyRequest) error { - if a.UpdateInstancePartiallyExecuteMock == nil { - return nil +// UpdateInstanceProtectionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateInstanceProtectionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateInstanceProtectionExecute(r ApiUpdateInstanceProtectionRequest) (*UpdateInstanceProtectionResponse, error) { + if a.UpdateInstanceProtectionExecuteMock == nil { + var localVarReturnValue *UpdateInstanceProtectionResponse + return localVarReturnValue, nil } - return (*a.UpdateInstancePartiallyExecuteMock)(r) + return (*a.UpdateInstanceProtectionExecuteMock)(r) } diff --git a/services/sqlserverflex/v3beta2api/model_get_collations_response.go b/services/sqlserverflex/v3beta2api/model_list_collations_response.go similarity index 57% rename from services/sqlserverflex/v3beta2api/model_get_collations_response.go rename to services/sqlserverflex/v3beta2api/model_list_collations_response.go index fe140da8d..5510415df 100644 --- a/services/sqlserverflex/v3beta2api/model_get_collations_response.go +++ b/services/sqlserverflex/v3beta2api/model_list_collations_response.go @@ -16,38 +16,38 @@ import ( "fmt" ) -// checks if the GetCollationsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetCollationsResponse{} +// checks if the ListCollationsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCollationsResponse{} -// GetCollationsResponse struct for GetCollationsResponse -type GetCollationsResponse struct { +// ListCollationsResponse struct for ListCollationsResponse +type ListCollationsResponse struct { // List of collations available for the instance. Collations []DatabaseGetcollation `json:"collations"` AdditionalProperties map[string]interface{} } -type _GetCollationsResponse GetCollationsResponse +type _ListCollationsResponse ListCollationsResponse -// NewGetCollationsResponse instantiates a new GetCollationsResponse object +// NewListCollationsResponse instantiates a new ListCollationsResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewGetCollationsResponse(collations []DatabaseGetcollation) *GetCollationsResponse { - this := GetCollationsResponse{} +func NewListCollationsResponse(collations []DatabaseGetcollation) *ListCollationsResponse { + this := ListCollationsResponse{} this.Collations = collations return &this } -// NewGetCollationsResponseWithDefaults instantiates a new GetCollationsResponse object +// NewListCollationsResponseWithDefaults instantiates a new ListCollationsResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set -func NewGetCollationsResponseWithDefaults() *GetCollationsResponse { - this := GetCollationsResponse{} +func NewListCollationsResponseWithDefaults() *ListCollationsResponse { + this := ListCollationsResponse{} return &this } // GetCollations returns the Collations field value -func (o *GetCollationsResponse) GetCollations() []DatabaseGetcollation { +func (o *ListCollationsResponse) GetCollations() []DatabaseGetcollation { if o == nil { var ret []DatabaseGetcollation return ret @@ -58,7 +58,7 @@ func (o *GetCollationsResponse) GetCollations() []DatabaseGetcollation { // GetCollationsOk returns a tuple with the Collations field value // and a boolean to check if the value has been set. -func (o *GetCollationsResponse) GetCollationsOk() ([]DatabaseGetcollation, bool) { +func (o *ListCollationsResponse) GetCollationsOk() ([]DatabaseGetcollation, bool) { if o == nil { return nil, false } @@ -66,11 +66,11 @@ func (o *GetCollationsResponse) GetCollationsOk() ([]DatabaseGetcollation, bool) } // SetCollations sets field value -func (o *GetCollationsResponse) SetCollations(v []DatabaseGetcollation) { +func (o *ListCollationsResponse) SetCollations(v []DatabaseGetcollation) { o.Collations = v } -func (o GetCollationsResponse) MarshalJSON() ([]byte, error) { +func (o ListCollationsResponse) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err @@ -78,7 +78,7 @@ func (o GetCollationsResponse) MarshalJSON() ([]byte, error) { return json.Marshal(toSerialize) } -func (o GetCollationsResponse) ToMap() (map[string]interface{}, error) { +func (o ListCollationsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["collations"] = o.Collations @@ -89,7 +89,7 @@ func (o GetCollationsResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } -func (o *GetCollationsResponse) UnmarshalJSON(data []byte) (err error) { +func (o *ListCollationsResponse) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. @@ -111,15 +111,15 @@ func (o *GetCollationsResponse) UnmarshalJSON(data []byte) (err error) { } } - varGetCollationsResponse := _GetCollationsResponse{} + varListCollationsResponse := _ListCollationsResponse{} - err = json.Unmarshal(data, &varGetCollationsResponse) + err = json.Unmarshal(data, &varListCollationsResponse) if err != nil { return err } - *o = GetCollationsResponse(varGetCollationsResponse) + *o = ListCollationsResponse(varListCollationsResponse) additionalProperties := make(map[string]interface{}) @@ -131,38 +131,38 @@ func (o *GetCollationsResponse) UnmarshalJSON(data []byte) (err error) { return err } -type NullableGetCollationsResponse struct { - value *GetCollationsResponse +type NullableListCollationsResponse struct { + value *ListCollationsResponse isSet bool } -func (v NullableGetCollationsResponse) Get() *GetCollationsResponse { +func (v NullableListCollationsResponse) Get() *ListCollationsResponse { return v.value } -func (v *NullableGetCollationsResponse) Set(val *GetCollationsResponse) { +func (v *NullableListCollationsResponse) Set(val *ListCollationsResponse) { v.value = val v.isSet = true } -func (v NullableGetCollationsResponse) IsSet() bool { +func (v NullableListCollationsResponse) IsSet() bool { return v.isSet } -func (v *NullableGetCollationsResponse) Unset() { +func (v *NullableListCollationsResponse) Unset() { v.value = nil v.isSet = false } -func NewNullableGetCollationsResponse(val *GetCollationsResponse) *NullableGetCollationsResponse { - return &NullableGetCollationsResponse{value: val, isSet: true} +func NewNullableListCollationsResponse(val *ListCollationsResponse) *NullableListCollationsResponse { + return &NullableListCollationsResponse{value: val, isSet: true} } -func (v NullableGetCollationsResponse) MarshalJSON() ([]byte, error) { +func (v NullableListCollationsResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } -func (v *NullableGetCollationsResponse) UnmarshalJSON(src []byte) error { +func (v *NullableListCollationsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/sqlserverflex/v3beta2api/model_get_storages_response.go b/services/sqlserverflex/v3beta2api/model_list_storages_response.go similarity index 60% rename from services/sqlserverflex/v3beta2api/model_get_storages_response.go rename to services/sqlserverflex/v3beta2api/model_list_storages_response.go index 5234f04c2..92a6c7067 100644 --- a/services/sqlserverflex/v3beta2api/model_get_storages_response.go +++ b/services/sqlserverflex/v3beta2api/model_list_storages_response.go @@ -16,40 +16,40 @@ import ( "fmt" ) -// checks if the GetStoragesResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetStoragesResponse{} +// checks if the ListStoragesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListStoragesResponse{} -// GetStoragesResponse struct for GetStoragesResponse -type GetStoragesResponse struct { +// ListStoragesResponse struct for ListStoragesResponse +type ListStoragesResponse struct { // maximum storage which can be ordered for the flavor in Gigabyte. StorageClasses []FlavorStorageClassesStorageClass `json:"storageClasses"` StorageRange FlavorStorageRange `json:"storageRange"` AdditionalProperties map[string]interface{} } -type _GetStoragesResponse GetStoragesResponse +type _ListStoragesResponse ListStoragesResponse -// NewGetStoragesResponse instantiates a new GetStoragesResponse object +// 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 NewGetStoragesResponse(storageClasses []FlavorStorageClassesStorageClass, storageRange FlavorStorageRange) *GetStoragesResponse { - this := GetStoragesResponse{} +func NewListStoragesResponse(storageClasses []FlavorStorageClassesStorageClass, storageRange FlavorStorageRange) *ListStoragesResponse { + this := ListStoragesResponse{} this.StorageClasses = storageClasses this.StorageRange = storageRange return &this } -// NewGetStoragesResponseWithDefaults instantiates a new GetStoragesResponse object +// 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 NewGetStoragesResponseWithDefaults() *GetStoragesResponse { - this := GetStoragesResponse{} +func NewListStoragesResponseWithDefaults() *ListStoragesResponse { + this := ListStoragesResponse{} return &this } // GetStorageClasses returns the StorageClasses field value -func (o *GetStoragesResponse) GetStorageClasses() []FlavorStorageClassesStorageClass { +func (o *ListStoragesResponse) GetStorageClasses() []FlavorStorageClassesStorageClass { if o == nil { var ret []FlavorStorageClassesStorageClass return ret @@ -60,7 +60,7 @@ func (o *GetStoragesResponse) GetStorageClasses() []FlavorStorageClassesStorageC // GetStorageClassesOk returns a tuple with the StorageClasses field value // and a boolean to check if the value has been set. -func (o *GetStoragesResponse) GetStorageClassesOk() ([]FlavorStorageClassesStorageClass, bool) { +func (o *ListStoragesResponse) GetStorageClassesOk() ([]FlavorStorageClassesStorageClass, bool) { if o == nil { return nil, false } @@ -68,12 +68,12 @@ func (o *GetStoragesResponse) GetStorageClassesOk() ([]FlavorStorageClassesStora } // SetStorageClasses sets field value -func (o *GetStoragesResponse) SetStorageClasses(v []FlavorStorageClassesStorageClass) { +func (o *ListStoragesResponse) SetStorageClasses(v []FlavorStorageClassesStorageClass) { o.StorageClasses = v } // GetStorageRange returns the StorageRange field value -func (o *GetStoragesResponse) GetStorageRange() FlavorStorageRange { +func (o *ListStoragesResponse) GetStorageRange() FlavorStorageRange { if o == nil { var ret FlavorStorageRange return ret @@ -84,7 +84,7 @@ func (o *GetStoragesResponse) GetStorageRange() FlavorStorageRange { // GetStorageRangeOk returns a tuple with the StorageRange field value // and a boolean to check if the value has been set. -func (o *GetStoragesResponse) GetStorageRangeOk() (*FlavorStorageRange, bool) { +func (o *ListStoragesResponse) GetStorageRangeOk() (*FlavorStorageRange, bool) { if o == nil { return nil, false } @@ -92,11 +92,11 @@ func (o *GetStoragesResponse) GetStorageRangeOk() (*FlavorStorageRange, bool) { } // SetStorageRange sets field value -func (o *GetStoragesResponse) SetStorageRange(v FlavorStorageRange) { +func (o *ListStoragesResponse) SetStorageRange(v FlavorStorageRange) { o.StorageRange = v } -func (o GetStoragesResponse) MarshalJSON() ([]byte, error) { +func (o ListStoragesResponse) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err @@ -104,7 +104,7 @@ func (o GetStoragesResponse) MarshalJSON() ([]byte, error) { return json.Marshal(toSerialize) } -func (o GetStoragesResponse) ToMap() (map[string]interface{}, error) { +func (o ListStoragesResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["storageClasses"] = o.StorageClasses toSerialize["storageRange"] = o.StorageRange @@ -116,7 +116,7 @@ func (o GetStoragesResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } -func (o *GetStoragesResponse) UnmarshalJSON(data []byte) (err error) { +func (o *ListStoragesResponse) 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. @@ -139,15 +139,15 @@ func (o *GetStoragesResponse) UnmarshalJSON(data []byte) (err error) { } } - varGetStoragesResponse := _GetStoragesResponse{} + varListStoragesResponse := _ListStoragesResponse{} - err = json.Unmarshal(data, &varGetStoragesResponse) + err = json.Unmarshal(data, &varListStoragesResponse) if err != nil { return err } - *o = GetStoragesResponse(varGetStoragesResponse) + *o = ListStoragesResponse(varListStoragesResponse) additionalProperties := make(map[string]interface{}) @@ -160,38 +160,38 @@ func (o *GetStoragesResponse) UnmarshalJSON(data []byte) (err error) { return err } -type NullableGetStoragesResponse struct { - value *GetStoragesResponse +type NullableListStoragesResponse struct { + value *ListStoragesResponse isSet bool } -func (v NullableGetStoragesResponse) Get() *GetStoragesResponse { +func (v NullableListStoragesResponse) Get() *ListStoragesResponse { return v.value } -func (v *NullableGetStoragesResponse) Set(val *GetStoragesResponse) { +func (v *NullableListStoragesResponse) Set(val *ListStoragesResponse) { v.value = val v.isSet = true } -func (v NullableGetStoragesResponse) IsSet() bool { +func (v NullableListStoragesResponse) IsSet() bool { return v.isSet } -func (v *NullableGetStoragesResponse) Unset() { +func (v *NullableListStoragesResponse) Unset() { v.value = nil v.isSet = false } -func NewNullableGetStoragesResponse(val *GetStoragesResponse) *NullableGetStoragesResponse { - return &NullableGetStoragesResponse{value: val, isSet: true} +func NewNullableListStoragesResponse(val *ListStoragesResponse) *NullableListStoragesResponse { + return &NullableListStoragesResponse{value: val, isSet: true} } -func (v NullableGetStoragesResponse) MarshalJSON() ([]byte, error) { +func (v NullableListStoragesResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } -func (v *NullableGetStoragesResponse) UnmarshalJSON(src []byte) error { +func (v *NullableListStoragesResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/sqlserverflex/v3beta2api/model_get_versions_response.go b/services/sqlserverflex/v3beta2api/model_list_versions_response.go similarity index 59% rename from services/sqlserverflex/v3beta2api/model_get_versions_response.go rename to services/sqlserverflex/v3beta2api/model_list_versions_response.go index 30c0b811b..5ca10dc15 100644 --- a/services/sqlserverflex/v3beta2api/model_get_versions_response.go +++ b/services/sqlserverflex/v3beta2api/model_list_versions_response.go @@ -16,38 +16,38 @@ import ( "fmt" ) -// checks if the GetVersionsResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetVersionsResponse{} +// checks if the ListVersionsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListVersionsResponse{} -// GetVersionsResponse struct for GetVersionsResponse -type GetVersionsResponse struct { +// ListVersionsResponse struct for ListVersionsResponse +type ListVersionsResponse struct { // A list containing available sqlserver versions. Versions []Version `json:"versions"` AdditionalProperties map[string]interface{} } -type _GetVersionsResponse GetVersionsResponse +type _ListVersionsResponse ListVersionsResponse -// NewGetVersionsResponse instantiates a new GetVersionsResponse object +// 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 NewGetVersionsResponse(versions []Version) *GetVersionsResponse { - this := GetVersionsResponse{} +func NewListVersionsResponse(versions []Version) *ListVersionsResponse { + this := ListVersionsResponse{} this.Versions = versions return &this } -// NewGetVersionsResponseWithDefaults instantiates a new GetVersionsResponse object +// 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 NewGetVersionsResponseWithDefaults() *GetVersionsResponse { - this := GetVersionsResponse{} +func NewListVersionsResponseWithDefaults() *ListVersionsResponse { + this := ListVersionsResponse{} return &this } // GetVersions returns the Versions field value -func (o *GetVersionsResponse) GetVersions() []Version { +func (o *ListVersionsResponse) GetVersions() []Version { if o == nil { var ret []Version return ret @@ -58,7 +58,7 @@ func (o *GetVersionsResponse) GetVersions() []Version { // GetVersionsOk returns a tuple with the Versions field value // and a boolean to check if the value has been set. -func (o *GetVersionsResponse) GetVersionsOk() ([]Version, bool) { +func (o *ListVersionsResponse) GetVersionsOk() ([]Version, bool) { if o == nil { return nil, false } @@ -66,11 +66,11 @@ func (o *GetVersionsResponse) GetVersionsOk() ([]Version, bool) { } // SetVersions sets field value -func (o *GetVersionsResponse) SetVersions(v []Version) { +func (o *ListVersionsResponse) SetVersions(v []Version) { o.Versions = v } -func (o GetVersionsResponse) MarshalJSON() ([]byte, error) { +func (o ListVersionsResponse) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err @@ -78,7 +78,7 @@ func (o GetVersionsResponse) MarshalJSON() ([]byte, error) { return json.Marshal(toSerialize) } -func (o GetVersionsResponse) ToMap() (map[string]interface{}, error) { +func (o ListVersionsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["versions"] = o.Versions @@ -89,7 +89,7 @@ func (o GetVersionsResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } -func (o *GetVersionsResponse) UnmarshalJSON(data []byte) (err error) { +func (o *ListVersionsResponse) 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. @@ -111,15 +111,15 @@ func (o *GetVersionsResponse) UnmarshalJSON(data []byte) (err error) { } } - varGetVersionsResponse := _GetVersionsResponse{} + varListVersionsResponse := _ListVersionsResponse{} - err = json.Unmarshal(data, &varGetVersionsResponse) + err = json.Unmarshal(data, &varListVersionsResponse) if err != nil { return err } - *o = GetVersionsResponse(varGetVersionsResponse) + *o = ListVersionsResponse(varListVersionsResponse) additionalProperties := make(map[string]interface{}) @@ -131,38 +131,38 @@ func (o *GetVersionsResponse) UnmarshalJSON(data []byte) (err error) { return err } -type NullableGetVersionsResponse struct { - value *GetVersionsResponse +type NullableListVersionsResponse struct { + value *ListVersionsResponse isSet bool } -func (v NullableGetVersionsResponse) Get() *GetVersionsResponse { +func (v NullableListVersionsResponse) Get() *ListVersionsResponse { return v.value } -func (v *NullableGetVersionsResponse) Set(val *GetVersionsResponse) { +func (v *NullableListVersionsResponse) Set(val *ListVersionsResponse) { v.value = val v.isSet = true } -func (v NullableGetVersionsResponse) IsSet() bool { +func (v NullableListVersionsResponse) IsSet() bool { return v.isSet } -func (v *NullableGetVersionsResponse) Unset() { +func (v *NullableListVersionsResponse) Unset() { v.value = nil v.isSet = false } -func NewNullableGetVersionsResponse(val *GetVersionsResponse) *NullableGetVersionsResponse { - return &NullableGetVersionsResponse{value: val, isSet: true} +func NewNullableListVersionsResponse(val *ListVersionsResponse) *NullableListVersionsResponse { + return &NullableListVersionsResponse{value: val, isSet: true} } -func (v NullableGetVersionsResponse) MarshalJSON() ([]byte, error) { +func (v NullableListVersionsResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } -func (v *NullableGetVersionsResponse) UnmarshalJSON(src []byte) error { +func (v *NullableListVersionsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/sqlserverflex/v3beta2api/model_update_instance_partially_payload.go b/services/sqlserverflex/v3beta2api/model_partial_update_instance_payload.go similarity index 63% rename from services/sqlserverflex/v3beta2api/model_update_instance_partially_payload.go rename to services/sqlserverflex/v3beta2api/model_partial_update_instance_payload.go index d43fa46fb..d30df6484 100644 --- a/services/sqlserverflex/v3beta2api/model_update_instance_partially_payload.go +++ b/services/sqlserverflex/v3beta2api/model_partial_update_instance_payload.go @@ -15,11 +15,11 @@ import ( "encoding/json" ) -// checks if the UpdateInstancePartiallyPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateInstancePartiallyPayload{} +// checks if the PartialUpdateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateInstancePayload{} -// UpdateInstancePartiallyPayload struct for UpdateInstancePartiallyPayload -type UpdateInstancePartiallyPayload struct { +// PartialUpdateInstancePayload struct for PartialUpdateInstancePayload +type PartialUpdateInstancePayload struct { // The schedule on which time the daily backup is being executed. The schedule is written as a cron schedule. BackupSchedule *string `json:"backupSchedule,omitempty"` // The id of the instance flavor. @@ -27,35 +27,35 @@ type UpdateInstancePartiallyPayload struct { // A dictionary of user-defined key-value pairs used to categorize or organize the resource. **Rules for Keys:** * Must be between 1 and 63 characters long. * Must begin and end with an alphanumeric character (`[a-z0-9A-Z]`). * May contain dashes (`-`), underscores (`_`), and dots (`.`). * **Regex:** `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$` * **Restriction:** The prefix `stackit-` is strictly reserved and cannot be used. **Rules for Values:** * Must be between 0 (empty string) and 63 characters long. * If not empty, must begin and end with an alphanumeric character. * May contain dashes (`-`), underscores (`_`), and dots (`.`). * **Regex:** `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$` Labels *map[string]string `json:"labels,omitempty"` // The name of the instance. - Name *string `json:"name,omitempty"` - Network *UpdateInstancePartiallyPayloadNetwork `json:"network,omitempty"` - RetentionDays *int32 `json:"retentionDays,omitempty"` - Storage *StorageUpdate `json:"storage,omitempty"` - Version *InstanceVersionOpt `json:"version,omitempty"` + Name *string `json:"name,omitempty"` + Network *PartialUpdateInstancePayloadNetwork `json:"network,omitempty"` + RetentionDays *int32 `json:"retentionDays,omitempty"` + Storage *StorageUpdate `json:"storage,omitempty"` + Version *InstanceVersionOpt `json:"version,omitempty"` AdditionalProperties map[string]interface{} } -type _UpdateInstancePartiallyPayload UpdateInstancePartiallyPayload +type _PartialUpdateInstancePayload PartialUpdateInstancePayload -// NewUpdateInstancePartiallyPayload instantiates a new UpdateInstancePartiallyPayload object +// 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 NewUpdateInstancePartiallyPayload() *UpdateInstancePartiallyPayload { - this := UpdateInstancePartiallyPayload{} +func NewPartialUpdateInstancePayload() *PartialUpdateInstancePayload { + this := PartialUpdateInstancePayload{} return &this } -// NewUpdateInstancePartiallyPayloadWithDefaults instantiates a new UpdateInstancePartiallyPayload object +// 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 NewUpdateInstancePartiallyPayloadWithDefaults() *UpdateInstancePartiallyPayload { - this := UpdateInstancePartiallyPayload{} +func NewPartialUpdateInstancePayloadWithDefaults() *PartialUpdateInstancePayload { + this := PartialUpdateInstancePayload{} return &this } // GetBackupSchedule returns the BackupSchedule field value if set, zero value otherwise. -func (o *UpdateInstancePartiallyPayload) GetBackupSchedule() string { +func (o *PartialUpdateInstancePayload) GetBackupSchedule() string { if o == nil || IsNil(o.BackupSchedule) { var ret string return ret @@ -65,7 +65,7 @@ func (o *UpdateInstancePartiallyPayload) GetBackupSchedule() string { // 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 *UpdateInstancePartiallyPayload) GetBackupScheduleOk() (*string, bool) { +func (o *PartialUpdateInstancePayload) GetBackupScheduleOk() (*string, bool) { if o == nil || IsNil(o.BackupSchedule) { return nil, false } @@ -73,7 +73,7 @@ func (o *UpdateInstancePartiallyPayload) GetBackupScheduleOk() (*string, bool) { } // HasBackupSchedule returns a boolean if a field has been set. -func (o *UpdateInstancePartiallyPayload) HasBackupSchedule() bool { +func (o *PartialUpdateInstancePayload) HasBackupSchedule() bool { if o != nil && !IsNil(o.BackupSchedule) { return true } @@ -82,12 +82,12 @@ func (o *UpdateInstancePartiallyPayload) HasBackupSchedule() bool { } // SetBackupSchedule gets a reference to the given string and assigns it to the BackupSchedule field. -func (o *UpdateInstancePartiallyPayload) SetBackupSchedule(v string) { +func (o *PartialUpdateInstancePayload) SetBackupSchedule(v string) { o.BackupSchedule = &v } // GetFlavorId returns the FlavorId field value if set, zero value otherwise. -func (o *UpdateInstancePartiallyPayload) GetFlavorId() string { +func (o *PartialUpdateInstancePayload) GetFlavorId() string { if o == nil || IsNil(o.FlavorId) { var ret string return ret @@ -97,7 +97,7 @@ func (o *UpdateInstancePartiallyPayload) GetFlavorId() string { // 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 *UpdateInstancePartiallyPayload) GetFlavorIdOk() (*string, bool) { +func (o *PartialUpdateInstancePayload) GetFlavorIdOk() (*string, bool) { if o == nil || IsNil(o.FlavorId) { return nil, false } @@ -105,7 +105,7 @@ func (o *UpdateInstancePartiallyPayload) GetFlavorIdOk() (*string, bool) { } // HasFlavorId returns a boolean if a field has been set. -func (o *UpdateInstancePartiallyPayload) HasFlavorId() bool { +func (o *PartialUpdateInstancePayload) HasFlavorId() bool { if o != nil && !IsNil(o.FlavorId) { return true } @@ -114,12 +114,12 @@ func (o *UpdateInstancePartiallyPayload) HasFlavorId() bool { } // SetFlavorId gets a reference to the given string and assigns it to the FlavorId field. -func (o *UpdateInstancePartiallyPayload) SetFlavorId(v string) { +func (o *PartialUpdateInstancePayload) SetFlavorId(v string) { o.FlavorId = &v } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateInstancePartiallyPayload) GetLabels() map[string]string { +func (o *PartialUpdateInstancePayload) GetLabels() map[string]string { if o == nil || IsNil(o.Labels) { var ret map[string]string return ret @@ -129,7 +129,7 @@ func (o *UpdateInstancePartiallyPayload) GetLabels() map[string]string { // 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 *UpdateInstancePartiallyPayload) GetLabelsOk() (*map[string]string, bool) { +func (o *PartialUpdateInstancePayload) GetLabelsOk() (*map[string]string, bool) { if o == nil || IsNil(o.Labels) { return nil, false } @@ -137,7 +137,7 @@ func (o *UpdateInstancePartiallyPayload) GetLabelsOk() (*map[string]string, bool } // HasLabels returns a boolean if a field has been set. -func (o *UpdateInstancePartiallyPayload) HasLabels() bool { +func (o *PartialUpdateInstancePayload) HasLabels() bool { if o != nil && !IsNil(o.Labels) { return true } @@ -146,12 +146,12 @@ func (o *UpdateInstancePartiallyPayload) HasLabels() bool { } // SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. -func (o *UpdateInstancePartiallyPayload) SetLabels(v map[string]string) { +func (o *PartialUpdateInstancePayload) SetLabels(v map[string]string) { o.Labels = &v } // GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateInstancePartiallyPayload) GetName() string { +func (o *PartialUpdateInstancePayload) GetName() string { if o == nil || IsNil(o.Name) { var ret string return ret @@ -161,7 +161,7 @@ func (o *UpdateInstancePartiallyPayload) GetName() string { // 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 *UpdateInstancePartiallyPayload) GetNameOk() (*string, bool) { +func (o *PartialUpdateInstancePayload) GetNameOk() (*string, bool) { if o == nil || IsNil(o.Name) { return nil, false } @@ -169,7 +169,7 @@ func (o *UpdateInstancePartiallyPayload) GetNameOk() (*string, bool) { } // HasName returns a boolean if a field has been set. -func (o *UpdateInstancePartiallyPayload) HasName() bool { +func (o *PartialUpdateInstancePayload) HasName() bool { if o != nil && !IsNil(o.Name) { return true } @@ -178,14 +178,14 @@ func (o *UpdateInstancePartiallyPayload) HasName() bool { } // SetName gets a reference to the given string and assigns it to the Name field. -func (o *UpdateInstancePartiallyPayload) SetName(v string) { +func (o *PartialUpdateInstancePayload) SetName(v string) { o.Name = &v } // GetNetwork returns the Network field value if set, zero value otherwise. -func (o *UpdateInstancePartiallyPayload) GetNetwork() UpdateInstancePartiallyPayloadNetwork { +func (o *PartialUpdateInstancePayload) GetNetwork() PartialUpdateInstancePayloadNetwork { if o == nil || IsNil(o.Network) { - var ret UpdateInstancePartiallyPayloadNetwork + var ret PartialUpdateInstancePayloadNetwork return ret } return *o.Network @@ -193,7 +193,7 @@ func (o *UpdateInstancePartiallyPayload) GetNetwork() UpdateInstancePartiallyPay // GetNetworkOk returns a tuple with the Network field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateInstancePartiallyPayload) GetNetworkOk() (*UpdateInstancePartiallyPayloadNetwork, bool) { +func (o *PartialUpdateInstancePayload) GetNetworkOk() (*PartialUpdateInstancePayloadNetwork, bool) { if o == nil || IsNil(o.Network) { return nil, false } @@ -201,7 +201,7 @@ func (o *UpdateInstancePartiallyPayload) GetNetworkOk() (*UpdateInstancePartiall } // HasNetwork returns a boolean if a field has been set. -func (o *UpdateInstancePartiallyPayload) HasNetwork() bool { +func (o *PartialUpdateInstancePayload) HasNetwork() bool { if o != nil && !IsNil(o.Network) { return true } @@ -209,13 +209,13 @@ func (o *UpdateInstancePartiallyPayload) HasNetwork() bool { return false } -// SetNetwork gets a reference to the given UpdateInstancePartiallyPayloadNetwork and assigns it to the Network field. -func (o *UpdateInstancePartiallyPayload) SetNetwork(v UpdateInstancePartiallyPayloadNetwork) { +// SetNetwork gets a reference to the given PartialUpdateInstancePayloadNetwork and assigns it to the Network field. +func (o *PartialUpdateInstancePayload) SetNetwork(v PartialUpdateInstancePayloadNetwork) { o.Network = &v } // GetRetentionDays returns the RetentionDays field value if set, zero value otherwise. -func (o *UpdateInstancePartiallyPayload) GetRetentionDays() int32 { +func (o *PartialUpdateInstancePayload) GetRetentionDays() int32 { if o == nil || IsNil(o.RetentionDays) { var ret int32 return ret @@ -225,7 +225,7 @@ func (o *UpdateInstancePartiallyPayload) GetRetentionDays() int32 { // GetRetentionDaysOk returns a tuple with the RetentionDays field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateInstancePartiallyPayload) GetRetentionDaysOk() (*int32, bool) { +func (o *PartialUpdateInstancePayload) GetRetentionDaysOk() (*int32, bool) { if o == nil || IsNil(o.RetentionDays) { return nil, false } @@ -233,7 +233,7 @@ func (o *UpdateInstancePartiallyPayload) GetRetentionDaysOk() (*int32, bool) { } // HasRetentionDays returns a boolean if a field has been set. -func (o *UpdateInstancePartiallyPayload) HasRetentionDays() bool { +func (o *PartialUpdateInstancePayload) HasRetentionDays() bool { if o != nil && !IsNil(o.RetentionDays) { return true } @@ -242,12 +242,12 @@ func (o *UpdateInstancePartiallyPayload) HasRetentionDays() bool { } // SetRetentionDays gets a reference to the given int32 and assigns it to the RetentionDays field. -func (o *UpdateInstancePartiallyPayload) SetRetentionDays(v int32) { +func (o *PartialUpdateInstancePayload) SetRetentionDays(v int32) { o.RetentionDays = &v } // GetStorage returns the Storage field value if set, zero value otherwise. -func (o *UpdateInstancePartiallyPayload) GetStorage() StorageUpdate { +func (o *PartialUpdateInstancePayload) GetStorage() StorageUpdate { if o == nil || IsNil(o.Storage) { var ret StorageUpdate return ret @@ -257,7 +257,7 @@ func (o *UpdateInstancePartiallyPayload) GetStorage() StorageUpdate { // 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 *UpdateInstancePartiallyPayload) GetStorageOk() (*StorageUpdate, bool) { +func (o *PartialUpdateInstancePayload) GetStorageOk() (*StorageUpdate, bool) { if o == nil || IsNil(o.Storage) { return nil, false } @@ -265,7 +265,7 @@ func (o *UpdateInstancePartiallyPayload) GetStorageOk() (*StorageUpdate, bool) { } // HasStorage returns a boolean if a field has been set. -func (o *UpdateInstancePartiallyPayload) HasStorage() bool { +func (o *PartialUpdateInstancePayload) HasStorage() bool { if o != nil && !IsNil(o.Storage) { return true } @@ -274,12 +274,12 @@ func (o *UpdateInstancePartiallyPayload) HasStorage() bool { } // SetStorage gets a reference to the given StorageUpdate and assigns it to the Storage field. -func (o *UpdateInstancePartiallyPayload) SetStorage(v StorageUpdate) { +func (o *PartialUpdateInstancePayload) SetStorage(v StorageUpdate) { o.Storage = &v } // GetVersion returns the Version field value if set, zero value otherwise. -func (o *UpdateInstancePartiallyPayload) GetVersion() InstanceVersionOpt { +func (o *PartialUpdateInstancePayload) GetVersion() InstanceVersionOpt { if o == nil || IsNil(o.Version) { var ret InstanceVersionOpt return ret @@ -289,7 +289,7 @@ func (o *UpdateInstancePartiallyPayload) GetVersion() InstanceVersionOpt { // 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 *UpdateInstancePartiallyPayload) GetVersionOk() (*InstanceVersionOpt, bool) { +func (o *PartialUpdateInstancePayload) GetVersionOk() (*InstanceVersionOpt, bool) { if o == nil || IsNil(o.Version) { return nil, false } @@ -297,7 +297,7 @@ func (o *UpdateInstancePartiallyPayload) GetVersionOk() (*InstanceVersionOpt, bo } // HasVersion returns a boolean if a field has been set. -func (o *UpdateInstancePartiallyPayload) HasVersion() bool { +func (o *PartialUpdateInstancePayload) HasVersion() bool { if o != nil && !IsNil(o.Version) { return true } @@ -306,11 +306,11 @@ func (o *UpdateInstancePartiallyPayload) HasVersion() bool { } // SetVersion gets a reference to the given InstanceVersionOpt and assigns it to the Version field. -func (o *UpdateInstancePartiallyPayload) SetVersion(v InstanceVersionOpt) { +func (o *PartialUpdateInstancePayload) SetVersion(v InstanceVersionOpt) { o.Version = &v } -func (o UpdateInstancePartiallyPayload) MarshalJSON() ([]byte, error) { +func (o PartialUpdateInstancePayload) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err @@ -318,7 +318,7 @@ func (o UpdateInstancePartiallyPayload) MarshalJSON() ([]byte, error) { return json.Marshal(toSerialize) } -func (o UpdateInstancePartiallyPayload) ToMap() (map[string]interface{}, error) { +func (o PartialUpdateInstancePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !IsNil(o.BackupSchedule) { toSerialize["backupSchedule"] = o.BackupSchedule @@ -352,16 +352,16 @@ func (o UpdateInstancePartiallyPayload) ToMap() (map[string]interface{}, error) return toSerialize, nil } -func (o *UpdateInstancePartiallyPayload) UnmarshalJSON(data []byte) (err error) { - varUpdateInstancePartiallyPayload := _UpdateInstancePartiallyPayload{} +func (o *PartialUpdateInstancePayload) UnmarshalJSON(data []byte) (err error) { + varPartialUpdateInstancePayload := _PartialUpdateInstancePayload{} - err = json.Unmarshal(data, &varUpdateInstancePartiallyPayload) + err = json.Unmarshal(data, &varPartialUpdateInstancePayload) if err != nil { return err } - *o = UpdateInstancePartiallyPayload(varUpdateInstancePartiallyPayload) + *o = PartialUpdateInstancePayload(varPartialUpdateInstancePayload) additionalProperties := make(map[string]interface{}) @@ -380,38 +380,38 @@ func (o *UpdateInstancePartiallyPayload) UnmarshalJSON(data []byte) (err error) return err } -type NullableUpdateInstancePartiallyPayload struct { - value *UpdateInstancePartiallyPayload +type NullablePartialUpdateInstancePayload struct { + value *PartialUpdateInstancePayload isSet bool } -func (v NullableUpdateInstancePartiallyPayload) Get() *UpdateInstancePartiallyPayload { +func (v NullablePartialUpdateInstancePayload) Get() *PartialUpdateInstancePayload { return v.value } -func (v *NullableUpdateInstancePartiallyPayload) Set(val *UpdateInstancePartiallyPayload) { +func (v *NullablePartialUpdateInstancePayload) Set(val *PartialUpdateInstancePayload) { v.value = val v.isSet = true } -func (v NullableUpdateInstancePartiallyPayload) IsSet() bool { +func (v NullablePartialUpdateInstancePayload) IsSet() bool { return v.isSet } -func (v *NullableUpdateInstancePartiallyPayload) Unset() { +func (v *NullablePartialUpdateInstancePayload) Unset() { v.value = nil v.isSet = false } -func NewNullableUpdateInstancePartiallyPayload(val *UpdateInstancePartiallyPayload) *NullableUpdateInstancePartiallyPayload { - return &NullableUpdateInstancePartiallyPayload{value: val, isSet: true} +func NewNullablePartialUpdateInstancePayload(val *PartialUpdateInstancePayload) *NullablePartialUpdateInstancePayload { + return &NullablePartialUpdateInstancePayload{value: val, isSet: true} } -func (v NullableUpdateInstancePartiallyPayload) MarshalJSON() ([]byte, error) { +func (v NullablePartialUpdateInstancePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } -func (v *NullableUpdateInstancePartiallyPayload) UnmarshalJSON(src []byte) error { +func (v *NullablePartialUpdateInstancePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/sqlserverflex/v3beta2api/model_partial_update_instance_payload_network.go b/services/sqlserverflex/v3beta2api/model_partial_update_instance_payload_network.go new file mode 100644 index 000000000..4fac1b629 --- /dev/null +++ b/services/sqlserverflex/v3beta2api/model_partial_update_instance_payload_network.go @@ -0,0 +1,155 @@ +/* +STACKIT MSSQL Service API + +This is the documentation for the STACKIT MSSQL service + +API version: 3beta2 +Contact: support@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v3beta2api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateInstancePayloadNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateInstancePayloadNetwork{} + +// PartialUpdateInstancePayloadNetwork the network configuration of the instance. +type PartialUpdateInstancePayloadNetwork struct { + // List of IPV4 cidr. + Acl []string `json:"acl,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PartialUpdateInstancePayloadNetwork PartialUpdateInstancePayloadNetwork + +// NewPartialUpdateInstancePayloadNetwork instantiates a new PartialUpdateInstancePayloadNetwork 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 NewPartialUpdateInstancePayloadNetwork() *PartialUpdateInstancePayloadNetwork { + this := PartialUpdateInstancePayloadNetwork{} + return &this +} + +// NewPartialUpdateInstancePayloadNetworkWithDefaults instantiates a new PartialUpdateInstancePayloadNetwork 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 NewPartialUpdateInstancePayloadNetworkWithDefaults() *PartialUpdateInstancePayloadNetwork { + this := PartialUpdateInstancePayloadNetwork{} + return &this +} + +// GetAcl returns the Acl field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayloadNetwork) GetAcl() []string { + if o == nil || IsNil(o.Acl) { + var ret []string + return ret + } + return o.Acl +} + +// GetAclOk returns a tuple with the Acl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayloadNetwork) GetAclOk() ([]string, bool) { + if o == nil || IsNil(o.Acl) { + return nil, false + } + return o.Acl, true +} + +// HasAcl returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayloadNetwork) HasAcl() bool { + if o != nil && !IsNil(o.Acl) { + return true + } + + return false +} + +// SetAcl gets a reference to the given []string and assigns it to the Acl field. +func (o *PartialUpdateInstancePayloadNetwork) SetAcl(v []string) { + o.Acl = v +} + +func (o PartialUpdateInstancePayloadNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateInstancePayloadNetwork) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Acl) { + toSerialize["acl"] = o.Acl + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PartialUpdateInstancePayloadNetwork) UnmarshalJSON(data []byte) (err error) { + varPartialUpdateInstancePayloadNetwork := _PartialUpdateInstancePayloadNetwork{} + + err = json.Unmarshal(data, &varPartialUpdateInstancePayloadNetwork) + + if err != nil { + return err + } + + *o = PartialUpdateInstancePayloadNetwork(varPartialUpdateInstancePayloadNetwork) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "acl") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePartialUpdateInstancePayloadNetwork struct { + value *PartialUpdateInstancePayloadNetwork + isSet bool +} + +func (v NullablePartialUpdateInstancePayloadNetwork) Get() *PartialUpdateInstancePayloadNetwork { + return v.value +} + +func (v *NullablePartialUpdateInstancePayloadNetwork) Set(val *PartialUpdateInstancePayloadNetwork) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateInstancePayloadNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateInstancePayloadNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateInstancePayloadNetwork(val *PartialUpdateInstancePayloadNetwork) *NullablePartialUpdateInstancePayloadNetwork { + return &NullablePartialUpdateInstancePayloadNetwork{value: val, isSet: true} +} + +func (v NullablePartialUpdateInstancePayloadNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateInstancePayloadNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sqlserverflex/v3beta2api/model_update_instance_partially_payload_network.go b/services/sqlserverflex/v3beta2api/model_update_instance_partially_payload_network.go deleted file mode 100644 index 48e6978ae..000000000 --- a/services/sqlserverflex/v3beta2api/model_update_instance_partially_payload_network.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -STACKIT MSSQL Service API - -This is the documentation for the STACKIT MSSQL service - -API version: 3beta2 -Contact: support@stackit.cloud -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v3beta2api - -import ( - "encoding/json" -) - -// checks if the UpdateInstancePartiallyPayloadNetwork type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateInstancePartiallyPayloadNetwork{} - -// UpdateInstancePartiallyPayloadNetwork the network configuration of the instance. -type UpdateInstancePartiallyPayloadNetwork struct { - // List of IPV4 cidr. - Acl []string `json:"acl,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _UpdateInstancePartiallyPayloadNetwork UpdateInstancePartiallyPayloadNetwork - -// NewUpdateInstancePartiallyPayloadNetwork instantiates a new UpdateInstancePartiallyPayloadNetwork 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 NewUpdateInstancePartiallyPayloadNetwork() *UpdateInstancePartiallyPayloadNetwork { - this := UpdateInstancePartiallyPayloadNetwork{} - return &this -} - -// NewUpdateInstancePartiallyPayloadNetworkWithDefaults instantiates a new UpdateInstancePartiallyPayloadNetwork 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 NewUpdateInstancePartiallyPayloadNetworkWithDefaults() *UpdateInstancePartiallyPayloadNetwork { - this := UpdateInstancePartiallyPayloadNetwork{} - return &this -} - -// GetAcl returns the Acl field value if set, zero value otherwise. -func (o *UpdateInstancePartiallyPayloadNetwork) GetAcl() []string { - if o == nil || IsNil(o.Acl) { - var ret []string - return ret - } - return o.Acl -} - -// GetAclOk returns a tuple with the Acl field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateInstancePartiallyPayloadNetwork) GetAclOk() ([]string, bool) { - if o == nil || IsNil(o.Acl) { - return nil, false - } - return o.Acl, true -} - -// HasAcl returns a boolean if a field has been set. -func (o *UpdateInstancePartiallyPayloadNetwork) HasAcl() bool { - if o != nil && !IsNil(o.Acl) { - return true - } - - return false -} - -// SetAcl gets a reference to the given []string and assigns it to the Acl field. -func (o *UpdateInstancePartiallyPayloadNetwork) SetAcl(v []string) { - o.Acl = v -} - -func (o UpdateInstancePartiallyPayloadNetwork) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateInstancePartiallyPayloadNetwork) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Acl) { - toSerialize["acl"] = o.Acl - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *UpdateInstancePartiallyPayloadNetwork) UnmarshalJSON(data []byte) (err error) { - varUpdateInstancePartiallyPayloadNetwork := _UpdateInstancePartiallyPayloadNetwork{} - - err = json.Unmarshal(data, &varUpdateInstancePartiallyPayloadNetwork) - - if err != nil { - return err - } - - *o = UpdateInstancePartiallyPayloadNetwork(varUpdateInstancePartiallyPayloadNetwork) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "acl") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableUpdateInstancePartiallyPayloadNetwork struct { - value *UpdateInstancePartiallyPayloadNetwork - isSet bool -} - -func (v NullableUpdateInstancePartiallyPayloadNetwork) Get() *UpdateInstancePartiallyPayloadNetwork { - return v.value -} - -func (v *NullableUpdateInstancePartiallyPayloadNetwork) Set(val *UpdateInstancePartiallyPayloadNetwork) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateInstancePartiallyPayloadNetwork) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateInstancePartiallyPayloadNetwork) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateInstancePartiallyPayloadNetwork(val *UpdateInstancePartiallyPayloadNetwork) *NullableUpdateInstancePartiallyPayloadNetwork { - return &NullableUpdateInstancePartiallyPayloadNetwork{value: val, isSet: true} -} - -func (v NullableUpdateInstancePartiallyPayloadNetwork) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateInstancePartiallyPayloadNetwork) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/sqlserverflex/v3beta2api/model_protect_instance_response.go b/services/sqlserverflex/v3beta2api/model_update_instance_protection_payload.go similarity index 54% rename from services/sqlserverflex/v3beta2api/model_protect_instance_response.go rename to services/sqlserverflex/v3beta2api/model_update_instance_protection_payload.go index 28cbcc6c1..05c62712c 100644 --- a/services/sqlserverflex/v3beta2api/model_protect_instance_response.go +++ b/services/sqlserverflex/v3beta2api/model_update_instance_protection_payload.go @@ -16,38 +16,38 @@ import ( "fmt" ) -// checks if the ProtectInstanceResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ProtectInstanceResponse{} +// checks if the UpdateInstanceProtectionPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateInstanceProtectionPayload{} -// ProtectInstanceResponse struct for ProtectInstanceResponse -type ProtectInstanceResponse struct { +// UpdateInstanceProtectionPayload struct for UpdateInstanceProtectionPayload +type UpdateInstanceProtectionPayload struct { // Protect instance from deletion. IsDeletable bool `json:"isDeletable"` AdditionalProperties map[string]interface{} } -type _ProtectInstanceResponse ProtectInstanceResponse +type _UpdateInstanceProtectionPayload UpdateInstanceProtectionPayload -// NewProtectInstanceResponse instantiates a new ProtectInstanceResponse object +// NewUpdateInstanceProtectionPayload instantiates a new UpdateInstanceProtectionPayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewProtectInstanceResponse(isDeletable bool) *ProtectInstanceResponse { - this := ProtectInstanceResponse{} +func NewUpdateInstanceProtectionPayload(isDeletable bool) *UpdateInstanceProtectionPayload { + this := UpdateInstanceProtectionPayload{} this.IsDeletable = isDeletable return &this } -// NewProtectInstanceResponseWithDefaults instantiates a new ProtectInstanceResponse object +// NewUpdateInstanceProtectionPayloadWithDefaults instantiates a new UpdateInstanceProtectionPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set -func NewProtectInstanceResponseWithDefaults() *ProtectInstanceResponse { - this := ProtectInstanceResponse{} +func NewUpdateInstanceProtectionPayloadWithDefaults() *UpdateInstanceProtectionPayload { + this := UpdateInstanceProtectionPayload{} return &this } // GetIsDeletable returns the IsDeletable field value -func (o *ProtectInstanceResponse) GetIsDeletable() bool { +func (o *UpdateInstanceProtectionPayload) GetIsDeletable() bool { if o == nil { var ret bool return ret @@ -58,7 +58,7 @@ func (o *ProtectInstanceResponse) GetIsDeletable() bool { // GetIsDeletableOk returns a tuple with the IsDeletable field value // and a boolean to check if the value has been set. -func (o *ProtectInstanceResponse) GetIsDeletableOk() (*bool, bool) { +func (o *UpdateInstanceProtectionPayload) GetIsDeletableOk() (*bool, bool) { if o == nil { return nil, false } @@ -66,11 +66,11 @@ func (o *ProtectInstanceResponse) GetIsDeletableOk() (*bool, bool) { } // SetIsDeletable sets field value -func (o *ProtectInstanceResponse) SetIsDeletable(v bool) { +func (o *UpdateInstanceProtectionPayload) SetIsDeletable(v bool) { o.IsDeletable = v } -func (o ProtectInstanceResponse) MarshalJSON() ([]byte, error) { +func (o UpdateInstanceProtectionPayload) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err @@ -78,7 +78,7 @@ func (o ProtectInstanceResponse) MarshalJSON() ([]byte, error) { return json.Marshal(toSerialize) } -func (o ProtectInstanceResponse) ToMap() (map[string]interface{}, error) { +func (o UpdateInstanceProtectionPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["isDeletable"] = o.IsDeletable @@ -89,7 +89,7 @@ func (o ProtectInstanceResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } -func (o *ProtectInstanceResponse) UnmarshalJSON(data []byte) (err error) { +func (o *UpdateInstanceProtectionPayload) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. @@ -111,15 +111,15 @@ func (o *ProtectInstanceResponse) UnmarshalJSON(data []byte) (err error) { } } - varProtectInstanceResponse := _ProtectInstanceResponse{} + varUpdateInstanceProtectionPayload := _UpdateInstanceProtectionPayload{} - err = json.Unmarshal(data, &varProtectInstanceResponse) + err = json.Unmarshal(data, &varUpdateInstanceProtectionPayload) if err != nil { return err } - *o = ProtectInstanceResponse(varProtectInstanceResponse) + *o = UpdateInstanceProtectionPayload(varUpdateInstanceProtectionPayload) additionalProperties := make(map[string]interface{}) @@ -131,38 +131,38 @@ func (o *ProtectInstanceResponse) UnmarshalJSON(data []byte) (err error) { return err } -type NullableProtectInstanceResponse struct { - value *ProtectInstanceResponse +type NullableUpdateInstanceProtectionPayload struct { + value *UpdateInstanceProtectionPayload isSet bool } -func (v NullableProtectInstanceResponse) Get() *ProtectInstanceResponse { +func (v NullableUpdateInstanceProtectionPayload) Get() *UpdateInstanceProtectionPayload { return v.value } -func (v *NullableProtectInstanceResponse) Set(val *ProtectInstanceResponse) { +func (v *NullableUpdateInstanceProtectionPayload) Set(val *UpdateInstanceProtectionPayload) { v.value = val v.isSet = true } -func (v NullableProtectInstanceResponse) IsSet() bool { +func (v NullableUpdateInstanceProtectionPayload) IsSet() bool { return v.isSet } -func (v *NullableProtectInstanceResponse) Unset() { +func (v *NullableUpdateInstanceProtectionPayload) Unset() { v.value = nil v.isSet = false } -func NewNullableProtectInstanceResponse(val *ProtectInstanceResponse) *NullableProtectInstanceResponse { - return &NullableProtectInstanceResponse{value: val, isSet: true} +func NewNullableUpdateInstanceProtectionPayload(val *UpdateInstanceProtectionPayload) *NullableUpdateInstanceProtectionPayload { + return &NullableUpdateInstanceProtectionPayload{value: val, isSet: true} } -func (v NullableProtectInstanceResponse) MarshalJSON() ([]byte, error) { +func (v NullableUpdateInstanceProtectionPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } -func (v *NullableProtectInstanceResponse) UnmarshalJSON(src []byte) error { +func (v *NullableUpdateInstanceProtectionPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/sqlserverflex/v3beta2api/model_protect_instance_payload.go b/services/sqlserverflex/v3beta2api/model_update_instance_protection_response.go similarity index 55% rename from services/sqlserverflex/v3beta2api/model_protect_instance_payload.go rename to services/sqlserverflex/v3beta2api/model_update_instance_protection_response.go index 3f5a5e936..b2b200c2c 100644 --- a/services/sqlserverflex/v3beta2api/model_protect_instance_payload.go +++ b/services/sqlserverflex/v3beta2api/model_update_instance_protection_response.go @@ -16,38 +16,38 @@ import ( "fmt" ) -// checks if the ProtectInstancePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ProtectInstancePayload{} +// checks if the UpdateInstanceProtectionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateInstanceProtectionResponse{} -// ProtectInstancePayload struct for ProtectInstancePayload -type ProtectInstancePayload struct { +// UpdateInstanceProtectionResponse struct for UpdateInstanceProtectionResponse +type UpdateInstanceProtectionResponse struct { // Protect instance from deletion. IsDeletable bool `json:"isDeletable"` AdditionalProperties map[string]interface{} } -type _ProtectInstancePayload ProtectInstancePayload +type _UpdateInstanceProtectionResponse UpdateInstanceProtectionResponse -// NewProtectInstancePayload instantiates a new ProtectInstancePayload object +// NewUpdateInstanceProtectionResponse instantiates a new UpdateInstanceProtectionResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewProtectInstancePayload(isDeletable bool) *ProtectInstancePayload { - this := ProtectInstancePayload{} +func NewUpdateInstanceProtectionResponse(isDeletable bool) *UpdateInstanceProtectionResponse { + this := UpdateInstanceProtectionResponse{} this.IsDeletable = isDeletable return &this } -// NewProtectInstancePayloadWithDefaults instantiates a new ProtectInstancePayload object +// NewUpdateInstanceProtectionResponseWithDefaults instantiates a new UpdateInstanceProtectionResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set -func NewProtectInstancePayloadWithDefaults() *ProtectInstancePayload { - this := ProtectInstancePayload{} +func NewUpdateInstanceProtectionResponseWithDefaults() *UpdateInstanceProtectionResponse { + this := UpdateInstanceProtectionResponse{} return &this } // GetIsDeletable returns the IsDeletable field value -func (o *ProtectInstancePayload) GetIsDeletable() bool { +func (o *UpdateInstanceProtectionResponse) GetIsDeletable() bool { if o == nil { var ret bool return ret @@ -58,7 +58,7 @@ func (o *ProtectInstancePayload) GetIsDeletable() bool { // GetIsDeletableOk returns a tuple with the IsDeletable field value // and a boolean to check if the value has been set. -func (o *ProtectInstancePayload) GetIsDeletableOk() (*bool, bool) { +func (o *UpdateInstanceProtectionResponse) GetIsDeletableOk() (*bool, bool) { if o == nil { return nil, false } @@ -66,11 +66,11 @@ func (o *ProtectInstancePayload) GetIsDeletableOk() (*bool, bool) { } // SetIsDeletable sets field value -func (o *ProtectInstancePayload) SetIsDeletable(v bool) { +func (o *UpdateInstanceProtectionResponse) SetIsDeletable(v bool) { o.IsDeletable = v } -func (o ProtectInstancePayload) MarshalJSON() ([]byte, error) { +func (o UpdateInstanceProtectionResponse) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err @@ -78,7 +78,7 @@ func (o ProtectInstancePayload) MarshalJSON() ([]byte, error) { return json.Marshal(toSerialize) } -func (o ProtectInstancePayload) ToMap() (map[string]interface{}, error) { +func (o UpdateInstanceProtectionResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["isDeletable"] = o.IsDeletable @@ -89,7 +89,7 @@ func (o ProtectInstancePayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } -func (o *ProtectInstancePayload) UnmarshalJSON(data []byte) (err error) { +func (o *UpdateInstanceProtectionResponse) UnmarshalJSON(data []byte) (err error) { // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. @@ -111,15 +111,15 @@ func (o *ProtectInstancePayload) UnmarshalJSON(data []byte) (err error) { } } - varProtectInstancePayload := _ProtectInstancePayload{} + varUpdateInstanceProtectionResponse := _UpdateInstanceProtectionResponse{} - err = json.Unmarshal(data, &varProtectInstancePayload) + err = json.Unmarshal(data, &varUpdateInstanceProtectionResponse) if err != nil { return err } - *o = ProtectInstancePayload(varProtectInstancePayload) + *o = UpdateInstanceProtectionResponse(varUpdateInstanceProtectionResponse) additionalProperties := make(map[string]interface{}) @@ -131,38 +131,38 @@ func (o *ProtectInstancePayload) UnmarshalJSON(data []byte) (err error) { return err } -type NullableProtectInstancePayload struct { - value *ProtectInstancePayload +type NullableUpdateInstanceProtectionResponse struct { + value *UpdateInstanceProtectionResponse isSet bool } -func (v NullableProtectInstancePayload) Get() *ProtectInstancePayload { +func (v NullableUpdateInstanceProtectionResponse) Get() *UpdateInstanceProtectionResponse { return v.value } -func (v *NullableProtectInstancePayload) Set(val *ProtectInstancePayload) { +func (v *NullableUpdateInstanceProtectionResponse) Set(val *UpdateInstanceProtectionResponse) { v.value = val v.isSet = true } -func (v NullableProtectInstancePayload) IsSet() bool { +func (v NullableUpdateInstanceProtectionResponse) IsSet() bool { return v.isSet } -func (v *NullableProtectInstancePayload) Unset() { +func (v *NullableUpdateInstanceProtectionResponse) Unset() { v.value = nil v.isSet = false } -func NewNullableProtectInstancePayload(val *ProtectInstancePayload) *NullableProtectInstancePayload { - return &NullableProtectInstancePayload{value: val, isSet: true} +func NewNullableUpdateInstanceProtectionResponse(val *UpdateInstanceProtectionResponse) *NullableUpdateInstanceProtectionResponse { + return &NullableUpdateInstanceProtectionResponse{value: val, isSet: true} } -func (v NullableProtectInstancePayload) MarshalJSON() ([]byte, error) { +func (v NullableUpdateInstanceProtectionResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } -func (v *NullableProtectInstancePayload) UnmarshalJSON(src []byte) error { +func (v *NullableUpdateInstanceProtectionResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }