diff --git a/services/iaasalpha/api_default.go b/services/iaasalpha/api_default.go index e9ab87dd4..1478d29a6 100644 --- a/services/iaasalpha/api_default.go +++ b/services/iaasalpha/api_default.go @@ -3613,32 +3613,43 @@ func (a *APIClient) DeleteImageExecute(ctx context.Context, projectId string, im return r.Execute() } -type ApiDeleteKeyPairRequest struct { - ctx context.Context - apiService *DefaultApiService - keypairName string +type ApiDeleteImageShareRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + imageId string } -func (r ApiDeleteKeyPairRequest) Execute() error { +func (r ApiDeleteImageShareRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteKeyPair") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteImageShare") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/keypairs/{keypairName}" - localVarPath = strings.Replace(localVarPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(r.keypairName, "keypairName")), -1) + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images/{imageId}/share" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.keypairName) > 127 { - return fmt.Errorf("keypairName must have less than 127 elements") + 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.imageId) < 36 { + return fmt.Errorf("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return fmt.Errorf("imageId must have less than 36 elements") } // to determine the Content-Type header @@ -3751,55 +3762,58 @@ func (r ApiDeleteKeyPairRequest) Execute() error { } /* -DeleteKeyPair: Delete an SSH keypair. +DeleteImageShare: Remove image share. -Delete an SSH keypair from a user. +Remove the image share. New scope will be local. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param keypairName The name of an SSH keypair. - @return ApiDeleteKeyPairRequest + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiDeleteImageShareRequest */ -func (a *APIClient) DeleteKeyPair(ctx context.Context, keypairName string) ApiDeleteKeyPairRequest { - return ApiDeleteKeyPairRequest{ - apiService: a.defaultApi, - ctx: ctx, - keypairName: keypairName, +func (a *APIClient) DeleteImageShare(ctx context.Context, projectId string, imageId string) ApiDeleteImageShareRequest { + return ApiDeleteImageShareRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + imageId: imageId, } } -func (a *APIClient) DeleteKeyPairExecute(ctx context.Context, keypairName string) error { - r := ApiDeleteKeyPairRequest{ - apiService: a.defaultApi, - ctx: ctx, - keypairName: keypairName, +func (a *APIClient) DeleteImageShareExecute(ctx context.Context, projectId string, imageId string) error { + r := ApiDeleteImageShareRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + imageId: imageId, } return r.Execute() } -type ApiDeleteNicRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - nicId string +type ApiDeleteImageShareConsumerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + imageId string + consumerProjectId string } -func (r ApiDeleteNicRequest) Execute() error { +func (r ApiDeleteImageShareConsumerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteNic") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteImageShareConsumer") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"consumerProjectId"+"}", url.PathEscape(ParameterValueToString(r.consumerProjectId, "consumerProjectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3810,17 +3824,17 @@ func (r ApiDeleteNicRequest) Execute() error { if strlen(r.projectId) > 36 { return fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.networkId) < 36 { - return fmt.Errorf("networkId must have at least 36 elements") + if strlen(r.imageId) < 36 { + return fmt.Errorf("imageId must have at least 36 elements") } - if strlen(r.networkId) > 36 { - return fmt.Errorf("networkId must have less than 36 elements") + if strlen(r.imageId) > 36 { + return fmt.Errorf("imageId must have less than 36 elements") } - if strlen(r.nicId) < 36 { - return fmt.Errorf("nicId must have at least 36 elements") + if strlen(r.consumerProjectId) < 36 { + return fmt.Errorf("consumerProjectId must have at least 36 elements") } - if strlen(r.nicId) > 36 { - return fmt.Errorf("nicId must have less than 36 elements") + if strlen(r.consumerProjectId) > 36 { + return fmt.Errorf("consumerProjectId must have less than 36 elements") } // to determine the Content-Type header @@ -3933,74 +3947,63 @@ func (r ApiDeleteNicRequest) Execute() error { } /* -DeleteNic: Delete a network interface. +DeleteImageShareConsumer: Remove an image share consumer. -Delete a network interface that is part of the project. +Remove consumer from a shared image. @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 networkId The identifier (ID) of a STACKIT Network. - @param nicId The identifier (ID) of a network interface. - @return ApiDeleteNicRequest + @param imageId The identifier (ID) of a STACKIT Image. + @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. + @return ApiDeleteImageShareConsumerRequest */ -func (a *APIClient) DeleteNic(ctx context.Context, projectId string, networkId string, nicId string) ApiDeleteNicRequest { - return ApiDeleteNicRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - nicId: nicId, +func (a *APIClient) DeleteImageShareConsumer(ctx context.Context, projectId string, imageId string, consumerProjectId string) ApiDeleteImageShareConsumerRequest { + return ApiDeleteImageShareConsumerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + imageId: imageId, + consumerProjectId: consumerProjectId, } } -func (a *APIClient) DeleteNicExecute(ctx context.Context, projectId string, networkId string, nicId string) error { - r := ApiDeleteNicRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - nicId: nicId, +func (a *APIClient) DeleteImageShareConsumerExecute(ctx context.Context, projectId string, imageId string, consumerProjectId string) error { + r := ApiDeleteImageShareConsumerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + imageId: imageId, + consumerProjectId: consumerProjectId, } return r.Execute() } -type ApiDeletePublicIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - publicIpId string +type ApiDeleteKeyPairRequest struct { + ctx context.Context + apiService *DefaultApiService + keypairName string } -func (r ApiDeletePublicIPRequest) Execute() error { +func (r ApiDeleteKeyPairRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeletePublicIP") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteKeyPair") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/public-ips/{publicIpId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(r.publicIpId, "publicIpId")), -1) + localVarPath := localBasePath + "/v1alpha1/keypairs/{keypairName}" + localVarPath = strings.Replace(localVarPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(r.keypairName, "keypairName")), -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.publicIpId) < 36 { - return fmt.Errorf("publicIpId must have at least 36 elements") - } - if strlen(r.publicIpId) > 36 { - return fmt.Errorf("publicIpId must have less than 36 elements") + if strlen(r.keypairName) > 127 { + return fmt.Errorf("keypairName must have less than 127 elements") } // to determine the Content-Type header @@ -4113,56 +4116,55 @@ func (r ApiDeletePublicIPRequest) Execute() error { } /* -DeletePublicIP: Delete a public IP. +DeleteKeyPair: Delete an SSH keypair. -Delete a public IP that is part of the project. +Delete an SSH keypair from a user. @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 publicIpId The identifier (ID) of a Public IP. - @return ApiDeletePublicIPRequest + @param keypairName The name of an SSH keypair. + @return ApiDeleteKeyPairRequest */ -func (a *APIClient) DeletePublicIP(ctx context.Context, projectId string, publicIpId string) ApiDeletePublicIPRequest { - return ApiDeletePublicIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - publicIpId: publicIpId, +func (a *APIClient) DeleteKeyPair(ctx context.Context, keypairName string) ApiDeleteKeyPairRequest { + return ApiDeleteKeyPairRequest{ + apiService: a.defaultApi, + ctx: ctx, + keypairName: keypairName, } } -func (a *APIClient) DeletePublicIPExecute(ctx context.Context, projectId string, publicIpId string) error { - r := ApiDeletePublicIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - publicIpId: publicIpId, +func (a *APIClient) DeleteKeyPairExecute(ctx context.Context, keypairName string) error { + r := ApiDeleteKeyPairRequest{ + apiService: a.defaultApi, + ctx: ctx, + keypairName: keypairName, } return r.Execute() } -type ApiDeleteSecurityGroupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string +type ApiDeleteNicRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + networkId string + nicId string } -func (r ApiDeleteSecurityGroupRequest) Execute() error { +func (r ApiDeleteNicRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteSecurityGroup") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteNic") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -4173,11 +4175,17 @@ func (r ApiDeleteSecurityGroupRequest) Execute() error { if strlen(r.projectId) > 36 { return fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.securityGroupId) < 36 { - return fmt.Errorf("securityGroupId must have at least 36 elements") + if strlen(r.networkId) < 36 { + return fmt.Errorf("networkId must have at least 36 elements") } - if strlen(r.securityGroupId) > 36 { - return fmt.Errorf("securityGroupId must have less than 36 elements") + if strlen(r.networkId) > 36 { + return fmt.Errorf("networkId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return fmt.Errorf("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return fmt.Errorf("nicId must have less than 36 elements") } // to determine the Content-Type header @@ -4273,17 +4281,6 @@ func (r ApiDeleteSecurityGroupRequest) Execute() error { newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 409 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -4301,58 +4298,59 @@ func (r ApiDeleteSecurityGroupRequest) Execute() error { } /* -DeleteSecurityGroup: Delete security group. +DeleteNic: Delete a network interface. -Delete a security group. +Delete a network interface 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. - @param securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiDeleteSecurityGroupRequest + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiDeleteNicRequest */ -func (a *APIClient) DeleteSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiDeleteSecurityGroupRequest { - return ApiDeleteSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) DeleteNic(ctx context.Context, projectId string, networkId string, nicId string) ApiDeleteNicRequest { + return ApiDeleteNicRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + networkId: networkId, + nicId: nicId, } } -func (a *APIClient) DeleteSecurityGroupExecute(ctx context.Context, projectId string, securityGroupId string) error { - r := ApiDeleteSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) DeleteNicExecute(ctx context.Context, projectId string, networkId string, nicId string) error { + r := ApiDeleteNicRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + networkId: networkId, + nicId: nicId, } return r.Execute() } -type ApiDeleteSecurityGroupRuleRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string - securityGroupRuleId string +type ApiDeletePublicIPRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + publicIpId string } -func (r ApiDeleteSecurityGroupRuleRequest) Execute() error { +func (r ApiDeletePublicIPRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteSecurityGroupRule") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeletePublicIP") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/public-ips/{publicIpId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"securityGroupRuleId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupRuleId, "securityGroupRuleId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(r.publicIpId, "publicIpId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -4363,17 +4361,11 @@ func (r ApiDeleteSecurityGroupRuleRequest) Execute() error { if strlen(r.projectId) > 36 { return fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.securityGroupId) < 36 { - return fmt.Errorf("securityGroupId must have at least 36 elements") - } - if strlen(r.securityGroupId) > 36 { - return fmt.Errorf("securityGroupId must have less than 36 elements") - } - if strlen(r.securityGroupRuleId) < 36 { - return fmt.Errorf("securityGroupRuleId must have at least 36 elements") + if strlen(r.publicIpId) < 36 { + return fmt.Errorf("publicIpId must have at least 36 elements") } - if strlen(r.securityGroupRuleId) > 36 { - return fmt.Errorf("securityGroupRuleId must have less than 36 elements") + if strlen(r.publicIpId) > 36 { + return fmt.Errorf("publicIpId must have less than 36 elements") } // to determine the Content-Type header @@ -4486,59 +4478,56 @@ func (r ApiDeleteSecurityGroupRuleRequest) Execute() error { } /* -DeleteSecurityGroupRule: Delete security group rule. +DeletePublicIP: Delete a public IP. -Delete a security group rule. +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. - @param securityGroupId The identifier (ID) of a STACKIT Security Group. - @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. - @return ApiDeleteSecurityGroupRuleRequest + @param publicIpId The identifier (ID) of a Public IP. + @return ApiDeletePublicIPRequest */ -func (a *APIClient) DeleteSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) ApiDeleteSecurityGroupRuleRequest { - return ApiDeleteSecurityGroupRuleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, - securityGroupRuleId: securityGroupRuleId, +func (a *APIClient) DeletePublicIP(ctx context.Context, projectId string, publicIpId string) ApiDeletePublicIPRequest { + return ApiDeletePublicIPRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + publicIpId: publicIpId, } } -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, +func (a *APIClient) DeletePublicIPExecute(ctx context.Context, projectId string, publicIpId string) error { + r := ApiDeletePublicIPRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + publicIpId: publicIpId, } return r.Execute() } -type ApiDeleteServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string +type ApiDeleteSecurityGroupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + securityGroupId string } -func (r ApiDeleteServerRequest) Execute() error { +func (r ApiDeleteSecurityGroupRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteServer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteSecurityGroup") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -4549,11 +4538,11 @@ func (r ApiDeleteServerRequest) Execute() error { 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.securityGroupId) < 36 { + return fmt.Errorf("securityGroupId must have at least 36 elements") } - if strlen(r.serverId) > 36 { - return fmt.Errorf("serverId must have less than 36 elements") + if strlen(r.securityGroupId) > 36 { + return fmt.Errorf("securityGroupId must have less than 36 elements") } // to determine the Content-Type header @@ -4649,6 +4638,17 @@ func (r ApiDeleteServerRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -4666,58 +4666,58 @@ func (r ApiDeleteServerRequest) Execute() error { } /* -DeleteServer: Delete a server. +DeleteSecurityGroup: Delete security group. -Delete a server. Volumes won't be deleted. +Delete a security group. @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 + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiDeleteSecurityGroupRequest */ -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) DeleteSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiDeleteSecurityGroupRequest { + return ApiDeleteSecurityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, } } -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) DeleteSecurityGroupExecute(ctx context.Context, projectId string, securityGroupId string) error { + r := ApiDeleteSecurityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, } return r.Execute() } -type ApiDeleteVirtualIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - virtualIpId string +type ApiDeleteSecurityGroupRuleRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + securityGroupId string + securityGroupRuleId string } -func (r ApiDeleteVirtualIPRequest) Execute() error { +func (r ApiDeleteSecurityGroupRuleRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteVirtualIP") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteSecurityGroupRule") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"virtualIpId"+"}", url.PathEscape(ParameterValueToString(r.virtualIpId, "virtualIpId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupRuleId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupRuleId, "securityGroupRuleId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -4728,17 +4728,17 @@ func (r ApiDeleteVirtualIPRequest) Execute() error { if strlen(r.projectId) > 36 { return fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.networkId) < 36 { - return fmt.Errorf("networkId must have at least 36 elements") + if strlen(r.securityGroupId) < 36 { + return fmt.Errorf("securityGroupId must have at least 36 elements") } - if strlen(r.networkId) > 36 { - return fmt.Errorf("networkId must have less than 36 elements") + if strlen(r.securityGroupId) > 36 { + return fmt.Errorf("securityGroupId must have less than 36 elements") } - if strlen(r.virtualIpId) < 36 { - return fmt.Errorf("virtualIpId must have at least 36 elements") + if strlen(r.securityGroupRuleId) < 36 { + return fmt.Errorf("securityGroupRuleId must have at least 36 elements") } - if strlen(r.virtualIpId) > 36 { - return fmt.Errorf("virtualIpId must have less than 36 elements") + if strlen(r.securityGroupRuleId) > 36 { + return fmt.Errorf("securityGroupRuleId must have less than 36 elements") } // to determine the Content-Type header @@ -4851,59 +4851,59 @@ func (r ApiDeleteVirtualIPRequest) Execute() error { } /* -DeleteVirtualIP: Delete a virtual IP. +DeleteSecurityGroupRule: Delete security group rule. -Delete a virtual IP that is part of the project. +Delete a security group rule. @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 networkId The identifier (ID) of a STACKIT Network. - @param virtualIpId The identifier (ID) of a Virtual IP. - @return ApiDeleteVirtualIPRequest + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. + @return ApiDeleteSecurityGroupRuleRequest */ -func (a *APIClient) DeleteVirtualIP(ctx context.Context, projectId string, networkId string, virtualIpId string) ApiDeleteVirtualIPRequest { - return ApiDeleteVirtualIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - virtualIpId: virtualIpId, +func (a *APIClient) DeleteSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) ApiDeleteSecurityGroupRuleRequest { + return ApiDeleteSecurityGroupRuleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, } } -func (a *APIClient) DeleteVirtualIPExecute(ctx context.Context, projectId string, networkId string, virtualIpId string) error { - r := ApiDeleteVirtualIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - virtualIpId: virtualIpId, +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 ApiDeleteVolumeRequest struct { +type ApiDeleteServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string - volumeId string + serverId string } -func (r ApiDeleteVolumeRequest) 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.DeleteVolume") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteServer") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes/{volumeId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -4914,11 +4914,11 @@ func (r ApiDeleteVolumeRequest) Execute() error { if strlen(r.projectId) > 36 { return fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.volumeId) < 36 { - return fmt.Errorf("volumeId must have at least 36 elements") + if strlen(r.serverId) < 36 { + return fmt.Errorf("serverId must have at least 36 elements") } - if strlen(r.volumeId) > 36 { - return fmt.Errorf("volumeId 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 @@ -5014,17 +5014,6 @@ func (r ApiDeleteVolumeRequest) Execute() error { newErr.Model = v return newErr } - if localVarHTTPResponse.StatusCode == 409 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -5042,59 +5031,820 @@ func (r ApiDeleteVolumeRequest) Execute() error { } /* -DeleteVolume: Delete a volume. +DeleteServer: Delete a server. -Delete a volume inside a project. The deletion will fail if the volume is still in use. +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 volumeId The identifier (ID) of a STACKIT Volume. - @return ApiDeleteVolumeRequest + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiDeleteServerRequest */ -func (a *APIClient) DeleteVolume(ctx context.Context, projectId string, volumeId string) ApiDeleteVolumeRequest { - return ApiDeleteVolumeRequest{ +func (a *APIClient) DeleteServer(ctx context.Context, projectId string, serverId string) ApiDeleteServerRequest { + return ApiDeleteServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - volumeId: volumeId, + serverId: serverId, } } -func (a *APIClient) DeleteVolumeExecute(ctx context.Context, projectId string, volumeId string) error { - r := ApiDeleteVolumeRequest{ +func (a *APIClient) DeleteServerExecute(ctx context.Context, projectId string, serverId string) error { + r := ApiDeleteServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - volumeId: volumeId, + serverId: serverId, } return r.Execute() } -type ApiGetAttachedVolumeRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - volumeId string -} - -func (r ApiGetAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { - var ( +type ApiDeleteVirtualIPRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + networkId string + virtualIpId string +} + +func (r ApiDeleteVirtualIPRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteVirtualIP") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"virtualIpId"+"}", url.PathEscape(ParameterValueToString(r.virtualIpId, "virtualIpId")), -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.networkId) < 36 { + return fmt.Errorf("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return fmt.Errorf("networkId must have less than 36 elements") + } + if strlen(r.virtualIpId) < 36 { + return fmt.Errorf("virtualIpId must have at least 36 elements") + } + if strlen(r.virtualIpId) > 36 { + return fmt.Errorf("virtualIpId 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 +} + +/* +DeleteVirtualIP: Delete a virtual IP. + +Delete a virtual 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. + @param networkId The identifier (ID) of a STACKIT Network. + @param virtualIpId The identifier (ID) of a Virtual IP. + @return ApiDeleteVirtualIPRequest +*/ +func (a *APIClient) DeleteVirtualIP(ctx context.Context, projectId string, networkId string, virtualIpId string) ApiDeleteVirtualIPRequest { + return ApiDeleteVirtualIPRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + networkId: networkId, + virtualIpId: virtualIpId, + } +} + +func (a *APIClient) DeleteVirtualIPExecute(ctx context.Context, projectId string, networkId string, virtualIpId string) error { + r := ApiDeleteVirtualIPRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + networkId: networkId, + virtualIpId: virtualIpId, + } + return r.Execute() +} + +type ApiDeleteVolumeRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + volumeId string +} + +func (r ApiDeleteVolumeRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteVolume") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -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.volumeId) < 36 { + return fmt.Errorf("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return fmt.Errorf("volumeId 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 == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 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 +} + +/* +DeleteVolume: Delete a volume. + +Delete a volume inside a project. The deletion will fail if the volume is still in use. + + @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 volumeId The identifier (ID) of a STACKIT Volume. + @return ApiDeleteVolumeRequest +*/ +func (a *APIClient) DeleteVolume(ctx context.Context, projectId string, volumeId string) ApiDeleteVolumeRequest { + return ApiDeleteVolumeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + volumeId: volumeId, + } +} + +func (a *APIClient) DeleteVolumeExecute(ctx context.Context, projectId string, volumeId string) error { + r := ApiDeleteVolumeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + volumeId: volumeId, + } + return r.Execute() +} + +type ApiGetAttachedVolumeRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string + volumeId string +} + +func (r ApiGetAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumeAttachment + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAttachedVolume") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -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 strlen(r.volumeId) < 36 { + return localVarReturnValue, fmt.Errorf("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return localVarReturnValue, fmt.Errorf("volumeId 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 == 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 +} + +/* +GetAttachedVolume: Get Volume Attachment details. + +Get the details of an existing Volume Attachment. + + @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. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiGetAttachedVolumeRequest +*/ +func (a *APIClient) GetAttachedVolume(ctx context.Context, projectId string, serverId string, volumeId string) ApiGetAttachedVolumeRequest { + return ApiGetAttachedVolumeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, + volumeId: volumeId, + } +} + +func (a *APIClient) GetAttachedVolumeExecute(ctx context.Context, projectId string, serverId string, volumeId string) (*VolumeAttachment, error) { + r := ApiGetAttachedVolumeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, + volumeId: volumeId, + } + return r.Execute() +} + +type ApiGetImageRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + imageId string +} + +func (r ApiGetImageRequest) Execute() (*Image, error) { + var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *VolumeAttachment + localVarReturnValue *Image ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAttachedVolume") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetImage") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images/{imageId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -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.imageId) < 36 { + return localVarReturnValue, fmt.Errorf("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, fmt.Errorf("imageId 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 == 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 +} + +/* +GetImage: Get details about an image. + +Get details about a specific Image 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. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiGetImageRequest +*/ +func (a *APIClient) GetImage(ctx context.Context, projectId string, imageId string) ApiGetImageRequest { + return ApiGetImageRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } +} + +func (a *APIClient) GetImageExecute(ctx context.Context, projectId string, imageId string) (*Image, error) { + r := ApiGetImageRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } + return r.Execute() +} + +type ApiGetImageShareRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + imageId string +} + +func (r ApiGetImageShareRequest) Execute() (*ImageShare, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageShare + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetImageShare") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images/{imageId}/share" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -5105,17 +5855,11 @@ func (r ApiGetAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { 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 strlen(r.volumeId) < 36 { - return localVarReturnValue, fmt.Errorf("volumeId must have at least 36 elements") + if strlen(r.imageId) < 36 { + return localVarReturnValue, fmt.Errorf("imageId must have at least 36 elements") } - if strlen(r.volumeId) > 36 { - return localVarReturnValue, fmt.Errorf("volumeId must have less than 36 elements") + if strlen(r.imageId) > 36 { + return localVarReturnValue, fmt.Errorf("imageId must have less than 36 elements") } // to determine the Content-Type header @@ -5238,60 +5982,59 @@ func (r ApiGetAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { } /* -GetAttachedVolume: Get Volume Attachment details. +GetImageShare: Get share details of an image. -Get the details of an existing Volume Attachment. +Get share details about an shared image. @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. - @param volumeId The identifier (ID) of a STACKIT Volume. - @return ApiGetAttachedVolumeRequest + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiGetImageShareRequest */ -func (a *APIClient) GetAttachedVolume(ctx context.Context, projectId string, serverId string, volumeId string) ApiGetAttachedVolumeRequest { - return ApiGetAttachedVolumeRequest{ +func (a *APIClient) GetImageShare(ctx context.Context, projectId string, imageId string) ApiGetImageShareRequest { + return ApiGetImageShareRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, - volumeId: volumeId, + imageId: imageId, } } -func (a *APIClient) GetAttachedVolumeExecute(ctx context.Context, projectId string, serverId string, volumeId string) (*VolumeAttachment, error) { - r := ApiGetAttachedVolumeRequest{ +func (a *APIClient) GetImageShareExecute(ctx context.Context, projectId string, imageId string) (*ImageShare, error) { + r := ApiGetImageShareRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, - volumeId: volumeId, + imageId: imageId, } return r.Execute() } -type ApiGetImageRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - imageId string +type ApiGetImageShareConsumerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + imageId string + consumerProjectId string } -func (r ApiGetImageRequest) Execute() (*Image, error) { +func (r ApiGetImageShareConsumerRequest) Execute() (*ImageShareConsumer, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Image + localVarReturnValue *ImageShareConsumer ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetImage") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetImageShareConsumer") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images/{imageId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"consumerProjectId"+"}", url.PathEscape(ParameterValueToString(r.consumerProjectId, "consumerProjectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -5308,6 +6051,12 @@ func (r ApiGetImageRequest) Execute() (*Image, error) { if strlen(r.imageId) > 36 { return localVarReturnValue, fmt.Errorf("imageId must have less than 36 elements") } + if strlen(r.consumerProjectId) < 36 { + return localVarReturnValue, fmt.Errorf("consumerProjectId must have at least 36 elements") + } + if strlen(r.consumerProjectId) > 36 { + return localVarReturnValue, fmt.Errorf("consumerProjectId must have less than 36 elements") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -5429,30 +6178,33 @@ func (r ApiGetImageRequest) Execute() (*Image, error) { } /* -GetImage: Get details about an image. +GetImageShareConsumer: Get image share consumer. -Get details about a specific Image inside a project. +Get details about an image share consumer. @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 imageId The identifier (ID) of a STACKIT Image. - @return ApiGetImageRequest + @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. + @return ApiGetImageShareConsumerRequest */ -func (a *APIClient) GetImage(ctx context.Context, projectId string, imageId string) ApiGetImageRequest { - return ApiGetImageRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, +func (a *APIClient) GetImageShareConsumer(ctx context.Context, projectId string, imageId string, consumerProjectId string) ApiGetImageShareConsumerRequest { + return ApiGetImageShareConsumerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + imageId: imageId, + consumerProjectId: consumerProjectId, } } -func (a *APIClient) GetImageExecute(ctx context.Context, projectId string, imageId string) (*Image, error) { - r := ApiGetImageRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, +func (a *APIClient) GetImageShareConsumerExecute(ctx context.Context, projectId string, imageId string, consumerProjectId string) (*ImageShareConsumer, error) { + r := ApiGetImageShareConsumerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + imageId: imageId, + consumerProjectId: consumerProjectId, } return r.Execute() } @@ -6360,7 +7112,7 @@ func (r ApiGetNicRequest) Execute() (*NIC, error) { } /* -GetNic: Get details about a network interface. +GetNic: Get details about a network interface of a network. Get details about a network interface inside a network. @@ -7907,17 +8659,17 @@ func (a *APIClient) GetServerConsoleExecute(ctx context.Context, projectId strin } type ApiGetServerLogRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - getServerLogRequest *GetServerLogRequest + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string + length *int64 } -// Request the server log. By default the length is limited to 2000 lines. +// Request the server log. By default the length is limited to 2000 lines. Set to 0 to retrieve the complete log. -func (r ApiGetServerLogRequest) GetServerLogRequest(getServerLogRequest GetServerLogRequest) ApiGetServerLogRequest { - r.getServerLogRequest = &getServerLogRequest +func (r ApiGetServerLogRequest) Length(length int64) ApiGetServerLogRequest { + r.length = &length return r } @@ -7954,8 +8706,11 @@ func (r ApiGetServerLogRequest) Execute() (*GetServerLog200Response, error) { return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") } + if r.length != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "length", r.length, "") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -7971,8 +8726,6 @@ func (r ApiGetServerLogRequest) Execute() (*GetServerLog200Response, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.getServerLogRequest req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -8648,73 +9401,245 @@ func (r ApiGetVolumePerformanceClassRequest) Execute() (*VolumePerformanceClass, } /* -GetVolumePerformanceClass: Get details about a volume performance class. +GetVolumePerformanceClass: Get details about a volume performance class. + +Get details about a specific volume performance class. + + @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 volumePerformanceClass The name of a STACKIT Volume performance class. + @return ApiGetVolumePerformanceClassRequest +*/ +func (a *APIClient) GetVolumePerformanceClass(ctx context.Context, projectId string, volumePerformanceClass string) ApiGetVolumePerformanceClassRequest { + return ApiGetVolumePerformanceClassRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + volumePerformanceClass: volumePerformanceClass, + } +} + +func (a *APIClient) GetVolumePerformanceClassExecute(ctx context.Context, projectId string, volumePerformanceClass string) (*VolumePerformanceClass, error) { + r := ApiGetVolumePerformanceClassRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + volumePerformanceClass: volumePerformanceClass, + } + return r.Execute() +} + +type ApiListAttachedVolumesRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string +} + +func (r ApiListAttachedVolumesRequest) Execute() (*VolumeAttachmentListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumeAttachmentListResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAttachedVolumes") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments" + 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") + } + + // 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 +} + +/* +ListAttachedVolumes: List all volume attachments of a server. -Get details about a specific volume performance class. +Get a list of all volume attachments of a server. @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 volumePerformanceClass The name of a STACKIT Volume performance class. - @return ApiGetVolumePerformanceClassRequest + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListAttachedVolumesRequest */ -func (a *APIClient) GetVolumePerformanceClass(ctx context.Context, projectId string, volumePerformanceClass string) ApiGetVolumePerformanceClassRequest { - return ApiGetVolumePerformanceClassRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - volumePerformanceClass: volumePerformanceClass, +func (a *APIClient) ListAttachedVolumes(ctx context.Context, projectId string, serverId string) ApiListAttachedVolumesRequest { + return ApiListAttachedVolumesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, } } -func (a *APIClient) GetVolumePerformanceClassExecute(ctx context.Context, projectId string, volumePerformanceClass string) (*VolumePerformanceClass, error) { - r := ApiGetVolumePerformanceClassRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - volumePerformanceClass: volumePerformanceClass, +func (a *APIClient) ListAttachedVolumesExecute(ctx context.Context, projectId string, serverId string) (*VolumeAttachmentListResponse, error) { + r := ApiListAttachedVolumesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, } return r.Execute() } -type ApiListAttachedVolumesRequest struct { +type ApiListAvailabilityZonesRequest struct { ctx context.Context apiService *DefaultApiService - projectId string - serverId string } -func (r ApiListAttachedVolumesRequest) Execute() (*VolumeAttachmentListResponse, error) { +func (r ApiListAvailabilityZonesRequest) Execute() (*AvailabilityZoneListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *VolumeAttachmentListResponse + localVarReturnValue *AvailabilityZoneListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAttachedVolumes") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAvailabilityZones") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath := localBasePath + "/v1alpha1/availability-zones" 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") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -8836,30 +9761,24 @@ func (r ApiListAttachedVolumesRequest) Execute() (*VolumeAttachmentListResponse, } /* -ListAttachedVolumes: List all volume attachments of a server. +ListAvailabilityZones: List all availability zones. -Get a list of all volume attachments of a server. +Get a list of all availability zones. @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 ApiListAttachedVolumesRequest + @return ApiListAvailabilityZonesRequest */ -func (a *APIClient) ListAttachedVolumes(ctx context.Context, projectId string, serverId string) ApiListAttachedVolumesRequest { - return ApiListAttachedVolumesRequest{ +func (a *APIClient) ListAvailabilityZones(ctx context.Context) ApiListAvailabilityZonesRequest { + return ApiListAvailabilityZonesRequest{ apiService: a.defaultApi, ctx: ctx, - projectId: projectId, - serverId: serverId, } } -func (a *APIClient) ListAttachedVolumesExecute(ctx context.Context, projectId string, serverId string) (*VolumeAttachmentListResponse, error) { - r := ApiListAttachedVolumesRequest{ +func (a *APIClient) ListAvailabilityZonesExecute(ctx context.Context) (*AvailabilityZoneListResponse, error) { + r := ApiListAvailabilityZonesRequest{ apiService: a.defaultApi, ctx: ctx, - projectId: projectId, - serverId: serverId, } return r.Execute() } @@ -14071,22 +14990,224 @@ func (r ApiResizeVolumeRequest) Execute() error { localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes/{volumeId}/resize" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -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.volumeId) < 36 { + return fmt.Errorf("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return fmt.Errorf("volumeId must have less than 36 elements") + } + + // 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.resizeVolumePayload + 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 == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 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 +} + +/* +ResizeVolume: Update the size of a volume. + +Update the size of a block device volume. The new volume size must be larger than the current size. + + @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 volumeId The identifier (ID) of a STACKIT Volume. + @return ApiResizeVolumeRequest +*/ +func (a *APIClient) ResizeVolume(ctx context.Context, projectId string, volumeId string) ApiResizeVolumeRequest { + return ApiResizeVolumeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + volumeId: volumeId, + } +} + +func (a *APIClient) ResizeVolumeExecute(ctx context.Context, projectId string, volumeId string) error { + r := ApiResizeVolumeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + volumeId: volumeId, + } + return r.Execute() +} + +type ApiSetImageShareRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + imageId string + setImageSharePayload *SetImageSharePayload +} + +// Settings for an Image Share. + +func (r ApiSetImageShareRequest) SetImageSharePayload(setImageSharePayload SetImageSharePayload) ApiSetImageShareRequest { + r.setImageSharePayload = &setImageSharePayload + return r +} + +func (r ApiSetImageShareRequest) Execute() (*ImageShare, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageShare + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.SetImageShare") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images/{imageId}/share" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -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") + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") } if strlen(r.projectId) > 36 { - return fmt.Errorf("projectId must have less than 36 elements") + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.volumeId) < 36 { - return fmt.Errorf("volumeId must have at least 36 elements") + if strlen(r.imageId) < 36 { + return localVarReturnValue, fmt.Errorf("imageId must have at least 36 elements") } - if strlen(r.volumeId) > 36 { - return fmt.Errorf("volumeId must have less than 36 elements") + if strlen(r.imageId) > 36 { + return localVarReturnValue, fmt.Errorf("imageId must have less than 36 elements") + } + if r.setImageSharePayload == nil { + return localVarReturnValue, fmt.Errorf("setImageSharePayload is required and must be specified") } // to determine the Content-Type header @@ -14107,10 +15228,10 @@ func (r ApiResizeVolumeRequest) Execute() error { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.resizeVolumePayload + localVarPostBody = r.setImageSharePayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return err + return localVarReturnValue, err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -14124,14 +15245,14 @@ func (r ApiResizeVolumeRequest) Execute() error { *contextHTTPResponse = localVarHTTPResponse } if err != nil || localVarHTTPResponse == nil { - return err + return localVarReturnValue, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return err + return localVarReturnValue, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -14145,97 +15266,96 @@ func (r ApiResizeVolumeRequest) Execute() error { err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 404 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } - if localVarHTTPResponse.StatusCode == 409 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } - return newErr + return localVarReturnValue, newErr } - return nil + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil } /* -ResizeVolume: Update the size of a volume. +SetImageShare: Set image share. -Update the size of a block device volume. The new volume size must be larger than the current size. +Set share of an Image. New Options will replace existing settings. @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 volumeId The identifier (ID) of a STACKIT Volume. - @return ApiResizeVolumeRequest + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiSetImageShareRequest */ -func (a *APIClient) ResizeVolume(ctx context.Context, projectId string, volumeId string) ApiResizeVolumeRequest { - return ApiResizeVolumeRequest{ +func (a *APIClient) SetImageShare(ctx context.Context, projectId string, imageId string) ApiSetImageShareRequest { + return ApiSetImageShareRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - volumeId: volumeId, + imageId: imageId, } } -func (a *APIClient) ResizeVolumeExecute(ctx context.Context, projectId string, volumeId string) error { - r := ApiResizeVolumeRequest{ +func (a *APIClient) SetImageShareExecute(ctx context.Context, projectId string, imageId string) (*ImageShare, error) { + r := ApiSetImageShareRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - volumeId: volumeId, + imageId: imageId, } return r.Execute() } @@ -15217,6 +16337,207 @@ func (a *APIClient) UpdateImageExecute(ctx context.Context, projectId string, im return r.Execute() } +type ApiUpdateImageShareRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + imageId string + updateImageSharePayload *UpdateImageSharePayload +} + +// Update an Image Share. + +func (r ApiUpdateImageShareRequest) UpdateImageSharePayload(updateImageSharePayload UpdateImageSharePayload) ApiUpdateImageShareRequest { + r.updateImageSharePayload = &updateImageSharePayload + return r +} + +func (r ApiUpdateImageShareRequest) Execute() (*ImageShare, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageShare + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateImageShare") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images/{imageId}/share" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -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.imageId) < 36 { + return localVarReturnValue, fmt.Errorf("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, fmt.Errorf("imageId must have less than 36 elements") + } + if r.updateImageSharePayload == nil { + return localVarReturnValue, fmt.Errorf("updateImageSharePayload 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.updateImageSharePayload + 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 +} + +/* +UpdateImageShare: Update image share. + +Update share of an Image. Projects will be appended to existing list. + + @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 imageId The identifier (ID) of a STACKIT Image. + @return ApiUpdateImageShareRequest +*/ +func (a *APIClient) UpdateImageShare(ctx context.Context, projectId string, imageId string) ApiUpdateImageShareRequest { + return ApiUpdateImageShareRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } +} + +func (a *APIClient) UpdateImageShareExecute(ctx context.Context, projectId string, imageId string) (*ImageShare, error) { + r := ApiUpdateImageShareRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } + return r.Execute() +} + type ApiUpdateKeyPairRequest struct { ctx context.Context apiService *DefaultApiService diff --git a/services/iaasalpha/api_default_test.go b/services/iaasalpha/api_default_test.go index 4b56d9e33..f0b6d8266 100644 --- a/services/iaasalpha/api_default_test.go +++ b/services/iaasalpha/api_default_test.go @@ -987,6 +987,107 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) + t.Run("Test DefaultApiService DeleteImageShare", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/images/{imageId}/share" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + imageIdValue := "imageId" + path = strings.Replace(path, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -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" + imageId := "imageId" + + reqErr := apiClient.DeleteImageShare(context.Background(), projectId, imageId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + t.Run("Test DefaultApiService DeleteImageShareConsumer", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + imageIdValue := "imageId" + path = strings.Replace(path, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) + consumerProjectIdValue := "consumerProjectId" + path = strings.Replace(path, "{"+"consumerProjectId"+"}", url.PathEscape(ParameterValueToString(consumerProjectIdValue, "consumerProjectId")), -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" + imageId := "imageId" + consumerProjectId := "consumerProjectId" + + reqErr := apiClient.DeleteImageShareConsumer(context.Background(), projectId, imageId, consumerProjectId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + t.Run("Test DefaultApiService DeleteKeyPair", func(t *testing.T) { path := "/v1alpha1/keypairs/{keypairName}" keypairNameValue := "keypairName" @@ -1498,6 +1599,119 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) + t.Run("Test DefaultApiService GetImageShare", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/images/{imageId}/share" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + imageIdValue := "imageId" + path = strings.Replace(path, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := ImageShare{} + 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" + imageId := "imageId" + + resp, reqErr := apiClient.GetImageShare(context.Background(), projectId, imageId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetImageShareConsumer", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + imageIdValue := "imageId" + path = strings.Replace(path, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) + consumerProjectIdValue := "consumerProjectId" + path = strings.Replace(path, "{"+"consumerProjectId"+"}", url.PathEscape(ParameterValueToString(consumerProjectIdValue, "consumerProjectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := ImageShareConsumer{} + 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" + imageId := "imageId" + consumerProjectId := "consumerProjectId" + + resp, reqErr := apiClient.GetImageShareConsumer(context.Background(), projectId, imageId, consumerProjectId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + t.Run("Test DefaultApiService GetKeyPair", func(t *testing.T) { path := "/v1alpha1/keypairs/{keypairName}" keypairNameValue := "keypairName" @@ -2491,6 +2705,54 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) + t.Run("Test DefaultApiService ListAvailabilityZones", func(t *testing.T) { + path := "/v1alpha1/availability-zones" + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := AvailabilityZoneListResponse{} + 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) + } + + resp, reqErr := apiClient.ListAvailabilityZones(context.Background()).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + t.Run("Test DefaultApiService ListImages", func(t *testing.T) { path := "/v1alpha1/projects/{projectId}/images" projectIdValue := "projectId" @@ -3960,6 +4222,62 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) + t.Run("Test DefaultApiService SetImageShare", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/images/{imageId}/share" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + imageIdValue := "imageId" + path = strings.Replace(path, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := ImageShare{} + 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" + imageId := "imageId" + setImageSharePayload := SetImageSharePayload{} + + resp, reqErr := apiClient.SetImageShare(context.Background(), projectId, imageId).SetImageSharePayload(setImageSharePayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + t.Run("Test DefaultApiService StartServer", func(t *testing.T) { path := "/v1alpha1/projects/{projectId}/servers/{serverId}/start" projectIdValue := "projectId" @@ -4222,6 +4540,62 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) + t.Run("Test DefaultApiService UpdateImageShare", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/images/{imageId}/share" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + imageIdValue := "imageId" + path = strings.Replace(path, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := ImageShare{} + 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" + imageId := "imageId" + updateImageSharePayload := UpdateImageSharePayload{} + + resp, reqErr := apiClient.UpdateImageShare(context.Background(), projectId, imageId).UpdateImageSharePayload(updateImageSharePayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + t.Run("Test DefaultApiService UpdateKeyPair", func(t *testing.T) { path := "/v1alpha1/keypairs/{keypairName}" keypairNameValue := "keypairName" diff --git a/services/iaasalpha/model_add_member_to_virtual_ip_payload.go b/services/iaasalpha/model_add_member_to_virtual_ip_payload.go index 704cbd917..6ac14e4ee 100644 --- a/services/iaasalpha/model_add_member_to_virtual_ip_payload.go +++ b/services/iaasalpha/model_add_member_to_virtual_ip_payload.go @@ -46,7 +46,7 @@ func NewAddMemberToVirtualIPPayloadWithDefaults() *AddMemberToVirtualIPPayload { // GetMember returns the Member field value func (o *AddMemberToVirtualIPPayload) GetMember() *string { - if o == nil { + if o == nil || IsNil(o.Member) { var ret *string return ret } diff --git a/services/iaasalpha/model_add_volume_to_server_payload.go b/services/iaasalpha/model_add_volume_to_server_payload.go index 1e8743892..7d6cb102f 100644 --- a/services/iaasalpha/model_add_volume_to_server_payload.go +++ b/services/iaasalpha/model_add_volume_to_server_payload.go @@ -68,7 +68,7 @@ func (o *AddVolumeToServerPayload) GetDeleteOnTerminationOk() (*bool, bool) { // HasDeleteOnTermination returns a boolean if a field has been set. func (o *AddVolumeToServerPayload) HasDeleteOnTermination() bool { - if o != nil && !IsNil(o.DeleteOnTermination) { + if o != nil && !IsNil(o.DeleteOnTermination) && !IsNil(o.DeleteOnTermination) { return true } @@ -100,7 +100,7 @@ func (o *AddVolumeToServerPayload) GetServerIdOk() (*string, bool) { // HasServerId returns a boolean if a field has been set. func (o *AddVolumeToServerPayload) HasServerId() bool { - if o != nil && !IsNil(o.ServerId) { + if o != nil && !IsNil(o.ServerId) && !IsNil(o.ServerId) { return true } @@ -132,7 +132,7 @@ func (o *AddVolumeToServerPayload) GetVolumeIdOk() (*string, bool) { // HasVolumeId returns a boolean if a field has been set. func (o *AddVolumeToServerPayload) HasVolumeId() bool { - if o != nil && !IsNil(o.VolumeId) { + if o != nil && !IsNil(o.VolumeId) && !IsNil(o.VolumeId) { return true } diff --git a/services/iaasalpha/model_area.go b/services/iaasalpha/model_area.go index 5a014f1e3..316d80e31 100644 --- a/services/iaasalpha/model_area.go +++ b/services/iaasalpha/model_area.go @@ -66,7 +66,7 @@ func (o *Area) GetDefaultNameserversOk() (*[]string, bool) { // HasDefaultNameservers returns a boolean if a field has been set. func (o *Area) HasDefaultNameservers() bool { - if o != nil && !IsNil(o.DefaultNameservers) { + if o != nil && !IsNil(o.DefaultNameservers) && !IsNil(o.DefaultNameservers) { return true } @@ -98,7 +98,7 @@ func (o *Area) GetNetworkRangesOk() (*[]NetworkRange, bool) { // HasNetworkRanges returns a boolean if a field has been set. func (o *Area) HasNetworkRanges() bool { - if o != nil && !IsNil(o.NetworkRanges) { + if o != nil && !IsNil(o.NetworkRanges) && !IsNil(o.NetworkRanges) { return true } @@ -130,7 +130,7 @@ func (o *Area) GetRoutesOk() (*[]Route, bool) { // HasRoutes returns a boolean if a field has been set. func (o *Area) HasRoutes() bool { - if o != nil && !IsNil(o.Routes) { + if o != nil && !IsNil(o.Routes) && !IsNil(o.Routes) { return true } @@ -162,7 +162,7 @@ func (o *Area) GetTransferNetworkOk() (*string, bool) { // HasTransferNetwork returns a boolean if a field has been set. func (o *Area) HasTransferNetwork() bool { - if o != nil && !IsNil(o.TransferNetwork) { + if o != nil && !IsNil(o.TransferNetwork) && !IsNil(o.TransferNetwork) { return true } diff --git a/services/iaasalpha/model_area_config.go b/services/iaasalpha/model_area_config.go index f905e44b9..1cbe5c35a 100644 --- a/services/iaasalpha/model_area_config.go +++ b/services/iaasalpha/model_area_config.go @@ -71,7 +71,7 @@ func (o *AreaConfig) GetDefaultNameserversOk() (*[]string, bool) { // HasDefaultNameservers returns a boolean if a field has been set. func (o *AreaConfig) HasDefaultNameservers() bool { - if o != nil && !IsNil(o.DefaultNameservers) { + if o != nil && !IsNil(o.DefaultNameservers) && !IsNil(o.DefaultNameservers) { return true } @@ -85,7 +85,7 @@ func (o *AreaConfig) SetDefaultNameservers(v *[]string) { // GetNetworkRanges returns the NetworkRanges field value func (o *AreaConfig) GetNetworkRanges() *[]NetworkRange { - if o == nil { + if o == nil || IsNil(o.NetworkRanges) { var ret *[]NetworkRange return ret } @@ -127,7 +127,7 @@ func (o *AreaConfig) GetRoutesOk() (*[]Route, bool) { // HasRoutes returns a boolean if a field has been set. func (o *AreaConfig) HasRoutes() bool { - if o != nil && !IsNil(o.Routes) { + if o != nil && !IsNil(o.Routes) && !IsNil(o.Routes) { return true } @@ -141,7 +141,7 @@ func (o *AreaConfig) SetRoutes(v *[]Route) { // GetTransferNetwork returns the TransferNetwork field value func (o *AreaConfig) GetTransferNetwork() *string { - if o == nil { + if o == nil || IsNil(o.TransferNetwork) { var ret *string return ret } diff --git a/services/iaasalpha/model_area_prefix_config_ipv4.go b/services/iaasalpha/model_area_prefix_config_ipv4.go index 641e394cf..5c7eb9631 100644 --- a/services/iaasalpha/model_area_prefix_config_ipv4.go +++ b/services/iaasalpha/model_area_prefix_config_ipv4.go @@ -76,7 +76,7 @@ func (o *AreaPrefixConfigIPv4) GetDefaultPrefixLenOk() (*int64, bool) { // HasDefaultPrefixLen returns a boolean if a field has been set. func (o *AreaPrefixConfigIPv4) HasDefaultPrefixLen() bool { - if o != nil && !IsNil(o.DefaultPrefixLen) { + if o != nil && !IsNil(o.DefaultPrefixLen) && !IsNil(o.DefaultPrefixLen) { return true } @@ -108,7 +108,7 @@ func (o *AreaPrefixConfigIPv4) GetMaxPrefixLenOk() (*int64, bool) { // HasMaxPrefixLen returns a boolean if a field has been set. func (o *AreaPrefixConfigIPv4) HasMaxPrefixLen() bool { - if o != nil && !IsNil(o.MaxPrefixLen) { + if o != nil && !IsNil(o.MaxPrefixLen) && !IsNil(o.MaxPrefixLen) { return true } @@ -140,7 +140,7 @@ func (o *AreaPrefixConfigIPv4) GetMinPrefixLenOk() (*int64, bool) { // HasMinPrefixLen returns a boolean if a field has been set. func (o *AreaPrefixConfigIPv4) HasMinPrefixLen() bool { - if o != nil && !IsNil(o.MinPrefixLen) { + if o != nil && !IsNil(o.MinPrefixLen) && !IsNil(o.MinPrefixLen) { return true } diff --git a/services/iaasalpha/model_availability_zone_list_response.go b/services/iaasalpha/model_availability_zone_list_response.go new file mode 100644 index 000000000..861580497 --- /dev/null +++ b/services/iaasalpha/model_availability_zone_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 AvailabilityZoneListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AvailabilityZoneListResponse{} + +// AvailabilityZoneListResponse Availability Zone list response. +type AvailabilityZoneListResponse struct { + // A list of availability zones. + // REQUIRED + Items *[]string `json:"items"` +} + +type _AvailabilityZoneListResponse AvailabilityZoneListResponse + +// NewAvailabilityZoneListResponse instantiates a new AvailabilityZoneListResponse 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 NewAvailabilityZoneListResponse(items *[]string) *AvailabilityZoneListResponse { + this := AvailabilityZoneListResponse{} + this.Items = items + return &this +} + +// NewAvailabilityZoneListResponseWithDefaults instantiates a new AvailabilityZoneListResponse 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 NewAvailabilityZoneListResponseWithDefaults() *AvailabilityZoneListResponse { + this := AvailabilityZoneListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *AvailabilityZoneListResponse) GetItems() *[]string { + if o == nil || IsNil(o.Items) { + var ret *[]string + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *AvailabilityZoneListResponse) GetItemsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *AvailabilityZoneListResponse) SetItems(v *[]string) { + o.Items = v +} + +func (o AvailabilityZoneListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +type NullableAvailabilityZoneListResponse struct { + value *AvailabilityZoneListResponse + isSet bool +} + +func (v NullableAvailabilityZoneListResponse) Get() *AvailabilityZoneListResponse { + return v.value +} + +func (v *NullableAvailabilityZoneListResponse) Set(val *AvailabilityZoneListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAvailabilityZoneListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAvailabilityZoneListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAvailabilityZoneListResponse(val *AvailabilityZoneListResponse) *NullableAvailabilityZoneListResponse { + return &NullableAvailabilityZoneListResponse{value: val, isSet: true} +} + +func (v NullableAvailabilityZoneListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAvailabilityZoneListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_base_security_group_rule.go b/services/iaasalpha/model_base_security_group_rule.go index a43f1fefb..7d36bf2ad 100644 --- a/services/iaasalpha/model_base_security_group_rule.go +++ b/services/iaasalpha/model_base_security_group_rule.go @@ -82,7 +82,7 @@ func (o *BaseSecurityGroupRule) GetDescriptionOk() (*string, bool) { // HasDescription returns a boolean if a field has been set. func (o *BaseSecurityGroupRule) HasDescription() bool { - if o != nil && !IsNil(o.Description) { + if o != nil && !IsNil(o.Description) && !IsNil(o.Description) { return true } @@ -96,7 +96,7 @@ func (o *BaseSecurityGroupRule) SetDescription(v *string) { // GetDirection returns the Direction field value func (o *BaseSecurityGroupRule) GetDirection() *string { - if o == nil { + if o == nil || IsNil(o.Direction) { var ret *string return ret } @@ -138,7 +138,7 @@ func (o *BaseSecurityGroupRule) GetEthertypeOk() (*string, bool) { // HasEthertype returns a boolean if a field has been set. func (o *BaseSecurityGroupRule) HasEthertype() bool { - if o != nil && !IsNil(o.Ethertype) { + if o != nil && !IsNil(o.Ethertype) && !IsNil(o.Ethertype) { return true } @@ -170,7 +170,7 @@ func (o *BaseSecurityGroupRule) GetIcmpParametersOk() (*ICMPParameters, bool) { // HasIcmpParameters returns a boolean if a field has been set. func (o *BaseSecurityGroupRule) HasIcmpParameters() bool { - if o != nil && !IsNil(o.IcmpParameters) { + if o != nil && !IsNil(o.IcmpParameters) && !IsNil(o.IcmpParameters) { return true } @@ -202,7 +202,7 @@ func (o *BaseSecurityGroupRule) GetIdOk() (*string, bool) { // HasId returns a boolean if a field has been set. func (o *BaseSecurityGroupRule) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && !IsNil(o.Id) && !IsNil(o.Id) { return true } @@ -234,7 +234,7 @@ func (o *BaseSecurityGroupRule) GetIpRangeOk() (*string, bool) { // HasIpRange returns a boolean if a field has been set. func (o *BaseSecurityGroupRule) HasIpRange() bool { - if o != nil && !IsNil(o.IpRange) { + if o != nil && !IsNil(o.IpRange) && !IsNil(o.IpRange) { return true } @@ -266,7 +266,7 @@ func (o *BaseSecurityGroupRule) GetPortRangeOk() (*PortRange, bool) { // HasPortRange returns a boolean if a field has been set. func (o *BaseSecurityGroupRule) HasPortRange() bool { - if o != nil && !IsNil(o.PortRange) { + if o != nil && !IsNil(o.PortRange) && !IsNil(o.PortRange) { return true } @@ -298,7 +298,7 @@ func (o *BaseSecurityGroupRule) GetRemoteSecurityGroupIdOk() (*string, bool) { // HasRemoteSecurityGroupId returns a boolean if a field has been set. func (o *BaseSecurityGroupRule) HasRemoteSecurityGroupId() bool { - if o != nil && !IsNil(o.RemoteSecurityGroupId) { + if o != nil && !IsNil(o.RemoteSecurityGroupId) && !IsNil(o.RemoteSecurityGroupId) { return true } @@ -330,7 +330,7 @@ func (o *BaseSecurityGroupRule) GetSecurityGroupIdOk() (*string, bool) { // HasSecurityGroupId returns a boolean if a field has been set. func (o *BaseSecurityGroupRule) HasSecurityGroupId() bool { - if o != nil && !IsNil(o.SecurityGroupId) { + if o != nil && !IsNil(o.SecurityGroupId) && !IsNil(o.SecurityGroupId) { return true } diff --git a/services/iaasalpha/model_boot_volume.go b/services/iaasalpha/model_boot_volume.go index 8d557707c..dab02e785 100644 --- a/services/iaasalpha/model_boot_volume.go +++ b/services/iaasalpha/model_boot_volume.go @@ -71,7 +71,7 @@ func (o *BootVolume) GetDeleteOnTerminationOk() (*bool, bool) { // HasDeleteOnTermination returns a boolean if a field has been set. func (o *BootVolume) HasDeleteOnTermination() bool { - if o != nil && !IsNil(o.DeleteOnTermination) { + if o != nil && !IsNil(o.DeleteOnTermination) && !IsNil(o.DeleteOnTermination) { return true } @@ -103,7 +103,7 @@ func (o *BootVolume) GetIdOk() (*string, bool) { // HasId returns a boolean if a field has been set. func (o *BootVolume) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && !IsNil(o.Id) && !IsNil(o.Id) { return true } @@ -135,7 +135,7 @@ func (o *BootVolume) GetPerformanceClassOk() (*string, bool) { // HasPerformanceClass returns a boolean if a field has been set. func (o *BootVolume) HasPerformanceClass() bool { - if o != nil && !IsNil(o.PerformanceClass) { + if o != nil && !IsNil(o.PerformanceClass) && !IsNil(o.PerformanceClass) { return true } @@ -167,7 +167,7 @@ func (o *BootVolume) GetSizeOk() (*int64, bool) { // HasSize returns a boolean if a field has been set. func (o *BootVolume) HasSize() bool { - if o != nil && !IsNil(o.Size) { + if o != nil && !IsNil(o.Size) && !IsNil(o.Size) { return true } @@ -199,7 +199,7 @@ func (o *BootVolume) GetSourceOk() (*BootVolumeSource, bool) { // HasSource returns a boolean if a field has been set. func (o *BootVolume) HasSource() bool { - if o != nil && !IsNil(o.Source) { + if o != nil && !IsNil(o.Source) && !IsNil(o.Source) { return true } diff --git a/services/iaasalpha/model_boot_volume_source.go b/services/iaasalpha/model_boot_volume_source.go index c163b12fa..e1cee12b7 100644 --- a/services/iaasalpha/model_boot_volume_source.go +++ b/services/iaasalpha/model_boot_volume_source.go @@ -50,7 +50,7 @@ func NewBootVolumeSourceWithDefaults() *BootVolumeSource { // GetId returns the Id field value func (o *BootVolumeSource) GetId() *string { - if o == nil { + if o == nil || IsNil(o.Id) { var ret *string return ret } @@ -74,7 +74,7 @@ func (o *BootVolumeSource) SetId(v *string) { // GetType returns the Type field value func (o *BootVolumeSource) GetType() *string { - if o == nil { + if o == nil || IsNil(o.Type) { var ret *string return ret } diff --git a/services/iaasalpha/model_create_area_address_family.go b/services/iaasalpha/model_create_area_address_family.go index 95a0ec077..ccabae74b 100644 --- a/services/iaasalpha/model_create_area_address_family.go +++ b/services/iaasalpha/model_create_area_address_family.go @@ -59,7 +59,7 @@ func (o *CreateAreaAddressFamily) GetIpv4Ok() (*CreateAreaIPv4, bool) { // HasIpv4 returns a boolean if a field has been set. func (o *CreateAreaAddressFamily) HasIpv4() bool { - if o != nil && !IsNil(o.Ipv4) { + if o != nil && !IsNil(o.Ipv4) && !IsNil(o.Ipv4) { return true } diff --git a/services/iaasalpha/model_create_area_ipv4.go b/services/iaasalpha/model_create_area_ipv4.go index e206d5fe1..025487ebd 100644 --- a/services/iaasalpha/model_create_area_ipv4.go +++ b/services/iaasalpha/model_create_area_ipv4.go @@ -89,7 +89,7 @@ func (o *CreateAreaIPv4) GetDefaultNameserversOk() (*[]string, bool) { // HasDefaultNameservers returns a boolean if a field has been set. func (o *CreateAreaIPv4) HasDefaultNameservers() bool { - if o != nil && !IsNil(o.DefaultNameservers) { + if o != nil && !IsNil(o.DefaultNameservers) && !IsNil(o.DefaultNameservers) { return true } @@ -103,7 +103,7 @@ func (o *CreateAreaIPv4) SetDefaultNameservers(v *[]string) { // GetNetworkRanges returns the NetworkRanges field value func (o *CreateAreaIPv4) GetNetworkRanges() *[]NetworkRange { - if o == nil { + if o == nil || IsNil(o.NetworkRanges) { var ret *[]NetworkRange return ret } @@ -145,7 +145,7 @@ func (o *CreateAreaIPv4) GetRoutesOk() (*[]Route, bool) { // HasRoutes returns a boolean if a field has been set. func (o *CreateAreaIPv4) HasRoutes() bool { - if o != nil && !IsNil(o.Routes) { + if o != nil && !IsNil(o.Routes) && !IsNil(o.Routes) { return true } @@ -159,7 +159,7 @@ func (o *CreateAreaIPv4) SetRoutes(v *[]Route) { // GetTransferNetwork returns the TransferNetwork field value func (o *CreateAreaIPv4) GetTransferNetwork() *string { - if o == nil { + if o == nil || IsNil(o.TransferNetwork) { var ret *string return ret } @@ -201,7 +201,7 @@ func (o *CreateAreaIPv4) GetDefaultPrefixLenOk() (*int64, bool) { // HasDefaultPrefixLen returns a boolean if a field has been set. func (o *CreateAreaIPv4) HasDefaultPrefixLen() bool { - if o != nil && !IsNil(o.DefaultPrefixLen) { + if o != nil && !IsNil(o.DefaultPrefixLen) && !IsNil(o.DefaultPrefixLen) { return true } @@ -233,7 +233,7 @@ func (o *CreateAreaIPv4) GetMaxPrefixLenOk() (*int64, bool) { // HasMaxPrefixLen returns a boolean if a field has been set. func (o *CreateAreaIPv4) HasMaxPrefixLen() bool { - if o != nil && !IsNil(o.MaxPrefixLen) { + if o != nil && !IsNil(o.MaxPrefixLen) && !IsNil(o.MaxPrefixLen) { return true } @@ -265,7 +265,7 @@ func (o *CreateAreaIPv4) GetMinPrefixLenOk() (*int64, bool) { // HasMinPrefixLen returns a boolean if a field has been set. func (o *CreateAreaIPv4) HasMinPrefixLen() bool { - if o != nil && !IsNil(o.MinPrefixLen) { + if o != nil && !IsNil(o.MinPrefixLen) && !IsNil(o.MinPrefixLen) { return true } diff --git a/services/iaasalpha/model_create_image_payload.go b/services/iaasalpha/model_create_image_payload.go index fdc79f52b..f1861f0f8 100644 --- a/services/iaasalpha/model_create_image_payload.go +++ b/services/iaasalpha/model_create_image_payload.go @@ -37,7 +37,9 @@ type CreateImagePayload struct { MinRam *int64 `json:"minRam,omitempty"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED - Name *string `json:"name"` + Name *string `json:"name"` + // Universally Unique Identifier (UUID). + Owner *string `json:"owner,omitempty"` Protected *bool `json:"protected,omitempty"` // Scope of an Image. Scope *string `json:"scope,omitempty"` @@ -88,7 +90,7 @@ func (o *CreateImagePayload) GetChecksumOk() (*ImageChecksum, bool) { // HasChecksum returns a boolean if a field has been set. func (o *CreateImagePayload) HasChecksum() bool { - if o != nil && !IsNil(o.Checksum) { + if o != nil && !IsNil(o.Checksum) && !IsNil(o.Checksum) { return true } @@ -120,7 +122,7 @@ func (o *CreateImagePayload) GetConfigOk() (*ImageConfig, bool) { // HasConfig returns a boolean if a field has been set. func (o *CreateImagePayload) HasConfig() bool { - if o != nil && !IsNil(o.Config) { + if o != nil && !IsNil(o.Config) && !IsNil(o.Config) { return true } @@ -152,7 +154,7 @@ func (o *CreateImagePayload) GetCreatedAtOk() (*time.Time, bool) { // HasCreatedAt returns a boolean if a field has been set. func (o *CreateImagePayload) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { + if o != nil && !IsNil(o.CreatedAt) && !IsNil(o.CreatedAt) { return true } @@ -166,7 +168,7 @@ func (o *CreateImagePayload) SetCreatedAt(v *time.Time) { // GetDiskFormat returns the DiskFormat field value func (o *CreateImagePayload) GetDiskFormat() *string { - if o == nil { + if o == nil || IsNil(o.DiskFormat) { var ret *string return ret } @@ -208,7 +210,7 @@ func (o *CreateImagePayload) GetIdOk() (*string, bool) { // HasId returns a boolean if a field has been set. func (o *CreateImagePayload) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && !IsNil(o.Id) && !IsNil(o.Id) { return true } @@ -240,7 +242,7 @@ func (o *CreateImagePayload) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *CreateImagePayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -272,7 +274,7 @@ func (o *CreateImagePayload) GetMinDiskSizeOk() (*int64, bool) { // HasMinDiskSize returns a boolean if a field has been set. func (o *CreateImagePayload) HasMinDiskSize() bool { - if o != nil && !IsNil(o.MinDiskSize) { + if o != nil && !IsNil(o.MinDiskSize) && !IsNil(o.MinDiskSize) { return true } @@ -304,7 +306,7 @@ func (o *CreateImagePayload) GetMinRamOk() (*int64, bool) { // HasMinRam returns a boolean if a field has been set. func (o *CreateImagePayload) HasMinRam() bool { - if o != nil && !IsNil(o.MinRam) { + if o != nil && !IsNil(o.MinRam) && !IsNil(o.MinRam) { return true } @@ -318,7 +320,7 @@ func (o *CreateImagePayload) SetMinRam(v *int64) { // GetName returns the Name field value func (o *CreateImagePayload) GetName() *string { - if o == nil { + if o == nil || IsNil(o.Name) { var ret *string return ret } @@ -340,6 +342,38 @@ func (o *CreateImagePayload) SetName(v *string) { o.Name = v } +// GetOwner returns the Owner field value if set, zero value otherwise. +func (o *CreateImagePayload) GetOwner() *string { + if o == nil || IsNil(o.Owner) { + var ret *string + return ret + } + return o.Owner +} + +// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetOwnerOk() (*string, bool) { + if o == nil || IsNil(o.Owner) { + return nil, false + } + return o.Owner, true +} + +// HasOwner returns a boolean if a field has been set. +func (o *CreateImagePayload) HasOwner() bool { + if o != nil && !IsNil(o.Owner) && !IsNil(o.Owner) { + return true + } + + return false +} + +// SetOwner gets a reference to the given string and assigns it to the Owner field. +func (o *CreateImagePayload) SetOwner(v *string) { + o.Owner = v +} + // GetProtected returns the Protected field value if set, zero value otherwise. func (o *CreateImagePayload) GetProtected() *bool { if o == nil || IsNil(o.Protected) { @@ -360,7 +394,7 @@ func (o *CreateImagePayload) GetProtectedOk() (*bool, bool) { // HasProtected returns a boolean if a field has been set. func (o *CreateImagePayload) HasProtected() bool { - if o != nil && !IsNil(o.Protected) { + if o != nil && !IsNil(o.Protected) && !IsNil(o.Protected) { return true } @@ -392,7 +426,7 @@ func (o *CreateImagePayload) GetScopeOk() (*string, bool) { // HasScope returns a boolean if a field has been set. func (o *CreateImagePayload) HasScope() bool { - if o != nil && !IsNil(o.Scope) { + if o != nil && !IsNil(o.Scope) && !IsNil(o.Scope) { return true } @@ -424,7 +458,7 @@ func (o *CreateImagePayload) GetStatusOk() (*string, bool) { // HasStatus returns a boolean if a field has been set. func (o *CreateImagePayload) HasStatus() bool { - if o != nil && !IsNil(o.Status) { + if o != nil && !IsNil(o.Status) && !IsNil(o.Status) { return true } @@ -456,7 +490,7 @@ func (o *CreateImagePayload) GetUpdatedAtOk() (*time.Time, bool) { // HasUpdatedAt returns a boolean if a field has been set. func (o *CreateImagePayload) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { + if o != nil && !IsNil(o.UpdatedAt) && !IsNil(o.UpdatedAt) { return true } @@ -493,6 +527,9 @@ func (o CreateImagePayload) ToMap() (map[string]interface{}, error) { toSerialize["minRam"] = o.MinRam } toSerialize["name"] = o.Name + if !IsNil(o.Owner) { + toSerialize["owner"] = o.Owner + } if !IsNil(o.Protected) { toSerialize["protected"] = o.Protected } diff --git a/services/iaasalpha/model_create_key_pair_payload.go b/services/iaasalpha/model_create_key_pair_payload.go index 7b82f33e1..2ed42600d 100644 --- a/services/iaasalpha/model_create_key_pair_payload.go +++ b/services/iaasalpha/model_create_key_pair_payload.go @@ -75,7 +75,7 @@ func (o *CreateKeyPairPayload) GetCreatedAtOk() (*time.Time, bool) { // HasCreatedAt returns a boolean if a field has been set. func (o *CreateKeyPairPayload) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { + if o != nil && !IsNil(o.CreatedAt) && !IsNil(o.CreatedAt) { return true } @@ -107,7 +107,7 @@ func (o *CreateKeyPairPayload) GetFingerprintOk() (*string, bool) { // HasFingerprint returns a boolean if a field has been set. func (o *CreateKeyPairPayload) HasFingerprint() bool { - if o != nil && !IsNil(o.Fingerprint) { + if o != nil && !IsNil(o.Fingerprint) && !IsNil(o.Fingerprint) { return true } @@ -139,7 +139,7 @@ func (o *CreateKeyPairPayload) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *CreateKeyPairPayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -171,7 +171,7 @@ func (o *CreateKeyPairPayload) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *CreateKeyPairPayload) HasName() bool { - if o != nil && !IsNil(o.Name) { + if o != nil && !IsNil(o.Name) && !IsNil(o.Name) { return true } @@ -185,7 +185,7 @@ func (o *CreateKeyPairPayload) SetName(v *string) { // GetPublicKey returns the PublicKey field value func (o *CreateKeyPairPayload) GetPublicKey() *string { - if o == nil { + if o == nil || IsNil(o.PublicKey) { var ret *string return ret } @@ -227,7 +227,7 @@ func (o *CreateKeyPairPayload) GetUpdatedAtOk() (*time.Time, bool) { // HasUpdatedAt returns a boolean if a field has been set. func (o *CreateKeyPairPayload) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { + if o != nil && !IsNil(o.UpdatedAt) && !IsNil(o.UpdatedAt) { return true } diff --git a/services/iaasalpha/model_create_nic_payload.go b/services/iaasalpha/model_create_nic_payload.go index 23928e931..d1c6e0b9c 100644 --- a/services/iaasalpha/model_create_nic_payload.go +++ b/services/iaasalpha/model_create_nic_payload.go @@ -86,7 +86,7 @@ func (o *CreateNicPayload) GetAllowedAddressesOk() (*[]AllowedAddressesInner, bo // HasAllowedAddresses returns a boolean if a field has been set. func (o *CreateNicPayload) HasAllowedAddresses() bool { - if o != nil && !IsNil(o.AllowedAddresses) { + if o != nil && !IsNil(o.AllowedAddresses) && !IsNil(o.AllowedAddresses) { return true } @@ -118,7 +118,7 @@ func (o *CreateNicPayload) GetDeviceOk() (*string, bool) { // HasDevice returns a boolean if a field has been set. func (o *CreateNicPayload) HasDevice() bool { - if o != nil && !IsNil(o.Device) { + if o != nil && !IsNil(o.Device) && !IsNil(o.Device) { return true } @@ -150,7 +150,7 @@ func (o *CreateNicPayload) GetIdOk() (*string, bool) { // HasId returns a boolean if a field has been set. func (o *CreateNicPayload) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && !IsNil(o.Id) && !IsNil(o.Id) { return true } @@ -182,7 +182,7 @@ func (o *CreateNicPayload) GetIpv4Ok() (*string, bool) { // HasIpv4 returns a boolean if a field has been set. func (o *CreateNicPayload) HasIpv4() bool { - if o != nil && !IsNil(o.Ipv4) { + if o != nil && !IsNil(o.Ipv4) && !IsNil(o.Ipv4) { return true } @@ -214,7 +214,7 @@ func (o *CreateNicPayload) GetIpv6Ok() (*string, bool) { // HasIpv6 returns a boolean if a field has been set. func (o *CreateNicPayload) HasIpv6() bool { - if o != nil && !IsNil(o.Ipv6) { + if o != nil && !IsNil(o.Ipv6) && !IsNil(o.Ipv6) { return true } @@ -246,7 +246,7 @@ func (o *CreateNicPayload) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *CreateNicPayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -278,7 +278,7 @@ func (o *CreateNicPayload) GetMacOk() (*string, bool) { // HasMac returns a boolean if a field has been set. func (o *CreateNicPayload) HasMac() bool { - if o != nil && !IsNil(o.Mac) { + if o != nil && !IsNil(o.Mac) && !IsNil(o.Mac) { return true } @@ -310,7 +310,7 @@ func (o *CreateNicPayload) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *CreateNicPayload) HasName() bool { - if o != nil && !IsNil(o.Name) { + if o != nil && !IsNil(o.Name) && !IsNil(o.Name) { return true } @@ -342,7 +342,7 @@ func (o *CreateNicPayload) GetNetworkIdOk() (*string, bool) { // HasNetworkId returns a boolean if a field has been set. func (o *CreateNicPayload) HasNetworkId() bool { - if o != nil && !IsNil(o.NetworkId) { + if o != nil && !IsNil(o.NetworkId) && !IsNil(o.NetworkId) { return true } @@ -374,7 +374,7 @@ func (o *CreateNicPayload) GetNicSecurityOk() (*bool, bool) { // HasNicSecurity returns a boolean if a field has been set. func (o *CreateNicPayload) HasNicSecurity() bool { - if o != nil && !IsNil(o.NicSecurity) { + if o != nil && !IsNil(o.NicSecurity) && !IsNil(o.NicSecurity) { return true } @@ -406,7 +406,7 @@ func (o *CreateNicPayload) GetSecurityGroupsOk() (*[]string, bool) { // HasSecurityGroups returns a boolean if a field has been set. func (o *CreateNicPayload) HasSecurityGroups() bool { - if o != nil && !IsNil(o.SecurityGroups) { + if o != nil && !IsNil(o.SecurityGroups) && !IsNil(o.SecurityGroups) { return true } @@ -438,7 +438,7 @@ func (o *CreateNicPayload) GetStatusOk() (*string, bool) { // HasStatus returns a boolean if a field has been set. func (o *CreateNicPayload) HasStatus() bool { - if o != nil && !IsNil(o.Status) { + if o != nil && !IsNil(o.Status) && !IsNil(o.Status) { return true } @@ -470,7 +470,7 @@ func (o *CreateNicPayload) GetTypeOk() (*string, bool) { // HasType returns a boolean if a field has been set. func (o *CreateNicPayload) HasType() bool { - if o != nil && !IsNil(o.Type) { + if o != nil && !IsNil(o.Type) && !IsNil(o.Type) { return true } diff --git a/services/iaasalpha/model_create_public_ip_payload.go b/services/iaasalpha/model_create_public_ip_payload.go index df0c594dc..5c8361bc9 100644 --- a/services/iaasalpha/model_create_public_ip_payload.go +++ b/services/iaasalpha/model_create_public_ip_payload.go @@ -66,7 +66,7 @@ func (o *CreatePublicIPPayload) GetIdOk() (*string, bool) { // HasId returns a boolean if a field has been set. func (o *CreatePublicIPPayload) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && !IsNil(o.Id) && !IsNil(o.Id) { return true } @@ -98,7 +98,7 @@ func (o *CreatePublicIPPayload) GetIpOk() (*string, bool) { // HasIp returns a boolean if a field has been set. func (o *CreatePublicIPPayload) HasIp() bool { - if o != nil && !IsNil(o.Ip) { + if o != nil && !IsNil(o.Ip) && !IsNil(o.Ip) { return true } @@ -130,7 +130,7 @@ func (o *CreatePublicIPPayload) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *CreatePublicIPPayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -144,7 +144,7 @@ func (o *CreatePublicIPPayload) SetLabels(v *map[string]interface{}) { // GetNetworkInterface returns the NetworkInterface field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CreatePublicIPPayload) GetNetworkInterface() *string { - if o == nil || IsNil(o.NetworkInterface.Get()) { + if o == nil || IsNil(o.NetworkInterface) || IsNil(o.NetworkInterface.Get()) { var ret *string return ret } @@ -155,7 +155,7 @@ func (o *CreatePublicIPPayload) GetNetworkInterface() *string { // 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 *CreatePublicIPPayload) GetNetworkInterfaceOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.NetworkInterface) { return nil, false } return o.NetworkInterface.Get(), o.NetworkInterface.IsSet() @@ -163,7 +163,7 @@ func (o *CreatePublicIPPayload) GetNetworkInterfaceOk() (*string, bool) { // HasNetworkInterface returns a boolean if a field has been set. func (o *CreatePublicIPPayload) HasNetworkInterface() bool { - if o != nil && o.NetworkInterface.IsSet() { + if o != nil && !IsNil(o.NetworkInterface) && !IsNil(o.NetworkInterface) && o.NetworkInterface.IsSet() { return true } @@ -172,16 +172,25 @@ func (o *CreatePublicIPPayload) HasNetworkInterface() bool { // SetNetworkInterface gets a reference to the given string and assigns it to the NetworkInterface field. func (o *CreatePublicIPPayload) SetNetworkInterface(v *string) { + if IsNil(o.NetworkInterface) { + o.NetworkInterface = new(NullableString) + } o.NetworkInterface.Set(v) } // SetNetworkInterfaceNil sets the value for NetworkInterface to be an explicit nil func (o *CreatePublicIPPayload) SetNetworkInterfaceNil() { + if IsNil(o.NetworkInterface) { + o.NetworkInterface = new(NullableString) + } o.NetworkInterface.Set(nil) } // UnsetNetworkInterface ensures that no value is present for NetworkInterface, not even an explicit nil func (o *CreatePublicIPPayload) UnsetNetworkInterface() { + if IsNil(o.NetworkInterface) { + o.NetworkInterface = new(NullableString) + } o.NetworkInterface.Unset() } diff --git a/services/iaasalpha/model_create_security_group_payload.go b/services/iaasalpha/model_create_security_group_payload.go index cca8cfa47..8de2bf876 100644 --- a/services/iaasalpha/model_create_security_group_payload.go +++ b/services/iaasalpha/model_create_security_group_payload.go @@ -83,7 +83,7 @@ func (o *CreateSecurityGroupPayload) GetCreatedAtOk() (*time.Time, bool) { // HasCreatedAt returns a boolean if a field has been set. func (o *CreateSecurityGroupPayload) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { + if o != nil && !IsNil(o.CreatedAt) && !IsNil(o.CreatedAt) { return true } @@ -115,7 +115,7 @@ func (o *CreateSecurityGroupPayload) GetDescriptionOk() (*string, bool) { // HasDescription returns a boolean if a field has been set. func (o *CreateSecurityGroupPayload) HasDescription() bool { - if o != nil && !IsNil(o.Description) { + if o != nil && !IsNil(o.Description) && !IsNil(o.Description) { return true } @@ -147,7 +147,7 @@ func (o *CreateSecurityGroupPayload) GetIdOk() (*string, bool) { // HasId returns a boolean if a field has been set. func (o *CreateSecurityGroupPayload) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && !IsNil(o.Id) && !IsNil(o.Id) { return true } @@ -179,7 +179,7 @@ func (o *CreateSecurityGroupPayload) GetLabelsOk() (*map[string]interface{}, boo // HasLabels returns a boolean if a field has been set. func (o *CreateSecurityGroupPayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -193,7 +193,7 @@ func (o *CreateSecurityGroupPayload) SetLabels(v *map[string]interface{}) { // GetName returns the Name field value func (o *CreateSecurityGroupPayload) GetName() *string { - if o == nil { + if o == nil || IsNil(o.Name) { var ret *string return ret } @@ -235,7 +235,7 @@ func (o *CreateSecurityGroupPayload) GetRulesOk() (*[]SecurityGroupRule, bool) { // HasRules returns a boolean if a field has been set. func (o *CreateSecurityGroupPayload) HasRules() bool { - if o != nil && !IsNil(o.Rules) { + if o != nil && !IsNil(o.Rules) && !IsNil(o.Rules) { return true } @@ -267,7 +267,7 @@ func (o *CreateSecurityGroupPayload) GetStatefulOk() (*bool, bool) { // HasStateful returns a boolean if a field has been set. func (o *CreateSecurityGroupPayload) HasStateful() bool { - if o != nil && !IsNil(o.Stateful) { + if o != nil && !IsNil(o.Stateful) && !IsNil(o.Stateful) { return true } @@ -299,7 +299,7 @@ func (o *CreateSecurityGroupPayload) GetUpdatedAtOk() (*time.Time, bool) { // HasUpdatedAt returns a boolean if a field has been set. func (o *CreateSecurityGroupPayload) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { + if o != nil && !IsNil(o.UpdatedAt) && !IsNil(o.UpdatedAt) { return true } diff --git a/services/iaasalpha/model_create_security_group_rule_payload.go b/services/iaasalpha/model_create_security_group_rule_payload.go index 282fce371..2e8c9f8db 100644 --- a/services/iaasalpha/model_create_security_group_rule_payload.go +++ b/services/iaasalpha/model_create_security_group_rule_payload.go @@ -83,7 +83,7 @@ func (o *CreateSecurityGroupRulePayload) GetDescriptionOk() (*string, bool) { // HasDescription returns a boolean if a field has been set. func (o *CreateSecurityGroupRulePayload) HasDescription() bool { - if o != nil && !IsNil(o.Description) { + if o != nil && !IsNil(o.Description) && !IsNil(o.Description) { return true } @@ -97,7 +97,7 @@ func (o *CreateSecurityGroupRulePayload) SetDescription(v *string) { // GetDirection returns the Direction field value func (o *CreateSecurityGroupRulePayload) GetDirection() *string { - if o == nil { + if o == nil || IsNil(o.Direction) { var ret *string return ret } @@ -139,7 +139,7 @@ func (o *CreateSecurityGroupRulePayload) GetEthertypeOk() (*string, bool) { // HasEthertype returns a boolean if a field has been set. func (o *CreateSecurityGroupRulePayload) HasEthertype() bool { - if o != nil && !IsNil(o.Ethertype) { + if o != nil && !IsNil(o.Ethertype) && !IsNil(o.Ethertype) { return true } @@ -171,7 +171,7 @@ func (o *CreateSecurityGroupRulePayload) GetIcmpParametersOk() (*ICMPParameters, // HasIcmpParameters returns a boolean if a field has been set. func (o *CreateSecurityGroupRulePayload) HasIcmpParameters() bool { - if o != nil && !IsNil(o.IcmpParameters) { + if o != nil && !IsNil(o.IcmpParameters) && !IsNil(o.IcmpParameters) { return true } @@ -203,7 +203,7 @@ func (o *CreateSecurityGroupRulePayload) GetIdOk() (*string, bool) { // HasId returns a boolean if a field has been set. func (o *CreateSecurityGroupRulePayload) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && !IsNil(o.Id) && !IsNil(o.Id) { return true } @@ -235,7 +235,7 @@ func (o *CreateSecurityGroupRulePayload) GetIpRangeOk() (*string, bool) { // HasIpRange returns a boolean if a field has been set. func (o *CreateSecurityGroupRulePayload) HasIpRange() bool { - if o != nil && !IsNil(o.IpRange) { + if o != nil && !IsNil(o.IpRange) && !IsNil(o.IpRange) { return true } @@ -267,7 +267,7 @@ func (o *CreateSecurityGroupRulePayload) GetPortRangeOk() (*PortRange, bool) { // HasPortRange returns a boolean if a field has been set. func (o *CreateSecurityGroupRulePayload) HasPortRange() bool { - if o != nil && !IsNil(o.PortRange) { + if o != nil && !IsNil(o.PortRange) && !IsNil(o.PortRange) { return true } @@ -299,7 +299,7 @@ func (o *CreateSecurityGroupRulePayload) GetRemoteSecurityGroupIdOk() (*string, // HasRemoteSecurityGroupId returns a boolean if a field has been set. func (o *CreateSecurityGroupRulePayload) HasRemoteSecurityGroupId() bool { - if o != nil && !IsNil(o.RemoteSecurityGroupId) { + if o != nil && !IsNil(o.RemoteSecurityGroupId) && !IsNil(o.RemoteSecurityGroupId) { return true } @@ -331,7 +331,7 @@ func (o *CreateSecurityGroupRulePayload) GetSecurityGroupIdOk() (*string, bool) // HasSecurityGroupId returns a boolean if a field has been set. func (o *CreateSecurityGroupRulePayload) HasSecurityGroupId() bool { - if o != nil && !IsNil(o.SecurityGroupId) { + if o != nil && !IsNil(o.SecurityGroupId) && !IsNil(o.SecurityGroupId) { return true } @@ -363,7 +363,7 @@ func (o *CreateSecurityGroupRulePayload) GetProtocolOk() (*CreateProtocol, bool) // HasProtocol returns a boolean if a field has been set. func (o *CreateSecurityGroupRulePayload) HasProtocol() bool { - if o != nil && !IsNil(o.Protocol) { + if o != nil && !IsNil(o.Protocol) && !IsNil(o.Protocol) { return true } diff --git a/services/iaasalpha/model_create_security_group_rule_protocol.go b/services/iaasalpha/model_create_security_group_rule_protocol.go index df89a947a..79515c87c 100644 --- a/services/iaasalpha/model_create_security_group_rule_protocol.go +++ b/services/iaasalpha/model_create_security_group_rule_protocol.go @@ -59,7 +59,7 @@ func (o *CreateSecurityGroupRuleProtocol) GetProtocolOk() (*CreateProtocol, bool // HasProtocol returns a boolean if a field has been set. func (o *CreateSecurityGroupRuleProtocol) HasProtocol() bool { - if o != nil && !IsNil(o.Protocol) { + if o != nil && !IsNil(o.Protocol) && !IsNil(o.Protocol) { return true } diff --git a/services/iaasalpha/model_create_server_networking.go b/services/iaasalpha/model_create_server_networking.go index c7f786c97..73bf93508 100644 --- a/services/iaasalpha/model_create_server_networking.go +++ b/services/iaasalpha/model_create_server_networking.go @@ -60,7 +60,7 @@ func (o *CreateServerNetworking) GetNetworkIdOk() (*string, bool) { // HasNetworkId returns a boolean if a field has been set. func (o *CreateServerNetworking) HasNetworkId() bool { - if o != nil && !IsNil(o.NetworkId) { + if o != nil && !IsNil(o.NetworkId) && !IsNil(o.NetworkId) { return true } diff --git a/services/iaasalpha/model_create_server_networking_with_nics.go b/services/iaasalpha/model_create_server_networking_with_nics.go index 92cfca6a3..b176aa87f 100644 --- a/services/iaasalpha/model_create_server_networking_with_nics.go +++ b/services/iaasalpha/model_create_server_networking_with_nics.go @@ -60,7 +60,7 @@ func (o *CreateServerNetworkingWithNics) GetNicIdsOk() (*[]string, bool) { // HasNicIds returns a boolean if a field has been set. func (o *CreateServerNetworkingWithNics) HasNicIds() bool { - if o != nil && !IsNil(o.NicIds) { + if o != nil && !IsNil(o.NicIds) && !IsNil(o.NicIds) { return true } diff --git a/services/iaasalpha/model_create_server_payload.go b/services/iaasalpha/model_create_server_payload.go index a4ff9cc7a..f4922ba7c 100644 --- a/services/iaasalpha/model_create_server_payload.go +++ b/services/iaasalpha/model_create_server_payload.go @@ -106,7 +106,7 @@ func (o *CreateServerPayload) GetAffinityGroupOk() (*string, bool) { // HasAffinityGroup returns a boolean if a field has been set. func (o *CreateServerPayload) HasAffinityGroup() bool { - if o != nil && !IsNil(o.AffinityGroup) { + if o != nil && !IsNil(o.AffinityGroup) && !IsNil(o.AffinityGroup) { return true } @@ -138,7 +138,7 @@ func (o *CreateServerPayload) GetAvailabilityZoneOk() (*string, bool) { // HasAvailabilityZone returns a boolean if a field has been set. func (o *CreateServerPayload) HasAvailabilityZone() bool { - if o != nil && !IsNil(o.AvailabilityZone) { + if o != nil && !IsNil(o.AvailabilityZone) && !IsNil(o.AvailabilityZone) { return true } @@ -170,7 +170,7 @@ func (o *CreateServerPayload) GetBootVolumeOk() (*CreateServerPayloadBootVolume, // HasBootVolume returns a boolean if a field has been set. func (o *CreateServerPayload) HasBootVolume() bool { - if o != nil && !IsNil(o.BootVolume) { + if o != nil && !IsNil(o.BootVolume) && !IsNil(o.BootVolume) { return true } @@ -202,7 +202,7 @@ func (o *CreateServerPayload) GetCreatedAtOk() (*time.Time, bool) { // HasCreatedAt returns a boolean if a field has been set. func (o *CreateServerPayload) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { + if o != nil && !IsNil(o.CreatedAt) && !IsNil(o.CreatedAt) { return true } @@ -234,7 +234,7 @@ func (o *CreateServerPayload) GetErrorMessageOk() (*string, bool) { // HasErrorMessage returns a boolean if a field has been set. func (o *CreateServerPayload) HasErrorMessage() bool { - if o != nil && !IsNil(o.ErrorMessage) { + if o != nil && !IsNil(o.ErrorMessage) && !IsNil(o.ErrorMessage) { return true } @@ -266,7 +266,7 @@ func (o *CreateServerPayload) GetIdOk() (*string, bool) { // HasId returns a boolean if a field has been set. func (o *CreateServerPayload) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && !IsNil(o.Id) && !IsNil(o.Id) { return true } @@ -298,7 +298,7 @@ func (o *CreateServerPayload) GetImageIdOk() (*string, bool) { // HasImageId returns a boolean if a field has been set. func (o *CreateServerPayload) HasImageId() bool { - if o != nil && !IsNil(o.ImageId) { + if o != nil && !IsNil(o.ImageId) && !IsNil(o.ImageId) { return true } @@ -330,7 +330,7 @@ func (o *CreateServerPayload) GetKeypairNameOk() (*string, bool) { // HasKeypairName returns a boolean if a field has been set. func (o *CreateServerPayload) HasKeypairName() bool { - if o != nil && !IsNil(o.KeypairName) { + if o != nil && !IsNil(o.KeypairName) && !IsNil(o.KeypairName) { return true } @@ -362,7 +362,7 @@ func (o *CreateServerPayload) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *CreateServerPayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -394,7 +394,7 @@ func (o *CreateServerPayload) GetLaunchedAtOk() (*time.Time, bool) { // HasLaunchedAt returns a boolean if a field has been set. func (o *CreateServerPayload) HasLaunchedAt() bool { - if o != nil && !IsNil(o.LaunchedAt) { + if o != nil && !IsNil(o.LaunchedAt) && !IsNil(o.LaunchedAt) { return true } @@ -408,7 +408,7 @@ func (o *CreateServerPayload) SetLaunchedAt(v *time.Time) { // GetMachineType returns the MachineType field value func (o *CreateServerPayload) GetMachineType() *string { - if o == nil { + if o == nil || IsNil(o.MachineType) { var ret *string return ret } @@ -450,7 +450,7 @@ func (o *CreateServerPayload) GetMaintenanceWindowOk() (*ServerMaintenance, bool // HasMaintenanceWindow returns a boolean if a field has been set. func (o *CreateServerPayload) HasMaintenanceWindow() bool { - if o != nil && !IsNil(o.MaintenanceWindow) { + if o != nil && !IsNil(o.MaintenanceWindow) && !IsNil(o.MaintenanceWindow) { return true } @@ -464,7 +464,7 @@ func (o *CreateServerPayload) SetMaintenanceWindow(v *ServerMaintenance) { // GetName returns the Name field value func (o *CreateServerPayload) GetName() *string { - if o == nil { + if o == nil || IsNil(o.Name) { var ret *string return ret } @@ -506,7 +506,7 @@ func (o *CreateServerPayload) GetNetworkingOk() (*CreateServerPayloadNetworking, // HasNetworking returns a boolean if a field has been set. func (o *CreateServerPayload) HasNetworking() bool { - if o != nil && !IsNil(o.Networking) { + if o != nil && !IsNil(o.Networking) && !IsNil(o.Networking) { return true } @@ -538,7 +538,7 @@ func (o *CreateServerPayload) GetNicsOk() (*[]ServerNetwork, bool) { // HasNics returns a boolean if a field has been set. func (o *CreateServerPayload) HasNics() bool { - if o != nil && !IsNil(o.Nics) { + if o != nil && !IsNil(o.Nics) && !IsNil(o.Nics) { return true } @@ -570,7 +570,7 @@ func (o *CreateServerPayload) GetPowerStatusOk() (*string, bool) { // HasPowerStatus returns a boolean if a field has been set. func (o *CreateServerPayload) HasPowerStatus() bool { - if o != nil && !IsNil(o.PowerStatus) { + if o != nil && !IsNil(o.PowerStatus) && !IsNil(o.PowerStatus) { return true } @@ -602,7 +602,7 @@ func (o *CreateServerPayload) GetSecurityGroupsOk() (*[]string, bool) { // HasSecurityGroups returns a boolean if a field has been set. func (o *CreateServerPayload) HasSecurityGroups() bool { - if o != nil && !IsNil(o.SecurityGroups) { + if o != nil && !IsNil(o.SecurityGroups) && !IsNil(o.SecurityGroups) { return true } @@ -634,7 +634,7 @@ func (o *CreateServerPayload) GetServiceAccountMailsOk() (*[]string, bool) { // HasServiceAccountMails returns a boolean if a field has been set. func (o *CreateServerPayload) HasServiceAccountMails() bool { - if o != nil && !IsNil(o.ServiceAccountMails) { + if o != nil && !IsNil(o.ServiceAccountMails) && !IsNil(o.ServiceAccountMails) { return true } @@ -666,7 +666,7 @@ func (o *CreateServerPayload) GetStatusOk() (*string, bool) { // HasStatus returns a boolean if a field has been set. func (o *CreateServerPayload) HasStatus() bool { - if o != nil && !IsNil(o.Status) { + if o != nil && !IsNil(o.Status) && !IsNil(o.Status) { return true } @@ -698,7 +698,7 @@ func (o *CreateServerPayload) GetUpdatedAtOk() (*time.Time, bool) { // HasUpdatedAt returns a boolean if a field has been set. func (o *CreateServerPayload) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { + if o != nil && !IsNil(o.UpdatedAt) && !IsNil(o.UpdatedAt) { return true } @@ -730,7 +730,7 @@ func (o *CreateServerPayload) GetUserDataOk() (*string, bool) { // HasUserData returns a boolean if a field has been set. func (o *CreateServerPayload) HasUserData() bool { - if o != nil && !IsNil(o.UserData) { + if o != nil && !IsNil(o.UserData) && !IsNil(o.UserData) { return true } @@ -762,7 +762,7 @@ func (o *CreateServerPayload) GetVolumesOk() (*[]string, bool) { // HasVolumes returns a boolean if a field has been set. func (o *CreateServerPayload) HasVolumes() bool { - if o != nil && !IsNil(o.Volumes) { + if o != nil && !IsNil(o.Volumes) && !IsNil(o.Volumes) { return true } diff --git a/services/iaasalpha/model_create_server_payload_boot_volume.go b/services/iaasalpha/model_create_server_payload_boot_volume.go index 633f932b9..3c1cb8784 100644 --- a/services/iaasalpha/model_create_server_payload_boot_volume.go +++ b/services/iaasalpha/model_create_server_payload_boot_volume.go @@ -71,7 +71,7 @@ func (o *CreateServerPayloadBootVolume) GetDeleteOnTerminationOk() (*bool, bool) // HasDeleteOnTermination returns a boolean if a field has been set. func (o *CreateServerPayloadBootVolume) HasDeleteOnTermination() bool { - if o != nil && !IsNil(o.DeleteOnTermination) { + if o != nil && !IsNil(o.DeleteOnTermination) && !IsNil(o.DeleteOnTermination) { return true } @@ -103,7 +103,7 @@ func (o *CreateServerPayloadBootVolume) GetIdOk() (*string, bool) { // HasId returns a boolean if a field has been set. func (o *CreateServerPayloadBootVolume) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && !IsNil(o.Id) && !IsNil(o.Id) { return true } @@ -135,7 +135,7 @@ func (o *CreateServerPayloadBootVolume) GetPerformanceClassOk() (*string, bool) // HasPerformanceClass returns a boolean if a field has been set. func (o *CreateServerPayloadBootVolume) HasPerformanceClass() bool { - if o != nil && !IsNil(o.PerformanceClass) { + if o != nil && !IsNil(o.PerformanceClass) && !IsNil(o.PerformanceClass) { return true } @@ -167,7 +167,7 @@ func (o *CreateServerPayloadBootVolume) GetSizeOk() (*int64, bool) { // HasSize returns a boolean if a field has been set. func (o *CreateServerPayloadBootVolume) HasSize() bool { - if o != nil && !IsNil(o.Size) { + if o != nil && !IsNil(o.Size) && !IsNil(o.Size) { return true } @@ -199,7 +199,7 @@ func (o *CreateServerPayloadBootVolume) GetSourceOk() (*BootVolumeSource, bool) // HasSource returns a boolean if a field has been set. func (o *CreateServerPayloadBootVolume) HasSource() bool { - if o != nil && !IsNil(o.Source) { + if o != nil && !IsNil(o.Source) && !IsNil(o.Source) { return true } diff --git a/services/iaasalpha/model_create_virtual_ip_payload.go b/services/iaasalpha/model_create_virtual_ip_payload.go index 86dde9cdb..e17ae6bc4 100644 --- a/services/iaasalpha/model_create_virtual_ip_payload.go +++ b/services/iaasalpha/model_create_virtual_ip_payload.go @@ -72,7 +72,7 @@ func (o *CreateVirtualIPPayload) GetIdOk() (*string, bool) { // HasId returns a boolean if a field has been set. func (o *CreateVirtualIPPayload) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && !IsNil(o.Id) && !IsNil(o.Id) { return true } @@ -104,7 +104,7 @@ func (o *CreateVirtualIPPayload) GetIpOk() (*string, bool) { // HasIp returns a boolean if a field has been set. func (o *CreateVirtualIPPayload) HasIp() bool { - if o != nil && !IsNil(o.Ip) { + if o != nil && !IsNil(o.Ip) && !IsNil(o.Ip) { return true } @@ -136,7 +136,7 @@ func (o *CreateVirtualIPPayload) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *CreateVirtualIPPayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -168,7 +168,7 @@ func (o *CreateVirtualIPPayload) GetMembersOk() (*[]string, bool) { // HasMembers returns a boolean if a field has been set. func (o *CreateVirtualIPPayload) HasMembers() bool { - if o != nil && !IsNil(o.Members) { + if o != nil && !IsNil(o.Members) && !IsNil(o.Members) { return true } @@ -200,7 +200,7 @@ func (o *CreateVirtualIPPayload) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *CreateVirtualIPPayload) HasName() bool { - if o != nil && !IsNil(o.Name) { + if o != nil && !IsNil(o.Name) && !IsNil(o.Name) { return true } @@ -232,7 +232,7 @@ func (o *CreateVirtualIPPayload) GetNetworkOk() (*string, bool) { // HasNetwork returns a boolean if a field has been set. func (o *CreateVirtualIPPayload) HasNetwork() bool { - if o != nil && !IsNil(o.Network) { + if o != nil && !IsNil(o.Network) && !IsNil(o.Network) { return true } @@ -264,7 +264,7 @@ func (o *CreateVirtualIPPayload) GetStatusOk() (*string, bool) { // HasStatus returns a boolean if a field has been set. func (o *CreateVirtualIPPayload) HasStatus() bool { - if o != nil && !IsNil(o.Status) { + if o != nil && !IsNil(o.Status) && !IsNil(o.Status) { return true } diff --git a/services/iaasalpha/model_create_volume_payload.go b/services/iaasalpha/model_create_volume_payload.go index d35849e3d..b399a8dd2 100644 --- a/services/iaasalpha/model_create_volume_payload.go +++ b/services/iaasalpha/model_create_volume_payload.go @@ -30,7 +30,8 @@ type CreateVolumePayload struct { // Description Object. Allows string up to 127 Characters. Description *string `json:"description,omitempty"` // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id *string `json:"id,omitempty"` + ImageConfig *ImageConfig `json:"imageConfig,omitempty"` // Object that represents the labels of an object. Labels *map[string]interface{} `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. @@ -70,7 +71,7 @@ func NewCreateVolumePayloadWithDefaults() *CreateVolumePayload { // GetAvailabilityZone returns the AvailabilityZone field value func (o *CreateVolumePayload) GetAvailabilityZone() *string { - if o == nil { + if o == nil || IsNil(o.AvailabilityZone) { var ret *string return ret } @@ -112,7 +113,7 @@ func (o *CreateVolumePayload) GetBootableOk() (*bool, bool) { // HasBootable returns a boolean if a field has been set. func (o *CreateVolumePayload) HasBootable() bool { - if o != nil && !IsNil(o.Bootable) { + if o != nil && !IsNil(o.Bootable) && !IsNil(o.Bootable) { return true } @@ -144,7 +145,7 @@ func (o *CreateVolumePayload) GetCreatedAtOk() (*time.Time, bool) { // HasCreatedAt returns a boolean if a field has been set. func (o *CreateVolumePayload) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { + if o != nil && !IsNil(o.CreatedAt) && !IsNil(o.CreatedAt) { return true } @@ -176,7 +177,7 @@ func (o *CreateVolumePayload) GetDescriptionOk() (*string, bool) { // HasDescription returns a boolean if a field has been set. func (o *CreateVolumePayload) HasDescription() bool { - if o != nil && !IsNil(o.Description) { + if o != nil && !IsNil(o.Description) && !IsNil(o.Description) { return true } @@ -208,7 +209,7 @@ func (o *CreateVolumePayload) GetIdOk() (*string, bool) { // HasId returns a boolean if a field has been set. func (o *CreateVolumePayload) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && !IsNil(o.Id) && !IsNil(o.Id) { return true } @@ -220,6 +221,38 @@ func (o *CreateVolumePayload) SetId(v *string) { o.Id = v } +// GetImageConfig returns the ImageConfig field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetImageConfig() *ImageConfig { + if o == nil || IsNil(o.ImageConfig) { + var ret *ImageConfig + return ret + } + return o.ImageConfig +} + +// GetImageConfigOk returns a tuple with the ImageConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetImageConfigOk() (*ImageConfig, bool) { + if o == nil || IsNil(o.ImageConfig) { + return nil, false + } + return o.ImageConfig, true +} + +// HasImageConfig returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasImageConfig() bool { + if o != nil && !IsNil(o.ImageConfig) && !IsNil(o.ImageConfig) { + return true + } + + return false +} + +// SetImageConfig gets a reference to the given ImageConfig and assigns it to the ImageConfig field. +func (o *CreateVolumePayload) SetImageConfig(v *ImageConfig) { + o.ImageConfig = v +} + // GetLabels returns the Labels field value if set, zero value otherwise. func (o *CreateVolumePayload) GetLabels() *map[string]interface{} { if o == nil || IsNil(o.Labels) { @@ -240,7 +273,7 @@ func (o *CreateVolumePayload) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *CreateVolumePayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -272,7 +305,7 @@ func (o *CreateVolumePayload) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *CreateVolumePayload) HasName() bool { - if o != nil && !IsNil(o.Name) { + if o != nil && !IsNil(o.Name) && !IsNil(o.Name) { return true } @@ -304,7 +337,7 @@ func (o *CreateVolumePayload) GetPerformanceClassOk() (*string, bool) { // HasPerformanceClass returns a boolean if a field has been set. func (o *CreateVolumePayload) HasPerformanceClass() bool { - if o != nil && !IsNil(o.PerformanceClass) { + if o != nil && !IsNil(o.PerformanceClass) && !IsNil(o.PerformanceClass) { return true } @@ -336,7 +369,7 @@ func (o *CreateVolumePayload) GetServerIdOk() (*string, bool) { // HasServerId returns a boolean if a field has been set. func (o *CreateVolumePayload) HasServerId() bool { - if o != nil && !IsNil(o.ServerId) { + if o != nil && !IsNil(o.ServerId) && !IsNil(o.ServerId) { return true } @@ -368,7 +401,7 @@ func (o *CreateVolumePayload) GetSizeOk() (*int64, bool) { // HasSize returns a boolean if a field has been set. func (o *CreateVolumePayload) HasSize() bool { - if o != nil && !IsNil(o.Size) { + if o != nil && !IsNil(o.Size) && !IsNil(o.Size) { return true } @@ -400,7 +433,7 @@ func (o *CreateVolumePayload) GetSourceOk() (*VolumeSource, bool) { // HasSource returns a boolean if a field has been set. func (o *CreateVolumePayload) HasSource() bool { - if o != nil && !IsNil(o.Source) { + if o != nil && !IsNil(o.Source) && !IsNil(o.Source) { return true } @@ -432,7 +465,7 @@ func (o *CreateVolumePayload) GetStatusOk() (*string, bool) { // HasStatus returns a boolean if a field has been set. func (o *CreateVolumePayload) HasStatus() bool { - if o != nil && !IsNil(o.Status) { + if o != nil && !IsNil(o.Status) && !IsNil(o.Status) { return true } @@ -464,7 +497,7 @@ func (o *CreateVolumePayload) GetUpdatedAtOk() (*time.Time, bool) { // HasUpdatedAt returns a boolean if a field has been set. func (o *CreateVolumePayload) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { + if o != nil && !IsNil(o.UpdatedAt) && !IsNil(o.UpdatedAt) { return true } @@ -491,6 +524,9 @@ func (o CreateVolumePayload) ToMap() (map[string]interface{}, error) { if !IsNil(o.Id) { toSerialize["id"] = o.Id } + if !IsNil(o.ImageConfig) { + toSerialize["imageConfig"] = o.ImageConfig + } if !IsNil(o.Labels) { toSerialize["labels"] = o.Labels } diff --git a/services/iaasalpha/model_error.go b/services/iaasalpha/model_error.go index 6b1c1b4fe..621533326 100644 --- a/services/iaasalpha/model_error.go +++ b/services/iaasalpha/model_error.go @@ -49,7 +49,7 @@ func NewErrorWithDefaults() *Error { // GetCode returns the Code field value func (o *Error) GetCode() *int64 { - if o == nil { + if o == nil || IsNil(o.Code) { var ret *int64 return ret } @@ -73,7 +73,7 @@ func (o *Error) SetCode(v *int64) { // GetMsg returns the Msg field value func (o *Error) GetMsg() *string { - if o == nil { + if o == nil || IsNil(o.Msg) { var ret *string return ret } diff --git a/services/iaasalpha/model_get_server_log_200_response.go b/services/iaasalpha/model_get_server_log_200_response.go index badfa9afa..b6cf6d623 100644 --- a/services/iaasalpha/model_get_server_log_200_response.go +++ b/services/iaasalpha/model_get_server_log_200_response.go @@ -59,7 +59,7 @@ func (o *GetServerLog200Response) GetOutputOk() (*string, bool) { // HasOutput returns a boolean if a field has been set. func (o *GetServerLog200Response) HasOutput() bool { - if o != nil && !IsNil(o.Output) { + if o != nil && !IsNil(o.Output) && !IsNil(o.Output) { return true } diff --git a/services/iaasalpha/model_get_server_log_request.go b/services/iaasalpha/model_get_server_log_request.go deleted file mode 100644 index 76d4f94d5..000000000 --- a/services/iaasalpha/model_get_server_log_request.go +++ /dev/null @@ -1,121 +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 GetServerLogRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetServerLogRequest{} - -// GetServerLogRequest struct for GetServerLogRequest -type GetServerLogRequest struct { - // Set to 0 to retrieve the complete log. - Length *int64 `json:"length,omitempty"` -} - -// NewGetServerLogRequest instantiates a new GetServerLogRequest 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 NewGetServerLogRequest() *GetServerLogRequest { - this := GetServerLogRequest{} - var length int64 = 2000 - this.Length = &length - return &this -} - -// NewGetServerLogRequestWithDefaults instantiates a new GetServerLogRequest 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 NewGetServerLogRequestWithDefaults() *GetServerLogRequest { - this := GetServerLogRequest{} - var length int64 = 2000 - this.Length = &length - return &this -} - -// GetLength returns the Length field value if set, zero value otherwise. -func (o *GetServerLogRequest) GetLength() *int64 { - if o == nil || IsNil(o.Length) { - var ret *int64 - return ret - } - return o.Length -} - -// GetLengthOk returns a tuple with the Length field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetServerLogRequest) GetLengthOk() (*int64, bool) { - if o == nil || IsNil(o.Length) { - return nil, false - } - return o.Length, true -} - -// HasLength returns a boolean if a field has been set. -func (o *GetServerLogRequest) HasLength() bool { - if o != nil && !IsNil(o.Length) { - return true - } - - return false -} - -// SetLength gets a reference to the given int64 and assigns it to the Length field. -func (o *GetServerLogRequest) SetLength(v *int64) { - o.Length = v -} - -func (o GetServerLogRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Length) { - toSerialize["length"] = o.Length - } - return toSerialize, nil -} - -type NullableGetServerLogRequest struct { - value *GetServerLogRequest - isSet bool -} - -func (v NullableGetServerLogRequest) Get() *GetServerLogRequest { - return v.value -} - -func (v *NullableGetServerLogRequest) Set(val *GetServerLogRequest) { - v.value = val - v.isSet = true -} - -func (v NullableGetServerLogRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableGetServerLogRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetServerLogRequest(val *GetServerLogRequest) *NullableGetServerLogRequest { - return &NullableGetServerLogRequest{value: val, isSet: true} -} - -func (v NullableGetServerLogRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetServerLogRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaasalpha/model_icmp_parameters.go b/services/iaasalpha/model_icmp_parameters.go index 1edbe5386..4b11ab4de 100644 --- a/services/iaasalpha/model_icmp_parameters.go +++ b/services/iaasalpha/model_icmp_parameters.go @@ -50,7 +50,7 @@ func NewICMPParametersWithDefaults() *ICMPParameters { // GetCode returns the Code field value func (o *ICMPParameters) GetCode() *int64 { - if o == nil { + if o == nil || IsNil(o.Code) { var ret *int64 return ret } @@ -74,7 +74,7 @@ func (o *ICMPParameters) SetCode(v *int64) { // GetType returns the Type field value func (o *ICMPParameters) GetType() *int64 { - if o == nil { + if o == nil || IsNil(o.Type) { var ret *int64 return ret } diff --git a/services/iaasalpha/model_image.go b/services/iaasalpha/model_image.go index e6e523da5..5efad51f4 100644 --- a/services/iaasalpha/model_image.go +++ b/services/iaasalpha/model_image.go @@ -37,7 +37,9 @@ type Image struct { MinRam *int64 `json:"minRam,omitempty"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED - Name *string `json:"name"` + Name *string `json:"name"` + // Universally Unique Identifier (UUID). + Owner *string `json:"owner,omitempty"` Protected *bool `json:"protected,omitempty"` // Scope of an Image. Scope *string `json:"scope,omitempty"` @@ -88,7 +90,7 @@ func (o *Image) GetChecksumOk() (*ImageChecksum, bool) { // HasChecksum returns a boolean if a field has been set. func (o *Image) HasChecksum() bool { - if o != nil && !IsNil(o.Checksum) { + if o != nil && !IsNil(o.Checksum) && !IsNil(o.Checksum) { return true } @@ -120,7 +122,7 @@ func (o *Image) GetConfigOk() (*ImageConfig, bool) { // HasConfig returns a boolean if a field has been set. func (o *Image) HasConfig() bool { - if o != nil && !IsNil(o.Config) { + if o != nil && !IsNil(o.Config) && !IsNil(o.Config) { return true } @@ -152,7 +154,7 @@ func (o *Image) GetCreatedAtOk() (*time.Time, bool) { // HasCreatedAt returns a boolean if a field has been set. func (o *Image) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { + if o != nil && !IsNil(o.CreatedAt) && !IsNil(o.CreatedAt) { return true } @@ -166,7 +168,7 @@ func (o *Image) SetCreatedAt(v *time.Time) { // GetDiskFormat returns the DiskFormat field value func (o *Image) GetDiskFormat() *string { - if o == nil { + if o == nil || IsNil(o.DiskFormat) { var ret *string return ret } @@ -208,7 +210,7 @@ func (o *Image) GetIdOk() (*string, bool) { // HasId returns a boolean if a field has been set. func (o *Image) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && !IsNil(o.Id) && !IsNil(o.Id) { return true } @@ -240,7 +242,7 @@ func (o *Image) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *Image) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -272,7 +274,7 @@ func (o *Image) GetMinDiskSizeOk() (*int64, bool) { // HasMinDiskSize returns a boolean if a field has been set. func (o *Image) HasMinDiskSize() bool { - if o != nil && !IsNil(o.MinDiskSize) { + if o != nil && !IsNil(o.MinDiskSize) && !IsNil(o.MinDiskSize) { return true } @@ -304,7 +306,7 @@ func (o *Image) GetMinRamOk() (*int64, bool) { // HasMinRam returns a boolean if a field has been set. func (o *Image) HasMinRam() bool { - if o != nil && !IsNil(o.MinRam) { + if o != nil && !IsNil(o.MinRam) && !IsNil(o.MinRam) { return true } @@ -318,7 +320,7 @@ func (o *Image) SetMinRam(v *int64) { // GetName returns the Name field value func (o *Image) GetName() *string { - if o == nil { + if o == nil || IsNil(o.Name) { var ret *string return ret } @@ -340,6 +342,38 @@ func (o *Image) SetName(v *string) { o.Name = v } +// GetOwner returns the Owner field value if set, zero value otherwise. +func (o *Image) GetOwner() *string { + if o == nil || IsNil(o.Owner) { + var ret *string + return ret + } + return o.Owner +} + +// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetOwnerOk() (*string, bool) { + if o == nil || IsNil(o.Owner) { + return nil, false + } + return o.Owner, true +} + +// HasOwner returns a boolean if a field has been set. +func (o *Image) HasOwner() bool { + if o != nil && !IsNil(o.Owner) && !IsNil(o.Owner) { + return true + } + + return false +} + +// SetOwner gets a reference to the given string and assigns it to the Owner field. +func (o *Image) SetOwner(v *string) { + o.Owner = v +} + // GetProtected returns the Protected field value if set, zero value otherwise. func (o *Image) GetProtected() *bool { if o == nil || IsNil(o.Protected) { @@ -360,7 +394,7 @@ func (o *Image) GetProtectedOk() (*bool, bool) { // HasProtected returns a boolean if a field has been set. func (o *Image) HasProtected() bool { - if o != nil && !IsNil(o.Protected) { + if o != nil && !IsNil(o.Protected) && !IsNil(o.Protected) { return true } @@ -392,7 +426,7 @@ func (o *Image) GetScopeOk() (*string, bool) { // HasScope returns a boolean if a field has been set. func (o *Image) HasScope() bool { - if o != nil && !IsNil(o.Scope) { + if o != nil && !IsNil(o.Scope) && !IsNil(o.Scope) { return true } @@ -424,7 +458,7 @@ func (o *Image) GetStatusOk() (*string, bool) { // HasStatus returns a boolean if a field has been set. func (o *Image) HasStatus() bool { - if o != nil && !IsNil(o.Status) { + if o != nil && !IsNil(o.Status) && !IsNil(o.Status) { return true } @@ -456,7 +490,7 @@ func (o *Image) GetUpdatedAtOk() (*time.Time, bool) { // HasUpdatedAt returns a boolean if a field has been set. func (o *Image) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { + if o != nil && !IsNil(o.UpdatedAt) && !IsNil(o.UpdatedAt) { return true } @@ -493,6 +527,9 @@ func (o Image) ToMap() (map[string]interface{}, error) { toSerialize["minRam"] = o.MinRam } toSerialize["name"] = o.Name + if !IsNil(o.Owner) { + toSerialize["owner"] = o.Owner + } if !IsNil(o.Protected) { toSerialize["protected"] = o.Protected } diff --git a/services/iaasalpha/model_image_checksum.go b/services/iaasalpha/model_image_checksum.go index 48df5c5b1..67852b70d 100644 --- a/services/iaasalpha/model_image_checksum.go +++ b/services/iaasalpha/model_image_checksum.go @@ -50,7 +50,7 @@ func NewImageChecksumWithDefaults() *ImageChecksum { // GetAlgorithm returns the Algorithm field value func (o *ImageChecksum) GetAlgorithm() *string { - if o == nil { + if o == nil || IsNil(o.Algorithm) { var ret *string return ret } @@ -74,7 +74,7 @@ func (o *ImageChecksum) SetAlgorithm(v *string) { // GetDigest returns the Digest field value func (o *ImageChecksum) GetDigest() *string { - if o == nil { + if o == nil || IsNil(o.Digest) { var ret *string return ret } diff --git a/services/iaasalpha/model_image_config.go b/services/iaasalpha/model_image_config.go index 4ab9cee04..f74d80056 100644 --- a/services/iaasalpha/model_image_config.go +++ b/services/iaasalpha/model_image_config.go @@ -100,7 +100,7 @@ func (o *ImageConfig) GetBootMenuOk() (*bool, bool) { // HasBootMenu returns a boolean if a field has been set. func (o *ImageConfig) HasBootMenu() bool { - if o != nil && !IsNil(o.BootMenu) { + if o != nil && !IsNil(o.BootMenu) && !IsNil(o.BootMenu) { return true } @@ -114,7 +114,7 @@ func (o *ImageConfig) SetBootMenu(v *bool) { // GetCdromBus returns the CdromBus field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ImageConfig) GetCdromBus() *string { - if o == nil || IsNil(o.CdromBus.Get()) { + if o == nil || IsNil(o.CdromBus) || IsNil(o.CdromBus.Get()) { var ret *string return ret } @@ -125,7 +125,7 @@ func (o *ImageConfig) GetCdromBus() *string { // 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 *ImageConfig) GetCdromBusOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.CdromBus) { return nil, false } return o.CdromBus.Get(), o.CdromBus.IsSet() @@ -133,7 +133,7 @@ func (o *ImageConfig) GetCdromBusOk() (*string, bool) { // HasCdromBus returns a boolean if a field has been set. func (o *ImageConfig) HasCdromBus() bool { - if o != nil && o.CdromBus.IsSet() { + if o != nil && !IsNil(o.CdromBus) && !IsNil(o.CdromBus) && o.CdromBus.IsSet() { return true } @@ -142,22 +142,31 @@ func (o *ImageConfig) HasCdromBus() bool { // SetCdromBus gets a reference to the given string and assigns it to the CdromBus field. func (o *ImageConfig) SetCdromBus(v *string) { + if IsNil(o.CdromBus) { + o.CdromBus = new(NullableString) + } o.CdromBus.Set(v) } // SetCdromBusNil sets the value for CdromBus to be an explicit nil func (o *ImageConfig) SetCdromBusNil() { + if IsNil(o.CdromBus) { + o.CdromBus = new(NullableString) + } o.CdromBus.Set(nil) } // UnsetCdromBus ensures that no value is present for CdromBus, not even an explicit nil func (o *ImageConfig) UnsetCdromBus() { + if IsNil(o.CdromBus) { + o.CdromBus = new(NullableString) + } o.CdromBus.Unset() } // GetDiskBus returns the DiskBus field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ImageConfig) GetDiskBus() *string { - if o == nil || IsNil(o.DiskBus.Get()) { + if o == nil || IsNil(o.DiskBus) || IsNil(o.DiskBus.Get()) { var ret *string return ret } @@ -168,7 +177,7 @@ func (o *ImageConfig) GetDiskBus() *string { // 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 *ImageConfig) GetDiskBusOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.DiskBus) { return nil, false } return o.DiskBus.Get(), o.DiskBus.IsSet() @@ -176,7 +185,7 @@ func (o *ImageConfig) GetDiskBusOk() (*string, bool) { // HasDiskBus returns a boolean if a field has been set. func (o *ImageConfig) HasDiskBus() bool { - if o != nil && o.DiskBus.IsSet() { + if o != nil && !IsNil(o.DiskBus) && !IsNil(o.DiskBus) && o.DiskBus.IsSet() { return true } @@ -185,22 +194,31 @@ func (o *ImageConfig) HasDiskBus() bool { // SetDiskBus gets a reference to the given string and assigns it to the DiskBus field. func (o *ImageConfig) SetDiskBus(v *string) { + if IsNil(o.DiskBus) { + o.DiskBus = new(NullableString) + } o.DiskBus.Set(v) } // SetDiskBusNil sets the value for DiskBus to be an explicit nil func (o *ImageConfig) SetDiskBusNil() { + if IsNil(o.DiskBus) { + o.DiskBus = new(NullableString) + } o.DiskBus.Set(nil) } // UnsetDiskBus ensures that no value is present for DiskBus, not even an explicit nil func (o *ImageConfig) UnsetDiskBus() { + if IsNil(o.DiskBus) { + o.DiskBus = new(NullableString) + } o.DiskBus.Unset() } // GetNicModel returns the NicModel field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ImageConfig) GetNicModel() *string { - if o == nil || IsNil(o.NicModel.Get()) { + if o == nil || IsNil(o.NicModel) || IsNil(o.NicModel.Get()) { var ret *string return ret } @@ -211,7 +229,7 @@ func (o *ImageConfig) GetNicModel() *string { // 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 *ImageConfig) GetNicModelOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.NicModel) { return nil, false } return o.NicModel.Get(), o.NicModel.IsSet() @@ -219,7 +237,7 @@ func (o *ImageConfig) GetNicModelOk() (*string, bool) { // HasNicModel returns a boolean if a field has been set. func (o *ImageConfig) HasNicModel() bool { - if o != nil && o.NicModel.IsSet() { + if o != nil && !IsNil(o.NicModel) && !IsNil(o.NicModel) && o.NicModel.IsSet() { return true } @@ -228,16 +246,25 @@ func (o *ImageConfig) HasNicModel() bool { // SetNicModel gets a reference to the given string and assigns it to the NicModel field. func (o *ImageConfig) SetNicModel(v *string) { + if IsNil(o.NicModel) { + o.NicModel = new(NullableString) + } o.NicModel.Set(v) } // SetNicModelNil sets the value for NicModel to be an explicit nil func (o *ImageConfig) SetNicModelNil() { + if IsNil(o.NicModel) { + o.NicModel = new(NullableString) + } o.NicModel.Set(nil) } // UnsetNicModel ensures that no value is present for NicModel, not even an explicit nil func (o *ImageConfig) UnsetNicModel() { + if IsNil(o.NicModel) { + o.NicModel = new(NullableString) + } o.NicModel.Unset() } @@ -261,7 +288,7 @@ func (o *ImageConfig) GetOperatingSystemOk() (*string, bool) { // HasOperatingSystem returns a boolean if a field has been set. func (o *ImageConfig) HasOperatingSystem() bool { - if o != nil && !IsNil(o.OperatingSystem) { + if o != nil && !IsNil(o.OperatingSystem) && !IsNil(o.OperatingSystem) { return true } @@ -275,7 +302,7 @@ func (o *ImageConfig) SetOperatingSystem(v *string) { // GetOperatingSystemDistro returns the OperatingSystemDistro field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ImageConfig) GetOperatingSystemDistro() *string { - if o == nil || IsNil(o.OperatingSystemDistro.Get()) { + if o == nil || IsNil(o.OperatingSystemDistro) || IsNil(o.OperatingSystemDistro.Get()) { var ret *string return ret } @@ -286,7 +313,7 @@ func (o *ImageConfig) GetOperatingSystemDistro() *string { // 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 *ImageConfig) GetOperatingSystemDistroOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.OperatingSystemDistro) { return nil, false } return o.OperatingSystemDistro.Get(), o.OperatingSystemDistro.IsSet() @@ -294,7 +321,7 @@ func (o *ImageConfig) GetOperatingSystemDistroOk() (*string, bool) { // HasOperatingSystemDistro returns a boolean if a field has been set. func (o *ImageConfig) HasOperatingSystemDistro() bool { - if o != nil && o.OperatingSystemDistro.IsSet() { + if o != nil && !IsNil(o.OperatingSystemDistro) && !IsNil(o.OperatingSystemDistro) && o.OperatingSystemDistro.IsSet() { return true } @@ -303,22 +330,31 @@ func (o *ImageConfig) HasOperatingSystemDistro() bool { // SetOperatingSystemDistro gets a reference to the given string and assigns it to the OperatingSystemDistro field. func (o *ImageConfig) SetOperatingSystemDistro(v *string) { + if IsNil(o.OperatingSystemDistro) { + o.OperatingSystemDistro = new(NullableString) + } o.OperatingSystemDistro.Set(v) } // SetOperatingSystemDistroNil sets the value for OperatingSystemDistro to be an explicit nil func (o *ImageConfig) SetOperatingSystemDistroNil() { + if IsNil(o.OperatingSystemDistro) { + o.OperatingSystemDistro = new(NullableString) + } o.OperatingSystemDistro.Set(nil) } // UnsetOperatingSystemDistro ensures that no value is present for OperatingSystemDistro, not even an explicit nil func (o *ImageConfig) UnsetOperatingSystemDistro() { + if IsNil(o.OperatingSystemDistro) { + o.OperatingSystemDistro = new(NullableString) + } o.OperatingSystemDistro.Unset() } // GetOperatingSystemVersion returns the OperatingSystemVersion field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ImageConfig) GetOperatingSystemVersion() *string { - if o == nil || IsNil(o.OperatingSystemVersion.Get()) { + if o == nil || IsNil(o.OperatingSystemVersion) || IsNil(o.OperatingSystemVersion.Get()) { var ret *string return ret } @@ -329,7 +365,7 @@ func (o *ImageConfig) GetOperatingSystemVersion() *string { // 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 *ImageConfig) GetOperatingSystemVersionOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.OperatingSystemVersion) { return nil, false } return o.OperatingSystemVersion.Get(), o.OperatingSystemVersion.IsSet() @@ -337,7 +373,7 @@ func (o *ImageConfig) GetOperatingSystemVersionOk() (*string, bool) { // HasOperatingSystemVersion returns a boolean if a field has been set. func (o *ImageConfig) HasOperatingSystemVersion() bool { - if o != nil && o.OperatingSystemVersion.IsSet() { + if o != nil && !IsNil(o.OperatingSystemVersion) && !IsNil(o.OperatingSystemVersion) && o.OperatingSystemVersion.IsSet() { return true } @@ -346,22 +382,31 @@ func (o *ImageConfig) HasOperatingSystemVersion() bool { // SetOperatingSystemVersion gets a reference to the given string and assigns it to the OperatingSystemVersion field. func (o *ImageConfig) SetOperatingSystemVersion(v *string) { + if IsNil(o.OperatingSystemVersion) { + o.OperatingSystemVersion = new(NullableString) + } o.OperatingSystemVersion.Set(v) } // SetOperatingSystemVersionNil sets the value for OperatingSystemVersion to be an explicit nil func (o *ImageConfig) SetOperatingSystemVersionNil() { + if IsNil(o.OperatingSystemVersion) { + o.OperatingSystemVersion = new(NullableString) + } o.OperatingSystemVersion.Set(nil) } // UnsetOperatingSystemVersion ensures that no value is present for OperatingSystemVersion, not even an explicit nil func (o *ImageConfig) UnsetOperatingSystemVersion() { + if IsNil(o.OperatingSystemVersion) { + o.OperatingSystemVersion = new(NullableString) + } o.OperatingSystemVersion.Unset() } // GetRescueBus returns the RescueBus field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ImageConfig) GetRescueBus() *string { - if o == nil || IsNil(o.RescueBus.Get()) { + if o == nil || IsNil(o.RescueBus) || IsNil(o.RescueBus.Get()) { var ret *string return ret } @@ -372,7 +417,7 @@ func (o *ImageConfig) GetRescueBus() *string { // 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 *ImageConfig) GetRescueBusOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.RescueBus) { return nil, false } return o.RescueBus.Get(), o.RescueBus.IsSet() @@ -380,7 +425,7 @@ func (o *ImageConfig) GetRescueBusOk() (*string, bool) { // HasRescueBus returns a boolean if a field has been set. func (o *ImageConfig) HasRescueBus() bool { - if o != nil && o.RescueBus.IsSet() { + if o != nil && !IsNil(o.RescueBus) && !IsNil(o.RescueBus) && o.RescueBus.IsSet() { return true } @@ -389,22 +434,31 @@ func (o *ImageConfig) HasRescueBus() bool { // SetRescueBus gets a reference to the given string and assigns it to the RescueBus field. func (o *ImageConfig) SetRescueBus(v *string) { + if IsNil(o.RescueBus) { + o.RescueBus = new(NullableString) + } o.RescueBus.Set(v) } // SetRescueBusNil sets the value for RescueBus to be an explicit nil func (o *ImageConfig) SetRescueBusNil() { + if IsNil(o.RescueBus) { + o.RescueBus = new(NullableString) + } o.RescueBus.Set(nil) } // UnsetRescueBus ensures that no value is present for RescueBus, not even an explicit nil func (o *ImageConfig) UnsetRescueBus() { + if IsNil(o.RescueBus) { + o.RescueBus = new(NullableString) + } o.RescueBus.Unset() } // GetRescueDevice returns the RescueDevice field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ImageConfig) GetRescueDevice() *string { - if o == nil || IsNil(o.RescueDevice.Get()) { + if o == nil || IsNil(o.RescueDevice) || IsNil(o.RescueDevice.Get()) { var ret *string return ret } @@ -415,7 +469,7 @@ func (o *ImageConfig) GetRescueDevice() *string { // 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 *ImageConfig) GetRescueDeviceOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.RescueDevice) { return nil, false } return o.RescueDevice.Get(), o.RescueDevice.IsSet() @@ -423,7 +477,7 @@ func (o *ImageConfig) GetRescueDeviceOk() (*string, bool) { // HasRescueDevice returns a boolean if a field has been set. func (o *ImageConfig) HasRescueDevice() bool { - if o != nil && o.RescueDevice.IsSet() { + if o != nil && !IsNil(o.RescueDevice) && !IsNil(o.RescueDevice) && o.RescueDevice.IsSet() { return true } @@ -432,16 +486,25 @@ func (o *ImageConfig) HasRescueDevice() bool { // SetRescueDevice gets a reference to the given string and assigns it to the RescueDevice field. func (o *ImageConfig) SetRescueDevice(v *string) { + if IsNil(o.RescueDevice) { + o.RescueDevice = new(NullableString) + } o.RescueDevice.Set(v) } // SetRescueDeviceNil sets the value for RescueDevice to be an explicit nil func (o *ImageConfig) SetRescueDeviceNil() { + if IsNil(o.RescueDevice) { + o.RescueDevice = new(NullableString) + } o.RescueDevice.Set(nil) } // UnsetRescueDevice ensures that no value is present for RescueDevice, not even an explicit nil func (o *ImageConfig) UnsetRescueDevice() { + if IsNil(o.RescueDevice) { + o.RescueDevice = new(NullableString) + } o.RescueDevice.Unset() } @@ -465,7 +528,7 @@ func (o *ImageConfig) GetSecureBootOk() (*bool, bool) { // HasSecureBoot returns a boolean if a field has been set. func (o *ImageConfig) HasSecureBoot() bool { - if o != nil && !IsNil(o.SecureBoot) { + if o != nil && !IsNil(o.SecureBoot) && !IsNil(o.SecureBoot) { return true } @@ -497,7 +560,7 @@ func (o *ImageConfig) GetUefiOk() (*bool, bool) { // HasUefi returns a boolean if a field has been set. func (o *ImageConfig) HasUefi() bool { - if o != nil && !IsNil(o.Uefi) { + if o != nil && !IsNil(o.Uefi) && !IsNil(o.Uefi) { return true } @@ -511,7 +574,7 @@ func (o *ImageConfig) SetUefi(v *bool) { // GetVideoModel returns the VideoModel field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ImageConfig) GetVideoModel() *string { - if o == nil || IsNil(o.VideoModel.Get()) { + if o == nil || IsNil(o.VideoModel) || IsNil(o.VideoModel.Get()) { var ret *string return ret } @@ -522,7 +585,7 @@ func (o *ImageConfig) GetVideoModel() *string { // 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 *ImageConfig) GetVideoModelOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.VideoModel) { return nil, false } return o.VideoModel.Get(), o.VideoModel.IsSet() @@ -530,7 +593,7 @@ func (o *ImageConfig) GetVideoModelOk() (*string, bool) { // HasVideoModel returns a boolean if a field has been set. func (o *ImageConfig) HasVideoModel() bool { - if o != nil && o.VideoModel.IsSet() { + if o != nil && !IsNil(o.VideoModel) && !IsNil(o.VideoModel) && o.VideoModel.IsSet() { return true } @@ -539,16 +602,25 @@ func (o *ImageConfig) HasVideoModel() bool { // SetVideoModel gets a reference to the given string and assigns it to the VideoModel field. func (o *ImageConfig) SetVideoModel(v *string) { + if IsNil(o.VideoModel) { + o.VideoModel = new(NullableString) + } o.VideoModel.Set(v) } // SetVideoModelNil sets the value for VideoModel to be an explicit nil func (o *ImageConfig) SetVideoModelNil() { + if IsNil(o.VideoModel) { + o.VideoModel = new(NullableString) + } o.VideoModel.Set(nil) } // UnsetVideoModel ensures that no value is present for VideoModel, not even an explicit nil func (o *ImageConfig) UnsetVideoModel() { + if IsNil(o.VideoModel) { + o.VideoModel = new(NullableString) + } o.VideoModel.Unset() } @@ -572,7 +644,7 @@ func (o *ImageConfig) GetVirtioScsiOk() (*bool, bool) { // HasVirtioScsi returns a boolean if a field has been set. func (o *ImageConfig) HasVirtioScsi() bool { - if o != nil && !IsNil(o.VirtioScsi) { + if o != nil && !IsNil(o.VirtioScsi) && !IsNil(o.VirtioScsi) { return true } diff --git a/services/iaasalpha/model_image_create_response.go b/services/iaasalpha/model_image_create_response.go index a010764b8..5ec35213e 100644 --- a/services/iaasalpha/model_image_create_response.go +++ b/services/iaasalpha/model_image_create_response.go @@ -49,7 +49,7 @@ func NewImageCreateResponseWithDefaults() *ImageCreateResponse { // GetId returns the Id field value func (o *ImageCreateResponse) GetId() *string { - if o == nil { + if o == nil || IsNil(o.Id) { var ret *string return ret } @@ -73,7 +73,7 @@ func (o *ImageCreateResponse) SetId(v *string) { // GetUploadUrl returns the UploadUrl field value func (o *ImageCreateResponse) GetUploadUrl() *string { - if o == nil { + if o == nil || IsNil(o.UploadUrl) { var ret *string return ret } diff --git a/services/iaasalpha/model_image_list_response.go b/services/iaasalpha/model_image_list_response.go index ebcf12485..2bbee9070 100644 --- a/services/iaasalpha/model_image_list_response.go +++ b/services/iaasalpha/model_image_list_response.go @@ -46,7 +46,7 @@ func NewImageListResponseWithDefaults() *ImageListResponse { // GetItems returns the Items field value func (o *ImageListResponse) GetItems() *[]Image { - if o == nil { + if o == nil || IsNil(o.Items) { var ret *[]Image return ret } diff --git a/services/iaasalpha/model_image_share.go b/services/iaasalpha/model_image_share.go new file mode 100644 index 000000000..768cfe4a0 --- /dev/null +++ b/services/iaasalpha/model_image_share.go @@ -0,0 +1,152 @@ +/* +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 ImageShare type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageShare{} + +// ImageShare Share details of an Image. ParentOrganization and Projects are mutually exclusive. +type ImageShare struct { + ParentOrganization *bool `json:"parentOrganization,omitempty"` + Projects *[]string `json:"projects,omitempty"` +} + +// NewImageShare instantiates a new ImageShare 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 NewImageShare() *ImageShare { + this := ImageShare{} + return &this +} + +// NewImageShareWithDefaults instantiates a new ImageShare 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 NewImageShareWithDefaults() *ImageShare { + this := ImageShare{} + return &this +} + +// GetParentOrganization returns the ParentOrganization field value if set, zero value otherwise. +func (o *ImageShare) GetParentOrganization() *bool { + if o == nil || IsNil(o.ParentOrganization) { + var ret *bool + return ret + } + return o.ParentOrganization +} + +// GetParentOrganizationOk returns a tuple with the ParentOrganization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShare) GetParentOrganizationOk() (*bool, bool) { + if o == nil || IsNil(o.ParentOrganization) { + return nil, false + } + return o.ParentOrganization, true +} + +// HasParentOrganization returns a boolean if a field has been set. +func (o *ImageShare) HasParentOrganization() bool { + if o != nil && !IsNil(o.ParentOrganization) && !IsNil(o.ParentOrganization) { + return true + } + + return false +} + +// SetParentOrganization gets a reference to the given bool and assigns it to the ParentOrganization field. +func (o *ImageShare) SetParentOrganization(v *bool) { + o.ParentOrganization = v +} + +// GetProjects returns the Projects field value if set, zero value otherwise. +func (o *ImageShare) GetProjects() *[]string { + if o == nil || IsNil(o.Projects) { + var ret *[]string + return ret + } + return o.Projects +} + +// GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShare) GetProjectsOk() (*[]string, bool) { + if o == nil || IsNil(o.Projects) { + return nil, false + } + return o.Projects, true +} + +// HasProjects returns a boolean if a field has been set. +func (o *ImageShare) HasProjects() bool { + if o != nil && !IsNil(o.Projects) && !IsNil(o.Projects) { + return true + } + + return false +} + +// SetProjects gets a reference to the given []string and assigns it to the Projects field. +func (o *ImageShare) SetProjects(v *[]string) { + o.Projects = v +} + +func (o ImageShare) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ParentOrganization) { + toSerialize["parentOrganization"] = o.ParentOrganization + } + if !IsNil(o.Projects) { + toSerialize["projects"] = o.Projects + } + return toSerialize, nil +} + +type NullableImageShare struct { + value *ImageShare + isSet bool +} + +func (v NullableImageShare) Get() *ImageShare { + return v.value +} + +func (v *NullableImageShare) Set(val *ImageShare) { + v.value = val + v.isSet = true +} + +func (v NullableImageShare) IsSet() bool { + return v.isSet +} + +func (v *NullableImageShare) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageShare(val *ImageShare) *NullableImageShare { + return &NullableImageShare{value: val, isSet: true} +} + +func (v NullableImageShare) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageShare) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_image_share_consumer.go b/services/iaasalpha/model_image_share_consumer.go new file mode 100644 index 000000000..1edd0c578 --- /dev/null +++ b/services/iaasalpha/model_image_share_consumer.go @@ -0,0 +1,229 @@ +/* +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" + "time" +) + +// checks if the ImageShareConsumer type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageShareConsumer{} + +// ImageShareConsumer The details of an Image share consumer. +type ImageShareConsumer struct { + // Universally Unique Identifier (UUID). + ConsumerProjectId *string `json:"consumerProjectId,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Universally Unique Identifier (UUID). + ImageId *string `json:"imageId,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +// NewImageShareConsumer instantiates a new ImageShareConsumer 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 NewImageShareConsumer() *ImageShareConsumer { + this := ImageShareConsumer{} + return &this +} + +// NewImageShareConsumerWithDefaults instantiates a new ImageShareConsumer 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 NewImageShareConsumerWithDefaults() *ImageShareConsumer { + this := ImageShareConsumer{} + return &this +} + +// GetConsumerProjectId returns the ConsumerProjectId field value if set, zero value otherwise. +func (o *ImageShareConsumer) GetConsumerProjectId() *string { + if o == nil || IsNil(o.ConsumerProjectId) { + var ret *string + return ret + } + return o.ConsumerProjectId +} + +// GetConsumerProjectIdOk returns a tuple with the ConsumerProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShareConsumer) GetConsumerProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.ConsumerProjectId) { + return nil, false + } + return o.ConsumerProjectId, true +} + +// HasConsumerProjectId returns a boolean if a field has been set. +func (o *ImageShareConsumer) HasConsumerProjectId() bool { + if o != nil && !IsNil(o.ConsumerProjectId) && !IsNil(o.ConsumerProjectId) { + return true + } + + return false +} + +// SetConsumerProjectId gets a reference to the given string and assigns it to the ConsumerProjectId field. +func (o *ImageShareConsumer) SetConsumerProjectId(v *string) { + o.ConsumerProjectId = v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *ImageShareConsumer) GetCreatedAt() *time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret *time.Time + return ret + } + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShareConsumer) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *ImageShareConsumer) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *ImageShareConsumer) SetCreatedAt(v *time.Time) { + o.CreatedAt = v +} + +// GetImageId returns the ImageId field value if set, zero value otherwise. +func (o *ImageShareConsumer) GetImageId() *string { + if o == nil || IsNil(o.ImageId) { + var ret *string + return ret + } + return o.ImageId +} + +// GetImageIdOk returns a tuple with the ImageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShareConsumer) GetImageIdOk() (*string, bool) { + if o == nil || IsNil(o.ImageId) { + return nil, false + } + return o.ImageId, true +} + +// HasImageId returns a boolean if a field has been set. +func (o *ImageShareConsumer) HasImageId() bool { + if o != nil && !IsNil(o.ImageId) && !IsNil(o.ImageId) { + return true + } + + return false +} + +// SetImageId gets a reference to the given string and assigns it to the ImageId field. +func (o *ImageShareConsumer) SetImageId(v *string) { + o.ImageId = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *ImageShareConsumer) GetUpdatedAt() *time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret *time.Time + return ret + } + return o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShareConsumer) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *ImageShareConsumer) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *ImageShareConsumer) SetUpdatedAt(v *time.Time) { + o.UpdatedAt = v +} + +func (o ImageShareConsumer) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ConsumerProjectId) { + toSerialize["consumerProjectId"] = o.ConsumerProjectId + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.ImageId) { + toSerialize["imageId"] = o.ImageId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +type NullableImageShareConsumer struct { + value *ImageShareConsumer + isSet bool +} + +func (v NullableImageShareConsumer) Get() *ImageShareConsumer { + return v.value +} + +func (v *NullableImageShareConsumer) Set(val *ImageShareConsumer) { + v.value = val + v.isSet = true +} + +func (v NullableImageShareConsumer) IsSet() bool { + return v.isSet +} + +func (v *NullableImageShareConsumer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageShareConsumer(val *ImageShareConsumer) *NullableImageShareConsumer { + return &NullableImageShareConsumer{value: val, isSet: true} +} + +func (v NullableImageShareConsumer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageShareConsumer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_key_pair_list_response.go b/services/iaasalpha/model_key_pair_list_response.go index 1f785141c..898eab2df 100644 --- a/services/iaasalpha/model_key_pair_list_response.go +++ b/services/iaasalpha/model_key_pair_list_response.go @@ -46,7 +46,7 @@ func NewKeyPairListResponseWithDefaults() *KeyPairListResponse { // GetItems returns the Items field value func (o *KeyPairListResponse) GetItems() *[]Keypair { - if o == nil { + if o == nil || IsNil(o.Items) { var ret *[]Keypair return ret } diff --git a/services/iaasalpha/model_keypair.go b/services/iaasalpha/model_keypair.go index 3dfa2264a..84632d91e 100644 --- a/services/iaasalpha/model_keypair.go +++ b/services/iaasalpha/model_keypair.go @@ -75,7 +75,7 @@ func (o *Keypair) GetCreatedAtOk() (*time.Time, bool) { // HasCreatedAt returns a boolean if a field has been set. func (o *Keypair) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { + if o != nil && !IsNil(o.CreatedAt) && !IsNil(o.CreatedAt) { return true } @@ -107,7 +107,7 @@ func (o *Keypair) GetFingerprintOk() (*string, bool) { // HasFingerprint returns a boolean if a field has been set. func (o *Keypair) HasFingerprint() bool { - if o != nil && !IsNil(o.Fingerprint) { + if o != nil && !IsNil(o.Fingerprint) && !IsNil(o.Fingerprint) { return true } @@ -139,7 +139,7 @@ func (o *Keypair) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *Keypair) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -171,7 +171,7 @@ func (o *Keypair) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *Keypair) HasName() bool { - if o != nil && !IsNil(o.Name) { + if o != nil && !IsNil(o.Name) && !IsNil(o.Name) { return true } @@ -185,7 +185,7 @@ func (o *Keypair) SetName(v *string) { // GetPublicKey returns the PublicKey field value func (o *Keypair) GetPublicKey() *string { - if o == nil { + if o == nil || IsNil(o.PublicKey) { var ret *string return ret } @@ -227,7 +227,7 @@ func (o *Keypair) GetUpdatedAtOk() (*time.Time, bool) { // HasUpdatedAt returns a boolean if a field has been set. func (o *Keypair) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { + if o != nil && !IsNil(o.UpdatedAt) && !IsNil(o.UpdatedAt) { return true } diff --git a/services/iaasalpha/model_machine_type.go b/services/iaasalpha/model_machine_type.go index 96084b648..3f82a2c58 100644 --- a/services/iaasalpha/model_machine_type.go +++ b/services/iaasalpha/model_machine_type.go @@ -80,7 +80,7 @@ func (o *MachineType) GetDescriptionOk() (*string, bool) { // HasDescription returns a boolean if a field has been set. func (o *MachineType) HasDescription() bool { - if o != nil && !IsNil(o.Description) { + if o != nil && !IsNil(o.Description) && !IsNil(o.Description) { return true } @@ -94,7 +94,7 @@ func (o *MachineType) SetDescription(v *string) { // GetDisk returns the Disk field value func (o *MachineType) GetDisk() *int64 { - if o == nil { + if o == nil || IsNil(o.Disk) { var ret *int64 return ret } @@ -136,7 +136,7 @@ func (o *MachineType) GetExtraSpecsOk() (*map[string]interface{}, bool) { // HasExtraSpecs returns a boolean if a field has been set. func (o *MachineType) HasExtraSpecs() bool { - if o != nil && !IsNil(o.ExtraSpecs) { + if o != nil && !IsNil(o.ExtraSpecs) && !IsNil(o.ExtraSpecs) { return true } @@ -150,7 +150,7 @@ func (o *MachineType) SetExtraSpecs(v *map[string]interface{}) { // GetName returns the Name field value func (o *MachineType) GetName() *string { - if o == nil { + if o == nil || IsNil(o.Name) { var ret *string return ret } @@ -174,7 +174,7 @@ func (o *MachineType) SetName(v *string) { // GetRam returns the Ram field value func (o *MachineType) GetRam() *int64 { - if o == nil { + if o == nil || IsNil(o.Ram) { var ret *int64 return ret } @@ -198,7 +198,7 @@ func (o *MachineType) SetRam(v *int64) { // GetVcpus returns the Vcpus field value func (o *MachineType) GetVcpus() *int64 { - if o == nil { + if o == nil || IsNil(o.Vcpus) { var ret *int64 return ret } diff --git a/services/iaasalpha/model_machine_type_list_response.go b/services/iaasalpha/model_machine_type_list_response.go index 2801cb90d..0c315c714 100644 --- a/services/iaasalpha/model_machine_type_list_response.go +++ b/services/iaasalpha/model_machine_type_list_response.go @@ -46,7 +46,7 @@ func NewMachineTypeListResponseWithDefaults() *MachineTypeListResponse { // GetItems returns the Items field value func (o *MachineTypeListResponse) GetItems() *[]MachineType { - if o == nil { + if o == nil || IsNil(o.Items) { var ret *[]MachineType return ret } diff --git a/services/iaasalpha/model_network.go b/services/iaasalpha/model_network.go index 86daaadec..c517d0c7e 100644 --- a/services/iaasalpha/model_network.go +++ b/services/iaasalpha/model_network.go @@ -92,7 +92,7 @@ func (o *Network) GetCreatedAtOk() (*time.Time, bool) { // HasCreatedAt returns a boolean if a field has been set. func (o *Network) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { + if o != nil && !IsNil(o.CreatedAt) && !IsNil(o.CreatedAt) { return true } @@ -106,7 +106,7 @@ 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() *string { - if o == nil || IsNil(o.Gateway.Get()) { + if o == nil || IsNil(o.Gateway) || IsNil(o.Gateway.Get()) { var ret *string return ret } @@ -117,7 +117,7 @@ func (o *Network) GetGateway() *string { // 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() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.Gateway) { return nil, false } return o.Gateway.Get(), o.Gateway.IsSet() @@ -125,7 +125,7 @@ func (o *Network) GetGatewayOk() (*string, bool) { // HasGateway returns a boolean if a field has been set. func (o *Network) HasGateway() bool { - if o != nil && o.Gateway.IsSet() { + if o != nil && !IsNil(o.Gateway) && !IsNil(o.Gateway) && o.Gateway.IsSet() { return true } @@ -134,22 +134,31 @@ func (o *Network) HasGateway() bool { // SetGateway gets a reference to the given string and assigns it to the Gateway field. func (o *Network) SetGateway(v *string) { + if IsNil(o.Gateway) { + o.Gateway = new(NullableString) + } o.Gateway.Set(v) } // SetGatewayNil sets the value for Gateway to be an explicit nil func (o *Network) SetGatewayNil() { + if IsNil(o.Gateway) { + o.Gateway = new(NullableString) + } o.Gateway.Set(nil) } // UnsetGateway ensures that no value is present for Gateway, not even an explicit nil func (o *Network) UnsetGateway() { + if IsNil(o.Gateway) { + o.Gateway = new(NullableString) + } o.Gateway.Unset() } // GetGatewayv6 returns the Gatewayv6 field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Network) GetGatewayv6() *string { - if o == nil || IsNil(o.Gatewayv6.Get()) { + if o == nil || IsNil(o.Gatewayv6) || IsNil(o.Gatewayv6.Get()) { var ret *string return ret } @@ -160,7 +169,7 @@ func (o *Network) GetGatewayv6() *string { // 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() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.Gatewayv6) { return nil, false } return o.Gatewayv6.Get(), o.Gatewayv6.IsSet() @@ -168,7 +177,7 @@ func (o *Network) GetGatewayv6Ok() (*string, bool) { // HasGatewayv6 returns a boolean if a field has been set. func (o *Network) HasGatewayv6() bool { - if o != nil && o.Gatewayv6.IsSet() { + if o != nil && !IsNil(o.Gatewayv6) && !IsNil(o.Gatewayv6) && o.Gatewayv6.IsSet() { return true } @@ -177,16 +186,25 @@ func (o *Network) HasGatewayv6() bool { // SetGatewayv6 gets a reference to the given string and assigns it to the Gatewayv6 field. func (o *Network) SetGatewayv6(v *string) { + if IsNil(o.Gatewayv6) { + o.Gatewayv6 = new(NullableString) + } o.Gatewayv6.Set(v) } // SetGatewayv6Nil sets the value for Gatewayv6 to be an explicit nil func (o *Network) SetGatewayv6Nil() { + if IsNil(o.Gatewayv6) { + o.Gatewayv6 = new(NullableString) + } o.Gatewayv6.Set(nil) } // UnsetGatewayv6 ensures that no value is present for Gatewayv6, not even an explicit nil func (o *Network) UnsetGatewayv6() { + if IsNil(o.Gatewayv6) { + o.Gatewayv6 = new(NullableString) + } o.Gatewayv6.Unset() } @@ -210,7 +228,7 @@ func (o *Network) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *Network) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -224,7 +242,7 @@ func (o *Network) SetLabels(v *map[string]interface{}) { // GetName returns the Name field value func (o *Network) GetName() *string { - if o == nil { + if o == nil || IsNil(o.Name) { var ret *string return ret } @@ -266,7 +284,7 @@ func (o *Network) GetNameserversOk() (*[]string, bool) { // HasNameservers returns a boolean if a field has been set. func (o *Network) HasNameservers() bool { - if o != nil && !IsNil(o.Nameservers) { + if o != nil && !IsNil(o.Nameservers) && !IsNil(o.Nameservers) { return true } @@ -298,7 +316,7 @@ func (o *Network) GetNameserversV6Ok() (*[]string, bool) { // HasNameserversV6 returns a boolean if a field has been set. func (o *Network) HasNameserversV6() bool { - if o != nil && !IsNil(o.NameserversV6) { + if o != nil && !IsNil(o.NameserversV6) && !IsNil(o.NameserversV6) { return true } @@ -312,7 +330,7 @@ func (o *Network) SetNameserversV6(v *[]string) { // GetNetworkId returns the NetworkId field value func (o *Network) GetNetworkId() *string { - if o == nil { + if o == nil || IsNil(o.NetworkId) { var ret *string return ret } @@ -354,7 +372,7 @@ func (o *Network) GetPrefixesOk() (*[]string, bool) { // HasPrefixes returns a boolean if a field has been set. func (o *Network) HasPrefixes() bool { - if o != nil && !IsNil(o.Prefixes) { + if o != nil && !IsNil(o.Prefixes) && !IsNil(o.Prefixes) { return true } @@ -386,7 +404,7 @@ func (o *Network) GetPrefixesV6Ok() (*[]string, bool) { // HasPrefixesV6 returns a boolean if a field has been set. func (o *Network) HasPrefixesV6() bool { - if o != nil && !IsNil(o.PrefixesV6) { + if o != nil && !IsNil(o.PrefixesV6) && !IsNil(o.PrefixesV6) { return true } @@ -418,7 +436,7 @@ func (o *Network) GetPublicIpOk() (*string, bool) { // HasPublicIp returns a boolean if a field has been set. func (o *Network) HasPublicIp() bool { - if o != nil && !IsNil(o.PublicIp) { + if o != nil && !IsNil(o.PublicIp) && !IsNil(o.PublicIp) { return true } @@ -450,7 +468,7 @@ func (o *Network) GetRoutedOk() (*bool, bool) { // HasRouted returns a boolean if a field has been set. func (o *Network) HasRouted() bool { - if o != nil && !IsNil(o.Routed) { + if o != nil && !IsNil(o.Routed) && !IsNil(o.Routed) { return true } @@ -464,7 +482,7 @@ func (o *Network) SetRouted(v *bool) { // GetState returns the State field value func (o *Network) GetState() *string { - if o == nil { + if o == nil || IsNil(o.State) { var ret *string return ret } @@ -506,7 +524,7 @@ func (o *Network) GetUpdatedAtOk() (*time.Time, bool) { // HasUpdatedAt returns a boolean if a field has been set. func (o *Network) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { + if o != nil && !IsNil(o.UpdatedAt) && !IsNil(o.UpdatedAt) { return true } diff --git a/services/iaasalpha/model_network_area.go b/services/iaasalpha/model_network_area.go index a37dfac1e..c2cb12d4f 100644 --- a/services/iaasalpha/model_network_area.go +++ b/services/iaasalpha/model_network_area.go @@ -65,7 +65,7 @@ func NewNetworkAreaWithDefaults() *NetworkArea { // GetAreaId returns the AreaId field value func (o *NetworkArea) GetAreaId() *string { - if o == nil { + if o == nil || IsNil(o.AreaId) { var ret *string return ret } @@ -107,7 +107,7 @@ func (o *NetworkArea) GetCreatedAtOk() (*time.Time, bool) { // HasCreatedAt returns a boolean if a field has been set. func (o *NetworkArea) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { + if o != nil && !IsNil(o.CreatedAt) && !IsNil(o.CreatedAt) { return true } @@ -139,7 +139,7 @@ func (o *NetworkArea) GetIpv4Ok() (*NetworkAreaIPv4, bool) { // HasIpv4 returns a boolean if a field has been set. func (o *NetworkArea) HasIpv4() bool { - if o != nil && !IsNil(o.Ipv4) { + if o != nil && !IsNil(o.Ipv4) && !IsNil(o.Ipv4) { return true } @@ -171,7 +171,7 @@ func (o *NetworkArea) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *NetworkArea) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -185,7 +185,7 @@ func (o *NetworkArea) SetLabels(v *map[string]interface{}) { // GetName returns the Name field value func (o *NetworkArea) GetName() *string { - if o == nil { + if o == nil || IsNil(o.Name) { var ret *string return ret } @@ -209,7 +209,7 @@ func (o *NetworkArea) SetName(v *string) { // GetProjectCount returns the ProjectCount field value func (o *NetworkArea) GetProjectCount() *int64 { - if o == nil { + if o == nil || IsNil(o.ProjectCount) { var ret *int64 return ret } @@ -233,7 +233,7 @@ func (o *NetworkArea) SetProjectCount(v *int64) { // GetState returns the State field value func (o *NetworkArea) GetState() *string { - if o == nil { + if o == nil || IsNil(o.State) { var ret *string return ret } @@ -275,7 +275,7 @@ func (o *NetworkArea) GetUpdatedAtOk() (*time.Time, bool) { // HasUpdatedAt returns a boolean if a field has been set. func (o *NetworkArea) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { + if o != nil && !IsNil(o.UpdatedAt) && !IsNil(o.UpdatedAt) { return true } diff --git a/services/iaasalpha/model_network_area_ipv4.go b/services/iaasalpha/model_network_area_ipv4.go index 6aaf4e7ce..c3b9e55f1 100644 --- a/services/iaasalpha/model_network_area_ipv4.go +++ b/services/iaasalpha/model_network_area_ipv4.go @@ -84,7 +84,7 @@ func (o *NetworkAreaIPv4) GetDefaultNameserversOk() (*[]string, bool) { // HasDefaultNameservers returns a boolean if a field has been set. func (o *NetworkAreaIPv4) HasDefaultNameservers() bool { - if o != nil && !IsNil(o.DefaultNameservers) { + if o != nil && !IsNil(o.DefaultNameservers) && !IsNil(o.DefaultNameservers) { return true } @@ -116,7 +116,7 @@ func (o *NetworkAreaIPv4) GetNetworkRangesOk() (*[]NetworkRange, bool) { // HasNetworkRanges returns a boolean if a field has been set. func (o *NetworkAreaIPv4) HasNetworkRanges() bool { - if o != nil && !IsNil(o.NetworkRanges) { + if o != nil && !IsNil(o.NetworkRanges) && !IsNil(o.NetworkRanges) { return true } @@ -148,7 +148,7 @@ func (o *NetworkAreaIPv4) GetRoutesOk() (*[]Route, bool) { // HasRoutes returns a boolean if a field has been set. func (o *NetworkAreaIPv4) HasRoutes() bool { - if o != nil && !IsNil(o.Routes) { + if o != nil && !IsNil(o.Routes) && !IsNil(o.Routes) { return true } @@ -180,7 +180,7 @@ func (o *NetworkAreaIPv4) GetTransferNetworkOk() (*string, bool) { // HasTransferNetwork returns a boolean if a field has been set. func (o *NetworkAreaIPv4) HasTransferNetwork() bool { - if o != nil && !IsNil(o.TransferNetwork) { + if o != nil && !IsNil(o.TransferNetwork) && !IsNil(o.TransferNetwork) { return true } @@ -212,7 +212,7 @@ func (o *NetworkAreaIPv4) GetDefaultPrefixLenOk() (*int64, bool) { // HasDefaultPrefixLen returns a boolean if a field has been set. func (o *NetworkAreaIPv4) HasDefaultPrefixLen() bool { - if o != nil && !IsNil(o.DefaultPrefixLen) { + if o != nil && !IsNil(o.DefaultPrefixLen) && !IsNil(o.DefaultPrefixLen) { return true } @@ -244,7 +244,7 @@ func (o *NetworkAreaIPv4) GetMaxPrefixLenOk() (*int64, bool) { // HasMaxPrefixLen returns a boolean if a field has been set. func (o *NetworkAreaIPv4) HasMaxPrefixLen() bool { - if o != nil && !IsNil(o.MaxPrefixLen) { + if o != nil && !IsNil(o.MaxPrefixLen) && !IsNil(o.MaxPrefixLen) { return true } @@ -276,7 +276,7 @@ func (o *NetworkAreaIPv4) GetMinPrefixLenOk() (*int64, bool) { // HasMinPrefixLen returns a boolean if a field has been set. func (o *NetworkAreaIPv4) HasMinPrefixLen() bool { - if o != nil && !IsNil(o.MinPrefixLen) { + if o != nil && !IsNil(o.MinPrefixLen) && !IsNil(o.MinPrefixLen) { return true } diff --git a/services/iaasalpha/model_network_area_list_response.go b/services/iaasalpha/model_network_area_list_response.go index d57b68487..7f2b995b6 100644 --- a/services/iaasalpha/model_network_area_list_response.go +++ b/services/iaasalpha/model_network_area_list_response.go @@ -46,7 +46,7 @@ func NewNetworkAreaListResponseWithDefaults() *NetworkAreaListResponse { // GetItems returns the Items field value func (o *NetworkAreaListResponse) GetItems() *[]NetworkArea { - if o == nil { + if o == nil || IsNil(o.Items) { var ret *[]NetworkArea return ret } diff --git a/services/iaasalpha/model_network_list_response.go b/services/iaasalpha/model_network_list_response.go index 5df8f90a8..031bc1d6d 100644 --- a/services/iaasalpha/model_network_list_response.go +++ b/services/iaasalpha/model_network_list_response.go @@ -46,7 +46,7 @@ func NewNetworkListResponseWithDefaults() *NetworkListResponse { // GetItems returns the Items field value func (o *NetworkListResponse) GetItems() *[]Network { - if o == nil { + if o == nil || IsNil(o.Items) { var ret *[]Network return ret } diff --git a/services/iaasalpha/model_network_range.go b/services/iaasalpha/model_network_range.go index 17ad61970..011fc877c 100644 --- a/services/iaasalpha/model_network_range.go +++ b/services/iaasalpha/model_network_range.go @@ -71,7 +71,7 @@ func (o *NetworkRange) GetCreatedAtOk() (*time.Time, bool) { // HasCreatedAt returns a boolean if a field has been set. func (o *NetworkRange) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { + if o != nil && !IsNil(o.CreatedAt) && !IsNil(o.CreatedAt) { return true } @@ -103,7 +103,7 @@ func (o *NetworkRange) GetNetworkRangeIdOk() (*string, bool) { // HasNetworkRangeId returns a boolean if a field has been set. func (o *NetworkRange) HasNetworkRangeId() bool { - if o != nil && !IsNil(o.NetworkRangeId) { + if o != nil && !IsNil(o.NetworkRangeId) && !IsNil(o.NetworkRangeId) { return true } @@ -117,7 +117,7 @@ func (o *NetworkRange) SetNetworkRangeId(v *string) { // GetPrefix returns the Prefix field value func (o *NetworkRange) GetPrefix() *string { - if o == nil { + if o == nil || IsNil(o.Prefix) { var ret *string return ret } @@ -159,7 +159,7 @@ func (o *NetworkRange) GetUpdatedAtOk() (*time.Time, bool) { // HasUpdatedAt returns a boolean if a field has been set. func (o *NetworkRange) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { + if o != nil && !IsNil(o.UpdatedAt) && !IsNil(o.UpdatedAt) { return true } diff --git a/services/iaasalpha/model_nic.go b/services/iaasalpha/model_nic.go index 5a39fa1e5..3e510238f 100644 --- a/services/iaasalpha/model_nic.go +++ b/services/iaasalpha/model_nic.go @@ -86,7 +86,7 @@ func (o *NIC) GetAllowedAddressesOk() (*[]AllowedAddressesInner, bool) { // HasAllowedAddresses returns a boolean if a field has been set. func (o *NIC) HasAllowedAddresses() bool { - if o != nil && !IsNil(o.AllowedAddresses) { + if o != nil && !IsNil(o.AllowedAddresses) && !IsNil(o.AllowedAddresses) { return true } @@ -118,7 +118,7 @@ func (o *NIC) GetDeviceOk() (*string, bool) { // HasDevice returns a boolean if a field has been set. func (o *NIC) HasDevice() bool { - if o != nil && !IsNil(o.Device) { + if o != nil && !IsNil(o.Device) && !IsNil(o.Device) { return true } @@ -150,7 +150,7 @@ func (o *NIC) GetIdOk() (*string, bool) { // HasId returns a boolean if a field has been set. func (o *NIC) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && !IsNil(o.Id) && !IsNil(o.Id) { return true } @@ -182,7 +182,7 @@ func (o *NIC) GetIpv4Ok() (*string, bool) { // HasIpv4 returns a boolean if a field has been set. func (o *NIC) HasIpv4() bool { - if o != nil && !IsNil(o.Ipv4) { + if o != nil && !IsNil(o.Ipv4) && !IsNil(o.Ipv4) { return true } @@ -214,7 +214,7 @@ func (o *NIC) GetIpv6Ok() (*string, bool) { // HasIpv6 returns a boolean if a field has been set. func (o *NIC) HasIpv6() bool { - if o != nil && !IsNil(o.Ipv6) { + if o != nil && !IsNil(o.Ipv6) && !IsNil(o.Ipv6) { return true } @@ -246,7 +246,7 @@ func (o *NIC) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *NIC) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -278,7 +278,7 @@ func (o *NIC) GetMacOk() (*string, bool) { // HasMac returns a boolean if a field has been set. func (o *NIC) HasMac() bool { - if o != nil && !IsNil(o.Mac) { + if o != nil && !IsNil(o.Mac) && !IsNil(o.Mac) { return true } @@ -310,7 +310,7 @@ func (o *NIC) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *NIC) HasName() bool { - if o != nil && !IsNil(o.Name) { + if o != nil && !IsNil(o.Name) && !IsNil(o.Name) { return true } @@ -342,7 +342,7 @@ func (o *NIC) GetNetworkIdOk() (*string, bool) { // HasNetworkId returns a boolean if a field has been set. func (o *NIC) HasNetworkId() bool { - if o != nil && !IsNil(o.NetworkId) { + if o != nil && !IsNil(o.NetworkId) && !IsNil(o.NetworkId) { return true } @@ -374,7 +374,7 @@ func (o *NIC) GetNicSecurityOk() (*bool, bool) { // HasNicSecurity returns a boolean if a field has been set. func (o *NIC) HasNicSecurity() bool { - if o != nil && !IsNil(o.NicSecurity) { + if o != nil && !IsNil(o.NicSecurity) && !IsNil(o.NicSecurity) { return true } @@ -406,7 +406,7 @@ func (o *NIC) GetSecurityGroupsOk() (*[]string, bool) { // HasSecurityGroups returns a boolean if a field has been set. func (o *NIC) HasSecurityGroups() bool { - if o != nil && !IsNil(o.SecurityGroups) { + if o != nil && !IsNil(o.SecurityGroups) && !IsNil(o.SecurityGroups) { return true } @@ -438,7 +438,7 @@ func (o *NIC) GetStatusOk() (*string, bool) { // HasStatus returns a boolean if a field has been set. func (o *NIC) HasStatus() bool { - if o != nil && !IsNil(o.Status) { + if o != nil && !IsNil(o.Status) && !IsNil(o.Status) { return true } @@ -470,7 +470,7 @@ func (o *NIC) GetTypeOk() (*string, bool) { // HasType returns a boolean if a field has been set. func (o *NIC) HasType() bool { - if o != nil && !IsNil(o.Type) { + if o != nil && !IsNil(o.Type) && !IsNil(o.Type) { return true } diff --git a/services/iaasalpha/model_nic_list_response.go b/services/iaasalpha/model_nic_list_response.go index fb1da78f1..fe05ca7c1 100644 --- a/services/iaasalpha/model_nic_list_response.go +++ b/services/iaasalpha/model_nic_list_response.go @@ -46,7 +46,7 @@ func NewNICListResponseWithDefaults() *NICListResponse { // GetItems returns the Items field value func (o *NICListResponse) GetItems() *[]NIC { - if o == nil { + if o == nil || IsNil(o.Items) { var ret *[]NIC return ret } diff --git a/services/iaasalpha/model_port_range.go b/services/iaasalpha/model_port_range.go index 314427a6e..f6c17d0d7 100644 --- a/services/iaasalpha/model_port_range.go +++ b/services/iaasalpha/model_port_range.go @@ -50,7 +50,7 @@ func NewPortRangeWithDefaults() *PortRange { // GetMax returns the Max field value func (o *PortRange) GetMax() *int64 { - if o == nil { + if o == nil || IsNil(o.Max) { var ret *int64 return ret } @@ -74,7 +74,7 @@ func (o *PortRange) SetMax(v *int64) { // GetMin returns the Min field value func (o *PortRange) GetMin() *int64 { - if o == nil { + if o == nil || IsNil(o.Min) { var ret *int64 return ret } diff --git a/services/iaasalpha/model_project.go b/services/iaasalpha/model_project.go index b31b50182..c781524cb 100644 --- a/services/iaasalpha/model_project.go +++ b/services/iaasalpha/model_project.go @@ -61,7 +61,7 @@ func NewProjectWithDefaults() *Project { // GetAreaId returns the AreaId field value func (o *Project) GetAreaId() *AreaId { - if o == nil { + if o == nil || IsNil(o.AreaId) { var ret *AreaId return ret } @@ -103,7 +103,7 @@ func (o *Project) GetCreatedAtOk() (*time.Time, bool) { // HasCreatedAt returns a boolean if a field has been set. func (o *Project) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { + if o != nil && !IsNil(o.CreatedAt) && !IsNil(o.CreatedAt) { return true } @@ -135,7 +135,7 @@ func (o *Project) GetInternetAccessOk() (*bool, bool) { // HasInternetAccess returns a boolean if a field has been set. func (o *Project) HasInternetAccess() bool { - if o != nil && !IsNil(o.InternetAccess) { + if o != nil && !IsNil(o.InternetAccess) && !IsNil(o.InternetAccess) { return true } @@ -167,7 +167,7 @@ func (o *Project) GetOpenstackProjectIdOk() (*string, bool) { // HasOpenstackProjectId returns a boolean if a field has been set. func (o *Project) HasOpenstackProjectId() bool { - if o != nil && !IsNil(o.OpenstackProjectId) { + if o != nil && !IsNil(o.OpenstackProjectId) && !IsNil(o.OpenstackProjectId) { return true } @@ -181,7 +181,7 @@ func (o *Project) SetOpenstackProjectId(v *string) { // GetProjectId returns the ProjectId field value func (o *Project) GetProjectId() *string { - if o == nil { + if o == nil || IsNil(o.ProjectId) { var ret *string return ret } @@ -205,7 +205,7 @@ func (o *Project) SetProjectId(v *string) { // GetState returns the State field value func (o *Project) GetState() *string { - if o == nil { + if o == nil || IsNil(o.State) { var ret *string return ret } @@ -247,7 +247,7 @@ func (o *Project) GetUpdatedAtOk() (*time.Time, bool) { // HasUpdatedAt returns a boolean if a field has been set. func (o *Project) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { + if o != nil && !IsNil(o.UpdatedAt) && !IsNil(o.UpdatedAt) { return true } diff --git a/services/iaasalpha/model_project_list_response.go b/services/iaasalpha/model_project_list_response.go index b31819009..5538d474d 100644 --- a/services/iaasalpha/model_project_list_response.go +++ b/services/iaasalpha/model_project_list_response.go @@ -46,7 +46,7 @@ func NewProjectListResponseWithDefaults() *ProjectListResponse { // GetItems returns the Items field value func (o *ProjectListResponse) GetItems() *[]string { - if o == nil { + if o == nil || IsNil(o.Items) { var ret *[]string return ret } diff --git a/services/iaasalpha/model_protocol.go b/services/iaasalpha/model_protocol.go index aa423d062..51165c8f7 100644 --- a/services/iaasalpha/model_protocol.go +++ b/services/iaasalpha/model_protocol.go @@ -62,7 +62,7 @@ func (o *Protocol) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *Protocol) HasName() bool { - if o != nil && !IsNil(o.Name) { + if o != nil && !IsNil(o.Name) && !IsNil(o.Name) { return true } @@ -94,7 +94,7 @@ func (o *Protocol) GetNumberOk() (*int64, bool) { // HasNumber returns a boolean if a field has been set. func (o *Protocol) HasNumber() bool { - if o != nil && !IsNil(o.Number) { + if o != nil && !IsNil(o.Number) && !IsNil(o.Number) { return true } diff --git a/services/iaasalpha/model_public_ip.go b/services/iaasalpha/model_public_ip.go index 550c9a0f4..d17ff5f74 100644 --- a/services/iaasalpha/model_public_ip.go +++ b/services/iaasalpha/model_public_ip.go @@ -66,7 +66,7 @@ func (o *PublicIp) GetIdOk() (*string, bool) { // HasId returns a boolean if a field has been set. func (o *PublicIp) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && !IsNil(o.Id) && !IsNil(o.Id) { return true } @@ -98,7 +98,7 @@ func (o *PublicIp) GetIpOk() (*string, bool) { // HasIp returns a boolean if a field has been set. func (o *PublicIp) HasIp() bool { - if o != nil && !IsNil(o.Ip) { + if o != nil && !IsNil(o.Ip) && !IsNil(o.Ip) { return true } @@ -130,7 +130,7 @@ func (o *PublicIp) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *PublicIp) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -144,7 +144,7 @@ func (o *PublicIp) SetLabels(v *map[string]interface{}) { // GetNetworkInterface returns the NetworkInterface field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PublicIp) GetNetworkInterface() *string { - if o == nil || IsNil(o.NetworkInterface.Get()) { + if o == nil || IsNil(o.NetworkInterface) || IsNil(o.NetworkInterface.Get()) { var ret *string return ret } @@ -155,7 +155,7 @@ func (o *PublicIp) GetNetworkInterface() *string { // 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 *PublicIp) GetNetworkInterfaceOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.NetworkInterface) { return nil, false } return o.NetworkInterface.Get(), o.NetworkInterface.IsSet() @@ -163,7 +163,7 @@ func (o *PublicIp) GetNetworkInterfaceOk() (*string, bool) { // HasNetworkInterface returns a boolean if a field has been set. func (o *PublicIp) HasNetworkInterface() bool { - if o != nil && o.NetworkInterface.IsSet() { + if o != nil && !IsNil(o.NetworkInterface) && !IsNil(o.NetworkInterface) && o.NetworkInterface.IsSet() { return true } @@ -172,16 +172,25 @@ func (o *PublicIp) HasNetworkInterface() bool { // SetNetworkInterface gets a reference to the given string and assigns it to the NetworkInterface field. func (o *PublicIp) SetNetworkInterface(v *string) { + if IsNil(o.NetworkInterface) { + o.NetworkInterface = new(NullableString) + } o.NetworkInterface.Set(v) } // SetNetworkInterfaceNil sets the value for NetworkInterface to be an explicit nil func (o *PublicIp) SetNetworkInterfaceNil() { + if IsNil(o.NetworkInterface) { + o.NetworkInterface = new(NullableString) + } o.NetworkInterface.Set(nil) } // UnsetNetworkInterface ensures that no value is present for NetworkInterface, not even an explicit nil func (o *PublicIp) UnsetNetworkInterface() { + if IsNil(o.NetworkInterface) { + o.NetworkInterface = new(NullableString) + } o.NetworkInterface.Unset() } diff --git a/services/iaasalpha/model_public_ip_list_response.go b/services/iaasalpha/model_public_ip_list_response.go index a233c225f..784379211 100644 --- a/services/iaasalpha/model_public_ip_list_response.go +++ b/services/iaasalpha/model_public_ip_list_response.go @@ -46,7 +46,7 @@ func NewPublicIpListResponseWithDefaults() *PublicIpListResponse { // GetItems returns the Items field value func (o *PublicIpListResponse) GetItems() *[]PublicIp { - if o == nil { + if o == nil || IsNil(o.Items) { var ret *[]PublicIp return ret } diff --git a/services/iaasalpha/model_public_network.go b/services/iaasalpha/model_public_network.go index feb5ee342..4606f27c2 100644 --- a/services/iaasalpha/model_public_network.go +++ b/services/iaasalpha/model_public_network.go @@ -46,7 +46,7 @@ func NewPublicNetworkWithDefaults() *PublicNetwork { // GetCidr returns the Cidr field value func (o *PublicNetwork) GetCidr() *string { - if o == nil { + if o == nil || IsNil(o.Cidr) { var ret *string return ret } diff --git a/services/iaasalpha/model_public_network_list_response.go b/services/iaasalpha/model_public_network_list_response.go index 97a59ef39..b1eacafc5 100644 --- a/services/iaasalpha/model_public_network_list_response.go +++ b/services/iaasalpha/model_public_network_list_response.go @@ -46,7 +46,7 @@ func NewPublicNetworkListResponseWithDefaults() *PublicNetworkListResponse { // GetItems returns the Items field value func (o *PublicNetworkListResponse) GetItems() *[]PublicNetwork { - if o == nil { + if o == nil || IsNil(o.Items) { var ret *[]PublicNetwork return ret } diff --git a/services/iaasalpha/model_remove_member_from_virtual_ip_payload.go b/services/iaasalpha/model_remove_member_from_virtual_ip_payload.go index 4d5282541..359c476f3 100644 --- a/services/iaasalpha/model_remove_member_from_virtual_ip_payload.go +++ b/services/iaasalpha/model_remove_member_from_virtual_ip_payload.go @@ -46,7 +46,7 @@ func NewRemoveMemberFromVirtualIPPayloadWithDefaults() *RemoveMemberFromVirtualI // GetMember returns the Member field value func (o *RemoveMemberFromVirtualIPPayload) GetMember() *string { - if o == nil { + if o == nil || IsNil(o.Member) { var ret *string return ret } diff --git a/services/iaasalpha/model_request.go b/services/iaasalpha/model_request.go index 224456fa3..9bc265ca7 100644 --- a/services/iaasalpha/model_request.go +++ b/services/iaasalpha/model_request.go @@ -80,7 +80,7 @@ func (o *Request) GetDetailsOk() (*string, bool) { // HasDetails returns a boolean if a field has been set. func (o *Request) HasDetails() bool { - if o != nil && !IsNil(o.Details) { + if o != nil && !IsNil(o.Details) && !IsNil(o.Details) { return true } @@ -94,7 +94,7 @@ func (o *Request) SetDetails(v *string) { // GetRequestAction returns the RequestAction field value func (o *Request) GetRequestAction() *string { - if o == nil { + if o == nil || IsNil(o.RequestAction) { var ret *string return ret } @@ -118,7 +118,7 @@ func (o *Request) SetRequestAction(v *string) { // GetRequestId returns the RequestId field value func (o *Request) GetRequestId() *string { - if o == nil { + if o == nil || IsNil(o.RequestId) { var ret *string return ret } @@ -142,7 +142,7 @@ func (o *Request) SetRequestId(v *string) { // GetRequestType returns the RequestType field value func (o *Request) GetRequestType() *string { - if o == nil { + if o == nil || IsNil(o.RequestType) { var ret *string return ret } @@ -166,7 +166,7 @@ func (o *Request) SetRequestType(v *string) { // GetResources returns the Resources field value func (o *Request) GetResources() *[]RequestResource { - if o == nil { + if o == nil || IsNil(o.Resources) { var ret *[]RequestResource return ret } @@ -190,7 +190,7 @@ func (o *Request) SetResources(v *[]RequestResource) { // GetStatus returns the Status field value func (o *Request) GetStatus() *string { - if o == nil { + if o == nil || IsNil(o.Status) { var ret *string return ret } diff --git a/services/iaasalpha/model_request_resource.go b/services/iaasalpha/model_request_resource.go index ceeebc2a8..f2a408f05 100644 --- a/services/iaasalpha/model_request_resource.go +++ b/services/iaasalpha/model_request_resource.go @@ -54,7 +54,7 @@ func NewRequestResourceWithDefaults() *RequestResource { // GetId returns the Id field value func (o *RequestResource) GetId() *string { - if o == nil { + if o == nil || IsNil(o.Id) { var ret *string return ret } @@ -78,7 +78,7 @@ func (o *RequestResource) SetId(v *string) { // GetStatus returns the Status field value func (o *RequestResource) GetStatus() *string { - if o == nil { + if o == nil || IsNil(o.Status) { var ret *string return ret } @@ -102,7 +102,7 @@ func (o *RequestResource) SetStatus(v *string) { // GetType returns the Type field value func (o *RequestResource) GetType() *string { - if o == nil { + if o == nil || IsNil(o.Type) { var ret *string return ret } diff --git a/services/iaasalpha/model_rescue_server_payload.go b/services/iaasalpha/model_rescue_server_payload.go index c67e67b21..e0f2d14a9 100644 --- a/services/iaasalpha/model_rescue_server_payload.go +++ b/services/iaasalpha/model_rescue_server_payload.go @@ -46,7 +46,7 @@ func NewRescueServerPayloadWithDefaults() *RescueServerPayload { // GetImage returns the Image field value func (o *RescueServerPayload) GetImage() *string { - if o == nil { + if o == nil || IsNil(o.Image) { var ret *string return ret } diff --git a/services/iaasalpha/model_resize_server_payload.go b/services/iaasalpha/model_resize_server_payload.go index 942cf3b97..6620c4826 100644 --- a/services/iaasalpha/model_resize_server_payload.go +++ b/services/iaasalpha/model_resize_server_payload.go @@ -46,7 +46,7 @@ func NewResizeServerPayloadWithDefaults() *ResizeServerPayload { // GetMachineType returns the MachineType field value func (o *ResizeServerPayload) GetMachineType() *string { - if o == nil { + if o == nil || IsNil(o.MachineType) { var ret *string return ret } diff --git a/services/iaasalpha/model_resize_volume_payload.go b/services/iaasalpha/model_resize_volume_payload.go index c10164ea6..53a819529 100644 --- a/services/iaasalpha/model_resize_volume_payload.go +++ b/services/iaasalpha/model_resize_volume_payload.go @@ -46,7 +46,7 @@ func NewResizeVolumePayloadWithDefaults() *ResizeVolumePayload { // GetSize returns the Size field value func (o *ResizeVolumePayload) GetSize() *int64 { - if o == nil { + if o == nil || IsNil(o.Size) { var ret *int64 return ret } diff --git a/services/iaasalpha/model_route.go b/services/iaasalpha/model_route.go index 55ad494d0..7e58a683a 100644 --- a/services/iaasalpha/model_route.go +++ b/services/iaasalpha/model_route.go @@ -77,7 +77,7 @@ func (o *Route) GetCreatedAtOk() (*time.Time, bool) { // HasCreatedAt returns a boolean if a field has been set. func (o *Route) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { + if o != nil && !IsNil(o.CreatedAt) && !IsNil(o.CreatedAt) { return true } @@ -109,7 +109,7 @@ func (o *Route) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *Route) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -123,7 +123,7 @@ func (o *Route) SetLabels(v *map[string]interface{}) { // GetNexthop returns the Nexthop field value func (o *Route) GetNexthop() *string { - if o == nil { + if o == nil || IsNil(o.Nexthop) { var ret *string return ret } @@ -147,7 +147,7 @@ func (o *Route) SetNexthop(v *string) { // GetPrefix returns the Prefix field value func (o *Route) GetPrefix() *string { - if o == nil { + if o == nil || IsNil(o.Prefix) { var ret *string return ret } @@ -189,7 +189,7 @@ func (o *Route) GetRouteIdOk() (*string, bool) { // HasRouteId returns a boolean if a field has been set. func (o *Route) HasRouteId() bool { - if o != nil && !IsNil(o.RouteId) { + if o != nil && !IsNil(o.RouteId) && !IsNil(o.RouteId) { return true } @@ -221,7 +221,7 @@ func (o *Route) GetUpdatedAtOk() (*time.Time, bool) { // HasUpdatedAt returns a boolean if a field has been set. func (o *Route) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { + if o != nil && !IsNil(o.UpdatedAt) && !IsNil(o.UpdatedAt) { return true } diff --git a/services/iaasalpha/model_security_group.go b/services/iaasalpha/model_security_group.go index 9bd14c92e..be7b04da3 100644 --- a/services/iaasalpha/model_security_group.go +++ b/services/iaasalpha/model_security_group.go @@ -83,7 +83,7 @@ func (o *SecurityGroup) GetCreatedAtOk() (*time.Time, bool) { // HasCreatedAt returns a boolean if a field has been set. func (o *SecurityGroup) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { + if o != nil && !IsNil(o.CreatedAt) && !IsNil(o.CreatedAt) { return true } @@ -115,7 +115,7 @@ func (o *SecurityGroup) GetDescriptionOk() (*string, bool) { // HasDescription returns a boolean if a field has been set. func (o *SecurityGroup) HasDescription() bool { - if o != nil && !IsNil(o.Description) { + if o != nil && !IsNil(o.Description) && !IsNil(o.Description) { return true } @@ -147,7 +147,7 @@ func (o *SecurityGroup) GetIdOk() (*string, bool) { // HasId returns a boolean if a field has been set. func (o *SecurityGroup) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && !IsNil(o.Id) && !IsNil(o.Id) { return true } @@ -179,7 +179,7 @@ func (o *SecurityGroup) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *SecurityGroup) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -193,7 +193,7 @@ func (o *SecurityGroup) SetLabels(v *map[string]interface{}) { // GetName returns the Name field value func (o *SecurityGroup) GetName() *string { - if o == nil { + if o == nil || IsNil(o.Name) { var ret *string return ret } @@ -235,7 +235,7 @@ func (o *SecurityGroup) GetRulesOk() (*[]SecurityGroupRule, bool) { // HasRules returns a boolean if a field has been set. func (o *SecurityGroup) HasRules() bool { - if o != nil && !IsNil(o.Rules) { + if o != nil && !IsNil(o.Rules) && !IsNil(o.Rules) { return true } @@ -267,7 +267,7 @@ func (o *SecurityGroup) GetStatefulOk() (*bool, bool) { // HasStateful returns a boolean if a field has been set. func (o *SecurityGroup) HasStateful() bool { - if o != nil && !IsNil(o.Stateful) { + if o != nil && !IsNil(o.Stateful) && !IsNil(o.Stateful) { return true } @@ -299,7 +299,7 @@ func (o *SecurityGroup) GetUpdatedAtOk() (*time.Time, bool) { // HasUpdatedAt returns a boolean if a field has been set. func (o *SecurityGroup) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { + if o != nil && !IsNil(o.UpdatedAt) && !IsNil(o.UpdatedAt) { return true } diff --git a/services/iaasalpha/model_security_group_list_response.go b/services/iaasalpha/model_security_group_list_response.go index 7598100cb..a3fd14382 100644 --- a/services/iaasalpha/model_security_group_list_response.go +++ b/services/iaasalpha/model_security_group_list_response.go @@ -46,7 +46,7 @@ func NewSecurityGroupListResponseWithDefaults() *SecurityGroupListResponse { // GetItems returns the Items field value func (o *SecurityGroupListResponse) GetItems() *[]SecurityGroup { - if o == nil { + if o == nil || IsNil(o.Items) { var ret *[]SecurityGroup return ret } diff --git a/services/iaasalpha/model_security_group_rule.go b/services/iaasalpha/model_security_group_rule.go index f04cf2627..ae613d3e6 100644 --- a/services/iaasalpha/model_security_group_rule.go +++ b/services/iaasalpha/model_security_group_rule.go @@ -83,7 +83,7 @@ func (o *SecurityGroupRule) GetDescriptionOk() (*string, bool) { // HasDescription returns a boolean if a field has been set. func (o *SecurityGroupRule) HasDescription() bool { - if o != nil && !IsNil(o.Description) { + if o != nil && !IsNil(o.Description) && !IsNil(o.Description) { return true } @@ -97,7 +97,7 @@ func (o *SecurityGroupRule) SetDescription(v *string) { // GetDirection returns the Direction field value func (o *SecurityGroupRule) GetDirection() *string { - if o == nil { + if o == nil || IsNil(o.Direction) { var ret *string return ret } @@ -139,7 +139,7 @@ func (o *SecurityGroupRule) GetEthertypeOk() (*string, bool) { // HasEthertype returns a boolean if a field has been set. func (o *SecurityGroupRule) HasEthertype() bool { - if o != nil && !IsNil(o.Ethertype) { + if o != nil && !IsNil(o.Ethertype) && !IsNil(o.Ethertype) { return true } @@ -171,7 +171,7 @@ func (o *SecurityGroupRule) GetIcmpParametersOk() (*ICMPParameters, bool) { // HasIcmpParameters returns a boolean if a field has been set. func (o *SecurityGroupRule) HasIcmpParameters() bool { - if o != nil && !IsNil(o.IcmpParameters) { + if o != nil && !IsNil(o.IcmpParameters) && !IsNil(o.IcmpParameters) { return true } @@ -203,7 +203,7 @@ func (o *SecurityGroupRule) GetIdOk() (*string, bool) { // HasId returns a boolean if a field has been set. func (o *SecurityGroupRule) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && !IsNil(o.Id) && !IsNil(o.Id) { return true } @@ -235,7 +235,7 @@ func (o *SecurityGroupRule) GetIpRangeOk() (*string, bool) { // HasIpRange returns a boolean if a field has been set. func (o *SecurityGroupRule) HasIpRange() bool { - if o != nil && !IsNil(o.IpRange) { + if o != nil && !IsNil(o.IpRange) && !IsNil(o.IpRange) { return true } @@ -267,7 +267,7 @@ func (o *SecurityGroupRule) GetPortRangeOk() (*PortRange, bool) { // HasPortRange returns a boolean if a field has been set. func (o *SecurityGroupRule) HasPortRange() bool { - if o != nil && !IsNil(o.PortRange) { + if o != nil && !IsNil(o.PortRange) && !IsNil(o.PortRange) { return true } @@ -299,7 +299,7 @@ func (o *SecurityGroupRule) GetRemoteSecurityGroupIdOk() (*string, bool) { // HasRemoteSecurityGroupId returns a boolean if a field has been set. func (o *SecurityGroupRule) HasRemoteSecurityGroupId() bool { - if o != nil && !IsNil(o.RemoteSecurityGroupId) { + if o != nil && !IsNil(o.RemoteSecurityGroupId) && !IsNil(o.RemoteSecurityGroupId) { return true } @@ -331,7 +331,7 @@ func (o *SecurityGroupRule) GetSecurityGroupIdOk() (*string, bool) { // HasSecurityGroupId returns a boolean if a field has been set. func (o *SecurityGroupRule) HasSecurityGroupId() bool { - if o != nil && !IsNil(o.SecurityGroupId) { + if o != nil && !IsNil(o.SecurityGroupId) && !IsNil(o.SecurityGroupId) { return true } @@ -363,7 +363,7 @@ func (o *SecurityGroupRule) GetProtocolOk() (*Protocol, bool) { // HasProtocol returns a boolean if a field has been set. func (o *SecurityGroupRule) HasProtocol() bool { - if o != nil && !IsNil(o.Protocol) { + if o != nil && !IsNil(o.Protocol) && !IsNil(o.Protocol) { return true } diff --git a/services/iaasalpha/model_security_group_rule_list_response.go b/services/iaasalpha/model_security_group_rule_list_response.go index 5a6eb248d..5d41178bd 100644 --- a/services/iaasalpha/model_security_group_rule_list_response.go +++ b/services/iaasalpha/model_security_group_rule_list_response.go @@ -46,7 +46,7 @@ func NewSecurityGroupRuleListResponseWithDefaults() *SecurityGroupRuleListRespon // GetItems returns the Items field value func (o *SecurityGroupRuleListResponse) GetItems() *[]SecurityGroupRule { - if o == nil { + if o == nil || IsNil(o.Items) { var ret *[]SecurityGroupRule return ret } diff --git a/services/iaasalpha/model_security_group_rule_protocol.go b/services/iaasalpha/model_security_group_rule_protocol.go index b284fe346..9b91c2f77 100644 --- a/services/iaasalpha/model_security_group_rule_protocol.go +++ b/services/iaasalpha/model_security_group_rule_protocol.go @@ -59,7 +59,7 @@ func (o *SecurityGroupRuleProtocol) GetProtocolOk() (*Protocol, bool) { // HasProtocol returns a boolean if a field has been set. func (o *SecurityGroupRuleProtocol) HasProtocol() bool { - if o != nil && !IsNil(o.Protocol) { + if o != nil && !IsNil(o.Protocol) && !IsNil(o.Protocol) { return true } diff --git a/services/iaasalpha/model_server.go b/services/iaasalpha/model_server.go index eefbb4440..218a5abde 100644 --- a/services/iaasalpha/model_server.go +++ b/services/iaasalpha/model_server.go @@ -106,7 +106,7 @@ func (o *Server) GetAffinityGroupOk() (*string, bool) { // HasAffinityGroup returns a boolean if a field has been set. func (o *Server) HasAffinityGroup() bool { - if o != nil && !IsNil(o.AffinityGroup) { + if o != nil && !IsNil(o.AffinityGroup) && !IsNil(o.AffinityGroup) { return true } @@ -138,7 +138,7 @@ func (o *Server) GetAvailabilityZoneOk() (*string, bool) { // HasAvailabilityZone returns a boolean if a field has been set. func (o *Server) HasAvailabilityZone() bool { - if o != nil && !IsNil(o.AvailabilityZone) { + if o != nil && !IsNil(o.AvailabilityZone) && !IsNil(o.AvailabilityZone) { return true } @@ -170,7 +170,7 @@ func (o *Server) GetBootVolumeOk() (*CreateServerPayloadBootVolume, bool) { // HasBootVolume returns a boolean if a field has been set. func (o *Server) HasBootVolume() bool { - if o != nil && !IsNil(o.BootVolume) { + if o != nil && !IsNil(o.BootVolume) && !IsNil(o.BootVolume) { return true } @@ -202,7 +202,7 @@ func (o *Server) GetCreatedAtOk() (*time.Time, bool) { // HasCreatedAt returns a boolean if a field has been set. func (o *Server) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { + if o != nil && !IsNil(o.CreatedAt) && !IsNil(o.CreatedAt) { return true } @@ -234,7 +234,7 @@ func (o *Server) GetErrorMessageOk() (*string, bool) { // HasErrorMessage returns a boolean if a field has been set. func (o *Server) HasErrorMessage() bool { - if o != nil && !IsNil(o.ErrorMessage) { + if o != nil && !IsNil(o.ErrorMessage) && !IsNil(o.ErrorMessage) { return true } @@ -266,7 +266,7 @@ func (o *Server) GetIdOk() (*string, bool) { // HasId returns a boolean if a field has been set. func (o *Server) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && !IsNil(o.Id) && !IsNil(o.Id) { return true } @@ -298,7 +298,7 @@ func (o *Server) GetImageIdOk() (*string, bool) { // HasImageId returns a boolean if a field has been set. func (o *Server) HasImageId() bool { - if o != nil && !IsNil(o.ImageId) { + if o != nil && !IsNil(o.ImageId) && !IsNil(o.ImageId) { return true } @@ -330,7 +330,7 @@ func (o *Server) GetKeypairNameOk() (*string, bool) { // HasKeypairName returns a boolean if a field has been set. func (o *Server) HasKeypairName() bool { - if o != nil && !IsNil(o.KeypairName) { + if o != nil && !IsNil(o.KeypairName) && !IsNil(o.KeypairName) { return true } @@ -362,7 +362,7 @@ func (o *Server) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *Server) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -394,7 +394,7 @@ func (o *Server) GetLaunchedAtOk() (*time.Time, bool) { // HasLaunchedAt returns a boolean if a field has been set. func (o *Server) HasLaunchedAt() bool { - if o != nil && !IsNil(o.LaunchedAt) { + if o != nil && !IsNil(o.LaunchedAt) && !IsNil(o.LaunchedAt) { return true } @@ -408,7 +408,7 @@ func (o *Server) SetLaunchedAt(v *time.Time) { // GetMachineType returns the MachineType field value func (o *Server) GetMachineType() *string { - if o == nil { + if o == nil || IsNil(o.MachineType) { var ret *string return ret } @@ -450,7 +450,7 @@ func (o *Server) GetMaintenanceWindowOk() (*ServerMaintenance, bool) { // HasMaintenanceWindow returns a boolean if a field has been set. func (o *Server) HasMaintenanceWindow() bool { - if o != nil && !IsNil(o.MaintenanceWindow) { + if o != nil && !IsNil(o.MaintenanceWindow) && !IsNil(o.MaintenanceWindow) { return true } @@ -464,7 +464,7 @@ func (o *Server) SetMaintenanceWindow(v *ServerMaintenance) { // GetName returns the Name field value func (o *Server) GetName() *string { - if o == nil { + if o == nil || IsNil(o.Name) { var ret *string return ret } @@ -506,7 +506,7 @@ func (o *Server) GetNetworkingOk() (*CreateServerPayloadNetworking, bool) { // HasNetworking returns a boolean if a field has been set. func (o *Server) HasNetworking() bool { - if o != nil && !IsNil(o.Networking) { + if o != nil && !IsNil(o.Networking) && !IsNil(o.Networking) { return true } @@ -538,7 +538,7 @@ func (o *Server) GetNicsOk() (*[]ServerNetwork, bool) { // HasNics returns a boolean if a field has been set. func (o *Server) HasNics() bool { - if o != nil && !IsNil(o.Nics) { + if o != nil && !IsNil(o.Nics) && !IsNil(o.Nics) { return true } @@ -570,7 +570,7 @@ func (o *Server) GetPowerStatusOk() (*string, bool) { // HasPowerStatus returns a boolean if a field has been set. func (o *Server) HasPowerStatus() bool { - if o != nil && !IsNil(o.PowerStatus) { + if o != nil && !IsNil(o.PowerStatus) && !IsNil(o.PowerStatus) { return true } @@ -602,7 +602,7 @@ func (o *Server) GetSecurityGroupsOk() (*[]string, bool) { // HasSecurityGroups returns a boolean if a field has been set. func (o *Server) HasSecurityGroups() bool { - if o != nil && !IsNil(o.SecurityGroups) { + if o != nil && !IsNil(o.SecurityGroups) && !IsNil(o.SecurityGroups) { return true } @@ -634,7 +634,7 @@ func (o *Server) GetServiceAccountMailsOk() (*[]string, bool) { // HasServiceAccountMails returns a boolean if a field has been set. func (o *Server) HasServiceAccountMails() bool { - if o != nil && !IsNil(o.ServiceAccountMails) { + if o != nil && !IsNil(o.ServiceAccountMails) && !IsNil(o.ServiceAccountMails) { return true } @@ -666,7 +666,7 @@ func (o *Server) GetStatusOk() (*string, bool) { // HasStatus returns a boolean if a field has been set. func (o *Server) HasStatus() bool { - if o != nil && !IsNil(o.Status) { + if o != nil && !IsNil(o.Status) && !IsNil(o.Status) { return true } @@ -698,7 +698,7 @@ func (o *Server) GetUpdatedAtOk() (*time.Time, bool) { // HasUpdatedAt returns a boolean if a field has been set. func (o *Server) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { + if o != nil && !IsNil(o.UpdatedAt) && !IsNil(o.UpdatedAt) { return true } @@ -730,7 +730,7 @@ func (o *Server) GetUserDataOk() (*string, bool) { // HasUserData returns a boolean if a field has been set. func (o *Server) HasUserData() bool { - if o != nil && !IsNil(o.UserData) { + if o != nil && !IsNil(o.UserData) && !IsNil(o.UserData) { return true } @@ -762,7 +762,7 @@ func (o *Server) GetVolumesOk() (*[]string, bool) { // HasVolumes returns a boolean if a field has been set. func (o *Server) HasVolumes() bool { - if o != nil && !IsNil(o.Volumes) { + if o != nil && !IsNil(o.Volumes) && !IsNil(o.Volumes) { return true } diff --git a/services/iaasalpha/model_server_console_url.go b/services/iaasalpha/model_server_console_url.go index ae465d320..cefb4b664 100644 --- a/services/iaasalpha/model_server_console_url.go +++ b/services/iaasalpha/model_server_console_url.go @@ -45,7 +45,7 @@ func NewServerConsoleUrlWithDefaults() *ServerConsoleUrl { // GetUrl returns the Url field value func (o *ServerConsoleUrl) GetUrl() *string { - if o == nil { + if o == nil || IsNil(o.Url) { var ret *string return ret } diff --git a/services/iaasalpha/model_server_list_response.go b/services/iaasalpha/model_server_list_response.go index ee671450f..bc1903dc2 100644 --- a/services/iaasalpha/model_server_list_response.go +++ b/services/iaasalpha/model_server_list_response.go @@ -46,7 +46,7 @@ func NewServerListResponseWithDefaults() *ServerListResponse { // GetItems returns the Items field value func (o *ServerListResponse) GetItems() *[]Server { - if o == nil { + if o == nil || IsNil(o.Items) { var ret *[]Server return ret } diff --git a/services/iaasalpha/model_server_maintenance.go b/services/iaasalpha/model_server_maintenance.go index 468cbcb33..4e8c63b91 100644 --- a/services/iaasalpha/model_server_maintenance.go +++ b/services/iaasalpha/model_server_maintenance.go @@ -73,7 +73,7 @@ func (o *ServerMaintenance) GetDetailsOk() (*string, bool) { // HasDetails returns a boolean if a field has been set. func (o *ServerMaintenance) HasDetails() bool { - if o != nil && !IsNil(o.Details) { + if o != nil && !IsNil(o.Details) && !IsNil(o.Details) { return true } @@ -87,7 +87,7 @@ func (o *ServerMaintenance) SetDetails(v *string) { // GetEndsAt returns the EndsAt field value func (o *ServerMaintenance) GetEndsAt() *time.Time { - if o == nil { + if o == nil || IsNil(o.EndsAt) { var ret *time.Time return ret } @@ -111,7 +111,7 @@ func (o *ServerMaintenance) SetEndsAt(v *time.Time) { // GetStartsAt returns the StartsAt field value func (o *ServerMaintenance) GetStartsAt() *time.Time { - if o == nil { + if o == nil || IsNil(o.StartsAt) { var ret *time.Time return ret } @@ -135,7 +135,7 @@ func (o *ServerMaintenance) SetStartsAt(v *time.Time) { // GetStatus returns the Status field value func (o *ServerMaintenance) GetStatus() *string { - if o == nil { + if o == nil || IsNil(o.Status) { var ret *string return ret } diff --git a/services/iaasalpha/model_server_network.go b/services/iaasalpha/model_server_network.go index 3e69c9187..3ec788c67 100644 --- a/services/iaasalpha/model_server_network.go +++ b/services/iaasalpha/model_server_network.go @@ -92,7 +92,7 @@ func (o *ServerNetwork) GetAllowedAddressesOk() (*[]AllowedAddressesInner, bool) // HasAllowedAddresses returns a boolean if a field has been set. func (o *ServerNetwork) HasAllowedAddresses() bool { - if o != nil && !IsNil(o.AllowedAddresses) { + if o != nil && !IsNil(o.AllowedAddresses) && !IsNil(o.AllowedAddresses) { return true } @@ -124,7 +124,7 @@ func (o *ServerNetwork) GetIpv4Ok() (*string, bool) { // HasIpv4 returns a boolean if a field has been set. func (o *ServerNetwork) HasIpv4() bool { - if o != nil && !IsNil(o.Ipv4) { + if o != nil && !IsNil(o.Ipv4) && !IsNil(o.Ipv4) { return true } @@ -156,7 +156,7 @@ func (o *ServerNetwork) GetIpv6Ok() (*string, bool) { // HasIpv6 returns a boolean if a field has been set. func (o *ServerNetwork) HasIpv6() bool { - if o != nil && !IsNil(o.Ipv6) { + if o != nil && !IsNil(o.Ipv6) && !IsNil(o.Ipv6) { return true } @@ -170,7 +170,7 @@ func (o *ServerNetwork) SetIpv6(v *string) { // GetMac returns the Mac field value func (o *ServerNetwork) GetMac() *string { - if o == nil { + if o == nil || IsNil(o.Mac) { var ret *string return ret } @@ -194,7 +194,7 @@ func (o *ServerNetwork) SetMac(v *string) { // GetNetworkId returns the NetworkId field value func (o *ServerNetwork) GetNetworkId() *string { - if o == nil { + if o == nil || IsNil(o.NetworkId) { var ret *string return ret } @@ -218,7 +218,7 @@ func (o *ServerNetwork) SetNetworkId(v *string) { // GetNetworkName returns the NetworkName field value func (o *ServerNetwork) GetNetworkName() *string { - if o == nil { + if o == nil || IsNil(o.NetworkName) { var ret *string return ret } @@ -242,7 +242,7 @@ func (o *ServerNetwork) SetNetworkName(v *string) { // GetNicId returns the NicId field value func (o *ServerNetwork) GetNicId() *string { - if o == nil { + if o == nil || IsNil(o.NicId) { var ret *string return ret } @@ -266,7 +266,7 @@ func (o *ServerNetwork) SetNicId(v *string) { // GetNicSecurity returns the NicSecurity field value func (o *ServerNetwork) GetNicSecurity() *bool { - if o == nil { + if o == nil || IsNil(o.NicSecurity) { var ret *bool return ret } @@ -308,7 +308,7 @@ func (o *ServerNetwork) GetPublicIpOk() (*string, bool) { // HasPublicIp returns a boolean if a field has been set. func (o *ServerNetwork) HasPublicIp() bool { - if o != nil && !IsNil(o.PublicIp) { + if o != nil && !IsNil(o.PublicIp) && !IsNil(o.PublicIp) { return true } @@ -340,7 +340,7 @@ func (o *ServerNetwork) GetSecurityGroupsOk() (*[]string, bool) { // HasSecurityGroups returns a boolean if a field has been set. func (o *ServerNetwork) HasSecurityGroups() bool { - if o != nil && !IsNil(o.SecurityGroups) { + if o != nil && !IsNil(o.SecurityGroups) && !IsNil(o.SecurityGroups) { return true } diff --git a/services/iaasalpha/model_service_account_mail_list_response.go b/services/iaasalpha/model_service_account_mail_list_response.go index f5114d775..6df09036c 100644 --- a/services/iaasalpha/model_service_account_mail_list_response.go +++ b/services/iaasalpha/model_service_account_mail_list_response.go @@ -46,7 +46,7 @@ func NewServiceAccountMailListResponseWithDefaults() *ServiceAccountMailListResp // GetItems returns the Items field value func (o *ServiceAccountMailListResponse) GetItems() *[]string { - if o == nil { + if o == nil || IsNil(o.Items) { var ret *[]string return ret } diff --git a/services/iaasalpha/model_set_image_share_payload.go b/services/iaasalpha/model_set_image_share_payload.go new file mode 100644 index 000000000..a72376cdb --- /dev/null +++ b/services/iaasalpha/model_set_image_share_payload.go @@ -0,0 +1,152 @@ +/* +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 SetImageSharePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetImageSharePayload{} + +// SetImageSharePayload Share details of an Image. ParentOrganization and Projects are mutually exclusive. +type SetImageSharePayload struct { + ParentOrganization *bool `json:"parentOrganization,omitempty"` + Projects *[]string `json:"projects,omitempty"` +} + +// NewSetImageSharePayload instantiates a new SetImageSharePayload 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 NewSetImageSharePayload() *SetImageSharePayload { + this := SetImageSharePayload{} + return &this +} + +// NewSetImageSharePayloadWithDefaults instantiates a new SetImageSharePayload 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 NewSetImageSharePayloadWithDefaults() *SetImageSharePayload { + this := SetImageSharePayload{} + return &this +} + +// GetParentOrganization returns the ParentOrganization field value if set, zero value otherwise. +func (o *SetImageSharePayload) GetParentOrganization() *bool { + if o == nil || IsNil(o.ParentOrganization) { + var ret *bool + return ret + } + return o.ParentOrganization +} + +// GetParentOrganizationOk returns a tuple with the ParentOrganization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SetImageSharePayload) GetParentOrganizationOk() (*bool, bool) { + if o == nil || IsNil(o.ParentOrganization) { + return nil, false + } + return o.ParentOrganization, true +} + +// HasParentOrganization returns a boolean if a field has been set. +func (o *SetImageSharePayload) HasParentOrganization() bool { + if o != nil && !IsNil(o.ParentOrganization) && !IsNil(o.ParentOrganization) { + return true + } + + return false +} + +// SetParentOrganization gets a reference to the given bool and assigns it to the ParentOrganization field. +func (o *SetImageSharePayload) SetParentOrganization(v *bool) { + o.ParentOrganization = v +} + +// GetProjects returns the Projects field value if set, zero value otherwise. +func (o *SetImageSharePayload) GetProjects() *[]string { + if o == nil || IsNil(o.Projects) { + var ret *[]string + return ret + } + return o.Projects +} + +// GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SetImageSharePayload) GetProjectsOk() (*[]string, bool) { + if o == nil || IsNil(o.Projects) { + return nil, false + } + return o.Projects, true +} + +// HasProjects returns a boolean if a field has been set. +func (o *SetImageSharePayload) HasProjects() bool { + if o != nil && !IsNil(o.Projects) && !IsNil(o.Projects) { + return true + } + + return false +} + +// SetProjects gets a reference to the given []string and assigns it to the Projects field. +func (o *SetImageSharePayload) SetProjects(v *[]string) { + o.Projects = v +} + +func (o SetImageSharePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ParentOrganization) { + toSerialize["parentOrganization"] = o.ParentOrganization + } + if !IsNil(o.Projects) { + toSerialize["projects"] = o.Projects + } + return toSerialize, nil +} + +type NullableSetImageSharePayload struct { + value *SetImageSharePayload + isSet bool +} + +func (v NullableSetImageSharePayload) Get() *SetImageSharePayload { + return v.value +} + +func (v *NullableSetImageSharePayload) Set(val *SetImageSharePayload) { + v.value = val + v.isSet = true +} + +func (v NullableSetImageSharePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableSetImageSharePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetImageSharePayload(val *SetImageSharePayload) *NullableSetImageSharePayload { + return &NullableSetImageSharePayload{value: val, isSet: true} +} + +func (v NullableSetImageSharePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetImageSharePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_update_area_address_family.go b/services/iaasalpha/model_update_area_address_family.go index 972bfcbb4..27cf7aead 100644 --- a/services/iaasalpha/model_update_area_address_family.go +++ b/services/iaasalpha/model_update_area_address_family.go @@ -59,7 +59,7 @@ func (o *UpdateAreaAddressFamily) GetIpv4Ok() (*UpdateAreaIPv4, bool) { // HasIpv4 returns a boolean if a field has been set. func (o *UpdateAreaAddressFamily) HasIpv4() bool { - if o != nil && !IsNil(o.Ipv4) { + if o != nil && !IsNil(o.Ipv4) && !IsNil(o.Ipv4) { return true } diff --git a/services/iaasalpha/model_update_area_ipv4.go b/services/iaasalpha/model_update_area_ipv4.go index e40374abf..5c8f89c57 100644 --- a/services/iaasalpha/model_update_area_ipv4.go +++ b/services/iaasalpha/model_update_area_ipv4.go @@ -65,7 +65,7 @@ func (o *UpdateAreaIPv4) GetDefaultNameserversOk() (*[]string, bool) { // HasDefaultNameservers returns a boolean if a field has been set. func (o *UpdateAreaIPv4) HasDefaultNameservers() bool { - if o != nil && !IsNil(o.DefaultNameservers) { + if o != nil && !IsNil(o.DefaultNameservers) && !IsNil(o.DefaultNameservers) { return true } @@ -97,7 +97,7 @@ func (o *UpdateAreaIPv4) GetDefaultPrefixLenOk() (*int64, bool) { // HasDefaultPrefixLen returns a boolean if a field has been set. func (o *UpdateAreaIPv4) HasDefaultPrefixLen() bool { - if o != nil && !IsNil(o.DefaultPrefixLen) { + if o != nil && !IsNil(o.DefaultPrefixLen) && !IsNil(o.DefaultPrefixLen) { return true } @@ -129,7 +129,7 @@ func (o *UpdateAreaIPv4) GetMaxPrefixLenOk() (*int64, bool) { // HasMaxPrefixLen returns a boolean if a field has been set. func (o *UpdateAreaIPv4) HasMaxPrefixLen() bool { - if o != nil && !IsNil(o.MaxPrefixLen) { + if o != nil && !IsNil(o.MaxPrefixLen) && !IsNil(o.MaxPrefixLen) { return true } @@ -161,7 +161,7 @@ func (o *UpdateAreaIPv4) GetMinPrefixLenOk() (*int64, bool) { // HasMinPrefixLen returns a boolean if a field has been set. func (o *UpdateAreaIPv4) HasMinPrefixLen() bool { - if o != nil && !IsNil(o.MinPrefixLen) { + if o != nil && !IsNil(o.MinPrefixLen) && !IsNil(o.MinPrefixLen) { return true } diff --git a/services/iaasalpha/model_update_attached_volume_payload.go b/services/iaasalpha/model_update_attached_volume_payload.go index 40a2405e3..efb7e575d 100644 --- a/services/iaasalpha/model_update_attached_volume_payload.go +++ b/services/iaasalpha/model_update_attached_volume_payload.go @@ -68,7 +68,7 @@ func (o *UpdateAttachedVolumePayload) GetDeleteOnTerminationOk() (*bool, bool) { // HasDeleteOnTermination returns a boolean if a field has been set. func (o *UpdateAttachedVolumePayload) HasDeleteOnTermination() bool { - if o != nil && !IsNil(o.DeleteOnTermination) { + if o != nil && !IsNil(o.DeleteOnTermination) && !IsNil(o.DeleteOnTermination) { return true } @@ -100,7 +100,7 @@ func (o *UpdateAttachedVolumePayload) GetServerIdOk() (*string, bool) { // HasServerId returns a boolean if a field has been set. func (o *UpdateAttachedVolumePayload) HasServerId() bool { - if o != nil && !IsNil(o.ServerId) { + if o != nil && !IsNil(o.ServerId) && !IsNil(o.ServerId) { return true } @@ -132,7 +132,7 @@ func (o *UpdateAttachedVolumePayload) GetVolumeIdOk() (*string, bool) { // HasVolumeId returns a boolean if a field has been set. func (o *UpdateAttachedVolumePayload) HasVolumeId() bool { - if o != nil && !IsNil(o.VolumeId) { + if o != nil && !IsNil(o.VolumeId) && !IsNil(o.VolumeId) { return true } diff --git a/services/iaasalpha/model_update_image_payload.go b/services/iaasalpha/model_update_image_payload.go index 9f82ca103..23c95f79e 100644 --- a/services/iaasalpha/model_update_image_payload.go +++ b/services/iaasalpha/model_update_image_payload.go @@ -70,7 +70,7 @@ func (o *UpdateImagePayload) GetConfigOk() (*ImageConfig, bool) { // HasConfig returns a boolean if a field has been set. func (o *UpdateImagePayload) HasConfig() bool { - if o != nil && !IsNil(o.Config) { + if o != nil && !IsNil(o.Config) && !IsNil(o.Config) { return true } @@ -102,7 +102,7 @@ func (o *UpdateImagePayload) GetDiskFormatOk() (*string, bool) { // HasDiskFormat returns a boolean if a field has been set. func (o *UpdateImagePayload) HasDiskFormat() bool { - if o != nil && !IsNil(o.DiskFormat) { + if o != nil && !IsNil(o.DiskFormat) && !IsNil(o.DiskFormat) { return true } @@ -134,7 +134,7 @@ func (o *UpdateImagePayload) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *UpdateImagePayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -166,7 +166,7 @@ func (o *UpdateImagePayload) GetMinDiskSizeOk() (*int64, bool) { // HasMinDiskSize returns a boolean if a field has been set. func (o *UpdateImagePayload) HasMinDiskSize() bool { - if o != nil && !IsNil(o.MinDiskSize) { + if o != nil && !IsNil(o.MinDiskSize) && !IsNil(o.MinDiskSize) { return true } @@ -198,7 +198,7 @@ func (o *UpdateImagePayload) GetMinRamOk() (*int64, bool) { // HasMinRam returns a boolean if a field has been set. func (o *UpdateImagePayload) HasMinRam() bool { - if o != nil && !IsNil(o.MinRam) { + if o != nil && !IsNil(o.MinRam) && !IsNil(o.MinRam) { return true } @@ -230,7 +230,7 @@ func (o *UpdateImagePayload) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *UpdateImagePayload) HasName() bool { - if o != nil && !IsNil(o.Name) { + if o != nil && !IsNil(o.Name) && !IsNil(o.Name) { return true } @@ -262,7 +262,7 @@ func (o *UpdateImagePayload) GetProtectedOk() (*bool, bool) { // HasProtected returns a boolean if a field has been set. func (o *UpdateImagePayload) HasProtected() bool { - if o != nil && !IsNil(o.Protected) { + if o != nil && !IsNil(o.Protected) && !IsNil(o.Protected) { return true } diff --git a/services/iaasalpha/model_update_image_share_payload.go b/services/iaasalpha/model_update_image_share_payload.go new file mode 100644 index 000000000..1aca950af --- /dev/null +++ b/services/iaasalpha/model_update_image_share_payload.go @@ -0,0 +1,152 @@ +/* +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 UpdateImageSharePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateImageSharePayload{} + +// UpdateImageSharePayload Share details of an Image. ParentOrganization and Projects are mutually exclusive. +type UpdateImageSharePayload struct { + ParentOrganization *bool `json:"parentOrganization,omitempty"` + Projects *[]string `json:"projects,omitempty"` +} + +// NewUpdateImageSharePayload instantiates a new UpdateImageSharePayload 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 NewUpdateImageSharePayload() *UpdateImageSharePayload { + this := UpdateImageSharePayload{} + return &this +} + +// NewUpdateImageSharePayloadWithDefaults instantiates a new UpdateImageSharePayload 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 NewUpdateImageSharePayloadWithDefaults() *UpdateImageSharePayload { + this := UpdateImageSharePayload{} + return &this +} + +// GetParentOrganization returns the ParentOrganization field value if set, zero value otherwise. +func (o *UpdateImageSharePayload) GetParentOrganization() *bool { + if o == nil || IsNil(o.ParentOrganization) { + var ret *bool + return ret + } + return o.ParentOrganization +} + +// GetParentOrganizationOk returns a tuple with the ParentOrganization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImageSharePayload) GetParentOrganizationOk() (*bool, bool) { + if o == nil || IsNil(o.ParentOrganization) { + return nil, false + } + return o.ParentOrganization, true +} + +// HasParentOrganization returns a boolean if a field has been set. +func (o *UpdateImageSharePayload) HasParentOrganization() bool { + if o != nil && !IsNil(o.ParentOrganization) && !IsNil(o.ParentOrganization) { + return true + } + + return false +} + +// SetParentOrganization gets a reference to the given bool and assigns it to the ParentOrganization field. +func (o *UpdateImageSharePayload) SetParentOrganization(v *bool) { + o.ParentOrganization = v +} + +// GetProjects returns the Projects field value if set, zero value otherwise. +func (o *UpdateImageSharePayload) GetProjects() *[]string { + if o == nil || IsNil(o.Projects) { + var ret *[]string + return ret + } + return o.Projects +} + +// GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImageSharePayload) GetProjectsOk() (*[]string, bool) { + if o == nil || IsNil(o.Projects) { + return nil, false + } + return o.Projects, true +} + +// HasProjects returns a boolean if a field has been set. +func (o *UpdateImageSharePayload) HasProjects() bool { + if o != nil && !IsNil(o.Projects) && !IsNil(o.Projects) { + return true + } + + return false +} + +// SetProjects gets a reference to the given []string and assigns it to the Projects field. +func (o *UpdateImageSharePayload) SetProjects(v *[]string) { + o.Projects = v +} + +func (o UpdateImageSharePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ParentOrganization) { + toSerialize["parentOrganization"] = o.ParentOrganization + } + if !IsNil(o.Projects) { + toSerialize["projects"] = o.Projects + } + return toSerialize, nil +} + +type NullableUpdateImageSharePayload struct { + value *UpdateImageSharePayload + isSet bool +} + +func (v NullableUpdateImageSharePayload) Get() *UpdateImageSharePayload { + return v.value +} + +func (v *NullableUpdateImageSharePayload) Set(val *UpdateImageSharePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateImageSharePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateImageSharePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateImageSharePayload(val *UpdateImageSharePayload) *NullableUpdateImageSharePayload { + return &NullableUpdateImageSharePayload{value: val, isSet: true} +} + +func (v NullableUpdateImageSharePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateImageSharePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_update_key_pair_payload.go b/services/iaasalpha/model_update_key_pair_payload.go index 80768d2d0..aec2b7385 100644 --- a/services/iaasalpha/model_update_key_pair_payload.go +++ b/services/iaasalpha/model_update_key_pair_payload.go @@ -60,7 +60,7 @@ func (o *UpdateKeyPairPayload) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *UpdateKeyPairPayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } diff --git a/services/iaasalpha/model_update_nic_payload.go b/services/iaasalpha/model_update_nic_payload.go index 978e429e9..dd8e89c65 100644 --- a/services/iaasalpha/model_update_nic_payload.go +++ b/services/iaasalpha/model_update_nic_payload.go @@ -68,7 +68,7 @@ func (o *UpdateNicPayload) GetAllowedAddressesOk() (*[]AllowedAddressesInner, bo // HasAllowedAddresses returns a boolean if a field has been set. func (o *UpdateNicPayload) HasAllowedAddresses() bool { - if o != nil && !IsNil(o.AllowedAddresses) { + if o != nil && !IsNil(o.AllowedAddresses) && !IsNil(o.AllowedAddresses) { return true } @@ -100,7 +100,7 @@ func (o *UpdateNicPayload) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *UpdateNicPayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -132,7 +132,7 @@ func (o *UpdateNicPayload) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *UpdateNicPayload) HasName() bool { - if o != nil && !IsNil(o.Name) { + if o != nil && !IsNil(o.Name) && !IsNil(o.Name) { return true } @@ -164,7 +164,7 @@ func (o *UpdateNicPayload) GetNicSecurityOk() (*bool, bool) { // HasNicSecurity returns a boolean if a field has been set. func (o *UpdateNicPayload) HasNicSecurity() bool { - if o != nil && !IsNil(o.NicSecurity) { + if o != nil && !IsNil(o.NicSecurity) && !IsNil(o.NicSecurity) { return true } @@ -196,7 +196,7 @@ func (o *UpdateNicPayload) GetSecurityGroupsOk() (*[]string, bool) { // HasSecurityGroups returns a boolean if a field has been set. func (o *UpdateNicPayload) HasSecurityGroups() bool { - if o != nil && !IsNil(o.SecurityGroups) { + if o != nil && !IsNil(o.SecurityGroups) && !IsNil(o.SecurityGroups) { return true } diff --git a/services/iaasalpha/model_update_public_ip_payload.go b/services/iaasalpha/model_update_public_ip_payload.go index 35aee757d..b91472dd0 100644 --- a/services/iaasalpha/model_update_public_ip_payload.go +++ b/services/iaasalpha/model_update_public_ip_payload.go @@ -66,7 +66,7 @@ func (o *UpdatePublicIPPayload) GetIdOk() (*string, bool) { // HasId returns a boolean if a field has been set. func (o *UpdatePublicIPPayload) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && !IsNil(o.Id) && !IsNil(o.Id) { return true } @@ -98,7 +98,7 @@ func (o *UpdatePublicIPPayload) GetIpOk() (*string, bool) { // HasIp returns a boolean if a field has been set. func (o *UpdatePublicIPPayload) HasIp() bool { - if o != nil && !IsNil(o.Ip) { + if o != nil && !IsNil(o.Ip) && !IsNil(o.Ip) { return true } @@ -130,7 +130,7 @@ func (o *UpdatePublicIPPayload) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *UpdatePublicIPPayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -144,7 +144,7 @@ func (o *UpdatePublicIPPayload) SetLabels(v *map[string]interface{}) { // GetNetworkInterface returns the NetworkInterface field value if set, zero value otherwise (both if not set or set to explicit null). func (o *UpdatePublicIPPayload) GetNetworkInterface() *string { - if o == nil || IsNil(o.NetworkInterface.Get()) { + if o == nil || IsNil(o.NetworkInterface) || IsNil(o.NetworkInterface.Get()) { var ret *string return ret } @@ -155,7 +155,7 @@ func (o *UpdatePublicIPPayload) GetNetworkInterface() *string { // 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 *UpdatePublicIPPayload) GetNetworkInterfaceOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.NetworkInterface) { return nil, false } return o.NetworkInterface.Get(), o.NetworkInterface.IsSet() @@ -163,7 +163,7 @@ func (o *UpdatePublicIPPayload) GetNetworkInterfaceOk() (*string, bool) { // HasNetworkInterface returns a boolean if a field has been set. func (o *UpdatePublicIPPayload) HasNetworkInterface() bool { - if o != nil && o.NetworkInterface.IsSet() { + if o != nil && !IsNil(o.NetworkInterface) && !IsNil(o.NetworkInterface) && o.NetworkInterface.IsSet() { return true } @@ -172,16 +172,25 @@ func (o *UpdatePublicIPPayload) HasNetworkInterface() bool { // SetNetworkInterface gets a reference to the given string and assigns it to the NetworkInterface field. func (o *UpdatePublicIPPayload) SetNetworkInterface(v *string) { + if IsNil(o.NetworkInterface) { + o.NetworkInterface = new(NullableString) + } o.NetworkInterface.Set(v) } // SetNetworkInterfaceNil sets the value for NetworkInterface to be an explicit nil func (o *UpdatePublicIPPayload) SetNetworkInterfaceNil() { + if IsNil(o.NetworkInterface) { + o.NetworkInterface = new(NullableString) + } o.NetworkInterface.Set(nil) } // UnsetNetworkInterface ensures that no value is present for NetworkInterface, not even an explicit nil func (o *UpdatePublicIPPayload) UnsetNetworkInterface() { + if IsNil(o.NetworkInterface) { + o.NetworkInterface = new(NullableString) + } o.NetworkInterface.Unset() } diff --git a/services/iaasalpha/model_update_security_group_payload.go b/services/iaasalpha/model_update_security_group_payload.go index 8358df1e5..d90b5296e 100644 --- a/services/iaasalpha/model_update_security_group_payload.go +++ b/services/iaasalpha/model_update_security_group_payload.go @@ -64,7 +64,7 @@ func (o *UpdateSecurityGroupPayload) GetDescriptionOk() (*string, bool) { // HasDescription returns a boolean if a field has been set. func (o *UpdateSecurityGroupPayload) HasDescription() bool { - if o != nil && !IsNil(o.Description) { + if o != nil && !IsNil(o.Description) && !IsNil(o.Description) { return true } @@ -96,7 +96,7 @@ func (o *UpdateSecurityGroupPayload) GetLabelsOk() (*map[string]interface{}, boo // HasLabels returns a boolean if a field has been set. func (o *UpdateSecurityGroupPayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -128,7 +128,7 @@ func (o *UpdateSecurityGroupPayload) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *UpdateSecurityGroupPayload) HasName() bool { - if o != nil && !IsNil(o.Name) { + if o != nil && !IsNil(o.Name) && !IsNil(o.Name) { return true } diff --git a/services/iaasalpha/model_update_server_payload.go b/services/iaasalpha/model_update_server_payload.go index a0be49e13..639c804b0 100644 --- a/services/iaasalpha/model_update_server_payload.go +++ b/services/iaasalpha/model_update_server_payload.go @@ -62,7 +62,7 @@ func (o *UpdateServerPayload) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *UpdateServerPayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -94,7 +94,7 @@ func (o *UpdateServerPayload) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *UpdateServerPayload) HasName() bool { - if o != nil && !IsNil(o.Name) { + if o != nil && !IsNil(o.Name) && !IsNil(o.Name) { return true } diff --git a/services/iaasalpha/model_update_virtual_ip_payload.go b/services/iaasalpha/model_update_virtual_ip_payload.go index 2a1ffb863..2a752d445 100644 --- a/services/iaasalpha/model_update_virtual_ip_payload.go +++ b/services/iaasalpha/model_update_virtual_ip_payload.go @@ -64,7 +64,7 @@ func (o *UpdateVirtualIPPayload) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *UpdateVirtualIPPayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -78,7 +78,7 @@ func (o *UpdateVirtualIPPayload) SetLabels(v *map[string]interface{}) { // GetMembers returns the Members field value if set, zero value otherwise (both if not set or set to explicit null). func (o *UpdateVirtualIPPayload) GetMembers() *[]string { - if o == nil { + if o == nil || IsNil(o.Members) { var ret *[]string return ret } @@ -97,7 +97,7 @@ func (o *UpdateVirtualIPPayload) GetMembersOk() (*[]string, bool) { // HasMembers returns a boolean if a field has been set. func (o *UpdateVirtualIPPayload) HasMembers() bool { - if o != nil && !IsNil(o.Members) { + if o != nil && !IsNil(o.Members) && !IsNil(o.Members) { return true } @@ -129,7 +129,7 @@ func (o *UpdateVirtualIPPayload) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *UpdateVirtualIPPayload) HasName() bool { - if o != nil && !IsNil(o.Name) { + if o != nil && !IsNil(o.Name) && !IsNil(o.Name) { return true } diff --git a/services/iaasalpha/model_update_volume_payload.go b/services/iaasalpha/model_update_volume_payload.go index fcb4f589a..9255ba570 100644 --- a/services/iaasalpha/model_update_volume_payload.go +++ b/services/iaasalpha/model_update_volume_payload.go @@ -22,7 +22,8 @@ type UpdateVolumePayload struct { // Indicates if a volume is bootable. Bootable *bool `json:"bootable,omitempty"` // Description Object. Allows string up to 127 Characters. - Description *string `json:"description,omitempty"` + Description *string `json:"description,omitempty"` + ImageConfig *ImageConfig `json:"imageConfig,omitempty"` // Object that represents the labels of an object. Labels *map[string]interface{} `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. @@ -70,7 +71,7 @@ func (o *UpdateVolumePayload) GetBootableOk() (*bool, bool) { // HasBootable returns a boolean if a field has been set. func (o *UpdateVolumePayload) HasBootable() bool { - if o != nil && !IsNil(o.Bootable) { + if o != nil && !IsNil(o.Bootable) && !IsNil(o.Bootable) { return true } @@ -102,7 +103,7 @@ func (o *UpdateVolumePayload) GetDescriptionOk() (*string, bool) { // HasDescription returns a boolean if a field has been set. func (o *UpdateVolumePayload) HasDescription() bool { - if o != nil && !IsNil(o.Description) { + if o != nil && !IsNil(o.Description) && !IsNil(o.Description) { return true } @@ -114,6 +115,38 @@ func (o *UpdateVolumePayload) SetDescription(v *string) { o.Description = v } +// GetImageConfig returns the ImageConfig field value if set, zero value otherwise. +func (o *UpdateVolumePayload) GetImageConfig() *ImageConfig { + if o == nil || IsNil(o.ImageConfig) { + var ret *ImageConfig + return ret + } + return o.ImageConfig +} + +// GetImageConfigOk returns a tuple with the ImageConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateVolumePayload) GetImageConfigOk() (*ImageConfig, bool) { + if o == nil || IsNil(o.ImageConfig) { + return nil, false + } + return o.ImageConfig, true +} + +// HasImageConfig returns a boolean if a field has been set. +func (o *UpdateVolumePayload) HasImageConfig() bool { + if o != nil && !IsNil(o.ImageConfig) && !IsNil(o.ImageConfig) { + return true + } + + return false +} + +// SetImageConfig gets a reference to the given ImageConfig and assigns it to the ImageConfig field. +func (o *UpdateVolumePayload) SetImageConfig(v *ImageConfig) { + o.ImageConfig = v +} + // GetLabels returns the Labels field value if set, zero value otherwise. func (o *UpdateVolumePayload) GetLabels() *map[string]interface{} { if o == nil || IsNil(o.Labels) { @@ -134,7 +167,7 @@ func (o *UpdateVolumePayload) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *UpdateVolumePayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -166,7 +199,7 @@ func (o *UpdateVolumePayload) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *UpdateVolumePayload) HasName() bool { - if o != nil && !IsNil(o.Name) { + if o != nil && !IsNil(o.Name) && !IsNil(o.Name) { return true } @@ -186,6 +219,9 @@ func (o UpdateVolumePayload) ToMap() (map[string]interface{}, error) { if !IsNil(o.Description) { toSerialize["description"] = o.Description } + if !IsNil(o.ImageConfig) { + toSerialize["imageConfig"] = o.ImageConfig + } if !IsNil(o.Labels) { toSerialize["labels"] = o.Labels } diff --git a/services/iaasalpha/model_virtual_ip.go b/services/iaasalpha/model_virtual_ip.go index 42a9d6df1..c4ebd868e 100644 --- a/services/iaasalpha/model_virtual_ip.go +++ b/services/iaasalpha/model_virtual_ip.go @@ -72,7 +72,7 @@ func (o *VirtualIp) GetIdOk() (*string, bool) { // HasId returns a boolean if a field has been set. func (o *VirtualIp) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && !IsNil(o.Id) && !IsNil(o.Id) { return true } @@ -104,7 +104,7 @@ func (o *VirtualIp) GetIpOk() (*string, bool) { // HasIp returns a boolean if a field has been set. func (o *VirtualIp) HasIp() bool { - if o != nil && !IsNil(o.Ip) { + if o != nil && !IsNil(o.Ip) && !IsNil(o.Ip) { return true } @@ -136,7 +136,7 @@ func (o *VirtualIp) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *VirtualIp) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -168,7 +168,7 @@ func (o *VirtualIp) GetMembersOk() (*[]string, bool) { // HasMembers returns a boolean if a field has been set. func (o *VirtualIp) HasMembers() bool { - if o != nil && !IsNil(o.Members) { + if o != nil && !IsNil(o.Members) && !IsNil(o.Members) { return true } @@ -200,7 +200,7 @@ func (o *VirtualIp) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *VirtualIp) HasName() bool { - if o != nil && !IsNil(o.Name) { + if o != nil && !IsNil(o.Name) && !IsNil(o.Name) { return true } @@ -232,7 +232,7 @@ func (o *VirtualIp) GetNetworkOk() (*string, bool) { // HasNetwork returns a boolean if a field has been set. func (o *VirtualIp) HasNetwork() bool { - if o != nil && !IsNil(o.Network) { + if o != nil && !IsNil(o.Network) && !IsNil(o.Network) { return true } @@ -264,7 +264,7 @@ func (o *VirtualIp) GetStatusOk() (*string, bool) { // HasStatus returns a boolean if a field has been set. func (o *VirtualIp) HasStatus() bool { - if o != nil && !IsNil(o.Status) { + if o != nil && !IsNil(o.Status) && !IsNil(o.Status) { return true } diff --git a/services/iaasalpha/model_virtual_ip_list_response.go b/services/iaasalpha/model_virtual_ip_list_response.go index dc728ae12..f0f26874b 100644 --- a/services/iaasalpha/model_virtual_ip_list_response.go +++ b/services/iaasalpha/model_virtual_ip_list_response.go @@ -46,7 +46,7 @@ func NewVirtualIpListResponseWithDefaults() *VirtualIpListResponse { // GetItems returns the Items field value func (o *VirtualIpListResponse) GetItems() *[]VirtualIp { - if o == nil { + if o == nil || IsNil(o.Items) { var ret *[]VirtualIp return ret } diff --git a/services/iaasalpha/model_volume.go b/services/iaasalpha/model_volume.go index e5157cbe0..8eb2aaa20 100644 --- a/services/iaasalpha/model_volume.go +++ b/services/iaasalpha/model_volume.go @@ -30,7 +30,8 @@ type Volume struct { // Description Object. Allows string up to 127 Characters. Description *string `json:"description,omitempty"` // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id *string `json:"id,omitempty"` + ImageConfig *ImageConfig `json:"imageConfig,omitempty"` // Object that represents the labels of an object. Labels *map[string]interface{} `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. @@ -70,7 +71,7 @@ func NewVolumeWithDefaults() *Volume { // GetAvailabilityZone returns the AvailabilityZone field value func (o *Volume) GetAvailabilityZone() *string { - if o == nil { + if o == nil || IsNil(o.AvailabilityZone) { var ret *string return ret } @@ -112,7 +113,7 @@ func (o *Volume) GetBootableOk() (*bool, bool) { // HasBootable returns a boolean if a field has been set. func (o *Volume) HasBootable() bool { - if o != nil && !IsNil(o.Bootable) { + if o != nil && !IsNil(o.Bootable) && !IsNil(o.Bootable) { return true } @@ -144,7 +145,7 @@ func (o *Volume) GetCreatedAtOk() (*time.Time, bool) { // HasCreatedAt returns a boolean if a field has been set. func (o *Volume) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { + if o != nil && !IsNil(o.CreatedAt) && !IsNil(o.CreatedAt) { return true } @@ -176,7 +177,7 @@ func (o *Volume) GetDescriptionOk() (*string, bool) { // HasDescription returns a boolean if a field has been set. func (o *Volume) HasDescription() bool { - if o != nil && !IsNil(o.Description) { + if o != nil && !IsNil(o.Description) && !IsNil(o.Description) { return true } @@ -208,7 +209,7 @@ func (o *Volume) GetIdOk() (*string, bool) { // HasId returns a boolean if a field has been set. func (o *Volume) HasId() bool { - if o != nil && !IsNil(o.Id) { + if o != nil && !IsNil(o.Id) && !IsNil(o.Id) { return true } @@ -220,6 +221,38 @@ func (o *Volume) SetId(v *string) { o.Id = v } +// GetImageConfig returns the ImageConfig field value if set, zero value otherwise. +func (o *Volume) GetImageConfig() *ImageConfig { + if o == nil || IsNil(o.ImageConfig) { + var ret *ImageConfig + return ret + } + return o.ImageConfig +} + +// GetImageConfigOk returns a tuple with the ImageConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetImageConfigOk() (*ImageConfig, bool) { + if o == nil || IsNil(o.ImageConfig) { + return nil, false + } + return o.ImageConfig, true +} + +// HasImageConfig returns a boolean if a field has been set. +func (o *Volume) HasImageConfig() bool { + if o != nil && !IsNil(o.ImageConfig) && !IsNil(o.ImageConfig) { + return true + } + + return false +} + +// SetImageConfig gets a reference to the given ImageConfig and assigns it to the ImageConfig field. +func (o *Volume) SetImageConfig(v *ImageConfig) { + o.ImageConfig = v +} + // GetLabels returns the Labels field value if set, zero value otherwise. func (o *Volume) GetLabels() *map[string]interface{} { if o == nil || IsNil(o.Labels) { @@ -240,7 +273,7 @@ func (o *Volume) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *Volume) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -272,7 +305,7 @@ func (o *Volume) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *Volume) HasName() bool { - if o != nil && !IsNil(o.Name) { + if o != nil && !IsNil(o.Name) && !IsNil(o.Name) { return true } @@ -304,7 +337,7 @@ func (o *Volume) GetPerformanceClassOk() (*string, bool) { // HasPerformanceClass returns a boolean if a field has been set. func (o *Volume) HasPerformanceClass() bool { - if o != nil && !IsNil(o.PerformanceClass) { + if o != nil && !IsNil(o.PerformanceClass) && !IsNil(o.PerformanceClass) { return true } @@ -336,7 +369,7 @@ func (o *Volume) GetServerIdOk() (*string, bool) { // HasServerId returns a boolean if a field has been set. func (o *Volume) HasServerId() bool { - if o != nil && !IsNil(o.ServerId) { + if o != nil && !IsNil(o.ServerId) && !IsNil(o.ServerId) { return true } @@ -368,7 +401,7 @@ func (o *Volume) GetSizeOk() (*int64, bool) { // HasSize returns a boolean if a field has been set. func (o *Volume) HasSize() bool { - if o != nil && !IsNil(o.Size) { + if o != nil && !IsNil(o.Size) && !IsNil(o.Size) { return true } @@ -400,7 +433,7 @@ func (o *Volume) GetSourceOk() (*VolumeSource, bool) { // HasSource returns a boolean if a field has been set. func (o *Volume) HasSource() bool { - if o != nil && !IsNil(o.Source) { + if o != nil && !IsNil(o.Source) && !IsNil(o.Source) { return true } @@ -432,7 +465,7 @@ func (o *Volume) GetStatusOk() (*string, bool) { // HasStatus returns a boolean if a field has been set. func (o *Volume) HasStatus() bool { - if o != nil && !IsNil(o.Status) { + if o != nil && !IsNil(o.Status) && !IsNil(o.Status) { return true } @@ -464,7 +497,7 @@ func (o *Volume) GetUpdatedAtOk() (*time.Time, bool) { // HasUpdatedAt returns a boolean if a field has been set. func (o *Volume) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { + if o != nil && !IsNil(o.UpdatedAt) && !IsNil(o.UpdatedAt) { return true } @@ -491,6 +524,9 @@ func (o Volume) ToMap() (map[string]interface{}, error) { if !IsNil(o.Id) { toSerialize["id"] = o.Id } + if !IsNil(o.ImageConfig) { + toSerialize["imageConfig"] = o.ImageConfig + } if !IsNil(o.Labels) { toSerialize["labels"] = o.Labels } diff --git a/services/iaasalpha/model_volume_attachment.go b/services/iaasalpha/model_volume_attachment.go index ac88398fb..2fccbba59 100644 --- a/services/iaasalpha/model_volume_attachment.go +++ b/services/iaasalpha/model_volume_attachment.go @@ -68,7 +68,7 @@ func (o *VolumeAttachment) GetDeleteOnTerminationOk() (*bool, bool) { // HasDeleteOnTermination returns a boolean if a field has been set. func (o *VolumeAttachment) HasDeleteOnTermination() bool { - if o != nil && !IsNil(o.DeleteOnTermination) { + if o != nil && !IsNil(o.DeleteOnTermination) && !IsNil(o.DeleteOnTermination) { return true } @@ -100,7 +100,7 @@ func (o *VolumeAttachment) GetServerIdOk() (*string, bool) { // HasServerId returns a boolean if a field has been set. func (o *VolumeAttachment) HasServerId() bool { - if o != nil && !IsNil(o.ServerId) { + if o != nil && !IsNil(o.ServerId) && !IsNil(o.ServerId) { return true } @@ -132,7 +132,7 @@ func (o *VolumeAttachment) GetVolumeIdOk() (*string, bool) { // HasVolumeId returns a boolean if a field has been set. func (o *VolumeAttachment) HasVolumeId() bool { - if o != nil && !IsNil(o.VolumeId) { + if o != nil && !IsNil(o.VolumeId) && !IsNil(o.VolumeId) { return true } diff --git a/services/iaasalpha/model_volume_attachment_list_response.go b/services/iaasalpha/model_volume_attachment_list_response.go index cc4133e95..cd22a185d 100644 --- a/services/iaasalpha/model_volume_attachment_list_response.go +++ b/services/iaasalpha/model_volume_attachment_list_response.go @@ -46,7 +46,7 @@ func NewVolumeAttachmentListResponseWithDefaults() *VolumeAttachmentListResponse // GetItems returns the Items field value func (o *VolumeAttachmentListResponse) GetItems() *[]VolumeAttachment { - if o == nil { + if o == nil || IsNil(o.Items) { var ret *[]VolumeAttachment return ret } diff --git a/services/iaasalpha/model_volume_list_response.go b/services/iaasalpha/model_volume_list_response.go index b247c77ca..51c55b384 100644 --- a/services/iaasalpha/model_volume_list_response.go +++ b/services/iaasalpha/model_volume_list_response.go @@ -46,7 +46,7 @@ func NewVolumeListResponseWithDefaults() *VolumeListResponse { // GetItems returns the Items field value func (o *VolumeListResponse) GetItems() *[]Volume { - if o == nil { + if o == nil || IsNil(o.Items) { var ret *[]Volume return ret } diff --git a/services/iaasalpha/model_volume_performance_class.go b/services/iaasalpha/model_volume_performance_class.go index 0b6921301..ca31961cc 100644 --- a/services/iaasalpha/model_volume_performance_class.go +++ b/services/iaasalpha/model_volume_performance_class.go @@ -72,7 +72,7 @@ func (o *VolumePerformanceClass) GetDescriptionOk() (*string, bool) { // HasDescription returns a boolean if a field has been set. func (o *VolumePerformanceClass) HasDescription() bool { - if o != nil && !IsNil(o.Description) { + if o != nil && !IsNil(o.Description) && !IsNil(o.Description) { return true } @@ -104,7 +104,7 @@ func (o *VolumePerformanceClass) GetIopsOk() (*int64, bool) { // HasIops returns a boolean if a field has been set. func (o *VolumePerformanceClass) HasIops() bool { - if o != nil && !IsNil(o.Iops) { + if o != nil && !IsNil(o.Iops) && !IsNil(o.Iops) { return true } @@ -136,7 +136,7 @@ func (o *VolumePerformanceClass) GetLabelsOk() (*map[string]interface{}, bool) { // HasLabels returns a boolean if a field has been set. func (o *VolumePerformanceClass) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { + if o != nil && !IsNil(o.Labels) && !IsNil(o.Labels) { return true } @@ -150,7 +150,7 @@ func (o *VolumePerformanceClass) SetLabels(v *map[string]interface{}) { // GetName returns the Name field value func (o *VolumePerformanceClass) GetName() *string { - if o == nil { + if o == nil || IsNil(o.Name) { var ret *string return ret } @@ -192,7 +192,7 @@ func (o *VolumePerformanceClass) GetThroughputOk() (*int64, bool) { // HasThroughput returns a boolean if a field has been set. func (o *VolumePerformanceClass) HasThroughput() bool { - if o != nil && !IsNil(o.Throughput) { + if o != nil && !IsNil(o.Throughput) && !IsNil(o.Throughput) { return true } diff --git a/services/iaasalpha/model_volume_performance_class_list_response.go b/services/iaasalpha/model_volume_performance_class_list_response.go index d2fc8037c..13579de7b 100644 --- a/services/iaasalpha/model_volume_performance_class_list_response.go +++ b/services/iaasalpha/model_volume_performance_class_list_response.go @@ -46,7 +46,7 @@ func NewVolumePerformanceClassListResponseWithDefaults() *VolumePerformanceClass // GetItems returns the Items field value func (o *VolumePerformanceClassListResponse) GetItems() *[]VolumePerformanceClass { - if o == nil { + if o == nil || IsNil(o.Items) { var ret *[]VolumePerformanceClass return ret } diff --git a/services/iaasalpha/model_volume_source.go b/services/iaasalpha/model_volume_source.go index b8cf26a09..7d5a9f003 100644 --- a/services/iaasalpha/model_volume_source.go +++ b/services/iaasalpha/model_volume_source.go @@ -50,7 +50,7 @@ func NewVolumeSourceWithDefaults() *VolumeSource { // GetId returns the Id field value func (o *VolumeSource) GetId() *string { - if o == nil { + if o == nil || IsNil(o.Id) { var ret *string return ret } @@ -74,7 +74,7 @@ func (o *VolumeSource) SetId(v *string) { // GetType returns the Type field value func (o *VolumeSource) GetType() *string { - if o == nil { + if o == nil || IsNil(o.Type) { var ret *string return ret }