From 683a7cf0a35eff100ac24a2b76e9917ea226c1f4 Mon Sep 17 00:00:00 2001 From: stackit-pipeline <142982727+stackit-pipeline@users.noreply.github.com> Date: Fri, 18 Oct 2024 10:51:50 +0200 Subject: [PATCH] Generate iaasalpha (#935) --- services/iaasalpha/api_default.go | 983 +++--------------- services/iaasalpha/api_default_test.go | 211 +--- .../model_base_security_group_rule.go | 409 ++++++++ services/iaasalpha/model_create_protocol.go | 145 +++ ...odel_create_security_group_rule_payload.go | 80 +- ...del_create_security_group_rule_protocol.go | 116 +++ .../model_create_server_group_payload.go | 214 ---- .../iaasalpha/model_create_server_payload.go | 74 +- services/iaasalpha/model_network.go | 28 +- services/iaasalpha/model_protocol.go | 154 +++ .../model_public_ip_list_response.go | 2 +- ...lic_network.go => model_public_network.go} | 50 +- .../model_public_network_list_response.go | 12 +- .../iaasalpha/model_security_group_rule.go | 78 +- .../model_security_group_rule_protocol.go | 116 +++ services/iaasalpha/model_server.go | 74 +- services/iaasalpha/model_server_group.go | 214 ---- .../model_server_group_list_response.go | 111 -- .../iaasalpha/model_v1_network_gateway.go | 80 -- .../model_v1_security_group_rule_protocol.go | 154 --- ...odel_v1_volume_attachment_list_response.go | 111 -- .../model_volume_attachment_list_response.go | 111 ++ 22 files changed, 1372 insertions(+), 2155 deletions(-) create mode 100644 services/iaasalpha/model_base_security_group_rule.go create mode 100644 services/iaasalpha/model_create_protocol.go create mode 100644 services/iaasalpha/model_create_security_group_rule_protocol.go delete mode 100644 services/iaasalpha/model_create_server_group_payload.go create mode 100644 services/iaasalpha/model_protocol.go rename services/iaasalpha/{model_v1_public_network.go => model_public_network.go} (51%) create mode 100644 services/iaasalpha/model_security_group_rule_protocol.go delete mode 100644 services/iaasalpha/model_server_group.go delete mode 100644 services/iaasalpha/model_server_group_list_response.go delete mode 100644 services/iaasalpha/model_v1_network_gateway.go delete mode 100644 services/iaasalpha/model_v1_security_group_rule_protocol.go delete mode 100644 services/iaasalpha/model_v1_volume_attachment_list_response.go create mode 100644 services/iaasalpha/model_volume_attachment_list_response.go diff --git a/services/iaasalpha/api_default.go b/services/iaasalpha/api_default.go index dd3cd4cc..dd52be3f 100644 --- a/services/iaasalpha/api_default.go +++ b/services/iaasalpha/api_default.go @@ -1658,7 +1658,7 @@ type ApiCreatePublicIPRequest struct { createPublicIPPayload *CreatePublicIPPayload } -// Request a public ip creation. +// Request a public IP creation. func (r ApiCreatePublicIPRequest) CreatePublicIPPayload(createPublicIPPayload CreatePublicIPPayload) ApiCreatePublicIPRequest { r.createPublicIPPayload = &createPublicIPPayload @@ -1827,9 +1827,9 @@ func (r ApiCreatePublicIPRequest) Execute() (*PublicIp, error) { } /* -CreatePublicIP: Create new public ip. +CreatePublicIP: Create new public IP. -Create a new public ip in a project. +Create a new public IP in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -2433,196 +2433,6 @@ func (a *APIClient) CreateServerExecute(ctx context.Context, projectId string) ( return r.Execute() } -type ApiCreateServerGroupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createServerGroupPayload *CreateServerGroupPayload -} - -// Request a server group creation. - -func (r ApiCreateServerGroupRequest) CreateServerGroupPayload(createServerGroupPayload CreateServerGroupPayload) ApiCreateServerGroupRequest { - r.createServerGroupPayload = &createServerGroupPayload - return r -} - -func (r ApiCreateServerGroupRequest) Execute() (*ServerGroup, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ServerGroup - ) - a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateServerGroup") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/server-groups" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") - } - if r.createServerGroupPayload == nil { - return localVarReturnValue, fmt.Errorf("createServerGroupPayload is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.createServerGroupPayload - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - } - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -/* -CreateServerGroup: Create a new server group in a project. - -Create a new server server group in the given project ID. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @return ApiCreateServerGroupRequest -*/ -func (a *APIClient) CreateServerGroup(ctx context.Context, projectId string) ApiCreateServerGroupRequest { - return ApiCreateServerGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) CreateServerGroupExecute(ctx context.Context, projectId string) (*ServerGroup, error) { - r := ApiCreateServerGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - type ApiCreateVolumeRequest struct { ctx context.Context apiService *DefaultApiService @@ -3501,9 +3311,9 @@ func (r ApiDeletePublicIPRequest) Execute() error { } /* -DeletePublicIP: Delete a public ip. +DeletePublicIP: Delete a public IP. -Delete a public ip that is part of the project. +Delete a public IP that is part of the project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -3894,216 +3704,39 @@ func (a *APIClient) DeleteSecurityGroupRule(ctx context.Context, projectId strin } } -func (a *APIClient) DeleteSecurityGroupRuleExecute(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) error { - r := ApiDeleteSecurityGroupRuleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, - securityGroupRuleId: securityGroupRuleId, - } - return r.Execute() -} - -type ApiDeleteServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string -} - -func (r ApiDeleteServerRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteServer") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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{} - if strlen(r.projectId) < 36 { - return fmt.Errorf("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return fmt.Errorf("projectId must have less than 36 elements") - } - if strlen(r.serverId) < 36 { - return fmt.Errorf("serverId must have at least 36 elements") - } - if strlen(r.serverId) > 36 { - return fmt.Errorf("serverId must have less than 36 elements") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - } - return newErr - } - - return nil -} - -/* -DeleteServer: Delete a server. - -Delete a server. Volumes won't be deleted. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param serverId The identifier (ID) of a STACKIT Server. - @return ApiDeleteServerRequest -*/ -func (a *APIClient) DeleteServer(ctx context.Context, projectId string, serverId string) ApiDeleteServerRequest { - return ApiDeleteServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } -} - -func (a *APIClient) DeleteServerExecute(ctx context.Context, projectId string, serverId string) error { - r := ApiDeleteServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, +func (a *APIClient) DeleteSecurityGroupRuleExecute(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) error { + r := ApiDeleteSecurityGroupRuleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, } return r.Execute() } -type ApiDeleteServerGroupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverGroupId string +type ApiDeleteServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string } -func (r ApiDeleteServerGroupRequest) Execute() error { +func (r ApiDeleteServerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteServerGroup") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteServer") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/server-groups/{serverGroupId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverGroupId"+"}", url.PathEscape(ParameterValueToString(r.serverGroupId, "serverGroupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -4114,11 +3747,11 @@ func (r ApiDeleteServerGroupRequest) Execute() error { if strlen(r.projectId) > 36 { return fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.serverGroupId) < 36 { - return fmt.Errorf("serverGroupId must have at least 36 elements") + if strlen(r.serverId) < 36 { + return fmt.Errorf("serverId must have at least 36 elements") } - if strlen(r.serverGroupId) > 36 { - return fmt.Errorf("serverGroupId must have less than 36 elements") + if strlen(r.serverId) > 36 { + return fmt.Errorf("serverId must have less than 36 elements") } // to determine the Content-Type header @@ -4231,30 +3864,30 @@ func (r ApiDeleteServerGroupRequest) Execute() error { } /* -DeleteServerGroup: Delete a server group in a project. +DeleteServer: Delete a server. -Delete a server group in the given project. +Delete a server. Volumes won't be deleted. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param serverGroupId The identifier (ID) of a STACKIT Server Group. - @return ApiDeleteServerGroupRequest + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiDeleteServerRequest */ -func (a *APIClient) DeleteServerGroup(ctx context.Context, projectId string, serverGroupId string) ApiDeleteServerGroupRequest { - return ApiDeleteServerGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverGroupId: serverGroupId, +func (a *APIClient) DeleteServer(ctx context.Context, projectId string, serverId string) ApiDeleteServerRequest { + return ApiDeleteServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, } } -func (a *APIClient) DeleteServerGroupExecute(ctx context.Context, projectId string, serverGroupId string) error { - r := ApiDeleteServerGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverGroupId: serverGroupId, +func (a *APIClient) DeleteServerExecute(ctx context.Context, projectId string, serverId string) error { + r := ApiDeleteServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, } return r.Execute() } @@ -6108,9 +5741,9 @@ func (r ApiGetPublicIPRequest) Execute() (*PublicIp, error) { } /* -GetPublicIP: Get details about a public ip. +GetPublicIP: Get details about a public IP. -Get details about a public ip inside a project. +Get details about a public IP inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -6507,242 +6140,51 @@ func (a *APIClient) GetSecurityGroupRule(ctx context.Context, projectId string, apiService: a.defaultApi, ctx: ctx, projectId: projectId, - securityGroupId: securityGroupId, - securityGroupRuleId: securityGroupRuleId, - } -} - -func (a *APIClient) GetSecurityGroupRuleExecute(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) (*SecurityGroupRule, error) { - r := ApiGetSecurityGroupRuleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, - securityGroupRuleId: securityGroupRuleId, - } - return r.Execute() -} - -type ApiGetServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - details *bool -} - -// Show detailed information about server. - -func (r ApiGetServerRequest) Details(details bool) ApiGetServerRequest { - r.details = &details - return r -} - -func (r ApiGetServerRequest) Execute() (*Server, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Server - ) - a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServer") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/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{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") - } - if strlen(r.serverId) < 36 { - return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") - } - if strlen(r.serverId) > 36 { - return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") - } - - if r.details != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "details", r.details, "") - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - } - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -/* -GetServer: Get server details. - -Get details about a server by its ID. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param serverId The identifier (ID) of a STACKIT Server. - @return ApiGetServerRequest -*/ -func (a *APIClient) GetServer(ctx context.Context, projectId string, serverId string) ApiGetServerRequest { - return ApiGetServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - } -} - -func (a *APIClient) GetServerExecute(ctx context.Context, projectId string, serverId string) (*Server, error) { - r := ApiGetServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, + } +} + +func (a *APIClient) GetSecurityGroupRuleExecute(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) (*SecurityGroupRule, error) { + r := ApiGetSecurityGroupRuleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, } return r.Execute() } -type ApiGetServerConsoleRequest struct { +type ApiGetServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string serverId string + details *bool } -func (r ApiGetServerConsoleRequest) Execute() (*ServerConsoleUrl, error) { +// Show detailed information about server. + +func (r ApiGetServerRequest) Details(details bool) ApiGetServerRequest { + r.details = &details + return r +} + +func (r ApiGetServerRequest) Execute() (*Server, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ServerConsoleUrl + localVarReturnValue *Server ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServerConsole") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServer") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/console" + localVarPath := localBasePath + "/v1alpha1/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) @@ -6762,6 +6204,9 @@ func (r ApiGetServerConsoleRequest) Execute() (*ServerConsoleUrl, error) { return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") } + if r.details != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "details", r.details, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -6882,17 +6327,17 @@ func (r ApiGetServerConsoleRequest) Execute() (*ServerConsoleUrl, error) { } /* -GetServerConsole: Get server console. +GetServer: Get server details. -Get a URL for server remote console. +Get details about a server by its ID. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @param serverId The identifier (ID) of a STACKIT Server. - @return ApiGetServerConsoleRequest + @return ApiGetServerRequest */ -func (a *APIClient) GetServerConsole(ctx context.Context, projectId string, serverId string) ApiGetServerConsoleRequest { - return ApiGetServerConsoleRequest{ +func (a *APIClient) GetServer(ctx context.Context, projectId string, serverId string) ApiGetServerRequest { + return ApiGetServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -6900,8 +6345,8 @@ func (a *APIClient) GetServerConsole(ctx context.Context, projectId string, serv } } -func (a *APIClient) GetServerConsoleExecute(ctx context.Context, projectId string, serverId string) (*ServerConsoleUrl, error) { - r := ApiGetServerConsoleRequest{ +func (a *APIClient) GetServerExecute(ctx context.Context, projectId string, serverId string) (*Server, error) { + r := ApiGetServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -6910,29 +6355,29 @@ func (a *APIClient) GetServerConsoleExecute(ctx context.Context, projectId strin return r.Execute() } -type ApiGetServerGroupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverGroupId string +type ApiGetServerConsoleRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string } -func (r ApiGetServerGroupRequest) Execute() (*ServerGroup, error) { +func (r ApiGetServerConsoleRequest) Execute() (*ServerConsoleUrl, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ServerGroup + localVarReturnValue *ServerConsoleUrl ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServerGroup") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServerConsole") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/server-groups/{serverGroupId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/console" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverGroupId"+"}", url.PathEscape(ParameterValueToString(r.serverGroupId, "serverGroupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -6943,11 +6388,11 @@ func (r ApiGetServerGroupRequest) Execute() (*ServerGroup, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.serverGroupId) < 36 { - return localVarReturnValue, fmt.Errorf("serverGroupId must have at least 36 elements") + if strlen(r.serverId) < 36 { + return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") } - if strlen(r.serverGroupId) > 36 { - return localVarReturnValue, fmt.Errorf("serverGroupId must have less than 36 elements") + if strlen(r.serverId) > 36 { + return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") } // to determine the Content-Type header @@ -7070,30 +6515,30 @@ func (r ApiGetServerGroupRequest) Execute() (*ServerGroup, error) { } /* -GetServerGroup: Get the server group. +GetServerConsole: Get server console. -Get the server group created in a project. +Get a URL for server remote console. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param serverGroupId The identifier (ID) of a STACKIT Server Group. - @return ApiGetServerGroupRequest + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerConsoleRequest */ -func (a *APIClient) GetServerGroup(ctx context.Context, projectId string, serverGroupId string) ApiGetServerGroupRequest { - return ApiGetServerGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverGroupId: serverGroupId, +func (a *APIClient) GetServerConsole(ctx context.Context, projectId string, serverId string) ApiGetServerConsoleRequest { + return ApiGetServerConsoleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, } } -func (a *APIClient) GetServerGroupExecute(ctx context.Context, projectId string, serverGroupId string) (*ServerGroup, error) { - r := ApiGetServerGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverGroupId: serverGroupId, +func (a *APIClient) GetServerConsoleExecute(ctx context.Context, projectId string, serverId string) (*ServerConsoleUrl, error) { + r := ApiGetServerConsoleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, } return r.Execute() } @@ -7676,12 +7121,12 @@ type ApiListAttachedVolumesRequest struct { serverId string } -func (r ApiListAttachedVolumesRequest) Execute() (*V1VolumeAttachmentListResponse, error) { +func (r ApiListAttachedVolumesRequest) Execute() (*VolumeAttachmentListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *V1VolumeAttachmentListResponse + localVarReturnValue *VolumeAttachmentListResponse ) a := r.apiService localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAttachedVolumes") @@ -7847,7 +7292,7 @@ func (a *APIClient) ListAttachedVolumes(ctx context.Context, projectId string, s } } -func (a *APIClient) ListAttachedVolumesExecute(ctx context.Context, projectId string, serverId string) (*V1VolumeAttachmentListResponse, error) { +func (a *APIClient) ListAttachedVolumesExecute(ctx context.Context, projectId string, serverId string) (*VolumeAttachmentListResponse, error) { r := ApiListAttachedVolumesRequest{ apiService: a.defaultApi, ctx: ctx, @@ -8941,9 +8386,9 @@ func (r ApiListPublicIPRangesRequest) Execute() (*PublicNetworkListResponse, err } /* -ListPublicIPRanges: List all public ip ranges. +ListPublicIPRanges: List all public IP ranges. -Get a list of all public ip ranges that STACKIT uses. +Get a list of all public IP ranges that STACKIT uses. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiListPublicIPRangesRequest @@ -9126,9 +8571,9 @@ func (r ApiListPublicIPsRequest) Execute() (*PublicIpListResponse, error) { } /* -ListPublicIPs: List all public ips inside a project. +ListPublicIPs: List all public IPs inside a project. -Get a list of all public ips inside a project. +Get a list of all public IPs inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -9527,194 +8972,6 @@ func (a *APIClient) ListSecurityGroupsExecute(ctx context.Context, projectId str return r.Execute() } -type ApiListServerGroupsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string -} - -func (r ApiListServerGroupsRequest) Execute() (*ServerGroupListResponse, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ServerGroupListResponse - ) - a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListServerGroups") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/server-groups" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := a.client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 409 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - } - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr - } - - return localVarReturnValue, nil -} - -/* -ListServerGroups: Get the server groups setup for a project. - -Get the server groups created in a project. Server groups are an indication of locality of a server relative to another group of servers. They can be either running on the same host (affinity) or on different ones (anti-affinity). - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @return ApiListServerGroupsRequest -*/ -func (a *APIClient) ListServerGroups(ctx context.Context, projectId string) ApiListServerGroupsRequest { - return ApiListServerGroupsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } -} - -func (a *APIClient) ListServerGroupsExecute(ctx context.Context, projectId string) (*ServerGroupListResponse, error) { - r := ApiListServerGroupsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - } - return r.Execute() -} - type ApiListServerNICsRequest struct { ctx context.Context apiService *DefaultApiService @@ -13218,7 +12475,7 @@ type ApiUpdateAttachedVolumeRequest struct { updateAttachedVolumePayload *UpdateAttachedVolumePayload } -// Request a volume attachment Update. +// Request a volume attachment update. func (r ApiUpdateAttachedVolumeRequest) UpdateAttachedVolumePayload(updateAttachedVolumePayload UpdateAttachedVolumePayload) ApiUpdateAttachedVolumeRequest { r.updateAttachedVolumePayload = &updateAttachedVolumePayload @@ -13617,7 +12874,7 @@ type ApiUpdateNICRequest struct { updateNICPayload *UpdateNICPayload } -// Request an Update of a network interface. +// Request an update of a network interface. func (r ApiUpdateNICRequest) UpdateNICPayload(updateNICPayload UpdateNICPayload) ApiUpdateNICRequest { r.updateNICPayload = &updateNICPayload @@ -13839,7 +13096,7 @@ type ApiUpdatePublicIPRequest struct { updatePublicIPPayload *UpdatePublicIPPayload } -// Request an Update of a public IP. +// Request an update of a public IP. func (r ApiUpdatePublicIPRequest) UpdatePublicIPPayload(updatePublicIPPayload UpdatePublicIPPayload) ApiUpdatePublicIPRequest { r.updatePublicIPPayload = &updatePublicIPPayload @@ -14004,9 +13261,9 @@ func (r ApiUpdatePublicIPRequest) Execute() (*PublicIp, error) { } /* -UpdatePublicIP: Update a public ip. +UpdatePublicIP: Update a public IP. -Update the properties of an existing public ip inside a project. +Update the properties of an existing public IP inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. diff --git a/services/iaasalpha/api_default_test.go b/services/iaasalpha/api_default_test.go index 79045d6a..fd2df0bf 100644 --- a/services/iaasalpha/api_default_test.go +++ b/services/iaasalpha/api_default_test.go @@ -668,59 +668,6 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService CreateServerGroup", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/server-groups" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := ServerGroup{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - 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 iaasalpha_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" - createServerGroupPayload := CreateServerGroupPayload{} - - resp, reqErr := apiClient.CreateServerGroup(context.Background(), projectId).CreateServerGroupPayload(createServerGroupPayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if resp == nil { - t.Fatalf("response not present") - } - }) - t.Run("Test DefaultApiService CreateVolume", func(t *testing.T) { path := "/v1alpha1/projects/{projectId}/volumes" projectIdValue := "projectId" @@ -1120,55 +1067,6 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService DeleteServerGroup", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/server-groups/{serverGroupId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverGroupIdValue := "serverGroupId" - path = strings.Replace(path, "{"+"serverGroupId"+"}", url.PathEscape(ParameterValueToString(serverGroupIdValue, "serverGroupId")), -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 iaasalpha_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" - serverGroupId := "serverGroupId" - - reqErr := apiClient.DeleteServerGroup(context.Background(), projectId, serverGroupId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - t.Run("Test DefaultApiService DeleteVolume", func(t *testing.T) { path := "/v1alpha1/projects/{projectId}/volumes/{volumeId}" projectIdValue := "projectId" @@ -1936,61 +1834,6 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetServerGroup", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/server-groups/{serverGroupId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverGroupIdValue := "serverGroupId" - path = strings.Replace(path, "{"+"serverGroupId"+"}", url.PathEscape(ParameterValueToString(serverGroupIdValue, "serverGroupId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := ServerGroup{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - 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 iaasalpha_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" - serverGroupId := "serverGroupId" - - resp, reqErr := apiClient.GetServerGroup(context.Background(), projectId, serverGroupId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if resp == nil { - t.Fatalf("response not present") - } - }) - t.Run("Test DefaultApiService GetServerLog", func(t *testing.T) { path := "/v1alpha1/projects/{projectId}/servers/{serverId}/log" projectIdValue := "projectId" @@ -2165,7 +2008,7 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := V1VolumeAttachmentListResponse{} + data := VolumeAttachmentListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -2680,58 +2523,6 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListServerGroups", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/server-groups" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := ServerGroupListResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - 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 iaasalpha_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" - - resp, reqErr := apiClient.ListServerGroups(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if resp == nil { - t.Fatalf("response not present") - } - }) - t.Run("Test DefaultApiService ListServerNICs", func(t *testing.T) { path := "/v1alpha1/projects/{projectId}/servers/{serverId}/nics" projectIdValue := "projectId" diff --git a/services/iaasalpha/model_base_security_group_rule.go b/services/iaasalpha/model_base_security_group_rule.go new file mode 100644 index 00000000..a43f1fef --- /dev/null +++ b/services/iaasalpha/model_base_security_group_rule.go @@ -0,0 +1,409 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +import ( + "encoding/json" +) + +// checks if the BaseSecurityGroupRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BaseSecurityGroupRule{} + +// BaseSecurityGroupRule The base schema for a security group rule. +type BaseSecurityGroupRule struct { + // Description Object. Allows string up to 127 Characters. + Description *string `json:"description,omitempty"` + // The direction of the traffic which the rule should match. + // REQUIRED + Direction *string `json:"direction"` + // The ethertype which the rule should match. + Ethertype *string `json:"ethertype,omitempty"` + IcmpParameters *ICMPParameters `json:"icmpParameters,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty"` + // Classless Inter-Domain Routing (CIDR). + IpRange *string `json:"ipRange,omitempty"` + PortRange *PortRange `json:"portRange,omitempty"` + // Universally Unique Identifier (UUID). + RemoteSecurityGroupId *string `json:"remoteSecurityGroupId,omitempty"` + // Universally Unique Identifier (UUID). + SecurityGroupId *string `json:"securityGroupId,omitempty"` +} + +type _BaseSecurityGroupRule BaseSecurityGroupRule + +// NewBaseSecurityGroupRule instantiates a new BaseSecurityGroupRule 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 NewBaseSecurityGroupRule(direction *string) *BaseSecurityGroupRule { + this := BaseSecurityGroupRule{} + this.Direction = direction + var ethertype string = "IPv4" + this.Ethertype = ðertype + return &this +} + +// NewBaseSecurityGroupRuleWithDefaults instantiates a new BaseSecurityGroupRule 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 NewBaseSecurityGroupRuleWithDefaults() *BaseSecurityGroupRule { + this := BaseSecurityGroupRule{} + var ethertype string = "IPv4" + this.Ethertype = ðertype + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetDescription() *string { + if o == nil || IsNil(o.Description) { + var ret *string + return ret + } + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *BaseSecurityGroupRule) SetDescription(v *string) { + o.Description = v +} + +// GetDirection returns the Direction field value +func (o *BaseSecurityGroupRule) GetDirection() *string { + if o == nil { + var ret *string + return ret + } + + return o.Direction +} + +// GetDirectionOk returns a tuple with the Direction field value +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetDirectionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Direction, true +} + +// SetDirection sets field value +func (o *BaseSecurityGroupRule) SetDirection(v *string) { + o.Direction = v +} + +// GetEthertype returns the Ethertype field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetEthertype() *string { + if o == nil || IsNil(o.Ethertype) { + var ret *string + return ret + } + return o.Ethertype +} + +// GetEthertypeOk returns a tuple with the Ethertype field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetEthertypeOk() (*string, bool) { + if o == nil || IsNil(o.Ethertype) { + return nil, false + } + return o.Ethertype, true +} + +// HasEthertype returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasEthertype() bool { + if o != nil && !IsNil(o.Ethertype) { + return true + } + + return false +} + +// SetEthertype gets a reference to the given string and assigns it to the Ethertype field. +func (o *BaseSecurityGroupRule) SetEthertype(v *string) { + o.Ethertype = v +} + +// GetIcmpParameters returns the IcmpParameters field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetIcmpParameters() *ICMPParameters { + if o == nil || IsNil(o.IcmpParameters) { + var ret *ICMPParameters + return ret + } + return o.IcmpParameters +} + +// GetIcmpParametersOk returns a tuple with the IcmpParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetIcmpParametersOk() (*ICMPParameters, bool) { + if o == nil || IsNil(o.IcmpParameters) { + return nil, false + } + return o.IcmpParameters, true +} + +// HasIcmpParameters returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasIcmpParameters() bool { + if o != nil && !IsNil(o.IcmpParameters) { + return true + } + + return false +} + +// SetIcmpParameters gets a reference to the given ICMPParameters and assigns it to the IcmpParameters field. +func (o *BaseSecurityGroupRule) SetIcmpParameters(v *ICMPParameters) { + o.IcmpParameters = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetId() *string { + if o == nil || IsNil(o.Id) { + var ret *string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *BaseSecurityGroupRule) SetId(v *string) { + o.Id = v +} + +// GetIpRange returns the IpRange field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetIpRange() *string { + if o == nil || IsNil(o.IpRange) { + var ret *string + return ret + } + return o.IpRange +} + +// GetIpRangeOk returns a tuple with the IpRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetIpRangeOk() (*string, bool) { + if o == nil || IsNil(o.IpRange) { + return nil, false + } + return o.IpRange, true +} + +// HasIpRange returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasIpRange() bool { + if o != nil && !IsNil(o.IpRange) { + return true + } + + return false +} + +// SetIpRange gets a reference to the given string and assigns it to the IpRange field. +func (o *BaseSecurityGroupRule) SetIpRange(v *string) { + o.IpRange = v +} + +// GetPortRange returns the PortRange field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetPortRange() *PortRange { + if o == nil || IsNil(o.PortRange) { + var ret *PortRange + return ret + } + return o.PortRange +} + +// GetPortRangeOk returns a tuple with the PortRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetPortRangeOk() (*PortRange, bool) { + if o == nil || IsNil(o.PortRange) { + return nil, false + } + return o.PortRange, true +} + +// HasPortRange returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasPortRange() bool { + if o != nil && !IsNil(o.PortRange) { + return true + } + + return false +} + +// SetPortRange gets a reference to the given PortRange and assigns it to the PortRange field. +func (o *BaseSecurityGroupRule) SetPortRange(v *PortRange) { + o.PortRange = v +} + +// GetRemoteSecurityGroupId returns the RemoteSecurityGroupId field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetRemoteSecurityGroupId() *string { + if o == nil || IsNil(o.RemoteSecurityGroupId) { + var ret *string + return ret + } + return o.RemoteSecurityGroupId +} + +// GetRemoteSecurityGroupIdOk returns a tuple with the RemoteSecurityGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetRemoteSecurityGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.RemoteSecurityGroupId) { + return nil, false + } + return o.RemoteSecurityGroupId, true +} + +// HasRemoteSecurityGroupId returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasRemoteSecurityGroupId() bool { + if o != nil && !IsNil(o.RemoteSecurityGroupId) { + return true + } + + return false +} + +// SetRemoteSecurityGroupId gets a reference to the given string and assigns it to the RemoteSecurityGroupId field. +func (o *BaseSecurityGroupRule) SetRemoteSecurityGroupId(v *string) { + o.RemoteSecurityGroupId = v +} + +// GetSecurityGroupId returns the SecurityGroupId field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetSecurityGroupId() *string { + if o == nil || IsNil(o.SecurityGroupId) { + var ret *string + return ret + } + return o.SecurityGroupId +} + +// GetSecurityGroupIdOk returns a tuple with the SecurityGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetSecurityGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.SecurityGroupId) { + return nil, false + } + return o.SecurityGroupId, true +} + +// HasSecurityGroupId returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasSecurityGroupId() bool { + if o != nil && !IsNil(o.SecurityGroupId) { + return true + } + + return false +} + +// SetSecurityGroupId gets a reference to the given string and assigns it to the SecurityGroupId field. +func (o *BaseSecurityGroupRule) SetSecurityGroupId(v *string) { + o.SecurityGroupId = v +} + +func (o BaseSecurityGroupRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["direction"] = o.Direction + if !IsNil(o.Ethertype) { + toSerialize["ethertype"] = o.Ethertype + } + if !IsNil(o.IcmpParameters) { + toSerialize["icmpParameters"] = o.IcmpParameters + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.IpRange) { + toSerialize["ipRange"] = o.IpRange + } + if !IsNil(o.PortRange) { + toSerialize["portRange"] = o.PortRange + } + if !IsNil(o.RemoteSecurityGroupId) { + toSerialize["remoteSecurityGroupId"] = o.RemoteSecurityGroupId + } + if !IsNil(o.SecurityGroupId) { + toSerialize["securityGroupId"] = o.SecurityGroupId + } + return toSerialize, nil +} + +type NullableBaseSecurityGroupRule struct { + value *BaseSecurityGroupRule + isSet bool +} + +func (v NullableBaseSecurityGroupRule) Get() *BaseSecurityGroupRule { + return v.value +} + +func (v *NullableBaseSecurityGroupRule) Set(val *BaseSecurityGroupRule) { + v.value = val + v.isSet = true +} + +func (v NullableBaseSecurityGroupRule) IsSet() bool { + return v.isSet +} + +func (v *NullableBaseSecurityGroupRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBaseSecurityGroupRule(val *BaseSecurityGroupRule) *NullableBaseSecurityGroupRule { + return &NullableBaseSecurityGroupRule{value: val, isSet: true} +} + +func (v NullableBaseSecurityGroupRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBaseSecurityGroupRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_create_protocol.go b/services/iaasalpha/model_create_protocol.go new file mode 100644 index 00000000..4c2cb05d --- /dev/null +++ b/services/iaasalpha/model_create_protocol.go @@ -0,0 +1,145 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +import ( + "encoding/json" + "fmt" +) + +// CreateProtocol - The schema for a protocol when creating a security group rule. +type CreateProtocol struct { + Int64 *int64 + String *string +} + +// int64AsCreateProtocol is a convenience function that returns int64 wrapped in CreateProtocol +func Int64AsCreateProtocol(v *int64) CreateProtocol { + return CreateProtocol{ + Int64: v, + } +} + +// stringAsCreateProtocol is a convenience function that returns string wrapped in CreateProtocol +func StringAsCreateProtocol(v *string) CreateProtocol { + return CreateProtocol{ + String: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateProtocol) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Int64 + err = newStrictDecoder(data).Decode(&dst.Int64) + if err == nil { + jsonInt64, _ := json.Marshal(dst.Int64) + if string(jsonInt64) == "{}" { // empty struct + dst.Int64 = nil + } else { + match++ + } + } else { + dst.Int64 = nil + } + + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Int64 = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(CreateProtocol)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(CreateProtocol)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateProtocol) MarshalJSON() ([]byte, error) { + if src.Int64 != nil { + return json.Marshal(&src.Int64) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *CreateProtocol) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.Int64 != nil { + return obj.Int64 + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableCreateProtocol struct { + value *CreateProtocol + isSet bool +} + +func (v NullableCreateProtocol) Get() *CreateProtocol { + return v.value +} + +func (v *NullableCreateProtocol) Set(val *CreateProtocol) { + v.value = val + v.isSet = true +} + +func (v NullableCreateProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateProtocol(val *CreateProtocol) *NullableCreateProtocol { + return &NullableCreateProtocol{value: val, isSet: true} +} + +func (v NullableCreateProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_create_security_group_rule_payload.go b/services/iaasalpha/model_create_security_group_rule_payload.go index 17029e99..282fce37 100644 --- a/services/iaasalpha/model_create_security_group_rule_payload.go +++ b/services/iaasalpha/model_create_security_group_rule_payload.go @@ -17,7 +17,7 @@ import ( // checks if the CreateSecurityGroupRulePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateSecurityGroupRulePayload{} -// CreateSecurityGroupRulePayload Object that represents a security group rule. +// CreateSecurityGroupRulePayload Object that represents a request body for security group rule creation. type CreateSecurityGroupRulePayload struct { // Description Object. Allows string up to 127 Characters. Description *string `json:"description,omitempty"` @@ -30,13 +30,13 @@ type CreateSecurityGroupRulePayload struct { // Universally Unique Identifier (UUID). Id *string `json:"id,omitempty"` // Classless Inter-Domain Routing (CIDR). - IpRange *string `json:"ipRange,omitempty"` - PortRange *PortRange `json:"portRange,omitempty"` - Protocol *V1SecurityGroupRuleProtocol `json:"protocol,omitempty"` + IpRange *string `json:"ipRange,omitempty"` + PortRange *PortRange `json:"portRange,omitempty"` // Universally Unique Identifier (UUID). RemoteSecurityGroupId *string `json:"remoteSecurityGroupId,omitempty"` // Universally Unique Identifier (UUID). - SecurityGroupId *string `json:"securityGroupId,omitempty"` + SecurityGroupId *string `json:"securityGroupId,omitempty"` + Protocol *CreateProtocol `json:"protocol,omitempty"` } type _CreateSecurityGroupRulePayload CreateSecurityGroupRulePayload @@ -279,38 +279,6 @@ func (o *CreateSecurityGroupRulePayload) SetPortRange(v *PortRange) { o.PortRange = v } -// GetProtocol returns the Protocol field value if set, zero value otherwise. -func (o *CreateSecurityGroupRulePayload) GetProtocol() *V1SecurityGroupRuleProtocol { - if o == nil || IsNil(o.Protocol) { - var ret *V1SecurityGroupRuleProtocol - return ret - } - return o.Protocol -} - -// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateSecurityGroupRulePayload) GetProtocolOk() (*V1SecurityGroupRuleProtocol, bool) { - if o == nil || IsNil(o.Protocol) { - return nil, false - } - return o.Protocol, true -} - -// HasProtocol returns a boolean if a field has been set. -func (o *CreateSecurityGroupRulePayload) HasProtocol() bool { - if o != nil && !IsNil(o.Protocol) { - return true - } - - return false -} - -// SetProtocol gets a reference to the given V1SecurityGroupRuleProtocol and assigns it to the Protocol field. -func (o *CreateSecurityGroupRulePayload) SetProtocol(v *V1SecurityGroupRuleProtocol) { - o.Protocol = v -} - // GetRemoteSecurityGroupId returns the RemoteSecurityGroupId field value if set, zero value otherwise. func (o *CreateSecurityGroupRulePayload) GetRemoteSecurityGroupId() *string { if o == nil || IsNil(o.RemoteSecurityGroupId) { @@ -375,6 +343,38 @@ func (o *CreateSecurityGroupRulePayload) SetSecurityGroupId(v *string) { o.SecurityGroupId = v } +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetProtocol() *CreateProtocol { + if o == nil || IsNil(o.Protocol) { + var ret *CreateProtocol + return ret + } + return o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetProtocolOk() (*CreateProtocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given CreateProtocol and assigns it to the Protocol field. +func (o *CreateSecurityGroupRulePayload) SetProtocol(v *CreateProtocol) { + o.Protocol = v +} + func (o CreateSecurityGroupRulePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !IsNil(o.Description) { @@ -396,15 +396,15 @@ func (o CreateSecurityGroupRulePayload) ToMap() (map[string]interface{}, error) if !IsNil(o.PortRange) { toSerialize["portRange"] = o.PortRange } - if !IsNil(o.Protocol) { - toSerialize["protocol"] = o.Protocol - } if !IsNil(o.RemoteSecurityGroupId) { toSerialize["remoteSecurityGroupId"] = o.RemoteSecurityGroupId } if !IsNil(o.SecurityGroupId) { toSerialize["securityGroupId"] = o.SecurityGroupId } + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } return toSerialize, nil } diff --git a/services/iaasalpha/model_create_security_group_rule_protocol.go b/services/iaasalpha/model_create_security_group_rule_protocol.go new file mode 100644 index 00000000..df89a947 --- /dev/null +++ b/services/iaasalpha/model_create_security_group_rule_protocol.go @@ -0,0 +1,116 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +import ( + "encoding/json" +) + +// checks if the CreateSecurityGroupRuleProtocol type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateSecurityGroupRuleProtocol{} + +// CreateSecurityGroupRuleProtocol The internet protocol which the rule should match. +type CreateSecurityGroupRuleProtocol struct { + Protocol *CreateProtocol `json:"protocol,omitempty"` +} + +// NewCreateSecurityGroupRuleProtocol instantiates a new CreateSecurityGroupRuleProtocol 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 NewCreateSecurityGroupRuleProtocol() *CreateSecurityGroupRuleProtocol { + this := CreateSecurityGroupRuleProtocol{} + return &this +} + +// NewCreateSecurityGroupRuleProtocolWithDefaults instantiates a new CreateSecurityGroupRuleProtocol 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 NewCreateSecurityGroupRuleProtocolWithDefaults() *CreateSecurityGroupRuleProtocol { + this := CreateSecurityGroupRuleProtocol{} + return &this +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *CreateSecurityGroupRuleProtocol) GetProtocol() *CreateProtocol { + if o == nil || IsNil(o.Protocol) { + var ret *CreateProtocol + return ret + } + return o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRuleProtocol) GetProtocolOk() (*CreateProtocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *CreateSecurityGroupRuleProtocol) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given CreateProtocol and assigns it to the Protocol field. +func (o *CreateSecurityGroupRuleProtocol) SetProtocol(v *CreateProtocol) { + o.Protocol = v +} + +func (o CreateSecurityGroupRuleProtocol) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + return toSerialize, nil +} + +type NullableCreateSecurityGroupRuleProtocol struct { + value *CreateSecurityGroupRuleProtocol + isSet bool +} + +func (v NullableCreateSecurityGroupRuleProtocol) Get() *CreateSecurityGroupRuleProtocol { + return v.value +} + +func (v *NullableCreateSecurityGroupRuleProtocol) Set(val *CreateSecurityGroupRuleProtocol) { + v.value = val + v.isSet = true +} + +func (v NullableCreateSecurityGroupRuleProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateSecurityGroupRuleProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateSecurityGroupRuleProtocol(val *CreateSecurityGroupRuleProtocol) *NullableCreateSecurityGroupRuleProtocol { + return &NullableCreateSecurityGroupRuleProtocol{value: val, isSet: true} +} + +func (v NullableCreateSecurityGroupRuleProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateSecurityGroupRuleProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_create_server_group_payload.go b/services/iaasalpha/model_create_server_group_payload.go deleted file mode 100644 index 4943491f..00000000 --- a/services/iaasalpha/model_create_server_group_payload.go +++ /dev/null @@ -1,214 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the CreateServerGroupPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateServerGroupPayload{} - -// CreateServerGroupPayload Definition of a server group. -type CreateServerGroupPayload struct { - // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` - // The servers that are part of the server group. - Members *[]string `json:"members,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - // REQUIRED - Name *string `json:"name"` - // The server group policy. - // REQUIRED - Policy *string `json:"policy"` -} - -type _CreateServerGroupPayload CreateServerGroupPayload - -// NewCreateServerGroupPayload instantiates a new CreateServerGroupPayload 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 NewCreateServerGroupPayload(name *string, policy *string) *CreateServerGroupPayload { - this := CreateServerGroupPayload{} - this.Name = name - this.Policy = policy - return &this -} - -// NewCreateServerGroupPayloadWithDefaults instantiates a new CreateServerGroupPayload 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 NewCreateServerGroupPayloadWithDefaults() *CreateServerGroupPayload { - this := CreateServerGroupPayload{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *CreateServerGroupPayload) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerGroupPayload) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *CreateServerGroupPayload) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *CreateServerGroupPayload) SetId(v *string) { - o.Id = v -} - -// GetMembers returns the Members field value if set, zero value otherwise. -func (o *CreateServerGroupPayload) GetMembers() *[]string { - if o == nil || IsNil(o.Members) { - var ret *[]string - return ret - } - return o.Members -} - -// GetMembersOk returns a tuple with the Members field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerGroupPayload) GetMembersOk() (*[]string, bool) { - if o == nil || IsNil(o.Members) { - return nil, false - } - return o.Members, true -} - -// HasMembers returns a boolean if a field has been set. -func (o *CreateServerGroupPayload) HasMembers() bool { - if o != nil && !IsNil(o.Members) { - return true - } - - return false -} - -// SetMembers gets a reference to the given []string and assigns it to the Members field. -func (o *CreateServerGroupPayload) SetMembers(v *[]string) { - o.Members = v -} - -// GetName returns the Name field value -func (o *CreateServerGroupPayload) GetName() *string { - if o == nil { - var ret *string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *CreateServerGroupPayload) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true -} - -// SetName sets field value -func (o *CreateServerGroupPayload) SetName(v *string) { - o.Name = v -} - -// GetPolicy returns the Policy field value -func (o *CreateServerGroupPayload) GetPolicy() *string { - if o == nil { - var ret *string - return ret - } - - return o.Policy -} - -// GetPolicyOk returns a tuple with the Policy field value -// and a boolean to check if the value has been set. -func (o *CreateServerGroupPayload) GetPolicyOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Policy, true -} - -// SetPolicy sets field value -func (o *CreateServerGroupPayload) SetPolicy(v *string) { - o.Policy = v -} - -func (o CreateServerGroupPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Members) { - toSerialize["members"] = o.Members - } - toSerialize["name"] = o.Name - toSerialize["policy"] = o.Policy - return toSerialize, nil -} - -type NullableCreateServerGroupPayload struct { - value *CreateServerGroupPayload - isSet bool -} - -func (v NullableCreateServerGroupPayload) Get() *CreateServerGroupPayload { - return v.value -} - -func (v *NullableCreateServerGroupPayload) Set(val *CreateServerGroupPayload) { - v.value = val - v.isSet = true -} - -func (v NullableCreateServerGroupPayload) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateServerGroupPayload) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateServerGroupPayload(val *CreateServerGroupPayload) *NullableCreateServerGroupPayload { - return &NullableCreateServerGroupPayload{value: val, isSet: true} -} - -func (v NullableCreateServerGroupPayload) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateServerGroupPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_create_server_payload.go b/services/iaasalpha/model_create_server_payload.go index 6fd6a195..a4ff9cc7 100644 --- a/services/iaasalpha/model_create_server_payload.go +++ b/services/iaasalpha/model_create_server_payload.go @@ -20,6 +20,8 @@ var _ MappedNullable = &CreateServerPayload{} // CreateServerPayload Representation of a single server object. type CreateServerPayload struct { + // Universally Unique Identifier (UUID). + AffinityGroup *string `json:"affinityGroup,omitempty"` // Object that represents an availability zone. AvailabilityZone *string `json:"availabilityZone,omitempty"` BootVolume *CreateServerPayloadBootVolume `json:"bootVolume,omitempty"` @@ -51,8 +53,6 @@ type CreateServerPayload struct { PowerStatus *string `json:"powerStatus,omitempty"` // A list of General Objects. SecurityGroups *[]string `json:"securityGroups,omitempty"` - // Universally Unique Identifier (UUID). - ServerGroup *string `json:"serverGroup,omitempty"` // A list of service account mails. ServiceAccountMails *[]string `json:"serviceAccountMails,omitempty"` // The status of a server object. @@ -86,6 +86,38 @@ func NewCreateServerPayloadWithDefaults() *CreateServerPayload { return &this } +// GetAffinityGroup returns the AffinityGroup field value if set, zero value otherwise. +func (o *CreateServerPayload) GetAffinityGroup() *string { + if o == nil || IsNil(o.AffinityGroup) { + var ret *string + return ret + } + return o.AffinityGroup +} + +// GetAffinityGroupOk returns a tuple with the AffinityGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetAffinityGroupOk() (*string, bool) { + if o == nil || IsNil(o.AffinityGroup) { + return nil, false + } + return o.AffinityGroup, true +} + +// HasAffinityGroup returns a boolean if a field has been set. +func (o *CreateServerPayload) HasAffinityGroup() bool { + if o != nil && !IsNil(o.AffinityGroup) { + return true + } + + return false +} + +// SetAffinityGroup gets a reference to the given string and assigns it to the AffinityGroup field. +func (o *CreateServerPayload) SetAffinityGroup(v *string) { + o.AffinityGroup = v +} + // GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. func (o *CreateServerPayload) GetAvailabilityZone() *string { if o == nil || IsNil(o.AvailabilityZone) { @@ -582,38 +614,6 @@ func (o *CreateServerPayload) SetSecurityGroups(v *[]string) { o.SecurityGroups = v } -// GetServerGroup returns the ServerGroup field value if set, zero value otherwise. -func (o *CreateServerPayload) GetServerGroup() *string { - if o == nil || IsNil(o.ServerGroup) { - var ret *string - return ret - } - return o.ServerGroup -} - -// GetServerGroupOk returns a tuple with the ServerGroup field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetServerGroupOk() (*string, bool) { - if o == nil || IsNil(o.ServerGroup) { - return nil, false - } - return o.ServerGroup, true -} - -// HasServerGroup returns a boolean if a field has been set. -func (o *CreateServerPayload) HasServerGroup() bool { - if o != nil && !IsNil(o.ServerGroup) { - return true - } - - return false -} - -// SetServerGroup gets a reference to the given string and assigns it to the ServerGroup field. -func (o *CreateServerPayload) SetServerGroup(v *string) { - o.ServerGroup = v -} - // GetServiceAccountMails returns the ServiceAccountMails field value if set, zero value otherwise. func (o *CreateServerPayload) GetServiceAccountMails() *[]string { if o == nil || IsNil(o.ServiceAccountMails) { @@ -776,6 +776,9 @@ func (o *CreateServerPayload) SetVolumes(v *[]string) { func (o CreateServerPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !IsNil(o.AffinityGroup) { + toSerialize["affinityGroup"] = o.AffinityGroup + } if !IsNil(o.AvailabilityZone) { toSerialize["availabilityZone"] = o.AvailabilityZone } @@ -820,9 +823,6 @@ func (o CreateServerPayload) ToMap() (map[string]interface{}, error) { if !IsNil(o.SecurityGroups) { toSerialize["securityGroups"] = o.SecurityGroups } - if !IsNil(o.ServerGroup) { - toSerialize["serverGroup"] = o.ServerGroup - } if !IsNil(o.ServiceAccountMails) { toSerialize["serviceAccountMails"] = o.ServiceAccountMails } diff --git a/services/iaasalpha/model_network.go b/services/iaasalpha/model_network.go index d95ce8fc..86daaade 100644 --- a/services/iaasalpha/model_network.go +++ b/services/iaasalpha/model_network.go @@ -21,9 +21,11 @@ var _ MappedNullable = &Network{} // Network Object that represents a network. type Network struct { // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` - Gateway *NullableV1NetworkGateway `json:"gateway,omitempty"` - Gatewayv6 *NullableV1NetworkGateway `json:"gatewayv6,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway *NullableString `json:"gateway,omitempty"` + // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gatewayv6 *NullableString `json:"gatewayv6,omitempty"` // Object that represents the labels of an object. Labels *map[string]interface{} `json:"labels,omitempty"` // REQUIRED @@ -103,9 +105,9 @@ func (o *Network) SetCreatedAt(v *time.Time) { } // GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Network) GetGateway() *V1NetworkGateway { +func (o *Network) GetGateway() *string { if o == nil || IsNil(o.Gateway.Get()) { - var ret *V1NetworkGateway + var ret *string return ret } return o.Gateway.Get() @@ -114,7 +116,7 @@ func (o *Network) GetGateway() *V1NetworkGateway { // GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Network) GetGatewayOk() (*V1NetworkGateway, bool) { +func (o *Network) GetGatewayOk() (*string, bool) { if o == nil { return nil, false } @@ -130,8 +132,8 @@ func (o *Network) HasGateway() bool { return false } -// SetGateway gets a reference to the given V1NetworkGateway and assigns it to the Gateway field. -func (o *Network) SetGateway(v *V1NetworkGateway) { +// SetGateway gets a reference to the given string and assigns it to the Gateway field. +func (o *Network) SetGateway(v *string) { o.Gateway.Set(v) } @@ -146,9 +148,9 @@ func (o *Network) UnsetGateway() { } // GetGatewayv6 returns the Gatewayv6 field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Network) GetGatewayv6() *V1NetworkGateway { +func (o *Network) GetGatewayv6() *string { if o == nil || IsNil(o.Gatewayv6.Get()) { - var ret *V1NetworkGateway + var ret *string return ret } return o.Gatewayv6.Get() @@ -157,7 +159,7 @@ func (o *Network) GetGatewayv6() *V1NetworkGateway { // GetGatewayv6Ok returns a tuple with the Gatewayv6 field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Network) GetGatewayv6Ok() (*V1NetworkGateway, bool) { +func (o *Network) GetGatewayv6Ok() (*string, bool) { if o == nil { return nil, false } @@ -173,8 +175,8 @@ func (o *Network) HasGatewayv6() bool { return false } -// SetGatewayv6 gets a reference to the given V1NetworkGateway and assigns it to the Gatewayv6 field. -func (o *Network) SetGatewayv6(v *V1NetworkGateway) { +// SetGatewayv6 gets a reference to the given string and assigns it to the Gatewayv6 field. +func (o *Network) SetGatewayv6(v *string) { o.Gatewayv6.Set(v) } diff --git a/services/iaasalpha/model_protocol.go b/services/iaasalpha/model_protocol.go new file mode 100644 index 00000000..aa423d06 --- /dev/null +++ b/services/iaasalpha/model_protocol.go @@ -0,0 +1,154 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +import ( + "encoding/json" +) + +// checks if the Protocol type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Protocol{} + +// Protocol The schema for a protocol of a security group rule. +type Protocol struct { + // The protocol name which the rule should match. + Name *string `json:"name,omitempty"` + // The protocol number which the rule should match. + Number *int64 `json:"number,omitempty"` +} + +// NewProtocol instantiates a new Protocol 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 NewProtocol() *Protocol { + this := Protocol{} + return &this +} + +// NewProtocolWithDefaults instantiates a new Protocol 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 NewProtocolWithDefaults() *Protocol { + this := Protocol{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Protocol) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Protocol) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Protocol) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Protocol) SetName(v *string) { + o.Name = v +} + +// GetNumber returns the Number field value if set, zero value otherwise. +func (o *Protocol) GetNumber() *int64 { + if o == nil || IsNil(o.Number) { + var ret *int64 + return ret + } + return o.Number +} + +// GetNumberOk returns a tuple with the Number field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Protocol) GetNumberOk() (*int64, bool) { + if o == nil || IsNil(o.Number) { + return nil, false + } + return o.Number, true +} + +// HasNumber returns a boolean if a field has been set. +func (o *Protocol) HasNumber() bool { + if o != nil && !IsNil(o.Number) { + return true + } + + return false +} + +// SetNumber gets a reference to the given int64 and assigns it to the Number field. +func (o *Protocol) SetNumber(v *int64) { + o.Number = v +} + +func (o Protocol) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Number) { + toSerialize["number"] = o.Number + } + return toSerialize, nil +} + +type NullableProtocol struct { + value *Protocol + isSet bool +} + +func (v NullableProtocol) Get() *Protocol { + return v.value +} + +func (v *NullableProtocol) Set(val *Protocol) { + v.value = val + v.isSet = true +} + +func (v NullableProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProtocol(val *Protocol) *NullableProtocol { + return &NullableProtocol{value: val, isSet: true} +} + +func (v NullableProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_public_ip_list_response.go b/services/iaasalpha/model_public_ip_list_response.go index 7eb7c803..a233c225 100644 --- a/services/iaasalpha/model_public_ip_list_response.go +++ b/services/iaasalpha/model_public_ip_list_response.go @@ -19,7 +19,7 @@ var _ MappedNullable = &PublicIpListResponse{} // PublicIpListResponse Public IP list response. type PublicIpListResponse struct { - // A list of public ips. + // A list of public IPs. // REQUIRED Items *[]PublicIp `json:"items"` } diff --git a/services/iaasalpha/model_v1_public_network.go b/services/iaasalpha/model_public_network.go similarity index 51% rename from services/iaasalpha/model_v1_public_network.go rename to services/iaasalpha/model_public_network.go index 36c1b7e4..feb5ee34 100644 --- a/services/iaasalpha/model_v1_public_network.go +++ b/services/iaasalpha/model_public_network.go @@ -14,38 +14,38 @@ import ( "encoding/json" ) -// checks if the V1PublicNetwork type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &V1PublicNetwork{} +// checks if the PublicNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PublicNetwork{} -// V1PublicNetwork Public network. -type V1PublicNetwork struct { +// PublicNetwork Public network. +type PublicNetwork struct { // Classless Inter-Domain Routing (CIDR). // REQUIRED Cidr *string `json:"cidr"` } -type _V1PublicNetwork V1PublicNetwork +type _PublicNetwork PublicNetwork -// NewV1PublicNetwork instantiates a new V1PublicNetwork object +// NewPublicNetwork instantiates a new PublicNetwork 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 NewV1PublicNetwork(cidr *string) *V1PublicNetwork { - this := V1PublicNetwork{} +func NewPublicNetwork(cidr *string) *PublicNetwork { + this := PublicNetwork{} this.Cidr = cidr return &this } -// NewV1PublicNetworkWithDefaults instantiates a new V1PublicNetwork object +// NewPublicNetworkWithDefaults instantiates a new PublicNetwork 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 NewV1PublicNetworkWithDefaults() *V1PublicNetwork { - this := V1PublicNetwork{} +func NewPublicNetworkWithDefaults() *PublicNetwork { + this := PublicNetwork{} return &this } // GetCidr returns the Cidr field value -func (o *V1PublicNetwork) GetCidr() *string { +func (o *PublicNetwork) GetCidr() *string { if o == nil { var ret *string return ret @@ -56,7 +56,7 @@ func (o *V1PublicNetwork) GetCidr() *string { // GetCidrOk returns a tuple with the Cidr field value // and a boolean to check if the value has been set. -func (o *V1PublicNetwork) GetCidrOk() (*string, bool) { +func (o *PublicNetwork) GetCidrOk() (*string, bool) { if o == nil { return nil, false } @@ -64,48 +64,48 @@ func (o *V1PublicNetwork) GetCidrOk() (*string, bool) { } // SetCidr sets field value -func (o *V1PublicNetwork) SetCidr(v *string) { +func (o *PublicNetwork) SetCidr(v *string) { o.Cidr = v } -func (o V1PublicNetwork) ToMap() (map[string]interface{}, error) { +func (o PublicNetwork) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["cidr"] = o.Cidr return toSerialize, nil } -type NullableV1PublicNetwork struct { - value *V1PublicNetwork +type NullablePublicNetwork struct { + value *PublicNetwork isSet bool } -func (v NullableV1PublicNetwork) Get() *V1PublicNetwork { +func (v NullablePublicNetwork) Get() *PublicNetwork { return v.value } -func (v *NullableV1PublicNetwork) Set(val *V1PublicNetwork) { +func (v *NullablePublicNetwork) Set(val *PublicNetwork) { v.value = val v.isSet = true } -func (v NullableV1PublicNetwork) IsSet() bool { +func (v NullablePublicNetwork) IsSet() bool { return v.isSet } -func (v *NullableV1PublicNetwork) Unset() { +func (v *NullablePublicNetwork) Unset() { v.value = nil v.isSet = false } -func NewNullableV1PublicNetwork(val *V1PublicNetwork) *NullableV1PublicNetwork { - return &NullableV1PublicNetwork{value: val, isSet: true} +func NewNullablePublicNetwork(val *PublicNetwork) *NullablePublicNetwork { + return &NullablePublicNetwork{value: val, isSet: true} } -func (v NullableV1PublicNetwork) MarshalJSON() ([]byte, error) { +func (v NullablePublicNetwork) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } -func (v *NullableV1PublicNetwork) UnmarshalJSON(src []byte) error { +func (v *NullablePublicNetwork) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/services/iaasalpha/model_public_network_list_response.go b/services/iaasalpha/model_public_network_list_response.go index 5ff4c652..97a59ef3 100644 --- a/services/iaasalpha/model_public_network_list_response.go +++ b/services/iaasalpha/model_public_network_list_response.go @@ -21,7 +21,7 @@ var _ MappedNullable = &PublicNetworkListResponse{} type PublicNetworkListResponse struct { // A list of public networks. // REQUIRED - Items *[]V1PublicNetwork `json:"items"` + Items *[]PublicNetwork `json:"items"` } type _PublicNetworkListResponse PublicNetworkListResponse @@ -30,7 +30,7 @@ type _PublicNetworkListResponse PublicNetworkListResponse // 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 NewPublicNetworkListResponse(items *[]V1PublicNetwork) *PublicNetworkListResponse { +func NewPublicNetworkListResponse(items *[]PublicNetwork) *PublicNetworkListResponse { this := PublicNetworkListResponse{} this.Items = items return &this @@ -45,9 +45,9 @@ func NewPublicNetworkListResponseWithDefaults() *PublicNetworkListResponse { } // GetItems returns the Items field value -func (o *PublicNetworkListResponse) GetItems() *[]V1PublicNetwork { +func (o *PublicNetworkListResponse) GetItems() *[]PublicNetwork { if o == nil { - var ret *[]V1PublicNetwork + var ret *[]PublicNetwork return ret } @@ -56,7 +56,7 @@ func (o *PublicNetworkListResponse) GetItems() *[]V1PublicNetwork { // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *PublicNetworkListResponse) GetItemsOk() (*[]V1PublicNetwork, bool) { +func (o *PublicNetworkListResponse) GetItemsOk() (*[]PublicNetwork, bool) { if o == nil { return nil, false } @@ -64,7 +64,7 @@ func (o *PublicNetworkListResponse) GetItemsOk() (*[]V1PublicNetwork, bool) { } // SetItems sets field value -func (o *PublicNetworkListResponse) SetItems(v *[]V1PublicNetwork) { +func (o *PublicNetworkListResponse) SetItems(v *[]PublicNetwork) { o.Items = v } diff --git a/services/iaasalpha/model_security_group_rule.go b/services/iaasalpha/model_security_group_rule.go index 2f47ba09..f04cf262 100644 --- a/services/iaasalpha/model_security_group_rule.go +++ b/services/iaasalpha/model_security_group_rule.go @@ -30,13 +30,13 @@ type SecurityGroupRule struct { // Universally Unique Identifier (UUID). Id *string `json:"id,omitempty"` // Classless Inter-Domain Routing (CIDR). - IpRange *string `json:"ipRange,omitempty"` - PortRange *PortRange `json:"portRange,omitempty"` - Protocol *V1SecurityGroupRuleProtocol `json:"protocol,omitempty"` + IpRange *string `json:"ipRange,omitempty"` + PortRange *PortRange `json:"portRange,omitempty"` // Universally Unique Identifier (UUID). RemoteSecurityGroupId *string `json:"remoteSecurityGroupId,omitempty"` // Universally Unique Identifier (UUID). - SecurityGroupId *string `json:"securityGroupId,omitempty"` + SecurityGroupId *string `json:"securityGroupId,omitempty"` + Protocol *Protocol `json:"protocol,omitempty"` } type _SecurityGroupRule SecurityGroupRule @@ -279,38 +279,6 @@ func (o *SecurityGroupRule) SetPortRange(v *PortRange) { o.PortRange = v } -// GetProtocol returns the Protocol field value if set, zero value otherwise. -func (o *SecurityGroupRule) GetProtocol() *V1SecurityGroupRuleProtocol { - if o == nil || IsNil(o.Protocol) { - var ret *V1SecurityGroupRuleProtocol - return ret - } - return o.Protocol -} - -// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SecurityGroupRule) GetProtocolOk() (*V1SecurityGroupRuleProtocol, bool) { - if o == nil || IsNil(o.Protocol) { - return nil, false - } - return o.Protocol, true -} - -// HasProtocol returns a boolean if a field has been set. -func (o *SecurityGroupRule) HasProtocol() bool { - if o != nil && !IsNil(o.Protocol) { - return true - } - - return false -} - -// SetProtocol gets a reference to the given V1SecurityGroupRuleProtocol and assigns it to the Protocol field. -func (o *SecurityGroupRule) SetProtocol(v *V1SecurityGroupRuleProtocol) { - o.Protocol = v -} - // GetRemoteSecurityGroupId returns the RemoteSecurityGroupId field value if set, zero value otherwise. func (o *SecurityGroupRule) GetRemoteSecurityGroupId() *string { if o == nil || IsNil(o.RemoteSecurityGroupId) { @@ -375,6 +343,38 @@ func (o *SecurityGroupRule) SetSecurityGroupId(v *string) { o.SecurityGroupId = v } +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetProtocol() *Protocol { + if o == nil || IsNil(o.Protocol) { + var ret *Protocol + return ret + } + return o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetProtocolOk() (*Protocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given Protocol and assigns it to the Protocol field. +func (o *SecurityGroupRule) SetProtocol(v *Protocol) { + o.Protocol = v +} + func (o SecurityGroupRule) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !IsNil(o.Description) { @@ -396,15 +396,15 @@ func (o SecurityGroupRule) ToMap() (map[string]interface{}, error) { if !IsNil(o.PortRange) { toSerialize["portRange"] = o.PortRange } - if !IsNil(o.Protocol) { - toSerialize["protocol"] = o.Protocol - } if !IsNil(o.RemoteSecurityGroupId) { toSerialize["remoteSecurityGroupId"] = o.RemoteSecurityGroupId } if !IsNil(o.SecurityGroupId) { toSerialize["securityGroupId"] = o.SecurityGroupId } + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } return toSerialize, nil } diff --git a/services/iaasalpha/model_security_group_rule_protocol.go b/services/iaasalpha/model_security_group_rule_protocol.go new file mode 100644 index 00000000..b284fe34 --- /dev/null +++ b/services/iaasalpha/model_security_group_rule_protocol.go @@ -0,0 +1,116 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +import ( + "encoding/json" +) + +// checks if the SecurityGroupRuleProtocol type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SecurityGroupRuleProtocol{} + +// SecurityGroupRuleProtocol The internet protocol which the rule matches. +type SecurityGroupRuleProtocol struct { + Protocol *Protocol `json:"protocol,omitempty"` +} + +// NewSecurityGroupRuleProtocol instantiates a new SecurityGroupRuleProtocol 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 NewSecurityGroupRuleProtocol() *SecurityGroupRuleProtocol { + this := SecurityGroupRuleProtocol{} + return &this +} + +// NewSecurityGroupRuleProtocolWithDefaults instantiates a new SecurityGroupRuleProtocol 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 NewSecurityGroupRuleProtocolWithDefaults() *SecurityGroupRuleProtocol { + this := SecurityGroupRuleProtocol{} + return &this +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *SecurityGroupRuleProtocol) GetProtocol() *Protocol { + if o == nil || IsNil(o.Protocol) { + var ret *Protocol + return ret + } + return o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRuleProtocol) GetProtocolOk() (*Protocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *SecurityGroupRuleProtocol) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given Protocol and assigns it to the Protocol field. +func (o *SecurityGroupRuleProtocol) SetProtocol(v *Protocol) { + o.Protocol = v +} + +func (o SecurityGroupRuleProtocol) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + return toSerialize, nil +} + +type NullableSecurityGroupRuleProtocol struct { + value *SecurityGroupRuleProtocol + isSet bool +} + +func (v NullableSecurityGroupRuleProtocol) Get() *SecurityGroupRuleProtocol { + return v.value +} + +func (v *NullableSecurityGroupRuleProtocol) Set(val *SecurityGroupRuleProtocol) { + v.value = val + v.isSet = true +} + +func (v NullableSecurityGroupRuleProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableSecurityGroupRuleProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSecurityGroupRuleProtocol(val *SecurityGroupRuleProtocol) *NullableSecurityGroupRuleProtocol { + return &NullableSecurityGroupRuleProtocol{value: val, isSet: true} +} + +func (v NullableSecurityGroupRuleProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSecurityGroupRuleProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_server.go b/services/iaasalpha/model_server.go index 2ded85dd..eefbb444 100644 --- a/services/iaasalpha/model_server.go +++ b/services/iaasalpha/model_server.go @@ -20,6 +20,8 @@ var _ MappedNullable = &Server{} // Server Representation of a single server object. type Server struct { + // Universally Unique Identifier (UUID). + AffinityGroup *string `json:"affinityGroup,omitempty"` // Object that represents an availability zone. AvailabilityZone *string `json:"availabilityZone,omitempty"` BootVolume *CreateServerPayloadBootVolume `json:"bootVolume,omitempty"` @@ -51,8 +53,6 @@ type Server struct { PowerStatus *string `json:"powerStatus,omitempty"` // A list of General Objects. SecurityGroups *[]string `json:"securityGroups,omitempty"` - // Universally Unique Identifier (UUID). - ServerGroup *string `json:"serverGroup,omitempty"` // A list of service account mails. ServiceAccountMails *[]string `json:"serviceAccountMails,omitempty"` // The status of a server object. @@ -86,6 +86,38 @@ func NewServerWithDefaults() *Server { return &this } +// GetAffinityGroup returns the AffinityGroup field value if set, zero value otherwise. +func (o *Server) GetAffinityGroup() *string { + if o == nil || IsNil(o.AffinityGroup) { + var ret *string + return ret + } + return o.AffinityGroup +} + +// GetAffinityGroupOk returns a tuple with the AffinityGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetAffinityGroupOk() (*string, bool) { + if o == nil || IsNil(o.AffinityGroup) { + return nil, false + } + return o.AffinityGroup, true +} + +// HasAffinityGroup returns a boolean if a field has been set. +func (o *Server) HasAffinityGroup() bool { + if o != nil && !IsNil(o.AffinityGroup) { + return true + } + + return false +} + +// SetAffinityGroup gets a reference to the given string and assigns it to the AffinityGroup field. +func (o *Server) SetAffinityGroup(v *string) { + o.AffinityGroup = v +} + // GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. func (o *Server) GetAvailabilityZone() *string { if o == nil || IsNil(o.AvailabilityZone) { @@ -582,38 +614,6 @@ func (o *Server) SetSecurityGroups(v *[]string) { o.SecurityGroups = v } -// GetServerGroup returns the ServerGroup field value if set, zero value otherwise. -func (o *Server) GetServerGroup() *string { - if o == nil || IsNil(o.ServerGroup) { - var ret *string - return ret - } - return o.ServerGroup -} - -// GetServerGroupOk returns a tuple with the ServerGroup field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Server) GetServerGroupOk() (*string, bool) { - if o == nil || IsNil(o.ServerGroup) { - return nil, false - } - return o.ServerGroup, true -} - -// HasServerGroup returns a boolean if a field has been set. -func (o *Server) HasServerGroup() bool { - if o != nil && !IsNil(o.ServerGroup) { - return true - } - - return false -} - -// SetServerGroup gets a reference to the given string and assigns it to the ServerGroup field. -func (o *Server) SetServerGroup(v *string) { - o.ServerGroup = v -} - // GetServiceAccountMails returns the ServiceAccountMails field value if set, zero value otherwise. func (o *Server) GetServiceAccountMails() *[]string { if o == nil || IsNil(o.ServiceAccountMails) { @@ -776,6 +776,9 @@ func (o *Server) SetVolumes(v *[]string) { func (o Server) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !IsNil(o.AffinityGroup) { + toSerialize["affinityGroup"] = o.AffinityGroup + } if !IsNil(o.AvailabilityZone) { toSerialize["availabilityZone"] = o.AvailabilityZone } @@ -820,9 +823,6 @@ func (o Server) ToMap() (map[string]interface{}, error) { if !IsNil(o.SecurityGroups) { toSerialize["securityGroups"] = o.SecurityGroups } - if !IsNil(o.ServerGroup) { - toSerialize["serverGroup"] = o.ServerGroup - } if !IsNil(o.ServiceAccountMails) { toSerialize["serviceAccountMails"] = o.ServiceAccountMails } diff --git a/services/iaasalpha/model_server_group.go b/services/iaasalpha/model_server_group.go deleted file mode 100644 index e620b989..00000000 --- a/services/iaasalpha/model_server_group.go +++ /dev/null @@ -1,214 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the ServerGroup type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ServerGroup{} - -// ServerGroup Definition of a server group. -type ServerGroup struct { - // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` - // The servers that are part of the server group. - Members *[]string `json:"members,omitempty"` - // The name for a General Object. Matches Names and also UUIDs. - // REQUIRED - Name *string `json:"name"` - // The server group policy. - // REQUIRED - Policy *string `json:"policy"` -} - -type _ServerGroup ServerGroup - -// NewServerGroup instantiates a new ServerGroup 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 NewServerGroup(name *string, policy *string) *ServerGroup { - this := ServerGroup{} - this.Name = name - this.Policy = policy - return &this -} - -// NewServerGroupWithDefaults instantiates a new ServerGroup 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 NewServerGroupWithDefaults() *ServerGroup { - this := ServerGroup{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *ServerGroup) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ServerGroup) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *ServerGroup) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *ServerGroup) SetId(v *string) { - o.Id = v -} - -// GetMembers returns the Members field value if set, zero value otherwise. -func (o *ServerGroup) GetMembers() *[]string { - if o == nil || IsNil(o.Members) { - var ret *[]string - return ret - } - return o.Members -} - -// GetMembersOk returns a tuple with the Members field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ServerGroup) GetMembersOk() (*[]string, bool) { - if o == nil || IsNil(o.Members) { - return nil, false - } - return o.Members, true -} - -// HasMembers returns a boolean if a field has been set. -func (o *ServerGroup) HasMembers() bool { - if o != nil && !IsNil(o.Members) { - return true - } - - return false -} - -// SetMembers gets a reference to the given []string and assigns it to the Members field. -func (o *ServerGroup) SetMembers(v *[]string) { - o.Members = v -} - -// GetName returns the Name field value -func (o *ServerGroup) GetName() *string { - if o == nil { - var ret *string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *ServerGroup) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true -} - -// SetName sets field value -func (o *ServerGroup) SetName(v *string) { - o.Name = v -} - -// GetPolicy returns the Policy field value -func (o *ServerGroup) GetPolicy() *string { - if o == nil { - var ret *string - return ret - } - - return o.Policy -} - -// GetPolicyOk returns a tuple with the Policy field value -// and a boolean to check if the value has been set. -func (o *ServerGroup) GetPolicyOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Policy, true -} - -// SetPolicy sets field value -func (o *ServerGroup) SetPolicy(v *string) { - o.Policy = v -} - -func (o ServerGroup) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Members) { - toSerialize["members"] = o.Members - } - toSerialize["name"] = o.Name - toSerialize["policy"] = o.Policy - return toSerialize, nil -} - -type NullableServerGroup struct { - value *ServerGroup - isSet bool -} - -func (v NullableServerGroup) Get() *ServerGroup { - return v.value -} - -func (v *NullableServerGroup) Set(val *ServerGroup) { - v.value = val - v.isSet = true -} - -func (v NullableServerGroup) IsSet() bool { - return v.isSet -} - -func (v *NullableServerGroup) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableServerGroup(val *ServerGroup) *NullableServerGroup { - return &NullableServerGroup{value: val, isSet: true} -} - -func (v NullableServerGroup) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableServerGroup) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_server_group_list_response.go b/services/iaasalpha/model_server_group_list_response.go deleted file mode 100644 index 67db3b63..00000000 --- a/services/iaasalpha/model_server_group_list_response.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the ServerGroupListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ServerGroupListResponse{} - -// ServerGroupListResponse Response object for server-group list request. -type ServerGroupListResponse struct { - // A list of servers-groups. - // REQUIRED - Items *[]ServerGroup `json:"items"` -} - -type _ServerGroupListResponse ServerGroupListResponse - -// NewServerGroupListResponse instantiates a new ServerGroupListResponse 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 NewServerGroupListResponse(items *[]ServerGroup) *ServerGroupListResponse { - this := ServerGroupListResponse{} - this.Items = items - return &this -} - -// NewServerGroupListResponseWithDefaults instantiates a new ServerGroupListResponse 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 NewServerGroupListResponseWithDefaults() *ServerGroupListResponse { - this := ServerGroupListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *ServerGroupListResponse) GetItems() *[]ServerGroup { - if o == nil { - var ret *[]ServerGroup - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *ServerGroupListResponse) GetItemsOk() (*[]ServerGroup, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *ServerGroupListResponse) SetItems(v *[]ServerGroup) { - o.Items = v -} - -func (o ServerGroupListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items - return toSerialize, nil -} - -type NullableServerGroupListResponse struct { - value *ServerGroupListResponse - isSet bool -} - -func (v NullableServerGroupListResponse) Get() *ServerGroupListResponse { - return v.value -} - -func (v *NullableServerGroupListResponse) Set(val *ServerGroupListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableServerGroupListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableServerGroupListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableServerGroupListResponse(val *ServerGroupListResponse) *NullableServerGroupListResponse { - return &NullableServerGroupListResponse{value: val, isSet: true} -} - -func (v NullableServerGroupListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableServerGroupListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_v1_network_gateway.go b/services/iaasalpha/model_v1_network_gateway.go deleted file mode 100644 index b279652d..00000000 --- a/services/iaasalpha/model_v1_network_gateway.go +++ /dev/null @@ -1,80 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the V1NetworkGateway type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &V1NetworkGateway{} - -// V1NetworkGateway The gateway of a network. If not specified the first ip of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. -type V1NetworkGateway struct { -} - -// NewV1NetworkGateway instantiates a new V1NetworkGateway 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 NewV1NetworkGateway() *V1NetworkGateway { - this := V1NetworkGateway{} - return &this -} - -// NewV1NetworkGatewayWithDefaults instantiates a new V1NetworkGateway 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 NewV1NetworkGatewayWithDefaults() *V1NetworkGateway { - this := V1NetworkGateway{} - return &this -} - -func (o V1NetworkGateway) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - return toSerialize, nil -} - -type NullableV1NetworkGateway struct { - value *V1NetworkGateway - isSet bool -} - -func (v NullableV1NetworkGateway) Get() *V1NetworkGateway { - return v.value -} - -func (v *NullableV1NetworkGateway) Set(val *V1NetworkGateway) { - v.value = val - v.isSet = true -} - -func (v NullableV1NetworkGateway) IsSet() bool { - return v.isSet -} - -func (v *NullableV1NetworkGateway) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableV1NetworkGateway(val *V1NetworkGateway) *NullableV1NetworkGateway { - return &NullableV1NetworkGateway{value: val, isSet: true} -} - -func (v NullableV1NetworkGateway) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableV1NetworkGateway) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_v1_security_group_rule_protocol.go b/services/iaasalpha/model_v1_security_group_rule_protocol.go deleted file mode 100644 index 7a851308..00000000 --- a/services/iaasalpha/model_v1_security_group_rule_protocol.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the V1SecurityGroupRuleProtocol type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &V1SecurityGroupRuleProtocol{} - -// V1SecurityGroupRuleProtocol The internet protocol which the rule should match. -type V1SecurityGroupRuleProtocol struct { - // The protocol name which the rule should match. - Name *string `json:"name,omitempty"` - // The protocol number which the rule should match. - Protocol *int64 `json:"protocol,omitempty"` -} - -// NewV1SecurityGroupRuleProtocol instantiates a new V1SecurityGroupRuleProtocol 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 NewV1SecurityGroupRuleProtocol() *V1SecurityGroupRuleProtocol { - this := V1SecurityGroupRuleProtocol{} - return &this -} - -// NewV1SecurityGroupRuleProtocolWithDefaults instantiates a new V1SecurityGroupRuleProtocol 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 NewV1SecurityGroupRuleProtocolWithDefaults() *V1SecurityGroupRuleProtocol { - this := V1SecurityGroupRuleProtocol{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *V1SecurityGroupRuleProtocol) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *V1SecurityGroupRuleProtocol) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *V1SecurityGroupRuleProtocol) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *V1SecurityGroupRuleProtocol) SetName(v *string) { - o.Name = v -} - -// GetProtocol returns the Protocol field value if set, zero value otherwise. -func (o *V1SecurityGroupRuleProtocol) GetProtocol() *int64 { - if o == nil || IsNil(o.Protocol) { - var ret *int64 - return ret - } - return o.Protocol -} - -// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *V1SecurityGroupRuleProtocol) GetProtocolOk() (*int64, bool) { - if o == nil || IsNil(o.Protocol) { - return nil, false - } - return o.Protocol, true -} - -// HasProtocol returns a boolean if a field has been set. -func (o *V1SecurityGroupRuleProtocol) HasProtocol() bool { - if o != nil && !IsNil(o.Protocol) { - return true - } - - return false -} - -// SetProtocol gets a reference to the given int64 and assigns it to the Protocol field. -func (o *V1SecurityGroupRuleProtocol) SetProtocol(v *int64) { - o.Protocol = v -} - -func (o V1SecurityGroupRuleProtocol) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.Protocol) { - toSerialize["protocol"] = o.Protocol - } - return toSerialize, nil -} - -type NullableV1SecurityGroupRuleProtocol struct { - value *V1SecurityGroupRuleProtocol - isSet bool -} - -func (v NullableV1SecurityGroupRuleProtocol) Get() *V1SecurityGroupRuleProtocol { - return v.value -} - -func (v *NullableV1SecurityGroupRuleProtocol) Set(val *V1SecurityGroupRuleProtocol) { - v.value = val - v.isSet = true -} - -func (v NullableV1SecurityGroupRuleProtocol) IsSet() bool { - return v.isSet -} - -func (v *NullableV1SecurityGroupRuleProtocol) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableV1SecurityGroupRuleProtocol(val *V1SecurityGroupRuleProtocol) *NullableV1SecurityGroupRuleProtocol { - return &NullableV1SecurityGroupRuleProtocol{value: val, isSet: true} -} - -func (v NullableV1SecurityGroupRuleProtocol) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableV1SecurityGroupRuleProtocol) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_v1_volume_attachment_list_response.go b/services/iaasalpha/model_v1_volume_attachment_list_response.go deleted file mode 100644 index 2fbcd87c..00000000 --- a/services/iaasalpha/model_v1_volume_attachment_list_response.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -IaaS-API - -This API allows you to create and modify IaaS resources. - -API version: 1alpha1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaasalpha - -import ( - "encoding/json" -) - -// checks if the V1VolumeAttachmentListResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &V1VolumeAttachmentListResponse{} - -// V1VolumeAttachmentListResponse Volume attachment list response. -type V1VolumeAttachmentListResponse struct { - // A list containing Volume attachments of a server. - // REQUIRED - Items *[]VolumeAttachment `json:"items"` -} - -type _V1VolumeAttachmentListResponse V1VolumeAttachmentListResponse - -// NewV1VolumeAttachmentListResponse instantiates a new V1VolumeAttachmentListResponse 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 NewV1VolumeAttachmentListResponse(items *[]VolumeAttachment) *V1VolumeAttachmentListResponse { - this := V1VolumeAttachmentListResponse{} - this.Items = items - return &this -} - -// NewV1VolumeAttachmentListResponseWithDefaults instantiates a new V1VolumeAttachmentListResponse 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 NewV1VolumeAttachmentListResponseWithDefaults() *V1VolumeAttachmentListResponse { - this := V1VolumeAttachmentListResponse{} - return &this -} - -// GetItems returns the Items field value -func (o *V1VolumeAttachmentListResponse) GetItems() *[]VolumeAttachment { - if o == nil { - var ret *[]VolumeAttachment - return ret - } - - return o.Items -} - -// GetItemsOk returns a tuple with the Items field value -// and a boolean to check if the value has been set. -func (o *V1VolumeAttachmentListResponse) GetItemsOk() (*[]VolumeAttachment, bool) { - if o == nil { - return nil, false - } - return o.Items, true -} - -// SetItems sets field value -func (o *V1VolumeAttachmentListResponse) SetItems(v *[]VolumeAttachment) { - o.Items = v -} - -func (o V1VolumeAttachmentListResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items - return toSerialize, nil -} - -type NullableV1VolumeAttachmentListResponse struct { - value *V1VolumeAttachmentListResponse - isSet bool -} - -func (v NullableV1VolumeAttachmentListResponse) Get() *V1VolumeAttachmentListResponse { - return v.value -} - -func (v *NullableV1VolumeAttachmentListResponse) Set(val *V1VolumeAttachmentListResponse) { - v.value = val - v.isSet = true -} - -func (v NullableV1VolumeAttachmentListResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableV1VolumeAttachmentListResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableV1VolumeAttachmentListResponse(val *V1VolumeAttachmentListResponse) *NullableV1VolumeAttachmentListResponse { - return &NullableV1VolumeAttachmentListResponse{value: val, isSet: true} -} - -func (v NullableV1VolumeAttachmentListResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableV1VolumeAttachmentListResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_volume_attachment_list_response.go b/services/iaasalpha/model_volume_attachment_list_response.go new file mode 100644 index 00000000..cc4133e9 --- /dev/null +++ b/services/iaasalpha/model_volume_attachment_list_response.go @@ -0,0 +1,111 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +import ( + "encoding/json" +) + +// checks if the VolumeAttachmentListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VolumeAttachmentListResponse{} + +// VolumeAttachmentListResponse Volume attachment list response. +type VolumeAttachmentListResponse struct { + // A list containing Volume attachments of a server. + // REQUIRED + Items *[]VolumeAttachment `json:"items"` +} + +type _VolumeAttachmentListResponse VolumeAttachmentListResponse + +// NewVolumeAttachmentListResponse instantiates a new VolumeAttachmentListResponse 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 NewVolumeAttachmentListResponse(items *[]VolumeAttachment) *VolumeAttachmentListResponse { + this := VolumeAttachmentListResponse{} + this.Items = items + return &this +} + +// NewVolumeAttachmentListResponseWithDefaults instantiates a new VolumeAttachmentListResponse 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 NewVolumeAttachmentListResponseWithDefaults() *VolumeAttachmentListResponse { + this := VolumeAttachmentListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *VolumeAttachmentListResponse) GetItems() *[]VolumeAttachment { + if o == nil { + var ret *[]VolumeAttachment + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *VolumeAttachmentListResponse) GetItemsOk() (*[]VolumeAttachment, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *VolumeAttachmentListResponse) SetItems(v *[]VolumeAttachment) { + o.Items = v +} + +func (o VolumeAttachmentListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +type NullableVolumeAttachmentListResponse struct { + value *VolumeAttachmentListResponse + isSet bool +} + +func (v NullableVolumeAttachmentListResponse) Get() *VolumeAttachmentListResponse { + return v.value +} + +func (v *NullableVolumeAttachmentListResponse) Set(val *VolumeAttachmentListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableVolumeAttachmentListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableVolumeAttachmentListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolumeAttachmentListResponse(val *VolumeAttachmentListResponse) *NullableVolumeAttachmentListResponse { + return &NullableVolumeAttachmentListResponse{value: val, isSet: true} +} + +func (v NullableVolumeAttachmentListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolumeAttachmentListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +}