From ebb15464b9c3ca52b2cd40d85abe8f0c5e8c01ab Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Fri, 14 Mar 2025 16:15:40 +0000 Subject: [PATCH 1/2] Generate serverupdate --- services/serverupdate/api_default.go | 495 ++++++++---------- services/serverupdate/api_default_test.go | 327 +++++------- services/serverupdate/client.go | 4 +- services/serverupdate/configuration.go | 9 +- .../model_create_update_payload.go | 106 ++-- .../model_create_update_schedule_payload.go | 202 ++++--- .../model_enable_service_payload.go | 116 ---- .../model_enable_service_resource_payload.go | 56 +- services/serverupdate/model_error_response.go | 172 ++++++ .../model_get_update_policies_response.go | 55 +- .../model_get_update_schedules_response.go | 55 +- .../model_get_update_service_response.go | 55 +- .../model_get_updates_list_response.go | 55 +- services/serverupdate/model_update.go | 367 ++++++++----- services/serverupdate/model_update_policy.go | 378 +++++++------ .../serverupdate/model_update_schedule.go | 251 ++++++--- .../model_update_schedule_all_of.go | 53 +- .../model_update_schedule_create_request.go | 202 ++++--- .../model_update_update_schedule_payload.go | 202 ++++--- services/serverupdate/utils.go | 28 +- 20 files changed, 1846 insertions(+), 1342 deletions(-) delete mode 100644 services/serverupdate/model_enable_service_payload.go create mode 100644 services/serverupdate/model_error_response.go diff --git a/services/serverupdate/api_default.go b/services/serverupdate/api_default.go index 7a69fe360..06c14145b 100644 --- a/services/serverupdate/api_default.go +++ b/services/serverupdate/api_default.go @@ -3,7 +3,7 @@ STACKIT Server Update Management API API endpoints for Server Update Operations on STACKIT Servers. -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -30,6 +30,7 @@ type ApiCreateUpdateRequest struct { apiService *DefaultApiService projectId string serverId string + region string createUpdatePayload *CreateUpdatePayload } @@ -51,9 +52,10 @@ func (r ApiCreateUpdateRequest) Execute() (*Update, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/updates" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/updates" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -110,6 +112,17 @@ func (r ApiCreateUpdateRequest) Execute() (*Update, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -132,23 +145,26 @@ CreateUpdate: create update @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @param serverId server id + @param region region @return ApiCreateUpdateRequest */ -func (a *APIClient) CreateUpdate(ctx context.Context, projectId string, serverId string) ApiCreateUpdateRequest { +func (a *APIClient) CreateUpdate(ctx context.Context, projectId string, serverId string, region string) ApiCreateUpdateRequest { return ApiCreateUpdateRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, + region: region, } } -func (a *APIClient) CreateUpdateExecute(ctx context.Context, projectId string, serverId string) (*Update, error) { +func (a *APIClient) CreateUpdateExecute(ctx context.Context, projectId string, serverId string, region string) (*Update, error) { r := ApiCreateUpdateRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, + region: region, } return r.Execute() } @@ -158,6 +174,7 @@ type ApiCreateUpdateScheduleRequest struct { apiService *DefaultApiService projectId string serverId string + region string createUpdateSchedulePayload *CreateUpdateSchedulePayload } @@ -179,9 +196,10 @@ func (r ApiCreateUpdateScheduleRequest) Execute() (*UpdateSchedule, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/update-schedules" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/update-schedules" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -238,6 +256,17 @@ func (r ApiCreateUpdateScheduleRequest) Execute() (*UpdateSchedule, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -260,23 +289,26 @@ CreateUpdateSchedule: create update schedule @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @param serverId server id + @param region region @return ApiCreateUpdateScheduleRequest */ -func (a *APIClient) CreateUpdateSchedule(ctx context.Context, projectId string, serverId string) ApiCreateUpdateScheduleRequest { +func (a *APIClient) CreateUpdateSchedule(ctx context.Context, projectId string, serverId string, region string) ApiCreateUpdateScheduleRequest { return ApiCreateUpdateScheduleRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, + region: region, } } -func (a *APIClient) CreateUpdateScheduleExecute(ctx context.Context, projectId string, serverId string) (*UpdateSchedule, error) { +func (a *APIClient) CreateUpdateScheduleExecute(ctx context.Context, projectId string, serverId string, region string) (*UpdateSchedule, error) { r := ApiCreateUpdateScheduleRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, + region: region, } return r.Execute() } @@ -287,6 +319,7 @@ type ApiDeleteUpdateScheduleRequest struct { projectId string serverId string scheduleId string + region string } func (r ApiDeleteUpdateScheduleRequest) Execute() error { @@ -301,10 +334,11 @@ func (r ApiDeleteUpdateScheduleRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/update-schedules/{scheduleId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/update-schedules/{scheduleId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"scheduleId"+"}", url.PathEscape(ParameterValueToString(r.scheduleId, "scheduleId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -320,7 +354,7 @@ func (r ApiDeleteUpdateScheduleRequest) Execute() error { } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -359,6 +393,17 @@ func (r ApiDeleteUpdateScheduleRequest) Execute() error { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } return newErr } @@ -372,137 +417,28 @@ DeleteUpdateSchedule: delete update schedule @param projectId project id @param serverId server id @param scheduleId update schedule id + @param region region @return ApiDeleteUpdateScheduleRequest */ -func (a *APIClient) DeleteUpdateSchedule(ctx context.Context, projectId string, serverId string, scheduleId string) ApiDeleteUpdateScheduleRequest { +func (a *APIClient) DeleteUpdateSchedule(ctx context.Context, projectId string, serverId string, scheduleId string, region string) ApiDeleteUpdateScheduleRequest { return ApiDeleteUpdateScheduleRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, scheduleId: scheduleId, + region: region, } } -func (a *APIClient) DeleteUpdateScheduleExecute(ctx context.Context, projectId string, serverId string, scheduleId string) error { +func (a *APIClient) DeleteUpdateScheduleExecute(ctx context.Context, projectId string, serverId string, scheduleId string, region string) error { r := ApiDeleteUpdateScheduleRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, scheduleId: scheduleId, - } - return r.Execute() -} - -type ApiDisableServiceRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string -} - -func (r ApiDisableServiceRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DisableService") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - return newErr - } - - return nil -} - -/* -DisableService: disable update service - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId project id - @param serverId server id - @return ApiDisableServiceRequest -*/ -func (a *APIClient) DisableService(ctx context.Context, projectId string, serverId string) ApiDisableServiceRequest { - return ApiDisableServiceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } -} - -/* -Deprecated: -*/ -func (a *APIClient) DisableServiceExecute(ctx context.Context, projectId string, serverId string) error { - r := ApiDisableServiceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, + region: region, } return r.Execute() } @@ -512,6 +448,7 @@ type ApiDisableServiceResourceRequest struct { apiService *DefaultApiService projectId string serverId string + region string } func (r ApiDisableServiceResourceRequest) Execute() error { @@ -526,9 +463,10 @@ func (r ApiDisableServiceResourceRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/service" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/service" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -544,7 +482,7 @@ func (r ApiDisableServiceResourceRequest) Execute() error { } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -583,6 +521,17 @@ func (r ApiDisableServiceResourceRequest) Execute() error { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } return newErr } @@ -595,143 +544,26 @@ DisableServiceResource: disable update service @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @param serverId server id + @param region region @return ApiDisableServiceResourceRequest */ -func (a *APIClient) DisableServiceResource(ctx context.Context, projectId string, serverId string) ApiDisableServiceResourceRequest { +func (a *APIClient) DisableServiceResource(ctx context.Context, projectId string, serverId string, region string) ApiDisableServiceResourceRequest { return ApiDisableServiceResourceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, + region: region, } } -func (a *APIClient) DisableServiceResourceExecute(ctx context.Context, projectId string, serverId string) error { +func (a *APIClient) DisableServiceResourceExecute(ctx context.Context, projectId string, serverId string, region string) error { r := ApiDisableServiceResourceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, - } - return r.Execute() -} - -type ApiEnableServiceRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - enableServicePayload *EnableServicePayload -} - -func (r ApiEnableServiceRequest) EnableServicePayload(enableServicePayload EnableServicePayload) ApiEnableServiceRequest { - r.enableServicePayload = &enableServicePayload - return r -} - -func (r ApiEnableServiceRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - ) - a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.EnableService") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.enableServicePayload - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - return newErr - } - - return nil -} - -/* -EnableService: enable update service - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId project id - @param serverId server id - @return ApiEnableServiceRequest -*/ -func (a *APIClient) EnableService(ctx context.Context, projectId string, serverId string) ApiEnableServiceRequest { - return ApiEnableServiceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } -} - -/* -Deprecated: -*/ -func (a *APIClient) EnableServiceExecute(ctx context.Context, projectId string, serverId string) error { - r := ApiEnableServiceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, + region: region, } return r.Execute() } @@ -741,6 +573,7 @@ type ApiEnableServiceResourceRequest struct { apiService *DefaultApiService projectId string serverId string + region string enableServiceResourcePayload *EnableServiceResourcePayload } @@ -761,9 +594,10 @@ func (r ApiEnableServiceResourceRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/service" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/service" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -779,7 +613,7 @@ func (r ApiEnableServiceResourceRequest) Execute() error { } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -820,6 +654,17 @@ func (r ApiEnableServiceResourceRequest) Execute() error { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } return newErr } @@ -832,23 +677,26 @@ EnableServiceResource: enable update service @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @param serverId server id + @param region region @return ApiEnableServiceResourceRequest */ -func (a *APIClient) EnableServiceResource(ctx context.Context, projectId string, serverId string) ApiEnableServiceResourceRequest { +func (a *APIClient) EnableServiceResource(ctx context.Context, projectId string, serverId string, region string) ApiEnableServiceResourceRequest { return ApiEnableServiceResourceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, + region: region, } } -func (a *APIClient) EnableServiceResourceExecute(ctx context.Context, projectId string, serverId string) error { +func (a *APIClient) EnableServiceResourceExecute(ctx context.Context, projectId string, serverId string, region string) error { r := ApiEnableServiceResourceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, + region: region, } return r.Execute() } @@ -858,6 +706,7 @@ type ApiGetServiceResourceRequest struct { apiService *DefaultApiService projectId string serverId string + region string } func (r ApiGetServiceResourceRequest) Execute() (*GetUpdateServiceResponse, error) { @@ -873,9 +722,10 @@ func (r ApiGetServiceResourceRequest) Execute() (*GetUpdateServiceResponse, erro return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/service" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/service" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -930,6 +780,17 @@ func (r ApiGetServiceResourceRequest) Execute() (*GetUpdateServiceResponse, erro Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -952,23 +813,26 @@ GetServiceResource: get update service details @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @param serverId server id + @param region region @return ApiGetServiceResourceRequest */ -func (a *APIClient) GetServiceResource(ctx context.Context, projectId string, serverId string) ApiGetServiceResourceRequest { +func (a *APIClient) GetServiceResource(ctx context.Context, projectId string, serverId string, region string) ApiGetServiceResourceRequest { return ApiGetServiceResourceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, + region: region, } } -func (a *APIClient) GetServiceResourceExecute(ctx context.Context, projectId string, serverId string) (*GetUpdateServiceResponse, error) { +func (a *APIClient) GetServiceResourceExecute(ctx context.Context, projectId string, serverId string, region string) (*GetUpdateServiceResponse, error) { r := ApiGetServiceResourceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, + region: region, } return r.Execute() } @@ -979,6 +843,7 @@ type ApiGetUpdateRequest struct { projectId string serverId string updateId string + region string } func (r ApiGetUpdateRequest) Execute() (*Update, error) { @@ -994,10 +859,11 @@ func (r ApiGetUpdateRequest) Execute() (*Update, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/updates/{updateId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/updates/{updateId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"updateId"+"}", url.PathEscape(ParameterValueToString(r.updateId, "updateId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1052,6 +918,17 @@ func (r ApiGetUpdateRequest) Execute() (*Update, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -1075,25 +952,28 @@ GetUpdate: get update @param projectId project id @param serverId server id @param updateId id of the update + @param region region @return ApiGetUpdateRequest */ -func (a *APIClient) GetUpdate(ctx context.Context, projectId string, serverId string, updateId string) ApiGetUpdateRequest { +func (a *APIClient) GetUpdate(ctx context.Context, projectId string, serverId string, updateId string, region string) ApiGetUpdateRequest { return ApiGetUpdateRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, updateId: updateId, + region: region, } } -func (a *APIClient) GetUpdateExecute(ctx context.Context, projectId string, serverId string, updateId string) (*Update, error) { +func (a *APIClient) GetUpdateExecute(ctx context.Context, projectId string, serverId string, updateId string, region string) (*Update, error) { r := ApiGetUpdateRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, updateId: updateId, + region: region, } return r.Execute() } @@ -1104,6 +984,7 @@ type ApiGetUpdateScheduleRequest struct { projectId string serverId string scheduleId string + region string } func (r ApiGetUpdateScheduleRequest) Execute() (*UpdateSchedule, error) { @@ -1119,10 +1000,11 @@ func (r ApiGetUpdateScheduleRequest) Execute() (*UpdateSchedule, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/update-schedules/{scheduleId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/update-schedules/{scheduleId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"scheduleId"+"}", url.PathEscape(ParameterValueToString(r.scheduleId, "scheduleId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1177,6 +1059,17 @@ func (r ApiGetUpdateScheduleRequest) Execute() (*UpdateSchedule, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -1200,25 +1093,28 @@ GetUpdateSchedule: get single update schedule details @param projectId project id @param serverId server id @param scheduleId update schedule id + @param region region @return ApiGetUpdateScheduleRequest */ -func (a *APIClient) GetUpdateSchedule(ctx context.Context, projectId string, serverId string, scheduleId string) ApiGetUpdateScheduleRequest { +func (a *APIClient) GetUpdateSchedule(ctx context.Context, projectId string, serverId string, scheduleId string, region string) ApiGetUpdateScheduleRequest { return ApiGetUpdateScheduleRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, scheduleId: scheduleId, + region: region, } } -func (a *APIClient) GetUpdateScheduleExecute(ctx context.Context, projectId string, serverId string, scheduleId string) (*UpdateSchedule, error) { +func (a *APIClient) GetUpdateScheduleExecute(ctx context.Context, projectId string, serverId string, scheduleId string, region string) (*UpdateSchedule, error) { r := ApiGetUpdateScheduleRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, scheduleId: scheduleId, + region: region, } return r.Execute() } @@ -1242,7 +1138,7 @@ func (r ApiListUpdatePoliciesRequest) Execute() (*GetUpdatePoliciesResponse, err return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/update-policies" + localVarPath := localBasePath + "/v2/projects/{projectId}/update-policies" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) @@ -1298,6 +1194,17 @@ func (r ApiListUpdatePoliciesRequest) Execute() (*GetUpdatePoliciesResponse, err Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -1343,6 +1250,7 @@ type ApiListUpdateSchedulesRequest struct { apiService *DefaultApiService projectId string serverId string + region string } func (r ApiListUpdateSchedulesRequest) Execute() (*GetUpdateSchedulesResponse, error) { @@ -1358,9 +1266,10 @@ func (r ApiListUpdateSchedulesRequest) Execute() (*GetUpdateSchedulesResponse, e return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/update-schedules" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/update-schedules" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1415,6 +1324,17 @@ func (r ApiListUpdateSchedulesRequest) Execute() (*GetUpdateSchedulesResponse, e Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -1437,23 +1357,26 @@ ListUpdateSchedules: get list of update schedules @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @param serverId server id + @param region region @return ApiListUpdateSchedulesRequest */ -func (a *APIClient) ListUpdateSchedules(ctx context.Context, projectId string, serverId string) ApiListUpdateSchedulesRequest { +func (a *APIClient) ListUpdateSchedules(ctx context.Context, projectId string, serverId string, region string) ApiListUpdateSchedulesRequest { return ApiListUpdateSchedulesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, + region: region, } } -func (a *APIClient) ListUpdateSchedulesExecute(ctx context.Context, projectId string, serverId string) (*GetUpdateSchedulesResponse, error) { +func (a *APIClient) ListUpdateSchedulesExecute(ctx context.Context, projectId string, serverId string, region string) (*GetUpdateSchedulesResponse, error) { r := ApiListUpdateSchedulesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, + region: region, } return r.Execute() } @@ -1463,6 +1386,7 @@ type ApiListUpdatesRequest struct { apiService *DefaultApiService projectId string serverId string + region string } func (r ApiListUpdatesRequest) Execute() (*GetUpdatesListResponse, error) { @@ -1478,9 +1402,10 @@ func (r ApiListUpdatesRequest) Execute() (*GetUpdatesListResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/updates" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/updates" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1535,6 +1460,17 @@ func (r ApiListUpdatesRequest) Execute() (*GetUpdatesListResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -1557,23 +1493,26 @@ ListUpdates: get list of updates @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @param serverId server id + @param region region @return ApiListUpdatesRequest */ -func (a *APIClient) ListUpdates(ctx context.Context, projectId string, serverId string) ApiListUpdatesRequest { +func (a *APIClient) ListUpdates(ctx context.Context, projectId string, serverId string, region string) ApiListUpdatesRequest { return ApiListUpdatesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, + region: region, } } -func (a *APIClient) ListUpdatesExecute(ctx context.Context, projectId string, serverId string) (*GetUpdatesListResponse, error) { +func (a *APIClient) ListUpdatesExecute(ctx context.Context, projectId string, serverId string, region string) (*GetUpdatesListResponse, error) { r := ApiListUpdatesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, + region: region, } return r.Execute() } @@ -1584,6 +1523,7 @@ type ApiUpdateUpdateScheduleRequest struct { projectId string serverId string scheduleId string + region string updateUpdateSchedulePayload *UpdateUpdateSchedulePayload } @@ -1605,10 +1545,11 @@ func (r ApiUpdateUpdateScheduleRequest) Execute() (*UpdateSchedule, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/update-schedules/{scheduleId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/update-schedules/{scheduleId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"scheduleId"+"}", url.PathEscape(ParameterValueToString(r.scheduleId, "scheduleId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1665,6 +1606,17 @@ func (r ApiUpdateUpdateScheduleRequest) Execute() (*UpdateSchedule, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } return localVarReturnValue, newErr } @@ -1688,25 +1640,28 @@ UpdateUpdateSchedule: update update schedule @param projectId project id @param serverId server id @param scheduleId update schedule id + @param region region @return ApiUpdateUpdateScheduleRequest */ -func (a *APIClient) UpdateUpdateSchedule(ctx context.Context, projectId string, serverId string, scheduleId string) ApiUpdateUpdateScheduleRequest { +func (a *APIClient) UpdateUpdateSchedule(ctx context.Context, projectId string, serverId string, scheduleId string, region string) ApiUpdateUpdateScheduleRequest { return ApiUpdateUpdateScheduleRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, scheduleId: scheduleId, + region: region, } } -func (a *APIClient) UpdateUpdateScheduleExecute(ctx context.Context, projectId string, serverId string, scheduleId string) (*UpdateSchedule, error) { +func (a *APIClient) UpdateUpdateScheduleExecute(ctx context.Context, projectId string, serverId string, scheduleId string, region string) (*UpdateSchedule, error) { r := ApiUpdateUpdateScheduleRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, scheduleId: scheduleId, + region: region, } return r.Execute() } diff --git a/services/serverupdate/api_default_test.go b/services/serverupdate/api_default_test.go index 474aad30c..322629a3e 100644 --- a/services/serverupdate/api_default_test.go +++ b/services/serverupdate/api_default_test.go @@ -24,14 +24,16 @@ import ( func Test_serverupdate_DefaultApiService(t *testing.T) { t.Run("Test DefaultApiService CreateUpdate", func(t *testing.T) { - path := "/v1/projects/{projectId}/servers/{serverId}/updates" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/updates" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + regionValue := "region" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := Update{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -65,28 +67,31 @@ func Test_serverupdate_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue + region := regionValue - resp, reqErr := apiClient.CreateUpdate(context.Background(), projectId, serverId).Execute() + resp, reqErr := apiClient.CreateUpdate(context.Background(), projectId, serverId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService CreateUpdateSchedule", func(t *testing.T) { - path := "/v1/projects/{projectId}/servers/{serverId}/update-schedules" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/update-schedules" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + regionValue := "region" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := UpdateSchedule{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -120,30 +125,33 @@ func Test_serverupdate_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue + region := regionValue - resp, reqErr := apiClient.CreateUpdateSchedule(context.Background(), projectId, serverId).Execute() + resp, reqErr := apiClient.CreateUpdateSchedule(context.Background(), projectId, serverId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService DeleteUpdateSchedule", func(t *testing.T) { - path := "/v1/projects/{projectId}/servers/{serverId}/update-schedules/{scheduleId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/update-schedules/{scheduleId}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) scheduleIdValue := "scheduleId" - path = strings.Replace(path, "{"+"scheduleId"+"}", url.PathEscape(ParameterValueToString(scheduleIdValue, "scheduleId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"scheduleId"+"}", url.PathEscape(ParameterValueToString(scheduleIdValue, "scheduleId")), -1) + regionValue := "region" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -174,60 +182,12 @@ func Test_serverupdate_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" - scheduleId := "scheduleId" + projectId := projectIdValue + serverId := serverIdValue + scheduleId := scheduleIdValue + region := regionValue - reqErr := apiClient.DeleteUpdateSchedule(context.Background(), projectId, serverId, scheduleId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService DisableService", func(t *testing.T) { - path := "/v1/projects/{projectId}/servers/{serverId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for serverupdate_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := "projectId" - serverId := "serverId" - - reqErr := apiClient.DisableService(context.Background(), projectId, serverId).Execute() + reqErr := apiClient.DeleteUpdateSchedule(context.Background(), projectId, serverId, scheduleId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -235,63 +195,16 @@ func Test_serverupdate_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DisableServiceResource", func(t *testing.T) { - path := "/v1/projects/{projectId}/servers/{serverId}/service" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for serverupdate_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := "projectId" - serverId := "serverId" - - reqErr := apiClient.DisableServiceResource(context.Background(), projectId, serverId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService EnableService", func(t *testing.T) { - path := "/v1/projects/{projectId}/servers/{serverId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/service" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + regionValue := "region" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -322,10 +235,11 @@ func Test_serverupdate_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue + region := regionValue - reqErr := apiClient.EnableService(context.Background(), projectId, serverId).Execute() + reqErr := apiClient.DisableServiceResource(context.Background(), projectId, serverId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -333,14 +247,16 @@ func Test_serverupdate_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService EnableServiceResource", func(t *testing.T) { - path := "/v1/projects/{projectId}/servers/{serverId}/service" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/service" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + regionValue := "region" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -371,10 +287,11 @@ func Test_serverupdate_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue + region := regionValue - reqErr := apiClient.EnableServiceResource(context.Background(), projectId, serverId).Execute() + reqErr := apiClient.EnableServiceResource(context.Background(), projectId, serverId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -382,14 +299,16 @@ func Test_serverupdate_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetServiceResource", func(t *testing.T) { - path := "/v1/projects/{projectId}/servers/{serverId}/service" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/service" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + regionValue := "region" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := GetUpdateServiceResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -423,30 +342,33 @@ func Test_serverupdate_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue + region := regionValue - resp, reqErr := apiClient.GetServiceResource(context.Background(), projectId, serverId).Execute() + resp, reqErr := apiClient.GetServiceResource(context.Background(), projectId, serverId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService GetUpdate", func(t *testing.T) { - path := "/v1/projects/{projectId}/servers/{serverId}/updates/{updateId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/updates/{updateId}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) updateIdValue := "updateId" - path = strings.Replace(path, "{"+"updateId"+"}", url.PathEscape(ParameterValueToString(updateIdValue, "updateId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"updateId"+"}", url.PathEscape(ParameterValueToString(updateIdValue, "updateId")), -1) + regionValue := "region" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := Update{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -480,31 +402,34 @@ func Test_serverupdate_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" - updateId := "updateId" + projectId := projectIdValue + serverId := serverIdValue + updateId := updateIdValue + region := regionValue - resp, reqErr := apiClient.GetUpdate(context.Background(), projectId, serverId, updateId).Execute() + resp, reqErr := apiClient.GetUpdate(context.Background(), projectId, serverId, updateId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService GetUpdateSchedule", func(t *testing.T) { - path := "/v1/projects/{projectId}/servers/{serverId}/update-schedules/{scheduleId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/update-schedules/{scheduleId}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) scheduleIdValue := "scheduleId" - path = strings.Replace(path, "{"+"scheduleId"+"}", url.PathEscape(ParameterValueToString(scheduleIdValue, "scheduleId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"scheduleId"+"}", url.PathEscape(ParameterValueToString(scheduleIdValue, "scheduleId")), -1) + regionValue := "region" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := UpdateSchedule{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -538,27 +463,28 @@ func Test_serverupdate_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" - scheduleId := "scheduleId" + projectId := projectIdValue + serverId := serverIdValue + scheduleId := scheduleIdValue + region := regionValue - resp, reqErr := apiClient.GetUpdateSchedule(context.Background(), projectId, serverId, scheduleId).Execute() + resp, reqErr := apiClient.GetUpdateSchedule(context.Background(), projectId, serverId, scheduleId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService ListUpdatePolicies", func(t *testing.T) { - path := "/v1/projects/{projectId}/update-policies" + _apiUrlPath := "/v2/projects/{projectId}/update-policies" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := GetUpdatePoliciesResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -592,27 +518,29 @@ func Test_serverupdate_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue resp, reqErr := apiClient.ListUpdatePolicies(context.Background(), projectId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService ListUpdateSchedules", func(t *testing.T) { - path := "/v1/projects/{projectId}/servers/{serverId}/update-schedules" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/update-schedules" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + regionValue := "region" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := GetUpdateSchedulesResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -646,28 +574,31 @@ func Test_serverupdate_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue + region := regionValue - resp, reqErr := apiClient.ListUpdateSchedules(context.Background(), projectId, serverId).Execute() + resp, reqErr := apiClient.ListUpdateSchedules(context.Background(), projectId, serverId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService ListUpdates", func(t *testing.T) { - path := "/v1/projects/{projectId}/servers/{serverId}/updates" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/updates" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + regionValue := "region" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := GetUpdatesListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -701,30 +632,33 @@ func Test_serverupdate_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue + region := regionValue - resp, reqErr := apiClient.ListUpdates(context.Background(), projectId, serverId).Execute() + resp, reqErr := apiClient.ListUpdates(context.Background(), projectId, serverId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService UpdateUpdateSchedule", func(t *testing.T) { - path := "/v1/projects/{projectId}/servers/{serverId}/update-schedules/{scheduleId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/update-schedules/{scheduleId}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) scheduleIdValue := "scheduleId" - path = strings.Replace(path, "{"+"scheduleId"+"}", url.PathEscape(ParameterValueToString(scheduleIdValue, "scheduleId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"scheduleId"+"}", url.PathEscape(ParameterValueToString(scheduleIdValue, "scheduleId")), -1) + regionValue := "region" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := UpdateSchedule{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -758,16 +692,17 @@ func Test_serverupdate_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" - scheduleId := "scheduleId" + projectId := projectIdValue + serverId := serverIdValue + scheduleId := scheduleIdValue + region := regionValue - resp, reqErr := apiClient.UpdateUpdateSchedule(context.Background(), projectId, serverId, scheduleId).Execute() + resp, reqErr := apiClient.UpdateUpdateSchedule(context.Background(), projectId, serverId, scheduleId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) diff --git a/services/serverupdate/client.go b/services/serverupdate/client.go index 9ef01d637..ef9f8bf9e 100644 --- a/services/serverupdate/client.go +++ b/services/serverupdate/client.go @@ -3,7 +3,7 @@ STACKIT Server Update Management API API endpoints for Server Update Operations on STACKIT Servers. -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -42,7 +42,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the STACKIT Server Update Management API API v1.0 +// APIClient manages communication with the STACKIT Server Update Management API API v2.0 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *config.Configuration diff --git a/services/serverupdate/configuration.go b/services/serverupdate/configuration.go index c1530143f..afe26550b 100644 --- a/services/serverupdate/configuration.go +++ b/services/serverupdate/configuration.go @@ -3,7 +3,7 @@ STACKIT Server Update Management API API endpoints for Server Update Operations on STACKIT Servers. -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -22,15 +22,12 @@ func NewConfiguration() *config.Configuration { Debug: false, Servers: config.ServerConfigurations{ { - URL: "https://server-update.api.{region}stackit.cloud", + URL: "https://server-update.api.stackit.cloud", Description: "No description provided", Variables: map[string]config.ServerVariable{ "region": { Description: "No description provided", - DefaultValue: "eu01.", - EnumValues: []string{ - "eu01.", - }, + DefaultValue: "global", }, }, }, diff --git a/services/serverupdate/model_create_update_payload.go b/services/serverupdate/model_create_update_payload.go index 52e2ed62c..758412480 100644 --- a/services/serverupdate/model_create_update_payload.go +++ b/services/serverupdate/model_create_update_payload.go @@ -3,7 +3,7 @@ STACKIT Server Update Management API API endpoints for Server Update Operations on STACKIT Servers. -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,12 +17,52 @@ import ( // checks if the CreateUpdatePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateUpdatePayload{} +/* + types and functions for backupBeforeUpdate +*/ + +// isBoolean +type CreateUpdatePayloadgetBackupBeforeUpdateAttributeType = *bool +type CreateUpdatePayloadgetBackupBeforeUpdateArgType = bool +type CreateUpdatePayloadgetBackupBeforeUpdateRetType = bool + +func getCreateUpdatePayloadgetBackupBeforeUpdateAttributeTypeOk(arg CreateUpdatePayloadgetBackupBeforeUpdateAttributeType) (ret CreateUpdatePayloadgetBackupBeforeUpdateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateUpdatePayloadgetBackupBeforeUpdateAttributeType(arg *CreateUpdatePayloadgetBackupBeforeUpdateAttributeType, val CreateUpdatePayloadgetBackupBeforeUpdateRetType) { + *arg = &val +} + +/* + types and functions for maintenanceWindow +*/ + +// isInteger +type CreateUpdatePayloadGetMaintenanceWindowAttributeType = *int64 +type CreateUpdatePayloadGetMaintenanceWindowArgType = int64 +type CreateUpdatePayloadGetMaintenanceWindowRetType = int64 + +func getCreateUpdatePayloadGetMaintenanceWindowAttributeTypeOk(arg CreateUpdatePayloadGetMaintenanceWindowAttributeType) (ret CreateUpdatePayloadGetMaintenanceWindowRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateUpdatePayloadGetMaintenanceWindowAttributeType(arg *CreateUpdatePayloadGetMaintenanceWindowAttributeType, val CreateUpdatePayloadGetMaintenanceWindowRetType) { + *arg = &val +} + // CreateUpdatePayload struct for CreateUpdatePayload type CreateUpdatePayload struct { - BackupBeforeUpdate *bool `json:"backupBeforeUpdate,omitempty"` + BackupBeforeUpdate CreateUpdatePayloadgetBackupBeforeUpdateAttributeType `json:"backupBeforeUpdate,omitempty"` // Can be cast to int32 without loss of precision. // REQUIRED - MaintenanceWindow *int64 `json:"maintenanceWindow"` + MaintenanceWindow CreateUpdatePayloadGetMaintenanceWindowAttributeType `json:"maintenanceWindow"` } type _CreateUpdatePayload CreateUpdatePayload @@ -31,9 +71,9 @@ type _CreateUpdatePayload CreateUpdatePayload // 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 NewCreateUpdatePayload(maintenanceWindow *int64) *CreateUpdatePayload { +func NewCreateUpdatePayload(maintenanceWindow CreateUpdatePayloadGetMaintenanceWindowArgType) *CreateUpdatePayload { this := CreateUpdatePayload{} - this.MaintenanceWindow = maintenanceWindow + setCreateUpdatePayloadGetMaintenanceWindowAttributeType(&this.MaintenanceWindow, maintenanceWindow) return &this } @@ -46,67 +86,53 @@ func NewCreateUpdatePayloadWithDefaults() *CreateUpdatePayload { } // GetBackupBeforeUpdate returns the BackupBeforeUpdate field value if set, zero value otherwise. -func (o *CreateUpdatePayload) GetBackupBeforeUpdate() *bool { - if o == nil || IsNil(o.BackupBeforeUpdate) { - var ret *bool - return ret - } - return o.BackupBeforeUpdate +func (o *CreateUpdatePayload) GetBackupBeforeUpdate() (res CreateUpdatePayloadgetBackupBeforeUpdateRetType) { + res, _ = o.GetBackupBeforeUpdateOk() + return } // GetBackupBeforeUpdateOk returns a tuple with the BackupBeforeUpdate field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateUpdatePayload) GetBackupBeforeUpdateOk() (*bool, bool) { - if o == nil || IsNil(o.BackupBeforeUpdate) { - return nil, false - } - return o.BackupBeforeUpdate, true +func (o *CreateUpdatePayload) GetBackupBeforeUpdateOk() (ret CreateUpdatePayloadgetBackupBeforeUpdateRetType, ok bool) { + return getCreateUpdatePayloadgetBackupBeforeUpdateAttributeTypeOk(o.BackupBeforeUpdate) } // HasBackupBeforeUpdate returns a boolean if a field has been set. func (o *CreateUpdatePayload) HasBackupBeforeUpdate() bool { - if o != nil && !IsNil(o.BackupBeforeUpdate) { - return true - } - - return false + _, ok := o.GetBackupBeforeUpdateOk() + return ok } // SetBackupBeforeUpdate gets a reference to the given bool and assigns it to the BackupBeforeUpdate field. -func (o *CreateUpdatePayload) SetBackupBeforeUpdate(v *bool) { - o.BackupBeforeUpdate = v +func (o *CreateUpdatePayload) SetBackupBeforeUpdate(v CreateUpdatePayloadgetBackupBeforeUpdateRetType) { + setCreateUpdatePayloadgetBackupBeforeUpdateAttributeType(&o.BackupBeforeUpdate, v) } // GetMaintenanceWindow returns the MaintenanceWindow field value -func (o *CreateUpdatePayload) GetMaintenanceWindow() *int64 { - if o == nil || IsNil(o.MaintenanceWindow) { - var ret *int64 - return ret - } - - return o.MaintenanceWindow +func (o *CreateUpdatePayload) GetMaintenanceWindow() (ret CreateUpdatePayloadGetMaintenanceWindowRetType) { + ret, _ = o.GetMaintenanceWindowOk() + return ret } // GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value // and a boolean to check if the value has been set. -func (o *CreateUpdatePayload) GetMaintenanceWindowOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.MaintenanceWindow, true +func (o *CreateUpdatePayload) GetMaintenanceWindowOk() (ret CreateUpdatePayloadGetMaintenanceWindowRetType, ok bool) { + return getCreateUpdatePayloadGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow) } // SetMaintenanceWindow sets field value -func (o *CreateUpdatePayload) SetMaintenanceWindow(v *int64) { - o.MaintenanceWindow = v +func (o *CreateUpdatePayload) SetMaintenanceWindow(v CreateUpdatePayloadGetMaintenanceWindowRetType) { + setCreateUpdatePayloadGetMaintenanceWindowAttributeType(&o.MaintenanceWindow, v) } func (o CreateUpdatePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.BackupBeforeUpdate) { - toSerialize["backupBeforeUpdate"] = o.BackupBeforeUpdate + if val, ok := getCreateUpdatePayloadgetBackupBeforeUpdateAttributeTypeOk(o.BackupBeforeUpdate); ok { + toSerialize["BackupBeforeUpdate"] = val + } + if val, ok := getCreateUpdatePayloadGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow); ok { + toSerialize["MaintenanceWindow"] = val } - toSerialize["maintenanceWindow"] = o.MaintenanceWindow return toSerialize, nil } diff --git a/services/serverupdate/model_create_update_schedule_payload.go b/services/serverupdate/model_create_update_schedule_payload.go index 5f07ff31a..a4e1e5abf 100644 --- a/services/serverupdate/model_create_update_schedule_payload.go +++ b/services/serverupdate/model_create_update_schedule_payload.go @@ -3,7 +3,7 @@ STACKIT Server Update Management API API endpoints for Server Update Operations on STACKIT Servers. -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,17 +17,99 @@ import ( // checks if the CreateUpdateSchedulePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateUpdateSchedulePayload{} +/* + types and functions for enabled +*/ + +// isBoolean +type CreateUpdateSchedulePayloadgetEnabledAttributeType = *bool +type CreateUpdateSchedulePayloadgetEnabledArgType = bool +type CreateUpdateSchedulePayloadgetEnabledRetType = bool + +func getCreateUpdateSchedulePayloadgetEnabledAttributeTypeOk(arg CreateUpdateSchedulePayloadgetEnabledAttributeType) (ret CreateUpdateSchedulePayloadgetEnabledRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateUpdateSchedulePayloadgetEnabledAttributeType(arg *CreateUpdateSchedulePayloadgetEnabledAttributeType, val CreateUpdateSchedulePayloadgetEnabledRetType) { + *arg = &val +} + +/* + types and functions for maintenanceWindow +*/ + +// isInteger +type CreateUpdateSchedulePayloadGetMaintenanceWindowAttributeType = *int64 +type CreateUpdateSchedulePayloadGetMaintenanceWindowArgType = int64 +type CreateUpdateSchedulePayloadGetMaintenanceWindowRetType = int64 + +func getCreateUpdateSchedulePayloadGetMaintenanceWindowAttributeTypeOk(arg CreateUpdateSchedulePayloadGetMaintenanceWindowAttributeType) (ret CreateUpdateSchedulePayloadGetMaintenanceWindowRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateUpdateSchedulePayloadGetMaintenanceWindowAttributeType(arg *CreateUpdateSchedulePayloadGetMaintenanceWindowAttributeType, val CreateUpdateSchedulePayloadGetMaintenanceWindowRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type CreateUpdateSchedulePayloadGetNameAttributeType = *string + +func getCreateUpdateSchedulePayloadGetNameAttributeTypeOk(arg CreateUpdateSchedulePayloadGetNameAttributeType) (ret CreateUpdateSchedulePayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateUpdateSchedulePayloadGetNameAttributeType(arg *CreateUpdateSchedulePayloadGetNameAttributeType, val CreateUpdateSchedulePayloadGetNameRetType) { + *arg = &val +} + +type CreateUpdateSchedulePayloadGetNameArgType = string +type CreateUpdateSchedulePayloadGetNameRetType = string + +/* + types and functions for rrule +*/ + +// isNotNullableString +type CreateUpdateSchedulePayloadGetRruleAttributeType = *string + +func getCreateUpdateSchedulePayloadGetRruleAttributeTypeOk(arg CreateUpdateSchedulePayloadGetRruleAttributeType) (ret CreateUpdateSchedulePayloadGetRruleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateUpdateSchedulePayloadGetRruleAttributeType(arg *CreateUpdateSchedulePayloadGetRruleAttributeType, val CreateUpdateSchedulePayloadGetRruleRetType) { + *arg = &val +} + +type CreateUpdateSchedulePayloadGetRruleArgType = string +type CreateUpdateSchedulePayloadGetRruleRetType = string + // CreateUpdateSchedulePayload struct for CreateUpdateSchedulePayload type CreateUpdateSchedulePayload struct { // REQUIRED - Enabled *bool `json:"enabled"` + Enabled CreateUpdateSchedulePayloadgetEnabledAttributeType `json:"enabled"` // Can be cast to int32 without loss of precision. // REQUIRED - MaintenanceWindow *int64 `json:"maintenanceWindow"` + MaintenanceWindow CreateUpdateSchedulePayloadGetMaintenanceWindowAttributeType `json:"maintenanceWindow"` // REQUIRED - Name *string `json:"name"` + Name CreateUpdateSchedulePayloadGetNameAttributeType `json:"name"` // REQUIRED - Rrule *string `json:"rrule"` + Rrule CreateUpdateSchedulePayloadGetRruleAttributeType `json:"rrule"` } type _CreateUpdateSchedulePayload CreateUpdateSchedulePayload @@ -36,12 +118,12 @@ type _CreateUpdateSchedulePayload CreateUpdateSchedulePayload // 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 NewCreateUpdateSchedulePayload(enabled *bool, maintenanceWindow *int64, name *string, rrule *string) *CreateUpdateSchedulePayload { +func NewCreateUpdateSchedulePayload(enabled CreateUpdateSchedulePayloadgetEnabledArgType, maintenanceWindow CreateUpdateSchedulePayloadGetMaintenanceWindowArgType, name CreateUpdateSchedulePayloadGetNameArgType, rrule CreateUpdateSchedulePayloadGetRruleArgType) *CreateUpdateSchedulePayload { this := CreateUpdateSchedulePayload{} - this.Enabled = enabled - this.MaintenanceWindow = maintenanceWindow - this.Name = name - this.Rrule = rrule + setCreateUpdateSchedulePayloadgetEnabledAttributeType(&this.Enabled, enabled) + setCreateUpdateSchedulePayloadGetMaintenanceWindowAttributeType(&this.MaintenanceWindow, maintenanceWindow) + setCreateUpdateSchedulePayloadGetNameAttributeType(&this.Name, name) + setCreateUpdateSchedulePayloadGetRruleAttributeType(&this.Rrule, rrule) return &this } @@ -54,107 +136,87 @@ func NewCreateUpdateSchedulePayloadWithDefaults() *CreateUpdateSchedulePayload { } // GetEnabled returns the Enabled field value -func (o *CreateUpdateSchedulePayload) GetEnabled() *bool { - if o == nil || IsNil(o.Enabled) { - var ret *bool - return ret - } - - return o.Enabled +func (o *CreateUpdateSchedulePayload) GetEnabled() (ret CreateUpdateSchedulePayloadgetEnabledRetType) { + ret, _ = o.GetEnabledOk() + return ret } // GetEnabledOk returns a tuple with the Enabled field value // and a boolean to check if the value has been set. -func (o *CreateUpdateSchedulePayload) GetEnabledOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.Enabled, true +func (o *CreateUpdateSchedulePayload) GetEnabledOk() (ret CreateUpdateSchedulePayloadgetEnabledRetType, ok bool) { + return getCreateUpdateSchedulePayloadgetEnabledAttributeTypeOk(o.Enabled) } // SetEnabled sets field value -func (o *CreateUpdateSchedulePayload) SetEnabled(v *bool) { - o.Enabled = v +func (o *CreateUpdateSchedulePayload) SetEnabled(v CreateUpdateSchedulePayloadgetEnabledRetType) { + setCreateUpdateSchedulePayloadgetEnabledAttributeType(&o.Enabled, v) } // GetMaintenanceWindow returns the MaintenanceWindow field value -func (o *CreateUpdateSchedulePayload) GetMaintenanceWindow() *int64 { - if o == nil || IsNil(o.MaintenanceWindow) { - var ret *int64 - return ret - } - - return o.MaintenanceWindow +func (o *CreateUpdateSchedulePayload) GetMaintenanceWindow() (ret CreateUpdateSchedulePayloadGetMaintenanceWindowRetType) { + ret, _ = o.GetMaintenanceWindowOk() + return ret } // GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value // and a boolean to check if the value has been set. -func (o *CreateUpdateSchedulePayload) GetMaintenanceWindowOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.MaintenanceWindow, true +func (o *CreateUpdateSchedulePayload) GetMaintenanceWindowOk() (ret CreateUpdateSchedulePayloadGetMaintenanceWindowRetType, ok bool) { + return getCreateUpdateSchedulePayloadGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow) } // SetMaintenanceWindow sets field value -func (o *CreateUpdateSchedulePayload) SetMaintenanceWindow(v *int64) { - o.MaintenanceWindow = v +func (o *CreateUpdateSchedulePayload) SetMaintenanceWindow(v CreateUpdateSchedulePayloadGetMaintenanceWindowRetType) { + setCreateUpdateSchedulePayloadGetMaintenanceWindowAttributeType(&o.MaintenanceWindow, v) } // GetName returns the Name field value -func (o *CreateUpdateSchedulePayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *CreateUpdateSchedulePayload) GetName() (ret CreateUpdateSchedulePayloadGetNameRetType) { + ret, _ = o.GetNameOk() + return ret } // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. -func (o *CreateUpdateSchedulePayload) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *CreateUpdateSchedulePayload) GetNameOk() (ret CreateUpdateSchedulePayloadGetNameRetType, ok bool) { + return getCreateUpdateSchedulePayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *CreateUpdateSchedulePayload) SetName(v *string) { - o.Name = v +func (o *CreateUpdateSchedulePayload) SetName(v CreateUpdateSchedulePayloadGetNameRetType) { + setCreateUpdateSchedulePayloadGetNameAttributeType(&o.Name, v) } // GetRrule returns the Rrule field value -func (o *CreateUpdateSchedulePayload) GetRrule() *string { - if o == nil || IsNil(o.Rrule) { - var ret *string - return ret - } - - return o.Rrule +func (o *CreateUpdateSchedulePayload) GetRrule() (ret CreateUpdateSchedulePayloadGetRruleRetType) { + ret, _ = o.GetRruleOk() + return ret } // GetRruleOk returns a tuple with the Rrule field value // and a boolean to check if the value has been set. -func (o *CreateUpdateSchedulePayload) GetRruleOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Rrule, true +func (o *CreateUpdateSchedulePayload) GetRruleOk() (ret CreateUpdateSchedulePayloadGetRruleRetType, ok bool) { + return getCreateUpdateSchedulePayloadGetRruleAttributeTypeOk(o.Rrule) } // SetRrule sets field value -func (o *CreateUpdateSchedulePayload) SetRrule(v *string) { - o.Rrule = v +func (o *CreateUpdateSchedulePayload) SetRrule(v CreateUpdateSchedulePayloadGetRruleRetType) { + setCreateUpdateSchedulePayloadGetRruleAttributeType(&o.Rrule, v) } func (o CreateUpdateSchedulePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["enabled"] = o.Enabled - toSerialize["maintenanceWindow"] = o.MaintenanceWindow - toSerialize["name"] = o.Name - toSerialize["rrule"] = o.Rrule + if val, ok := getCreateUpdateSchedulePayloadgetEnabledAttributeTypeOk(o.Enabled); ok { + toSerialize["Enabled"] = val + } + if val, ok := getCreateUpdateSchedulePayloadGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow); ok { + toSerialize["MaintenanceWindow"] = val + } + if val, ok := getCreateUpdateSchedulePayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getCreateUpdateSchedulePayloadGetRruleAttributeTypeOk(o.Rrule); ok { + toSerialize["Rrule"] = val + } return toSerialize, nil } diff --git a/services/serverupdate/model_enable_service_payload.go b/services/serverupdate/model_enable_service_payload.go deleted file mode 100644 index 147b4d390..000000000 --- a/services/serverupdate/model_enable_service_payload.go +++ /dev/null @@ -1,116 +0,0 @@ -/* -STACKIT Server Update Management API - -API endpoints for Server Update Operations on STACKIT Servers. - -API version: 1.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package serverupdate - -import ( - "encoding/json" -) - -// checks if the EnableServicePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &EnableServicePayload{} - -// EnableServicePayload struct for EnableServicePayload -type EnableServicePayload struct { - UpdatePolicyId *string `json:"updatePolicyId,omitempty"` -} - -// NewEnableServicePayload instantiates a new EnableServicePayload 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 NewEnableServicePayload() *EnableServicePayload { - this := EnableServicePayload{} - return &this -} - -// NewEnableServicePayloadWithDefaults instantiates a new EnableServicePayload 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 NewEnableServicePayloadWithDefaults() *EnableServicePayload { - this := EnableServicePayload{} - return &this -} - -// GetUpdatePolicyId returns the UpdatePolicyId field value if set, zero value otherwise. -func (o *EnableServicePayload) GetUpdatePolicyId() *string { - if o == nil || IsNil(o.UpdatePolicyId) { - var ret *string - return ret - } - return o.UpdatePolicyId -} - -// GetUpdatePolicyIdOk returns a tuple with the UpdatePolicyId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnableServicePayload) GetUpdatePolicyIdOk() (*string, bool) { - if o == nil || IsNil(o.UpdatePolicyId) { - return nil, false - } - return o.UpdatePolicyId, true -} - -// HasUpdatePolicyId returns a boolean if a field has been set. -func (o *EnableServicePayload) HasUpdatePolicyId() bool { - if o != nil && !IsNil(o.UpdatePolicyId) { - return true - } - - return false -} - -// SetUpdatePolicyId gets a reference to the given string and assigns it to the UpdatePolicyId field. -func (o *EnableServicePayload) SetUpdatePolicyId(v *string) { - o.UpdatePolicyId = v -} - -func (o EnableServicePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.UpdatePolicyId) { - toSerialize["updatePolicyId"] = o.UpdatePolicyId - } - return toSerialize, nil -} - -type NullableEnableServicePayload struct { - value *EnableServicePayload - isSet bool -} - -func (v NullableEnableServicePayload) Get() *EnableServicePayload { - return v.value -} - -func (v *NullableEnableServicePayload) Set(val *EnableServicePayload) { - v.value = val - v.isSet = true -} - -func (v NullableEnableServicePayload) IsSet() bool { - return v.isSet -} - -func (v *NullableEnableServicePayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableEnableServicePayload(val *EnableServicePayload) *NullableEnableServicePayload { - return &NullableEnableServicePayload{value: val, isSet: true} -} - -func (v NullableEnableServicePayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableEnableServicePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/serverupdate/model_enable_service_resource_payload.go b/services/serverupdate/model_enable_service_resource_payload.go index 59b1268d1..8afdcd0c6 100644 --- a/services/serverupdate/model_enable_service_resource_payload.go +++ b/services/serverupdate/model_enable_service_resource_payload.go @@ -3,7 +3,7 @@ STACKIT Server Update Management API API endpoints for Server Update Operations on STACKIT Servers. -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,9 +17,30 @@ import ( // checks if the EnableServiceResourcePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &EnableServiceResourcePayload{} +/* + types and functions for updatePolicyId +*/ + +// isNotNullableString +type EnableServiceResourcePayloadGetUpdatePolicyIdAttributeType = *string + +func getEnableServiceResourcePayloadGetUpdatePolicyIdAttributeTypeOk(arg EnableServiceResourcePayloadGetUpdatePolicyIdAttributeType) (ret EnableServiceResourcePayloadGetUpdatePolicyIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setEnableServiceResourcePayloadGetUpdatePolicyIdAttributeType(arg *EnableServiceResourcePayloadGetUpdatePolicyIdAttributeType, val EnableServiceResourcePayloadGetUpdatePolicyIdRetType) { + *arg = &val +} + +type EnableServiceResourcePayloadGetUpdatePolicyIdArgType = string +type EnableServiceResourcePayloadGetUpdatePolicyIdRetType = string + // EnableServiceResourcePayload struct for EnableServiceResourcePayload type EnableServiceResourcePayload struct { - UpdatePolicyId *string `json:"updatePolicyId,omitempty"` + UpdatePolicyId EnableServiceResourcePayloadGetUpdatePolicyIdAttributeType `json:"updatePolicyId,omitempty"` } // NewEnableServiceResourcePayload instantiates a new EnableServiceResourcePayload object @@ -40,41 +61,32 @@ func NewEnableServiceResourcePayloadWithDefaults() *EnableServiceResourcePayload } // GetUpdatePolicyId returns the UpdatePolicyId field value if set, zero value otherwise. -func (o *EnableServiceResourcePayload) GetUpdatePolicyId() *string { - if o == nil || IsNil(o.UpdatePolicyId) { - var ret *string - return ret - } - return o.UpdatePolicyId +func (o *EnableServiceResourcePayload) GetUpdatePolicyId() (res EnableServiceResourcePayloadGetUpdatePolicyIdRetType) { + res, _ = o.GetUpdatePolicyIdOk() + return } // GetUpdatePolicyIdOk returns a tuple with the UpdatePolicyId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *EnableServiceResourcePayload) GetUpdatePolicyIdOk() (*string, bool) { - if o == nil || IsNil(o.UpdatePolicyId) { - return nil, false - } - return o.UpdatePolicyId, true +func (o *EnableServiceResourcePayload) GetUpdatePolicyIdOk() (ret EnableServiceResourcePayloadGetUpdatePolicyIdRetType, ok bool) { + return getEnableServiceResourcePayloadGetUpdatePolicyIdAttributeTypeOk(o.UpdatePolicyId) } // HasUpdatePolicyId returns a boolean if a field has been set. func (o *EnableServiceResourcePayload) HasUpdatePolicyId() bool { - if o != nil && !IsNil(o.UpdatePolicyId) { - return true - } - - return false + _, ok := o.GetUpdatePolicyIdOk() + return ok } // SetUpdatePolicyId gets a reference to the given string and assigns it to the UpdatePolicyId field. -func (o *EnableServiceResourcePayload) SetUpdatePolicyId(v *string) { - o.UpdatePolicyId = v +func (o *EnableServiceResourcePayload) SetUpdatePolicyId(v EnableServiceResourcePayloadGetUpdatePolicyIdRetType) { + setEnableServiceResourcePayloadGetUpdatePolicyIdAttributeType(&o.UpdatePolicyId, v) } func (o EnableServiceResourcePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.UpdatePolicyId) { - toSerialize["updatePolicyId"] = o.UpdatePolicyId + if val, ok := getEnableServiceResourcePayloadGetUpdatePolicyIdAttributeTypeOk(o.UpdatePolicyId); ok { + toSerialize["UpdatePolicyId"] = val } return toSerialize, nil } diff --git a/services/serverupdate/model_error_response.go b/services/serverupdate/model_error_response.go new file mode 100644 index 000000000..59ad0ef06 --- /dev/null +++ b/services/serverupdate/model_error_response.go @@ -0,0 +1,172 @@ +/* +STACKIT Server Update Management API + +API endpoints for Server Update Operations on STACKIT Servers. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package serverupdate + +import ( + "encoding/json" +) + +// checks if the ErrorResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorResponse{} + +/* + types and functions for message +*/ + +// isNotNullableString +type ErrorResponseGetMessageAttributeType = *string + +func getErrorResponseGetMessageAttributeTypeOk(arg ErrorResponseGetMessageAttributeType) (ret ErrorResponseGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorResponseGetMessageAttributeType(arg *ErrorResponseGetMessageAttributeType, val ErrorResponseGetMessageRetType) { + *arg = &val +} + +type ErrorResponseGetMessageArgType = string +type ErrorResponseGetMessageRetType = string + +/* + types and functions for status +*/ + +// isNotNullableString +type ErrorResponseGetStatusAttributeType = *string + +func getErrorResponseGetStatusAttributeTypeOk(arg ErrorResponseGetStatusAttributeType) (ret ErrorResponseGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorResponseGetStatusAttributeType(arg *ErrorResponseGetStatusAttributeType, val ErrorResponseGetStatusRetType) { + *arg = &val +} + +type ErrorResponseGetStatusArgType = string +type ErrorResponseGetStatusRetType = string + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + // Details about the error + // REQUIRED + Message ErrorResponseGetMessageAttributeType `json:"message"` + // The string representation of the http status code (i.e. Not Found, Bad Request, etc) + // REQUIRED + Status ErrorResponseGetStatusAttributeType `json:"status"` +} + +type _ErrorResponse ErrorResponse + +// NewErrorResponse instantiates a new ErrorResponse 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 NewErrorResponse(message ErrorResponseGetMessageArgType, status ErrorResponseGetStatusArgType) *ErrorResponse { + this := ErrorResponse{} + setErrorResponseGetMessageAttributeType(&this.Message, message) + setErrorResponseGetStatusAttributeType(&this.Status, status) + return &this +} + +// NewErrorResponseWithDefaults instantiates a new ErrorResponse 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 NewErrorResponseWithDefaults() *ErrorResponse { + this := ErrorResponse{} + return &this +} + +// GetMessage returns the Message field value +func (o *ErrorResponse) GetMessage() (ret ErrorResponseGetMessageRetType) { + ret, _ = o.GetMessageOk() + return ret +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ErrorResponse) GetMessageOk() (ret ErrorResponseGetMessageRetType, ok bool) { + return getErrorResponseGetMessageAttributeTypeOk(o.Message) +} + +// SetMessage sets field value +func (o *ErrorResponse) SetMessage(v ErrorResponseGetMessageRetType) { + setErrorResponseGetMessageAttributeType(&o.Message, v) +} + +// GetStatus returns the Status field value +func (o *ErrorResponse) GetStatus() (ret ErrorResponseGetStatusRetType) { + ret, _ = o.GetStatusOk() + return ret +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *ErrorResponse) GetStatusOk() (ret ErrorResponseGetStatusRetType, ok bool) { + return getErrorResponseGetStatusAttributeTypeOk(o.Status) +} + +// SetStatus sets field value +func (o *ErrorResponse) SetStatus(v ErrorResponseGetStatusRetType) { + setErrorResponseGetStatusAttributeType(&o.Status, v) +} + +func (o ErrorResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getErrorResponseGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + if val, ok := getErrorResponseGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val + } + return toSerialize, nil +} + +type NullableErrorResponse struct { + value *ErrorResponse + isSet bool +} + +func (v NullableErrorResponse) Get() *ErrorResponse { + return v.value +} + +func (v *NullableErrorResponse) Set(val *ErrorResponse) { + v.value = val + v.isSet = true +} + +func (v NullableErrorResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorResponse(val *ErrorResponse) *NullableErrorResponse { + return &NullableErrorResponse{value: val, isSet: true} +} + +func (v NullableErrorResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverupdate/model_get_update_policies_response.go b/services/serverupdate/model_get_update_policies_response.go index 4e33eb703..26cf84534 100644 --- a/services/serverupdate/model_get_update_policies_response.go +++ b/services/serverupdate/model_get_update_policies_response.go @@ -3,7 +3,7 @@ STACKIT Server Update Management API API endpoints for Server Update Operations on STACKIT Servers. -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,9 +17,29 @@ import ( // checks if the GetUpdatePoliciesResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GetUpdatePoliciesResponse{} +/* + types and functions for items +*/ + +// isArray +type GetUpdatePoliciesResponseGetItemsAttributeType = *[]UpdatePolicy +type GetUpdatePoliciesResponseGetItemsArgType = []UpdatePolicy +type GetUpdatePoliciesResponseGetItemsRetType = []UpdatePolicy + +func getGetUpdatePoliciesResponseGetItemsAttributeTypeOk(arg GetUpdatePoliciesResponseGetItemsAttributeType) (ret GetUpdatePoliciesResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetUpdatePoliciesResponseGetItemsAttributeType(arg *GetUpdatePoliciesResponseGetItemsAttributeType, val GetUpdatePoliciesResponseGetItemsRetType) { + *arg = &val +} + // GetUpdatePoliciesResponse struct for GetUpdatePoliciesResponse type GetUpdatePoliciesResponse struct { - Items *[]UpdatePolicy `json:"items,omitempty"` + Items GetUpdatePoliciesResponseGetItemsAttributeType `json:"items,omitempty"` } // NewGetUpdatePoliciesResponse instantiates a new GetUpdatePoliciesResponse object @@ -40,41 +60,32 @@ func NewGetUpdatePoliciesResponseWithDefaults() *GetUpdatePoliciesResponse { } // GetItems returns the Items field value if set, zero value otherwise. -func (o *GetUpdatePoliciesResponse) GetItems() *[]UpdatePolicy { - if o == nil || IsNil(o.Items) { - var ret *[]UpdatePolicy - return ret - } - return o.Items +func (o *GetUpdatePoliciesResponse) GetItems() (res GetUpdatePoliciesResponseGetItemsRetType) { + res, _ = o.GetItemsOk() + return } // GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GetUpdatePoliciesResponse) GetItemsOk() (*[]UpdatePolicy, bool) { - if o == nil || IsNil(o.Items) { - return nil, false - } - return o.Items, true +func (o *GetUpdatePoliciesResponse) GetItemsOk() (ret GetUpdatePoliciesResponseGetItemsRetType, ok bool) { + return getGetUpdatePoliciesResponseGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. func (o *GetUpdatePoliciesResponse) HasItems() bool { - if o != nil && !IsNil(o.Items) { - return true - } - - return false + _, ok := o.GetItemsOk() + return ok } // SetItems gets a reference to the given []UpdatePolicy and assigns it to the Items field. -func (o *GetUpdatePoliciesResponse) SetItems(v *[]UpdatePolicy) { - o.Items = v +func (o *GetUpdatePoliciesResponse) SetItems(v GetUpdatePoliciesResponseGetItemsRetType) { + setGetUpdatePoliciesResponseGetItemsAttributeType(&o.Items, v) } func (o GetUpdatePoliciesResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Items) { - toSerialize["items"] = o.Items + if val, ok := getGetUpdatePoliciesResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val } return toSerialize, nil } diff --git a/services/serverupdate/model_get_update_schedules_response.go b/services/serverupdate/model_get_update_schedules_response.go index 15be219f8..a3cdf90ca 100644 --- a/services/serverupdate/model_get_update_schedules_response.go +++ b/services/serverupdate/model_get_update_schedules_response.go @@ -3,7 +3,7 @@ STACKIT Server Update Management API API endpoints for Server Update Operations on STACKIT Servers. -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,9 +17,29 @@ import ( // checks if the GetUpdateSchedulesResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GetUpdateSchedulesResponse{} +/* + types and functions for items +*/ + +// isArray +type GetUpdateSchedulesResponseGetItemsAttributeType = *[]UpdateSchedule +type GetUpdateSchedulesResponseGetItemsArgType = []UpdateSchedule +type GetUpdateSchedulesResponseGetItemsRetType = []UpdateSchedule + +func getGetUpdateSchedulesResponseGetItemsAttributeTypeOk(arg GetUpdateSchedulesResponseGetItemsAttributeType) (ret GetUpdateSchedulesResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetUpdateSchedulesResponseGetItemsAttributeType(arg *GetUpdateSchedulesResponseGetItemsAttributeType, val GetUpdateSchedulesResponseGetItemsRetType) { + *arg = &val +} + // GetUpdateSchedulesResponse struct for GetUpdateSchedulesResponse type GetUpdateSchedulesResponse struct { - Items *[]UpdateSchedule `json:"items,omitempty"` + Items GetUpdateSchedulesResponseGetItemsAttributeType `json:"items,omitempty"` } // NewGetUpdateSchedulesResponse instantiates a new GetUpdateSchedulesResponse object @@ -40,41 +60,32 @@ func NewGetUpdateSchedulesResponseWithDefaults() *GetUpdateSchedulesResponse { } // GetItems returns the Items field value if set, zero value otherwise. -func (o *GetUpdateSchedulesResponse) GetItems() *[]UpdateSchedule { - if o == nil || IsNil(o.Items) { - var ret *[]UpdateSchedule - return ret - } - return o.Items +func (o *GetUpdateSchedulesResponse) GetItems() (res GetUpdateSchedulesResponseGetItemsRetType) { + res, _ = o.GetItemsOk() + return } // GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GetUpdateSchedulesResponse) GetItemsOk() (*[]UpdateSchedule, bool) { - if o == nil || IsNil(o.Items) { - return nil, false - } - return o.Items, true +func (o *GetUpdateSchedulesResponse) GetItemsOk() (ret GetUpdateSchedulesResponseGetItemsRetType, ok bool) { + return getGetUpdateSchedulesResponseGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. func (o *GetUpdateSchedulesResponse) HasItems() bool { - if o != nil && !IsNil(o.Items) { - return true - } - - return false + _, ok := o.GetItemsOk() + return ok } // SetItems gets a reference to the given []UpdateSchedule and assigns it to the Items field. -func (o *GetUpdateSchedulesResponse) SetItems(v *[]UpdateSchedule) { - o.Items = v +func (o *GetUpdateSchedulesResponse) SetItems(v GetUpdateSchedulesResponseGetItemsRetType) { + setGetUpdateSchedulesResponseGetItemsAttributeType(&o.Items, v) } func (o GetUpdateSchedulesResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Items) { - toSerialize["items"] = o.Items + if val, ok := getGetUpdateSchedulesResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val } return toSerialize, nil } diff --git a/services/serverupdate/model_get_update_service_response.go b/services/serverupdate/model_get_update_service_response.go index d270a7a0a..85ce4cd85 100644 --- a/services/serverupdate/model_get_update_service_response.go +++ b/services/serverupdate/model_get_update_service_response.go @@ -3,7 +3,7 @@ STACKIT Server Update Management API API endpoints for Server Update Operations on STACKIT Servers. -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,9 +17,29 @@ import ( // checks if the GetUpdateServiceResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GetUpdateServiceResponse{} +/* + types and functions for enabled +*/ + +// isBoolean +type GetUpdateServiceResponsegetEnabledAttributeType = *bool +type GetUpdateServiceResponsegetEnabledArgType = bool +type GetUpdateServiceResponsegetEnabledRetType = bool + +func getGetUpdateServiceResponsegetEnabledAttributeTypeOk(arg GetUpdateServiceResponsegetEnabledAttributeType) (ret GetUpdateServiceResponsegetEnabledRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetUpdateServiceResponsegetEnabledAttributeType(arg *GetUpdateServiceResponsegetEnabledAttributeType, val GetUpdateServiceResponsegetEnabledRetType) { + *arg = &val +} + // GetUpdateServiceResponse struct for GetUpdateServiceResponse type GetUpdateServiceResponse struct { - Enabled *bool `json:"enabled,omitempty"` + Enabled GetUpdateServiceResponsegetEnabledAttributeType `json:"enabled,omitempty"` } // NewGetUpdateServiceResponse instantiates a new GetUpdateServiceResponse object @@ -40,41 +60,32 @@ func NewGetUpdateServiceResponseWithDefaults() *GetUpdateServiceResponse { } // GetEnabled returns the Enabled field value if set, zero value otherwise. -func (o *GetUpdateServiceResponse) GetEnabled() *bool { - if o == nil || IsNil(o.Enabled) { - var ret *bool - return ret - } - return o.Enabled +func (o *GetUpdateServiceResponse) GetEnabled() (res GetUpdateServiceResponsegetEnabledRetType) { + res, _ = o.GetEnabledOk() + return } // GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GetUpdateServiceResponse) GetEnabledOk() (*bool, bool) { - if o == nil || IsNil(o.Enabled) { - return nil, false - } - return o.Enabled, true +func (o *GetUpdateServiceResponse) GetEnabledOk() (ret GetUpdateServiceResponsegetEnabledRetType, ok bool) { + return getGetUpdateServiceResponsegetEnabledAttributeTypeOk(o.Enabled) } // HasEnabled returns a boolean if a field has been set. func (o *GetUpdateServiceResponse) HasEnabled() bool { - if o != nil && !IsNil(o.Enabled) { - return true - } - - return false + _, ok := o.GetEnabledOk() + return ok } // SetEnabled gets a reference to the given bool and assigns it to the Enabled field. -func (o *GetUpdateServiceResponse) SetEnabled(v *bool) { - o.Enabled = v +func (o *GetUpdateServiceResponse) SetEnabled(v GetUpdateServiceResponsegetEnabledRetType) { + setGetUpdateServiceResponsegetEnabledAttributeType(&o.Enabled, v) } func (o GetUpdateServiceResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Enabled) { - toSerialize["enabled"] = o.Enabled + if val, ok := getGetUpdateServiceResponsegetEnabledAttributeTypeOk(o.Enabled); ok { + toSerialize["Enabled"] = val } return toSerialize, nil } diff --git a/services/serverupdate/model_get_updates_list_response.go b/services/serverupdate/model_get_updates_list_response.go index 344dda62e..ba4ca597a 100644 --- a/services/serverupdate/model_get_updates_list_response.go +++ b/services/serverupdate/model_get_updates_list_response.go @@ -3,7 +3,7 @@ STACKIT Server Update Management API API endpoints for Server Update Operations on STACKIT Servers. -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,9 +17,29 @@ import ( // checks if the GetUpdatesListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GetUpdatesListResponse{} +/* + types and functions for items +*/ + +// isArray +type GetUpdatesListResponseGetItemsAttributeType = *[]Update +type GetUpdatesListResponseGetItemsArgType = []Update +type GetUpdatesListResponseGetItemsRetType = []Update + +func getGetUpdatesListResponseGetItemsAttributeTypeOk(arg GetUpdatesListResponseGetItemsAttributeType) (ret GetUpdatesListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetUpdatesListResponseGetItemsAttributeType(arg *GetUpdatesListResponseGetItemsAttributeType, val GetUpdatesListResponseGetItemsRetType) { + *arg = &val +} + // GetUpdatesListResponse struct for GetUpdatesListResponse type GetUpdatesListResponse struct { - Items *[]Update `json:"items,omitempty"` + Items GetUpdatesListResponseGetItemsAttributeType `json:"items,omitempty"` } // NewGetUpdatesListResponse instantiates a new GetUpdatesListResponse object @@ -40,41 +60,32 @@ func NewGetUpdatesListResponseWithDefaults() *GetUpdatesListResponse { } // GetItems returns the Items field value if set, zero value otherwise. -func (o *GetUpdatesListResponse) GetItems() *[]Update { - if o == nil || IsNil(o.Items) { - var ret *[]Update - return ret - } - return o.Items +func (o *GetUpdatesListResponse) GetItems() (res GetUpdatesListResponseGetItemsRetType) { + res, _ = o.GetItemsOk() + return } // GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GetUpdatesListResponse) GetItemsOk() (*[]Update, bool) { - if o == nil || IsNil(o.Items) { - return nil, false - } - return o.Items, true +func (o *GetUpdatesListResponse) GetItemsOk() (ret GetUpdatesListResponseGetItemsRetType, ok bool) { + return getGetUpdatesListResponseGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. func (o *GetUpdatesListResponse) HasItems() bool { - if o != nil && !IsNil(o.Items) { - return true - } - - return false + _, ok := o.GetItemsOk() + return ok } // SetItems gets a reference to the given []Update and assigns it to the Items field. -func (o *GetUpdatesListResponse) SetItems(v *[]Update) { - o.Items = v +func (o *GetUpdatesListResponse) SetItems(v GetUpdatesListResponseGetItemsRetType) { + setGetUpdatesListResponseGetItemsAttributeType(&o.Items, v) } func (o GetUpdatesListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Items) { - toSerialize["items"] = o.Items + if val, ok := getGetUpdatesListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val } return toSerialize, nil } diff --git a/services/serverupdate/model_update.go b/services/serverupdate/model_update.go index d0fa99d45..90cf368cb 100644 --- a/services/serverupdate/model_update.go +++ b/services/serverupdate/model_update.go @@ -3,7 +3,7 @@ STACKIT Server Update Management API API endpoints for Server Update Operations on STACKIT Servers. -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,21 +17,165 @@ import ( // checks if the Update type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Update{} +/* + types and functions for endDate +*/ + +// isNotNullableString +type UpdateGetEndDateAttributeType = *string + +func getUpdateGetEndDateAttributeTypeOk(arg UpdateGetEndDateAttributeType) (ret UpdateGetEndDateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateGetEndDateAttributeType(arg *UpdateGetEndDateAttributeType, val UpdateGetEndDateRetType) { + *arg = &val +} + +type UpdateGetEndDateArgType = string +type UpdateGetEndDateRetType = string + +/* + types and functions for failReason +*/ + +// isNotNullableString +type UpdateGetFailReasonAttributeType = *string + +func getUpdateGetFailReasonAttributeTypeOk(arg UpdateGetFailReasonAttributeType) (ret UpdateGetFailReasonRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateGetFailReasonAttributeType(arg *UpdateGetFailReasonAttributeType, val UpdateGetFailReasonRetType) { + *arg = &val +} + +type UpdateGetFailReasonArgType = string +type UpdateGetFailReasonRetType = string + +/* + types and functions for failedUpdates +*/ + +// isInteger +type UpdateGetFailedUpdatesAttributeType = *int64 +type UpdateGetFailedUpdatesArgType = int64 +type UpdateGetFailedUpdatesRetType = int64 + +func getUpdateGetFailedUpdatesAttributeTypeOk(arg UpdateGetFailedUpdatesAttributeType) (ret UpdateGetFailedUpdatesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateGetFailedUpdatesAttributeType(arg *UpdateGetFailedUpdatesAttributeType, val UpdateGetFailedUpdatesRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isInteger +type UpdateGetIdAttributeType = *int64 +type UpdateGetIdArgType = int64 +type UpdateGetIdRetType = int64 + +func getUpdateGetIdAttributeTypeOk(arg UpdateGetIdAttributeType) (ret UpdateGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateGetIdAttributeType(arg *UpdateGetIdAttributeType, val UpdateGetIdRetType) { + *arg = &val +} + +/* + types and functions for installedUpdates +*/ + +// isInteger +type UpdateGetInstalledUpdatesAttributeType = *int64 +type UpdateGetInstalledUpdatesArgType = int64 +type UpdateGetInstalledUpdatesRetType = int64 + +func getUpdateGetInstalledUpdatesAttributeTypeOk(arg UpdateGetInstalledUpdatesAttributeType) (ret UpdateGetInstalledUpdatesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateGetInstalledUpdatesAttributeType(arg *UpdateGetInstalledUpdatesAttributeType, val UpdateGetInstalledUpdatesRetType) { + *arg = &val +} + +/* + types and functions for startDate +*/ + +// isNotNullableString +type UpdateGetStartDateAttributeType = *string + +func getUpdateGetStartDateAttributeTypeOk(arg UpdateGetStartDateAttributeType) (ret UpdateGetStartDateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateGetStartDateAttributeType(arg *UpdateGetStartDateAttributeType, val UpdateGetStartDateRetType) { + *arg = &val +} + +type UpdateGetStartDateArgType = string +type UpdateGetStartDateRetType = string + +/* + types and functions for status +*/ + +// isNotNullableString +type UpdateGetStatusAttributeType = *string + +func getUpdateGetStatusAttributeTypeOk(arg UpdateGetStatusAttributeType) (ret UpdateGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateGetStatusAttributeType(arg *UpdateGetStatusAttributeType, val UpdateGetStatusRetType) { + *arg = &val +} + +type UpdateGetStatusArgType = string +type UpdateGetStatusRetType = string + // Update struct for Update type Update struct { - EndDate *string `json:"endDate,omitempty"` - FailReason *string `json:"failReason,omitempty"` + EndDate UpdateGetEndDateAttributeType `json:"endDate,omitempty"` + FailReason UpdateGetFailReasonAttributeType `json:"failReason,omitempty"` // Can be cast to int32 without loss of precision. - FailedUpdates *int64 `json:"failedUpdates,omitempty"` + FailedUpdates UpdateGetFailedUpdatesAttributeType `json:"failedUpdates,omitempty"` // Can be cast to int32 without loss of precision. // REQUIRED - Id *int64 `json:"id"` + Id UpdateGetIdAttributeType `json:"id"` // Can be cast to int32 without loss of precision. - InstalledUpdates *int64 `json:"installedUpdates,omitempty"` + InstalledUpdates UpdateGetInstalledUpdatesAttributeType `json:"installedUpdates,omitempty"` // REQUIRED - StartDate *string `json:"startDate"` + StartDate UpdateGetStartDateAttributeType `json:"startDate"` // REQUIRED - Status *string `json:"status"` + Status UpdateGetStatusAttributeType `json:"status"` } type _Update Update @@ -40,11 +184,11 @@ type _Update Update // 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 NewUpdate(id *int64, startDate *string, status *string) *Update { +func NewUpdate(id UpdateGetIdArgType, startDate UpdateGetStartDateArgType, status UpdateGetStatusArgType) *Update { this := Update{} - this.Id = id - this.StartDate = startDate - this.Status = status + setUpdateGetIdAttributeType(&this.Id, id) + setUpdateGetStartDateAttributeType(&this.StartDate, startDate) + setUpdateGetStatusAttributeType(&this.Status, status) return &this } @@ -57,222 +201,171 @@ func NewUpdateWithDefaults() *Update { } // GetEndDate returns the EndDate field value if set, zero value otherwise. -func (o *Update) GetEndDate() *string { - if o == nil || IsNil(o.EndDate) { - var ret *string - return ret - } - return o.EndDate +func (o *Update) GetEndDate() (res UpdateGetEndDateRetType) { + res, _ = o.GetEndDateOk() + return } // GetEndDateOk returns a tuple with the EndDate field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Update) GetEndDateOk() (*string, bool) { - if o == nil || IsNil(o.EndDate) { - return nil, false - } - return o.EndDate, true +func (o *Update) GetEndDateOk() (ret UpdateGetEndDateRetType, ok bool) { + return getUpdateGetEndDateAttributeTypeOk(o.EndDate) } // HasEndDate returns a boolean if a field has been set. func (o *Update) HasEndDate() bool { - if o != nil && !IsNil(o.EndDate) { - return true - } - - return false + _, ok := o.GetEndDateOk() + return ok } // SetEndDate gets a reference to the given string and assigns it to the EndDate field. -func (o *Update) SetEndDate(v *string) { - o.EndDate = v +func (o *Update) SetEndDate(v UpdateGetEndDateRetType) { + setUpdateGetEndDateAttributeType(&o.EndDate, v) } // GetFailReason returns the FailReason field value if set, zero value otherwise. -func (o *Update) GetFailReason() *string { - if o == nil || IsNil(o.FailReason) { - var ret *string - return ret - } - return o.FailReason +func (o *Update) GetFailReason() (res UpdateGetFailReasonRetType) { + res, _ = o.GetFailReasonOk() + return } // GetFailReasonOk returns a tuple with the FailReason field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Update) GetFailReasonOk() (*string, bool) { - if o == nil || IsNil(o.FailReason) { - return nil, false - } - return o.FailReason, true +func (o *Update) GetFailReasonOk() (ret UpdateGetFailReasonRetType, ok bool) { + return getUpdateGetFailReasonAttributeTypeOk(o.FailReason) } // HasFailReason returns a boolean if a field has been set. func (o *Update) HasFailReason() bool { - if o != nil && !IsNil(o.FailReason) { - return true - } - - return false + _, ok := o.GetFailReasonOk() + return ok } // SetFailReason gets a reference to the given string and assigns it to the FailReason field. -func (o *Update) SetFailReason(v *string) { - o.FailReason = v +func (o *Update) SetFailReason(v UpdateGetFailReasonRetType) { + setUpdateGetFailReasonAttributeType(&o.FailReason, v) } // GetFailedUpdates returns the FailedUpdates field value if set, zero value otherwise. -func (o *Update) GetFailedUpdates() *int64 { - if o == nil || IsNil(o.FailedUpdates) { - var ret *int64 - return ret - } - return o.FailedUpdates +func (o *Update) GetFailedUpdates() (res UpdateGetFailedUpdatesRetType) { + res, _ = o.GetFailedUpdatesOk() + return } // GetFailedUpdatesOk returns a tuple with the FailedUpdates field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Update) GetFailedUpdatesOk() (*int64, bool) { - if o == nil || IsNil(o.FailedUpdates) { - return nil, false - } - return o.FailedUpdates, true +func (o *Update) GetFailedUpdatesOk() (ret UpdateGetFailedUpdatesRetType, ok bool) { + return getUpdateGetFailedUpdatesAttributeTypeOk(o.FailedUpdates) } // HasFailedUpdates returns a boolean if a field has been set. func (o *Update) HasFailedUpdates() bool { - if o != nil && !IsNil(o.FailedUpdates) { - return true - } - - return false + _, ok := o.GetFailedUpdatesOk() + return ok } // SetFailedUpdates gets a reference to the given int64 and assigns it to the FailedUpdates field. -func (o *Update) SetFailedUpdates(v *int64) { - o.FailedUpdates = v +func (o *Update) SetFailedUpdates(v UpdateGetFailedUpdatesRetType) { + setUpdateGetFailedUpdatesAttributeType(&o.FailedUpdates, v) } // GetId returns the Id field value -func (o *Update) GetId() *int64 { - if o == nil || IsNil(o.Id) { - var ret *int64 - return ret - } - - return o.Id +func (o *Update) GetId() (ret UpdateGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *Update) GetIdOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Id, true +func (o *Update) GetIdOk() (ret UpdateGetIdRetType, ok bool) { + return getUpdateGetIdAttributeTypeOk(o.Id) } // SetId sets field value -func (o *Update) SetId(v *int64) { - o.Id = v +func (o *Update) SetId(v UpdateGetIdRetType) { + setUpdateGetIdAttributeType(&o.Id, v) } // GetInstalledUpdates returns the InstalledUpdates field value if set, zero value otherwise. -func (o *Update) GetInstalledUpdates() *int64 { - if o == nil || IsNil(o.InstalledUpdates) { - var ret *int64 - return ret - } - return o.InstalledUpdates +func (o *Update) GetInstalledUpdates() (res UpdateGetInstalledUpdatesRetType) { + res, _ = o.GetInstalledUpdatesOk() + return } // GetInstalledUpdatesOk returns a tuple with the InstalledUpdates field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Update) GetInstalledUpdatesOk() (*int64, bool) { - if o == nil || IsNil(o.InstalledUpdates) { - return nil, false - } - return o.InstalledUpdates, true +func (o *Update) GetInstalledUpdatesOk() (ret UpdateGetInstalledUpdatesRetType, ok bool) { + return getUpdateGetInstalledUpdatesAttributeTypeOk(o.InstalledUpdates) } // HasInstalledUpdates returns a boolean if a field has been set. func (o *Update) HasInstalledUpdates() bool { - if o != nil && !IsNil(o.InstalledUpdates) { - return true - } - - return false + _, ok := o.GetInstalledUpdatesOk() + return ok } // SetInstalledUpdates gets a reference to the given int64 and assigns it to the InstalledUpdates field. -func (o *Update) SetInstalledUpdates(v *int64) { - o.InstalledUpdates = v +func (o *Update) SetInstalledUpdates(v UpdateGetInstalledUpdatesRetType) { + setUpdateGetInstalledUpdatesAttributeType(&o.InstalledUpdates, v) } // GetStartDate returns the StartDate field value -func (o *Update) GetStartDate() *string { - if o == nil || IsNil(o.StartDate) { - var ret *string - return ret - } - - return o.StartDate +func (o *Update) GetStartDate() (ret UpdateGetStartDateRetType) { + ret, _ = o.GetStartDateOk() + return ret } // GetStartDateOk returns a tuple with the StartDate field value // and a boolean to check if the value has been set. -func (o *Update) GetStartDateOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.StartDate, true +func (o *Update) GetStartDateOk() (ret UpdateGetStartDateRetType, ok bool) { + return getUpdateGetStartDateAttributeTypeOk(o.StartDate) } // SetStartDate sets field value -func (o *Update) SetStartDate(v *string) { - o.StartDate = v +func (o *Update) SetStartDate(v UpdateGetStartDateRetType) { + setUpdateGetStartDateAttributeType(&o.StartDate, v) } // GetStatus returns the Status field value -func (o *Update) GetStatus() *string { - if o == nil || IsNil(o.Status) { - var ret *string - return ret - } - - return o.Status +func (o *Update) GetStatus() (ret UpdateGetStatusRetType) { + ret, _ = o.GetStatusOk() + return ret } // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *Update) GetStatusOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Status, true +func (o *Update) GetStatusOk() (ret UpdateGetStatusRetType, ok bool) { + return getUpdateGetStatusAttributeTypeOk(o.Status) } // SetStatus sets field value -func (o *Update) SetStatus(v *string) { - o.Status = v +func (o *Update) SetStatus(v UpdateGetStatusRetType) { + setUpdateGetStatusAttributeType(&o.Status, v) } func (o Update) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.EndDate) { - toSerialize["endDate"] = o.EndDate + if val, ok := getUpdateGetEndDateAttributeTypeOk(o.EndDate); ok { + toSerialize["EndDate"] = val + } + if val, ok := getUpdateGetFailReasonAttributeTypeOk(o.FailReason); ok { + toSerialize["FailReason"] = val + } + if val, ok := getUpdateGetFailedUpdatesAttributeTypeOk(o.FailedUpdates); ok { + toSerialize["FailedUpdates"] = val + } + if val, ok := getUpdateGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.FailReason) { - toSerialize["failReason"] = o.FailReason + if val, ok := getUpdateGetInstalledUpdatesAttributeTypeOk(o.InstalledUpdates); ok { + toSerialize["InstalledUpdates"] = val } - if !IsNil(o.FailedUpdates) { - toSerialize["failedUpdates"] = o.FailedUpdates + if val, ok := getUpdateGetStartDateAttributeTypeOk(o.StartDate); ok { + toSerialize["StartDate"] = val } - toSerialize["id"] = o.Id - if !IsNil(o.InstalledUpdates) { - toSerialize["installedUpdates"] = o.InstalledUpdates + if val, ok := getUpdateGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } - toSerialize["startDate"] = o.StartDate - toSerialize["status"] = o.Status return toSerialize, nil } diff --git a/services/serverupdate/model_update_policy.go b/services/serverupdate/model_update_policy.go index 58cfd6ef6..85cc4ef85 100644 --- a/services/serverupdate/model_update_policy.go +++ b/services/serverupdate/model_update_policy.go @@ -3,7 +3,7 @@ STACKIT Server Update Management API API endpoints for Server Update Operations on STACKIT Servers. -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,15 +17,160 @@ import ( // checks if the UpdatePolicy type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdatePolicy{} +/* + types and functions for default +*/ + +// isBoolean +type UpdatePolicygetDefaultAttributeType = *bool +type UpdatePolicygetDefaultArgType = bool +type UpdatePolicygetDefaultRetType = bool + +func getUpdatePolicygetDefaultAttributeTypeOk(arg UpdatePolicygetDefaultAttributeType) (ret UpdatePolicygetDefaultRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdatePolicygetDefaultAttributeType(arg *UpdatePolicygetDefaultAttributeType, val UpdatePolicygetDefaultRetType) { + *arg = &val +} + +/* + types and functions for description +*/ + +// isNotNullableString +type UpdatePolicyGetDescriptionAttributeType = *string + +func getUpdatePolicyGetDescriptionAttributeTypeOk(arg UpdatePolicyGetDescriptionAttributeType) (ret UpdatePolicyGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdatePolicyGetDescriptionAttributeType(arg *UpdatePolicyGetDescriptionAttributeType, val UpdatePolicyGetDescriptionRetType) { + *arg = &val +} + +type UpdatePolicyGetDescriptionArgType = string +type UpdatePolicyGetDescriptionRetType = string + +/* + types and functions for enabled +*/ + +// isBoolean +type UpdatePolicygetEnabledAttributeType = *bool +type UpdatePolicygetEnabledArgType = bool +type UpdatePolicygetEnabledRetType = bool + +func getUpdatePolicygetEnabledAttributeTypeOk(arg UpdatePolicygetEnabledAttributeType) (ret UpdatePolicygetEnabledRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdatePolicygetEnabledAttributeType(arg *UpdatePolicygetEnabledAttributeType, val UpdatePolicygetEnabledRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type UpdatePolicyGetIdAttributeType = *string + +func getUpdatePolicyGetIdAttributeTypeOk(arg UpdatePolicyGetIdAttributeType) (ret UpdatePolicyGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdatePolicyGetIdAttributeType(arg *UpdatePolicyGetIdAttributeType, val UpdatePolicyGetIdRetType) { + *arg = &val +} + +type UpdatePolicyGetIdArgType = string +type UpdatePolicyGetIdRetType = string + +/* + types and functions for maintenanceWindow +*/ + +// isInteger +type UpdatePolicyGetMaintenanceWindowAttributeType = *int64 +type UpdatePolicyGetMaintenanceWindowArgType = int64 +type UpdatePolicyGetMaintenanceWindowRetType = int64 + +func getUpdatePolicyGetMaintenanceWindowAttributeTypeOk(arg UpdatePolicyGetMaintenanceWindowAttributeType) (ret UpdatePolicyGetMaintenanceWindowRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdatePolicyGetMaintenanceWindowAttributeType(arg *UpdatePolicyGetMaintenanceWindowAttributeType, val UpdatePolicyGetMaintenanceWindowRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type UpdatePolicyGetNameAttributeType = *string + +func getUpdatePolicyGetNameAttributeTypeOk(arg UpdatePolicyGetNameAttributeType) (ret UpdatePolicyGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdatePolicyGetNameAttributeType(arg *UpdatePolicyGetNameAttributeType, val UpdatePolicyGetNameRetType) { + *arg = &val +} + +type UpdatePolicyGetNameArgType = string +type UpdatePolicyGetNameRetType = string + +/* + types and functions for rrule +*/ + +// isNotNullableString +type UpdatePolicyGetRruleAttributeType = *string + +func getUpdatePolicyGetRruleAttributeTypeOk(arg UpdatePolicyGetRruleAttributeType) (ret UpdatePolicyGetRruleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdatePolicyGetRruleAttributeType(arg *UpdatePolicyGetRruleAttributeType, val UpdatePolicyGetRruleRetType) { + *arg = &val +} + +type UpdatePolicyGetRruleArgType = string +type UpdatePolicyGetRruleRetType = string + // UpdatePolicy struct for UpdatePolicy type UpdatePolicy struct { - Default *bool `json:"default,omitempty"` - Description *string `json:"description,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - Id *string `json:"id,omitempty"` - MaintenanceWindow *int64 `json:"maintenanceWindow,omitempty"` - Name *string `json:"name,omitempty"` - Rrule *string `json:"rrule,omitempty"` + Default UpdatePolicygetDefaultAttributeType `json:"default,omitempty"` + Description UpdatePolicyGetDescriptionAttributeType `json:"description,omitempty"` + Enabled UpdatePolicygetEnabledAttributeType `json:"enabled,omitempty"` + Id UpdatePolicyGetIdAttributeType `json:"id,omitempty"` + // Can be cast to int32 without loss of precision. + MaintenanceWindow UpdatePolicyGetMaintenanceWindowAttributeType `json:"maintenanceWindow,omitempty"` + Name UpdatePolicyGetNameAttributeType `json:"name,omitempty"` + Rrule UpdatePolicyGetRruleAttributeType `json:"rrule,omitempty"` } // NewUpdatePolicy instantiates a new UpdatePolicy object @@ -46,251 +191,188 @@ func NewUpdatePolicyWithDefaults() *UpdatePolicy { } // GetDefault returns the Default field value if set, zero value otherwise. -func (o *UpdatePolicy) GetDefault() *bool { - if o == nil || IsNil(o.Default) { - var ret *bool - return ret - } - return o.Default +func (o *UpdatePolicy) GetDefault() (res UpdatePolicygetDefaultRetType) { + res, _ = o.GetDefaultOk() + return } // GetDefaultOk returns a tuple with the Default field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdatePolicy) GetDefaultOk() (*bool, bool) { - if o == nil || IsNil(o.Default) { - return nil, false - } - return o.Default, true +func (o *UpdatePolicy) GetDefaultOk() (ret UpdatePolicygetDefaultRetType, ok bool) { + return getUpdatePolicygetDefaultAttributeTypeOk(o.Default) } // HasDefault returns a boolean if a field has been set. func (o *UpdatePolicy) HasDefault() bool { - if o != nil && !IsNil(o.Default) { - return true - } - - return false + _, ok := o.GetDefaultOk() + return ok } // SetDefault gets a reference to the given bool and assigns it to the Default field. -func (o *UpdatePolicy) SetDefault(v *bool) { - o.Default = v +func (o *UpdatePolicy) SetDefault(v UpdatePolicygetDefaultRetType) { + setUpdatePolicygetDefaultAttributeType(&o.Default, v) } // GetDescription returns the Description field value if set, zero value otherwise. -func (o *UpdatePolicy) GetDescription() *string { - if o == nil || IsNil(o.Description) { - var ret *string - return ret - } - return o.Description +func (o *UpdatePolicy) GetDescription() (res UpdatePolicyGetDescriptionRetType) { + res, _ = o.GetDescriptionOk() + return } // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdatePolicy) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true +func (o *UpdatePolicy) GetDescriptionOk() (ret UpdatePolicyGetDescriptionRetType, ok bool) { + return getUpdatePolicyGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. func (o *UpdatePolicy) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false + _, ok := o.GetDescriptionOk() + return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *UpdatePolicy) SetDescription(v *string) { - o.Description = v +func (o *UpdatePolicy) SetDescription(v UpdatePolicyGetDescriptionRetType) { + setUpdatePolicyGetDescriptionAttributeType(&o.Description, v) } // GetEnabled returns the Enabled field value if set, zero value otherwise. -func (o *UpdatePolicy) GetEnabled() *bool { - if o == nil || IsNil(o.Enabled) { - var ret *bool - return ret - } - return o.Enabled +func (o *UpdatePolicy) GetEnabled() (res UpdatePolicygetEnabledRetType) { + res, _ = o.GetEnabledOk() + return } // GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdatePolicy) GetEnabledOk() (*bool, bool) { - if o == nil || IsNil(o.Enabled) { - return nil, false - } - return o.Enabled, true +func (o *UpdatePolicy) GetEnabledOk() (ret UpdatePolicygetEnabledRetType, ok bool) { + return getUpdatePolicygetEnabledAttributeTypeOk(o.Enabled) } // HasEnabled returns a boolean if a field has been set. func (o *UpdatePolicy) HasEnabled() bool { - if o != nil && !IsNil(o.Enabled) { - return true - } - - return false + _, ok := o.GetEnabledOk() + return ok } // SetEnabled gets a reference to the given bool and assigns it to the Enabled field. -func (o *UpdatePolicy) SetEnabled(v *bool) { - o.Enabled = v +func (o *UpdatePolicy) SetEnabled(v UpdatePolicygetEnabledRetType) { + setUpdatePolicygetEnabledAttributeType(&o.Enabled, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *UpdatePolicy) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *UpdatePolicy) GetId() (res UpdatePolicyGetIdRetType) { + res, _ = o.GetIdOk() + return } // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdatePolicy) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *UpdatePolicy) GetIdOk() (ret UpdatePolicyGetIdRetType, ok bool) { + return getUpdatePolicyGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *UpdatePolicy) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false + _, ok := o.GetIdOk() + return ok } // SetId gets a reference to the given string and assigns it to the Id field. -func (o *UpdatePolicy) SetId(v *string) { - o.Id = v +func (o *UpdatePolicy) SetId(v UpdatePolicyGetIdRetType) { + setUpdatePolicyGetIdAttributeType(&o.Id, v) } // GetMaintenanceWindow returns the MaintenanceWindow field value if set, zero value otherwise. -func (o *UpdatePolicy) GetMaintenanceWindow() *int64 { - if o == nil || IsNil(o.MaintenanceWindow) { - var ret *int64 - return ret - } - return o.MaintenanceWindow +func (o *UpdatePolicy) GetMaintenanceWindow() (res UpdatePolicyGetMaintenanceWindowRetType) { + res, _ = o.GetMaintenanceWindowOk() + return } // GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdatePolicy) GetMaintenanceWindowOk() (*int64, bool) { - if o == nil || IsNil(o.MaintenanceWindow) { - return nil, false - } - return o.MaintenanceWindow, true +func (o *UpdatePolicy) GetMaintenanceWindowOk() (ret UpdatePolicyGetMaintenanceWindowRetType, ok bool) { + return getUpdatePolicyGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow) } // HasMaintenanceWindow returns a boolean if a field has been set. func (o *UpdatePolicy) HasMaintenanceWindow() bool { - if o != nil && !IsNil(o.MaintenanceWindow) { - return true - } - - return false + _, ok := o.GetMaintenanceWindowOk() + return ok } // SetMaintenanceWindow gets a reference to the given int64 and assigns it to the MaintenanceWindow field. -func (o *UpdatePolicy) SetMaintenanceWindow(v *int64) { - o.MaintenanceWindow = v +func (o *UpdatePolicy) SetMaintenanceWindow(v UpdatePolicyGetMaintenanceWindowRetType) { + setUpdatePolicyGetMaintenanceWindowAttributeType(&o.MaintenanceWindow, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *UpdatePolicy) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *UpdatePolicy) GetName() (res UpdatePolicyGetNameRetType) { + res, _ = o.GetNameOk() + return } // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdatePolicy) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *UpdatePolicy) GetNameOk() (ret UpdatePolicyGetNameRetType, ok bool) { + return getUpdatePolicyGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *UpdatePolicy) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false + _, ok := o.GetNameOk() + return ok } // SetName gets a reference to the given string and assigns it to the Name field. -func (o *UpdatePolicy) SetName(v *string) { - o.Name = v +func (o *UpdatePolicy) SetName(v UpdatePolicyGetNameRetType) { + setUpdatePolicyGetNameAttributeType(&o.Name, v) } // GetRrule returns the Rrule field value if set, zero value otherwise. -func (o *UpdatePolicy) GetRrule() *string { - if o == nil || IsNil(o.Rrule) { - var ret *string - return ret - } - return o.Rrule +func (o *UpdatePolicy) GetRrule() (res UpdatePolicyGetRruleRetType) { + res, _ = o.GetRruleOk() + return } // GetRruleOk returns a tuple with the Rrule field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdatePolicy) GetRruleOk() (*string, bool) { - if o == nil || IsNil(o.Rrule) { - return nil, false - } - return o.Rrule, true +func (o *UpdatePolicy) GetRruleOk() (ret UpdatePolicyGetRruleRetType, ok bool) { + return getUpdatePolicyGetRruleAttributeTypeOk(o.Rrule) } // HasRrule returns a boolean if a field has been set. func (o *UpdatePolicy) HasRrule() bool { - if o != nil && !IsNil(o.Rrule) { - return true - } - - return false + _, ok := o.GetRruleOk() + return ok } // SetRrule gets a reference to the given string and assigns it to the Rrule field. -func (o *UpdatePolicy) SetRrule(v *string) { - o.Rrule = v +func (o *UpdatePolicy) SetRrule(v UpdatePolicyGetRruleRetType) { + setUpdatePolicyGetRruleAttributeType(&o.Rrule, v) } func (o UpdatePolicy) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Default) { - toSerialize["default"] = o.Default + if val, ok := getUpdatePolicygetDefaultAttributeTypeOk(o.Default); ok { + toSerialize["Default"] = val } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description + if val, ok := getUpdatePolicyGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val } - if !IsNil(o.Enabled) { - toSerialize["enabled"] = o.Enabled + if val, ok := getUpdatePolicygetEnabledAttributeTypeOk(o.Enabled); ok { + toSerialize["Enabled"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getUpdatePolicyGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.MaintenanceWindow) { - toSerialize["maintenanceWindow"] = o.MaintenanceWindow + if val, ok := getUpdatePolicyGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow); ok { + toSerialize["MaintenanceWindow"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getUpdatePolicyGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Rrule) { - toSerialize["rrule"] = o.Rrule + if val, ok := getUpdatePolicyGetRruleAttributeTypeOk(o.Rrule); ok { + toSerialize["Rrule"] = val } return toSerialize, nil } diff --git a/services/serverupdate/model_update_schedule.go b/services/serverupdate/model_update_schedule.go index 4c4069d06..b4e09e8d2 100644 --- a/services/serverupdate/model_update_schedule.go +++ b/services/serverupdate/model_update_schedule.go @@ -3,7 +3,7 @@ STACKIT Server Update Management API API endpoints for Server Update Operations on STACKIT Servers. -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,20 +17,122 @@ import ( // checks if the UpdateSchedule type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateSchedule{} +/* + types and functions for enabled +*/ + +// isBoolean +type UpdateSchedulegetEnabledAttributeType = *bool +type UpdateSchedulegetEnabledArgType = bool +type UpdateSchedulegetEnabledRetType = bool + +func getUpdateSchedulegetEnabledAttributeTypeOk(arg UpdateSchedulegetEnabledAttributeType) (ret UpdateSchedulegetEnabledRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateSchedulegetEnabledAttributeType(arg *UpdateSchedulegetEnabledAttributeType, val UpdateSchedulegetEnabledRetType) { + *arg = &val +} + +/* + types and functions for maintenanceWindow +*/ + +// isInteger +type UpdateScheduleGetMaintenanceWindowAttributeType = *int64 +type UpdateScheduleGetMaintenanceWindowArgType = int64 +type UpdateScheduleGetMaintenanceWindowRetType = int64 + +func getUpdateScheduleGetMaintenanceWindowAttributeTypeOk(arg UpdateScheduleGetMaintenanceWindowAttributeType) (ret UpdateScheduleGetMaintenanceWindowRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateScheduleGetMaintenanceWindowAttributeType(arg *UpdateScheduleGetMaintenanceWindowAttributeType, val UpdateScheduleGetMaintenanceWindowRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type UpdateScheduleGetNameAttributeType = *string + +func getUpdateScheduleGetNameAttributeTypeOk(arg UpdateScheduleGetNameAttributeType) (ret UpdateScheduleGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateScheduleGetNameAttributeType(arg *UpdateScheduleGetNameAttributeType, val UpdateScheduleGetNameRetType) { + *arg = &val +} + +type UpdateScheduleGetNameArgType = string +type UpdateScheduleGetNameRetType = string + +/* + types and functions for rrule +*/ + +// isNotNullableString +type UpdateScheduleGetRruleAttributeType = *string + +func getUpdateScheduleGetRruleAttributeTypeOk(arg UpdateScheduleGetRruleAttributeType) (ret UpdateScheduleGetRruleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateScheduleGetRruleAttributeType(arg *UpdateScheduleGetRruleAttributeType, val UpdateScheduleGetRruleRetType) { + *arg = &val +} + +type UpdateScheduleGetRruleArgType = string +type UpdateScheduleGetRruleRetType = string + +/* + types and functions for id +*/ + +// isInteger +type UpdateScheduleGetIdAttributeType = *int64 +type UpdateScheduleGetIdArgType = int64 +type UpdateScheduleGetIdRetType = int64 + +func getUpdateScheduleGetIdAttributeTypeOk(arg UpdateScheduleGetIdAttributeType) (ret UpdateScheduleGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateScheduleGetIdAttributeType(arg *UpdateScheduleGetIdAttributeType, val UpdateScheduleGetIdRetType) { + *arg = &val +} + // UpdateSchedule struct for UpdateSchedule type UpdateSchedule struct { // REQUIRED - Enabled *bool `json:"enabled"` + Enabled UpdateSchedulegetEnabledAttributeType `json:"enabled"` // Can be cast to int32 without loss of precision. // REQUIRED - MaintenanceWindow *int64 `json:"maintenanceWindow"` + MaintenanceWindow UpdateScheduleGetMaintenanceWindowAttributeType `json:"maintenanceWindow"` // REQUIRED - Name *string `json:"name"` + Name UpdateScheduleGetNameAttributeType `json:"name"` // REQUIRED - Rrule *string `json:"rrule"` + Rrule UpdateScheduleGetRruleAttributeType `json:"rrule"` // Can be cast to int32 without loss of precision. // REQUIRED - Id *int64 `json:"id"` + Id UpdateScheduleGetIdAttributeType `json:"id"` } type _UpdateSchedule UpdateSchedule @@ -39,13 +141,13 @@ type _UpdateSchedule UpdateSchedule // 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 NewUpdateSchedule(enabled *bool, maintenanceWindow *int64, name *string, rrule *string, id *int64) *UpdateSchedule { +func NewUpdateSchedule(enabled UpdateSchedulegetEnabledArgType, maintenanceWindow UpdateScheduleGetMaintenanceWindowArgType, name UpdateScheduleGetNameArgType, rrule UpdateScheduleGetRruleArgType, id UpdateScheduleGetIdArgType) *UpdateSchedule { this := UpdateSchedule{} - this.Enabled = enabled - this.MaintenanceWindow = maintenanceWindow - this.Name = name - this.Rrule = rrule - this.Id = id + setUpdateSchedulegetEnabledAttributeType(&this.Enabled, enabled) + setUpdateScheduleGetMaintenanceWindowAttributeType(&this.MaintenanceWindow, maintenanceWindow) + setUpdateScheduleGetNameAttributeType(&this.Name, name) + setUpdateScheduleGetRruleAttributeType(&this.Rrule, rrule) + setUpdateScheduleGetIdAttributeType(&this.Id, id) return &this } @@ -58,132 +160,107 @@ func NewUpdateScheduleWithDefaults() *UpdateSchedule { } // GetEnabled returns the Enabled field value -func (o *UpdateSchedule) GetEnabled() *bool { - if o == nil || IsNil(o.Enabled) { - var ret *bool - return ret - } - - return o.Enabled +func (o *UpdateSchedule) GetEnabled() (ret UpdateSchedulegetEnabledRetType) { + ret, _ = o.GetEnabledOk() + return ret } // GetEnabledOk returns a tuple with the Enabled field value // and a boolean to check if the value has been set. -func (o *UpdateSchedule) GetEnabledOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.Enabled, true +func (o *UpdateSchedule) GetEnabledOk() (ret UpdateSchedulegetEnabledRetType, ok bool) { + return getUpdateSchedulegetEnabledAttributeTypeOk(o.Enabled) } // SetEnabled sets field value -func (o *UpdateSchedule) SetEnabled(v *bool) { - o.Enabled = v +func (o *UpdateSchedule) SetEnabled(v UpdateSchedulegetEnabledRetType) { + setUpdateSchedulegetEnabledAttributeType(&o.Enabled, v) } // GetMaintenanceWindow returns the MaintenanceWindow field value -func (o *UpdateSchedule) GetMaintenanceWindow() *int64 { - if o == nil || IsNil(o.MaintenanceWindow) { - var ret *int64 - return ret - } - - return o.MaintenanceWindow +func (o *UpdateSchedule) GetMaintenanceWindow() (ret UpdateScheduleGetMaintenanceWindowRetType) { + ret, _ = o.GetMaintenanceWindowOk() + return ret } // GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value // and a boolean to check if the value has been set. -func (o *UpdateSchedule) GetMaintenanceWindowOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.MaintenanceWindow, true +func (o *UpdateSchedule) GetMaintenanceWindowOk() (ret UpdateScheduleGetMaintenanceWindowRetType, ok bool) { + return getUpdateScheduleGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow) } // SetMaintenanceWindow sets field value -func (o *UpdateSchedule) SetMaintenanceWindow(v *int64) { - o.MaintenanceWindow = v +func (o *UpdateSchedule) SetMaintenanceWindow(v UpdateScheduleGetMaintenanceWindowRetType) { + setUpdateScheduleGetMaintenanceWindowAttributeType(&o.MaintenanceWindow, v) } // GetName returns the Name field value -func (o *UpdateSchedule) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *UpdateSchedule) GetName() (ret UpdateScheduleGetNameRetType) { + ret, _ = o.GetNameOk() + return ret } // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. -func (o *UpdateSchedule) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *UpdateSchedule) GetNameOk() (ret UpdateScheduleGetNameRetType, ok bool) { + return getUpdateScheduleGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *UpdateSchedule) SetName(v *string) { - o.Name = v +func (o *UpdateSchedule) SetName(v UpdateScheduleGetNameRetType) { + setUpdateScheduleGetNameAttributeType(&o.Name, v) } // GetRrule returns the Rrule field value -func (o *UpdateSchedule) GetRrule() *string { - if o == nil || IsNil(o.Rrule) { - var ret *string - return ret - } - - return o.Rrule +func (o *UpdateSchedule) GetRrule() (ret UpdateScheduleGetRruleRetType) { + ret, _ = o.GetRruleOk() + return ret } // GetRruleOk returns a tuple with the Rrule field value // and a boolean to check if the value has been set. -func (o *UpdateSchedule) GetRruleOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Rrule, true +func (o *UpdateSchedule) GetRruleOk() (ret UpdateScheduleGetRruleRetType, ok bool) { + return getUpdateScheduleGetRruleAttributeTypeOk(o.Rrule) } // SetRrule sets field value -func (o *UpdateSchedule) SetRrule(v *string) { - o.Rrule = v +func (o *UpdateSchedule) SetRrule(v UpdateScheduleGetRruleRetType) { + setUpdateScheduleGetRruleAttributeType(&o.Rrule, v) } // GetId returns the Id field value -func (o *UpdateSchedule) GetId() *int64 { - if o == nil || IsNil(o.Id) { - var ret *int64 - return ret - } - - return o.Id +func (o *UpdateSchedule) GetId() (ret UpdateScheduleGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *UpdateSchedule) GetIdOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Id, true +func (o *UpdateSchedule) GetIdOk() (ret UpdateScheduleGetIdRetType, ok bool) { + return getUpdateScheduleGetIdAttributeTypeOk(o.Id) } // SetId sets field value -func (o *UpdateSchedule) SetId(v *int64) { - o.Id = v +func (o *UpdateSchedule) SetId(v UpdateScheduleGetIdRetType) { + setUpdateScheduleGetIdAttributeType(&o.Id, v) } func (o UpdateSchedule) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["enabled"] = o.Enabled - toSerialize["maintenanceWindow"] = o.MaintenanceWindow - toSerialize["name"] = o.Name - toSerialize["rrule"] = o.Rrule - toSerialize["id"] = o.Id + if val, ok := getUpdateSchedulegetEnabledAttributeTypeOk(o.Enabled); ok { + toSerialize["Enabled"] = val + } + if val, ok := getUpdateScheduleGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow); ok { + toSerialize["MaintenanceWindow"] = val + } + if val, ok := getUpdateScheduleGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getUpdateScheduleGetRruleAttributeTypeOk(o.Rrule); ok { + toSerialize["Rrule"] = val + } + if val, ok := getUpdateScheduleGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } return toSerialize, nil } diff --git a/services/serverupdate/model_update_schedule_all_of.go b/services/serverupdate/model_update_schedule_all_of.go index eaf70e146..b7785fec8 100644 --- a/services/serverupdate/model_update_schedule_all_of.go +++ b/services/serverupdate/model_update_schedule_all_of.go @@ -3,7 +3,7 @@ STACKIT Server Update Management API API endpoints for Server Update Operations on STACKIT Servers. -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,11 +17,31 @@ import ( // checks if the UpdateScheduleAllOf type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateScheduleAllOf{} +/* + types and functions for id +*/ + +// isInteger +type UpdateScheduleAllOfGetIdAttributeType = *int64 +type UpdateScheduleAllOfGetIdArgType = int64 +type UpdateScheduleAllOfGetIdRetType = int64 + +func getUpdateScheduleAllOfGetIdAttributeTypeOk(arg UpdateScheduleAllOfGetIdAttributeType) (ret UpdateScheduleAllOfGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateScheduleAllOfGetIdAttributeType(arg *UpdateScheduleAllOfGetIdAttributeType, val UpdateScheduleAllOfGetIdRetType) { + *arg = &val +} + // UpdateScheduleAllOf struct for UpdateScheduleAllOf type UpdateScheduleAllOf struct { // Can be cast to int32 without loss of precision. // REQUIRED - Id *int64 `json:"id"` + Id UpdateScheduleAllOfGetIdAttributeType `json:"id"` } type _UpdateScheduleAllOf UpdateScheduleAllOf @@ -30,9 +50,9 @@ type _UpdateScheduleAllOf UpdateScheduleAllOf // 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 NewUpdateScheduleAllOf(id *int64) *UpdateScheduleAllOf { +func NewUpdateScheduleAllOf(id UpdateScheduleAllOfGetIdArgType) *UpdateScheduleAllOf { this := UpdateScheduleAllOf{} - this.Id = id + setUpdateScheduleAllOfGetIdAttributeType(&this.Id, id) return &this } @@ -45,32 +65,27 @@ func NewUpdateScheduleAllOfWithDefaults() *UpdateScheduleAllOf { } // GetId returns the Id field value -func (o *UpdateScheduleAllOf) GetId() *int64 { - if o == nil || IsNil(o.Id) { - var ret *int64 - return ret - } - - return o.Id +func (o *UpdateScheduleAllOf) GetId() (ret UpdateScheduleAllOfGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *UpdateScheduleAllOf) GetIdOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Id, true +func (o *UpdateScheduleAllOf) GetIdOk() (ret UpdateScheduleAllOfGetIdRetType, ok bool) { + return getUpdateScheduleAllOfGetIdAttributeTypeOk(o.Id) } // SetId sets field value -func (o *UpdateScheduleAllOf) SetId(v *int64) { - o.Id = v +func (o *UpdateScheduleAllOf) SetId(v UpdateScheduleAllOfGetIdRetType) { + setUpdateScheduleAllOfGetIdAttributeType(&o.Id, v) } func (o UpdateScheduleAllOf) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id + if val, ok := getUpdateScheduleAllOfGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } return toSerialize, nil } diff --git a/services/serverupdate/model_update_schedule_create_request.go b/services/serverupdate/model_update_schedule_create_request.go index 211102427..a55430591 100644 --- a/services/serverupdate/model_update_schedule_create_request.go +++ b/services/serverupdate/model_update_schedule_create_request.go @@ -3,7 +3,7 @@ STACKIT Server Update Management API API endpoints for Server Update Operations on STACKIT Servers. -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,17 +17,99 @@ import ( // checks if the UpdateScheduleCreateRequest type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateScheduleCreateRequest{} +/* + types and functions for enabled +*/ + +// isBoolean +type UpdateScheduleCreateRequestgetEnabledAttributeType = *bool +type UpdateScheduleCreateRequestgetEnabledArgType = bool +type UpdateScheduleCreateRequestgetEnabledRetType = bool + +func getUpdateScheduleCreateRequestgetEnabledAttributeTypeOk(arg UpdateScheduleCreateRequestgetEnabledAttributeType) (ret UpdateScheduleCreateRequestgetEnabledRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateScheduleCreateRequestgetEnabledAttributeType(arg *UpdateScheduleCreateRequestgetEnabledAttributeType, val UpdateScheduleCreateRequestgetEnabledRetType) { + *arg = &val +} + +/* + types and functions for maintenanceWindow +*/ + +// isInteger +type UpdateScheduleCreateRequestGetMaintenanceWindowAttributeType = *int64 +type UpdateScheduleCreateRequestGetMaintenanceWindowArgType = int64 +type UpdateScheduleCreateRequestGetMaintenanceWindowRetType = int64 + +func getUpdateScheduleCreateRequestGetMaintenanceWindowAttributeTypeOk(arg UpdateScheduleCreateRequestGetMaintenanceWindowAttributeType) (ret UpdateScheduleCreateRequestGetMaintenanceWindowRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateScheduleCreateRequestGetMaintenanceWindowAttributeType(arg *UpdateScheduleCreateRequestGetMaintenanceWindowAttributeType, val UpdateScheduleCreateRequestGetMaintenanceWindowRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type UpdateScheduleCreateRequestGetNameAttributeType = *string + +func getUpdateScheduleCreateRequestGetNameAttributeTypeOk(arg UpdateScheduleCreateRequestGetNameAttributeType) (ret UpdateScheduleCreateRequestGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateScheduleCreateRequestGetNameAttributeType(arg *UpdateScheduleCreateRequestGetNameAttributeType, val UpdateScheduleCreateRequestGetNameRetType) { + *arg = &val +} + +type UpdateScheduleCreateRequestGetNameArgType = string +type UpdateScheduleCreateRequestGetNameRetType = string + +/* + types and functions for rrule +*/ + +// isNotNullableString +type UpdateScheduleCreateRequestGetRruleAttributeType = *string + +func getUpdateScheduleCreateRequestGetRruleAttributeTypeOk(arg UpdateScheduleCreateRequestGetRruleAttributeType) (ret UpdateScheduleCreateRequestGetRruleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateScheduleCreateRequestGetRruleAttributeType(arg *UpdateScheduleCreateRequestGetRruleAttributeType, val UpdateScheduleCreateRequestGetRruleRetType) { + *arg = &val +} + +type UpdateScheduleCreateRequestGetRruleArgType = string +type UpdateScheduleCreateRequestGetRruleRetType = string + // UpdateScheduleCreateRequest struct for UpdateScheduleCreateRequest type UpdateScheduleCreateRequest struct { // REQUIRED - Enabled *bool `json:"enabled"` + Enabled UpdateScheduleCreateRequestgetEnabledAttributeType `json:"enabled"` // Can be cast to int32 without loss of precision. // REQUIRED - MaintenanceWindow *int64 `json:"maintenanceWindow"` + MaintenanceWindow UpdateScheduleCreateRequestGetMaintenanceWindowAttributeType `json:"maintenanceWindow"` // REQUIRED - Name *string `json:"name"` + Name UpdateScheduleCreateRequestGetNameAttributeType `json:"name"` // REQUIRED - Rrule *string `json:"rrule"` + Rrule UpdateScheduleCreateRequestGetRruleAttributeType `json:"rrule"` } type _UpdateScheduleCreateRequest UpdateScheduleCreateRequest @@ -36,12 +118,12 @@ type _UpdateScheduleCreateRequest UpdateScheduleCreateRequest // 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 NewUpdateScheduleCreateRequest(enabled *bool, maintenanceWindow *int64, name *string, rrule *string) *UpdateScheduleCreateRequest { +func NewUpdateScheduleCreateRequest(enabled UpdateScheduleCreateRequestgetEnabledArgType, maintenanceWindow UpdateScheduleCreateRequestGetMaintenanceWindowArgType, name UpdateScheduleCreateRequestGetNameArgType, rrule UpdateScheduleCreateRequestGetRruleArgType) *UpdateScheduleCreateRequest { this := UpdateScheduleCreateRequest{} - this.Enabled = enabled - this.MaintenanceWindow = maintenanceWindow - this.Name = name - this.Rrule = rrule + setUpdateScheduleCreateRequestgetEnabledAttributeType(&this.Enabled, enabled) + setUpdateScheduleCreateRequestGetMaintenanceWindowAttributeType(&this.MaintenanceWindow, maintenanceWindow) + setUpdateScheduleCreateRequestGetNameAttributeType(&this.Name, name) + setUpdateScheduleCreateRequestGetRruleAttributeType(&this.Rrule, rrule) return &this } @@ -54,107 +136,87 @@ func NewUpdateScheduleCreateRequestWithDefaults() *UpdateScheduleCreateRequest { } // GetEnabled returns the Enabled field value -func (o *UpdateScheduleCreateRequest) GetEnabled() *bool { - if o == nil || IsNil(o.Enabled) { - var ret *bool - return ret - } - - return o.Enabled +func (o *UpdateScheduleCreateRequest) GetEnabled() (ret UpdateScheduleCreateRequestgetEnabledRetType) { + ret, _ = o.GetEnabledOk() + return ret } // GetEnabledOk returns a tuple with the Enabled field value // and a boolean to check if the value has been set. -func (o *UpdateScheduleCreateRequest) GetEnabledOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.Enabled, true +func (o *UpdateScheduleCreateRequest) GetEnabledOk() (ret UpdateScheduleCreateRequestgetEnabledRetType, ok bool) { + return getUpdateScheduleCreateRequestgetEnabledAttributeTypeOk(o.Enabled) } // SetEnabled sets field value -func (o *UpdateScheduleCreateRequest) SetEnabled(v *bool) { - o.Enabled = v +func (o *UpdateScheduleCreateRequest) SetEnabled(v UpdateScheduleCreateRequestgetEnabledRetType) { + setUpdateScheduleCreateRequestgetEnabledAttributeType(&o.Enabled, v) } // GetMaintenanceWindow returns the MaintenanceWindow field value -func (o *UpdateScheduleCreateRequest) GetMaintenanceWindow() *int64 { - if o == nil || IsNil(o.MaintenanceWindow) { - var ret *int64 - return ret - } - - return o.MaintenanceWindow +func (o *UpdateScheduleCreateRequest) GetMaintenanceWindow() (ret UpdateScheduleCreateRequestGetMaintenanceWindowRetType) { + ret, _ = o.GetMaintenanceWindowOk() + return ret } // GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value // and a boolean to check if the value has been set. -func (o *UpdateScheduleCreateRequest) GetMaintenanceWindowOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.MaintenanceWindow, true +func (o *UpdateScheduleCreateRequest) GetMaintenanceWindowOk() (ret UpdateScheduleCreateRequestGetMaintenanceWindowRetType, ok bool) { + return getUpdateScheduleCreateRequestGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow) } // SetMaintenanceWindow sets field value -func (o *UpdateScheduleCreateRequest) SetMaintenanceWindow(v *int64) { - o.MaintenanceWindow = v +func (o *UpdateScheduleCreateRequest) SetMaintenanceWindow(v UpdateScheduleCreateRequestGetMaintenanceWindowRetType) { + setUpdateScheduleCreateRequestGetMaintenanceWindowAttributeType(&o.MaintenanceWindow, v) } // GetName returns the Name field value -func (o *UpdateScheduleCreateRequest) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *UpdateScheduleCreateRequest) GetName() (ret UpdateScheduleCreateRequestGetNameRetType) { + ret, _ = o.GetNameOk() + return ret } // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. -func (o *UpdateScheduleCreateRequest) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *UpdateScheduleCreateRequest) GetNameOk() (ret UpdateScheduleCreateRequestGetNameRetType, ok bool) { + return getUpdateScheduleCreateRequestGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *UpdateScheduleCreateRequest) SetName(v *string) { - o.Name = v +func (o *UpdateScheduleCreateRequest) SetName(v UpdateScheduleCreateRequestGetNameRetType) { + setUpdateScheduleCreateRequestGetNameAttributeType(&o.Name, v) } // GetRrule returns the Rrule field value -func (o *UpdateScheduleCreateRequest) GetRrule() *string { - if o == nil || IsNil(o.Rrule) { - var ret *string - return ret - } - - return o.Rrule +func (o *UpdateScheduleCreateRequest) GetRrule() (ret UpdateScheduleCreateRequestGetRruleRetType) { + ret, _ = o.GetRruleOk() + return ret } // GetRruleOk returns a tuple with the Rrule field value // and a boolean to check if the value has been set. -func (o *UpdateScheduleCreateRequest) GetRruleOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Rrule, true +func (o *UpdateScheduleCreateRequest) GetRruleOk() (ret UpdateScheduleCreateRequestGetRruleRetType, ok bool) { + return getUpdateScheduleCreateRequestGetRruleAttributeTypeOk(o.Rrule) } // SetRrule sets field value -func (o *UpdateScheduleCreateRequest) SetRrule(v *string) { - o.Rrule = v +func (o *UpdateScheduleCreateRequest) SetRrule(v UpdateScheduleCreateRequestGetRruleRetType) { + setUpdateScheduleCreateRequestGetRruleAttributeType(&o.Rrule, v) } func (o UpdateScheduleCreateRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["enabled"] = o.Enabled - toSerialize["maintenanceWindow"] = o.MaintenanceWindow - toSerialize["name"] = o.Name - toSerialize["rrule"] = o.Rrule + if val, ok := getUpdateScheduleCreateRequestgetEnabledAttributeTypeOk(o.Enabled); ok { + toSerialize["Enabled"] = val + } + if val, ok := getUpdateScheduleCreateRequestGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow); ok { + toSerialize["MaintenanceWindow"] = val + } + if val, ok := getUpdateScheduleCreateRequestGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getUpdateScheduleCreateRequestGetRruleAttributeTypeOk(o.Rrule); ok { + toSerialize["Rrule"] = val + } return toSerialize, nil } diff --git a/services/serverupdate/model_update_update_schedule_payload.go b/services/serverupdate/model_update_update_schedule_payload.go index b928d8f82..0a5106fae 100644 --- a/services/serverupdate/model_update_update_schedule_payload.go +++ b/services/serverupdate/model_update_update_schedule_payload.go @@ -3,7 +3,7 @@ STACKIT Server Update Management API API endpoints for Server Update Operations on STACKIT Servers. -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,17 +17,99 @@ import ( // checks if the UpdateUpdateSchedulePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateUpdateSchedulePayload{} +/* + types and functions for enabled +*/ + +// isBoolean +type UpdateUpdateSchedulePayloadgetEnabledAttributeType = *bool +type UpdateUpdateSchedulePayloadgetEnabledArgType = bool +type UpdateUpdateSchedulePayloadgetEnabledRetType = bool + +func getUpdateUpdateSchedulePayloadgetEnabledAttributeTypeOk(arg UpdateUpdateSchedulePayloadgetEnabledAttributeType) (ret UpdateUpdateSchedulePayloadgetEnabledRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateUpdateSchedulePayloadgetEnabledAttributeType(arg *UpdateUpdateSchedulePayloadgetEnabledAttributeType, val UpdateUpdateSchedulePayloadgetEnabledRetType) { + *arg = &val +} + +/* + types and functions for maintenanceWindow +*/ + +// isInteger +type UpdateUpdateSchedulePayloadGetMaintenanceWindowAttributeType = *int64 +type UpdateUpdateSchedulePayloadGetMaintenanceWindowArgType = int64 +type UpdateUpdateSchedulePayloadGetMaintenanceWindowRetType = int64 + +func getUpdateUpdateSchedulePayloadGetMaintenanceWindowAttributeTypeOk(arg UpdateUpdateSchedulePayloadGetMaintenanceWindowAttributeType) (ret UpdateUpdateSchedulePayloadGetMaintenanceWindowRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateUpdateSchedulePayloadGetMaintenanceWindowAttributeType(arg *UpdateUpdateSchedulePayloadGetMaintenanceWindowAttributeType, val UpdateUpdateSchedulePayloadGetMaintenanceWindowRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type UpdateUpdateSchedulePayloadGetNameAttributeType = *string + +func getUpdateUpdateSchedulePayloadGetNameAttributeTypeOk(arg UpdateUpdateSchedulePayloadGetNameAttributeType) (ret UpdateUpdateSchedulePayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateUpdateSchedulePayloadGetNameAttributeType(arg *UpdateUpdateSchedulePayloadGetNameAttributeType, val UpdateUpdateSchedulePayloadGetNameRetType) { + *arg = &val +} + +type UpdateUpdateSchedulePayloadGetNameArgType = string +type UpdateUpdateSchedulePayloadGetNameRetType = string + +/* + types and functions for rrule +*/ + +// isNotNullableString +type UpdateUpdateSchedulePayloadGetRruleAttributeType = *string + +func getUpdateUpdateSchedulePayloadGetRruleAttributeTypeOk(arg UpdateUpdateSchedulePayloadGetRruleAttributeType) (ret UpdateUpdateSchedulePayloadGetRruleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateUpdateSchedulePayloadGetRruleAttributeType(arg *UpdateUpdateSchedulePayloadGetRruleAttributeType, val UpdateUpdateSchedulePayloadGetRruleRetType) { + *arg = &val +} + +type UpdateUpdateSchedulePayloadGetRruleArgType = string +type UpdateUpdateSchedulePayloadGetRruleRetType = string + // UpdateUpdateSchedulePayload struct for UpdateUpdateSchedulePayload type UpdateUpdateSchedulePayload struct { // REQUIRED - Enabled *bool `json:"enabled"` + Enabled UpdateUpdateSchedulePayloadgetEnabledAttributeType `json:"enabled"` // Can be cast to int32 without loss of precision. // REQUIRED - MaintenanceWindow *int64 `json:"maintenanceWindow"` + MaintenanceWindow UpdateUpdateSchedulePayloadGetMaintenanceWindowAttributeType `json:"maintenanceWindow"` // REQUIRED - Name *string `json:"name"` + Name UpdateUpdateSchedulePayloadGetNameAttributeType `json:"name"` // REQUIRED - Rrule *string `json:"rrule"` + Rrule UpdateUpdateSchedulePayloadGetRruleAttributeType `json:"rrule"` } type _UpdateUpdateSchedulePayload UpdateUpdateSchedulePayload @@ -36,12 +118,12 @@ type _UpdateUpdateSchedulePayload UpdateUpdateSchedulePayload // 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 NewUpdateUpdateSchedulePayload(enabled *bool, maintenanceWindow *int64, name *string, rrule *string) *UpdateUpdateSchedulePayload { +func NewUpdateUpdateSchedulePayload(enabled UpdateUpdateSchedulePayloadgetEnabledArgType, maintenanceWindow UpdateUpdateSchedulePayloadGetMaintenanceWindowArgType, name UpdateUpdateSchedulePayloadGetNameArgType, rrule UpdateUpdateSchedulePayloadGetRruleArgType) *UpdateUpdateSchedulePayload { this := UpdateUpdateSchedulePayload{} - this.Enabled = enabled - this.MaintenanceWindow = maintenanceWindow - this.Name = name - this.Rrule = rrule + setUpdateUpdateSchedulePayloadgetEnabledAttributeType(&this.Enabled, enabled) + setUpdateUpdateSchedulePayloadGetMaintenanceWindowAttributeType(&this.MaintenanceWindow, maintenanceWindow) + setUpdateUpdateSchedulePayloadGetNameAttributeType(&this.Name, name) + setUpdateUpdateSchedulePayloadGetRruleAttributeType(&this.Rrule, rrule) return &this } @@ -54,107 +136,87 @@ func NewUpdateUpdateSchedulePayloadWithDefaults() *UpdateUpdateSchedulePayload { } // GetEnabled returns the Enabled field value -func (o *UpdateUpdateSchedulePayload) GetEnabled() *bool { - if o == nil || IsNil(o.Enabled) { - var ret *bool - return ret - } - - return o.Enabled +func (o *UpdateUpdateSchedulePayload) GetEnabled() (ret UpdateUpdateSchedulePayloadgetEnabledRetType) { + ret, _ = o.GetEnabledOk() + return ret } // GetEnabledOk returns a tuple with the Enabled field value // and a boolean to check if the value has been set. -func (o *UpdateUpdateSchedulePayload) GetEnabledOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.Enabled, true +func (o *UpdateUpdateSchedulePayload) GetEnabledOk() (ret UpdateUpdateSchedulePayloadgetEnabledRetType, ok bool) { + return getUpdateUpdateSchedulePayloadgetEnabledAttributeTypeOk(o.Enabled) } // SetEnabled sets field value -func (o *UpdateUpdateSchedulePayload) SetEnabled(v *bool) { - o.Enabled = v +func (o *UpdateUpdateSchedulePayload) SetEnabled(v UpdateUpdateSchedulePayloadgetEnabledRetType) { + setUpdateUpdateSchedulePayloadgetEnabledAttributeType(&o.Enabled, v) } // GetMaintenanceWindow returns the MaintenanceWindow field value -func (o *UpdateUpdateSchedulePayload) GetMaintenanceWindow() *int64 { - if o == nil || IsNil(o.MaintenanceWindow) { - var ret *int64 - return ret - } - - return o.MaintenanceWindow +func (o *UpdateUpdateSchedulePayload) GetMaintenanceWindow() (ret UpdateUpdateSchedulePayloadGetMaintenanceWindowRetType) { + ret, _ = o.GetMaintenanceWindowOk() + return ret } // GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value // and a boolean to check if the value has been set. -func (o *UpdateUpdateSchedulePayload) GetMaintenanceWindowOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.MaintenanceWindow, true +func (o *UpdateUpdateSchedulePayload) GetMaintenanceWindowOk() (ret UpdateUpdateSchedulePayloadGetMaintenanceWindowRetType, ok bool) { + return getUpdateUpdateSchedulePayloadGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow) } // SetMaintenanceWindow sets field value -func (o *UpdateUpdateSchedulePayload) SetMaintenanceWindow(v *int64) { - o.MaintenanceWindow = v +func (o *UpdateUpdateSchedulePayload) SetMaintenanceWindow(v UpdateUpdateSchedulePayloadGetMaintenanceWindowRetType) { + setUpdateUpdateSchedulePayloadGetMaintenanceWindowAttributeType(&o.MaintenanceWindow, v) } // GetName returns the Name field value -func (o *UpdateUpdateSchedulePayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *UpdateUpdateSchedulePayload) GetName() (ret UpdateUpdateSchedulePayloadGetNameRetType) { + ret, _ = o.GetNameOk() + return ret } // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. -func (o *UpdateUpdateSchedulePayload) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *UpdateUpdateSchedulePayload) GetNameOk() (ret UpdateUpdateSchedulePayloadGetNameRetType, ok bool) { + return getUpdateUpdateSchedulePayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *UpdateUpdateSchedulePayload) SetName(v *string) { - o.Name = v +func (o *UpdateUpdateSchedulePayload) SetName(v UpdateUpdateSchedulePayloadGetNameRetType) { + setUpdateUpdateSchedulePayloadGetNameAttributeType(&o.Name, v) } // GetRrule returns the Rrule field value -func (o *UpdateUpdateSchedulePayload) GetRrule() *string { - if o == nil || IsNil(o.Rrule) { - var ret *string - return ret - } - - return o.Rrule +func (o *UpdateUpdateSchedulePayload) GetRrule() (ret UpdateUpdateSchedulePayloadGetRruleRetType) { + ret, _ = o.GetRruleOk() + return ret } // GetRruleOk returns a tuple with the Rrule field value // and a boolean to check if the value has been set. -func (o *UpdateUpdateSchedulePayload) GetRruleOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Rrule, true +func (o *UpdateUpdateSchedulePayload) GetRruleOk() (ret UpdateUpdateSchedulePayloadGetRruleRetType, ok bool) { + return getUpdateUpdateSchedulePayloadGetRruleAttributeTypeOk(o.Rrule) } // SetRrule sets field value -func (o *UpdateUpdateSchedulePayload) SetRrule(v *string) { - o.Rrule = v +func (o *UpdateUpdateSchedulePayload) SetRrule(v UpdateUpdateSchedulePayloadGetRruleRetType) { + setUpdateUpdateSchedulePayloadGetRruleAttributeType(&o.Rrule, v) } func (o UpdateUpdateSchedulePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["enabled"] = o.Enabled - toSerialize["maintenanceWindow"] = o.MaintenanceWindow - toSerialize["name"] = o.Name - toSerialize["rrule"] = o.Rrule + if val, ok := getUpdateUpdateSchedulePayloadgetEnabledAttributeTypeOk(o.Enabled); ok { + toSerialize["Enabled"] = val + } + if val, ok := getUpdateUpdateSchedulePayloadGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow); ok { + toSerialize["MaintenanceWindow"] = val + } + if val, ok := getUpdateUpdateSchedulePayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getUpdateUpdateSchedulePayloadGetRruleAttributeTypeOk(o.Rrule); ok { + toSerialize["Rrule"] = val + } return toSerialize, nil } diff --git a/services/serverupdate/utils.go b/services/serverupdate/utils.go index eb0b64019..2eaf4b82d 100644 --- a/services/serverupdate/utils.go +++ b/services/serverupdate/utils.go @@ -3,7 +3,7 @@ STACKIT Server Update Management API API endpoints for Server Update Operations on STACKIT Servers. -API version: 1.0 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -40,6 +40,29 @@ func PtrString(v string) *string { return &v } // PtrTime is helper routine that returns a pointer to given Time value. func PtrTime(v time.Time) *time.Time { return &v } +type NullableValue[T any] struct { + value *T + isSet bool +} + +func (v NullableValue[T]) Get() *T { + return v.value +} + +func (v *NullableValue[T]) Set(val *T) { + v.value = val + v.isSet = true +} + +func (v NullableValue[T]) IsSet() bool { + return v.isSet +} + +func (v *NullableValue[T]) Unset() { + v.value = nil + v.isSet = false +} + type NullableBool struct { value *bool isSet bool @@ -333,6 +356,9 @@ func IsNil(i interface{}) bool { if i == nil { return true } + if t, ok := i.(interface{ IsSet() bool }); ok { + return !t.IsSet() + } switch reflect.TypeOf(i).Kind() { case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: return reflect.ValueOf(i).IsNil() From 784b9f634fe682c76404a54a4772bc03dec96ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Schmitz?= <152157960+bahkauv70@users.noreply.github.com> Date: Mon, 17 Mar 2025 09:21:55 +0100 Subject: [PATCH 2/2] chore: updated changelog --- CHANGELOG.md | 4 ++++ services/serverupdate/CHANGELOG.md | 3 +++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 764e3c089..1a1916f4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## Release (2025-03-19) + - `serverupdate`: [v1.0.0](services/serverupdate/CHANGELOG.md#v100-2025-03-19) + - **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. + ## Release (2025-03-14) - `certificates`: [v1.0.0](services/certificates/CHANGELOG.md#v100-2025-03-14) - **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. diff --git a/services/serverupdate/CHANGELOG.md b/services/serverupdate/CHANGELOG.md index ffb5cd0a5..70c158e55 100644 --- a/services/serverupdate/CHANGELOG.md +++ b/services/serverupdate/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.0.0 (2025-03-19) + - **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. + ## v0.5.0 (2025-02-21) - **New:** Minimal go version is now Go 1.21