diff --git a/services/iaasalpha/api_default.go b/services/iaasalpha/api_default.go index 1478d29a..ae7bee24 100644 --- a/services/iaasalpha/api_default.go +++ b/services/iaasalpha/api_default.go @@ -1450,34 +1450,34 @@ func (a *APIClient) AddVolumeToServerExecute(ctx context.Context, projectId stri return r.Execute() } -type ApiCreateImageRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createImagePayload *CreateImagePayload +type ApiCreateAffinityGroupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + createAffinityGroupPayload *CreateAffinityGroupPayload } -// Request an image creation. +// Request a affinity group creation. -func (r ApiCreateImageRequest) CreateImagePayload(createImagePayload CreateImagePayload) ApiCreateImageRequest { - r.createImagePayload = &createImagePayload +func (r ApiCreateAffinityGroupRequest) CreateAffinityGroupPayload(createAffinityGroupPayload CreateAffinityGroupPayload) ApiCreateAffinityGroupRequest { + r.createAffinityGroupPayload = &createAffinityGroupPayload return r } -func (r ApiCreateImageRequest) Execute() (*ImageCreateResponse, error) { +func (r ApiCreateAffinityGroupRequest) Execute() (*AffinityGroup, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ImageCreateResponse + localVarReturnValue *AffinityGroup ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateImage") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateAffinityGroup") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/affinity-groups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) @@ -1489,8 +1489,8 @@ func (r ApiCreateImageRequest) Execute() (*ImageCreateResponse, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if r.createImagePayload == nil { - return localVarReturnValue, fmt.Errorf("createImagePayload is required and must be specified") + if r.createAffinityGroupPayload == nil { + return localVarReturnValue, fmt.Errorf("createAffinityGroupPayload is required and must be specified") } // to determine the Content-Type header @@ -1511,7 +1511,7 @@ func (r ApiCreateImageRequest) Execute() (*ImageCreateResponse, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createImagePayload + localVarPostBody = r.createAffinityGroupPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -1588,17 +1588,6 @@ func (r ApiCreateImageRequest) Execute() (*ImageCreateResponse, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 429 { - 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")) @@ -1626,24 +1615,24 @@ func (r ApiCreateImageRequest) Execute() (*ImageCreateResponse, error) { } /* -CreateImage: Create new Image. +CreateAffinityGroup: Create a new affinity group in a project. -Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. +Create a new server affinity group in the given project ID. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiCreateImageRequest + @return ApiCreateAffinityGroupRequest */ -func (a *APIClient) CreateImage(ctx context.Context, projectId string) ApiCreateImageRequest { - return ApiCreateImageRequest{ +func (a *APIClient) CreateAffinityGroup(ctx context.Context, projectId string) ApiCreateAffinityGroupRequest { + return ApiCreateAffinityGroupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, } } -func (a *APIClient) CreateImageExecute(ctx context.Context, projectId string) (*ImageCreateResponse, error) { - r := ApiCreateImageRequest{ +func (a *APIClient) CreateAffinityGroupExecute(ctx context.Context, projectId string) (*AffinityGroup, error) { + r := ApiCreateAffinityGroupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -1651,39 +1640,47 @@ func (a *APIClient) CreateImageExecute(ctx context.Context, projectId string) (* return r.Execute() } -type ApiCreateKeyPairRequest struct { - ctx context.Context - apiService *DefaultApiService - createKeyPairPayload *CreateKeyPairPayload +type ApiCreateBackupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + createBackupPayload *CreateBackupPayload } -// Request a public key import. +// Request a backup creation. -func (r ApiCreateKeyPairRequest) CreateKeyPairPayload(createKeyPairPayload CreateKeyPairPayload) ApiCreateKeyPairRequest { - r.createKeyPairPayload = &createKeyPairPayload +func (r ApiCreateBackupRequest) CreateBackupPayload(createBackupPayload CreateBackupPayload) ApiCreateBackupRequest { + r.createBackupPayload = &createBackupPayload return r } -func (r ApiCreateKeyPairRequest) Execute() (*Keypair, error) { +func (r ApiCreateBackupRequest) Execute() (*Backup, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Keypair + localVarReturnValue *Backup ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateKeyPair") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateBackup") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/keypairs" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.createKeyPairPayload == nil { - return localVarReturnValue, fmt.Errorf("createKeyPairPayload is required and must be specified") + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + } + if r.createBackupPayload == nil { + return localVarReturnValue, fmt.Errorf("createBackupPayload is required and must be specified") } // to determine the Content-Type header @@ -1704,7 +1701,7 @@ func (r ApiCreateKeyPairRequest) Execute() (*Keypair, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createKeyPairPayload + localVarPostBody = r.createBackupPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -1781,17 +1778,6 @@ func (r ApiCreateKeyPairRequest) Execute() (*Keypair, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 409 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1819,59 +1805,60 @@ func (r ApiCreateKeyPairRequest) Execute() (*Keypair, error) { } /* -CreateKeyPair: Import a public key. +CreateBackup: Create new Backup. -Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. +Create a new Backup in a project. If a snapshot ID is provided create the backup from the snapshot. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCreateKeyPairRequest + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiCreateBackupRequest */ -func (a *APIClient) CreateKeyPair(ctx context.Context) ApiCreateKeyPairRequest { - return ApiCreateKeyPairRequest{ +func (a *APIClient) CreateBackup(ctx context.Context, projectId string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ apiService: a.defaultApi, ctx: ctx, + projectId: projectId, } } -func (a *APIClient) CreateKeyPairExecute(ctx context.Context) (*Keypair, error) { - r := ApiCreateKeyPairRequest{ +func (a *APIClient) CreateBackupExecute(ctx context.Context, projectId string) (*Backup, error) { + r := ApiCreateBackupRequest{ apiService: a.defaultApi, ctx: ctx, + projectId: projectId, } return r.Execute() } -type ApiCreateNicRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - createNicPayload *CreateNicPayload +type ApiCreateImageRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + createImagePayload *CreateImagePayload } -// Request a network interface creation. +// Request an image creation. -func (r ApiCreateNicRequest) CreateNicPayload(createNicPayload CreateNicPayload) ApiCreateNicRequest { - r.createNicPayload = &createNicPayload +func (r ApiCreateImageRequest) CreateImagePayload(createImagePayload CreateImagePayload) ApiCreateImageRequest { + r.createImagePayload = &createImagePayload return r } -func (r ApiCreateNicRequest) Execute() (*NIC, error) { +func (r ApiCreateImageRequest) Execute() (*ImageCreateResponse, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NIC + localVarReturnValue *ImageCreateResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateNic") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateImage") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/nics" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1882,14 +1869,8 @@ func (r ApiCreateNicRequest) Execute() (*NIC, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.networkId) < 36 { - return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") - } - if strlen(r.networkId) > 36 { - return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") - } - if r.createNicPayload == nil { - return localVarReturnValue, fmt.Errorf("createNicPayload is required and must be specified") + if r.createImagePayload == nil { + return localVarReturnValue, fmt.Errorf("createImagePayload is required and must be specified") } // to determine the Content-Type header @@ -1910,7 +1891,7 @@ func (r ApiCreateNicRequest) Execute() (*NIC, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createNicPayload + localVarPostBody = r.createImagePayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -1987,17 +1968,6 @@ func (r ApiCreateNicRequest) Execute() (*NIC, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 409 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } if localVarHTTPResponse.StatusCode == 429 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2036,75 +2006,64 @@ func (r ApiCreateNicRequest) Execute() (*NIC, error) { } /* -CreateNic: Create new network interface. +CreateImage: Create new Image. -Create a new network interface in a project. +Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the 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. - @return ApiCreateNicRequest + @return ApiCreateImageRequest */ -func (a *APIClient) CreateNic(ctx context.Context, projectId string, networkId string) ApiCreateNicRequest { - return ApiCreateNicRequest{ +func (a *APIClient) CreateImage(ctx context.Context, projectId string) ApiCreateImageRequest { + return ApiCreateImageRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - networkId: networkId, } } -func (a *APIClient) CreateNicExecute(ctx context.Context, projectId string, networkId string) (*NIC, error) { - r := ApiCreateNicRequest{ +func (a *APIClient) CreateImageExecute(ctx context.Context, projectId string) (*ImageCreateResponse, error) { + r := ApiCreateImageRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - networkId: networkId, } return r.Execute() } -type ApiCreatePublicIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createPublicIPPayload *CreatePublicIPPayload +type ApiCreateKeyPairRequest struct { + ctx context.Context + apiService *DefaultApiService + createKeyPairPayload *CreateKeyPairPayload } -// Request a public IP creation. +// Request a public key import. -func (r ApiCreatePublicIPRequest) CreatePublicIPPayload(createPublicIPPayload CreatePublicIPPayload) ApiCreatePublicIPRequest { - r.createPublicIPPayload = &createPublicIPPayload +func (r ApiCreateKeyPairRequest) CreateKeyPairPayload(createKeyPairPayload CreateKeyPairPayload) ApiCreateKeyPairRequest { + r.createKeyPairPayload = &createKeyPairPayload return r } -func (r ApiCreatePublicIPRequest) Execute() (*PublicIp, error) { +func (r ApiCreateKeyPairRequest) Execute() (*Keypair, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *PublicIp + localVarReturnValue *Keypair ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreatePublicIP") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateKeyPair") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/public-ips" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath := localBasePath + "/v1alpha1/keypairs" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") - } - if strlen(r.projectId) > 36 { - return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") - } - if r.createPublicIPPayload == nil { - return localVarReturnValue, fmt.Errorf("createPublicIPPayload is required and must be specified") + if r.createKeyPairPayload == nil { + return localVarReturnValue, fmt.Errorf("createKeyPairPayload is required and must be specified") } // to determine the Content-Type header @@ -2125,7 +2084,7 @@ func (r ApiCreatePublicIPRequest) Execute() (*PublicIp, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createPublicIPPayload + localVarPostBody = r.createKeyPairPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -2202,7 +2161,7 @@ func (r ApiCreatePublicIPRequest) Execute() (*PublicIp, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 409 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -2240,59 +2199,56 @@ func (r ApiCreatePublicIPRequest) Execute() (*PublicIp, error) { } /* -CreatePublicIP: Create new public IP. +CreateKeyPair: Import a public key. -Create a new public IP in a project. +Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @return ApiCreatePublicIPRequest + @return ApiCreateKeyPairRequest */ -func (a *APIClient) CreatePublicIP(ctx context.Context, projectId string) ApiCreatePublicIPRequest { - return ApiCreatePublicIPRequest{ +func (a *APIClient) CreateKeyPair(ctx context.Context) ApiCreateKeyPairRequest { + return ApiCreateKeyPairRequest{ apiService: a.defaultApi, ctx: ctx, - projectId: projectId, } } -func (a *APIClient) CreatePublicIPExecute(ctx context.Context, projectId string) (*PublicIp, error) { - r := ApiCreatePublicIPRequest{ +func (a *APIClient) CreateKeyPairExecute(ctx context.Context) (*Keypair, error) { + r := ApiCreateKeyPairRequest{ apiService: a.defaultApi, ctx: ctx, - projectId: projectId, } return r.Execute() } -type ApiCreateSecurityGroupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createSecurityGroupPayload *CreateSecurityGroupPayload +type ApiCreateNetworkRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + createNetworkPayload *CreateNetworkPayload } -// Request a security group creation. +// Request a network creation. -func (r ApiCreateSecurityGroupRequest) CreateSecurityGroupPayload(createSecurityGroupPayload CreateSecurityGroupPayload) ApiCreateSecurityGroupRequest { - r.createSecurityGroupPayload = &createSecurityGroupPayload +func (r ApiCreateNetworkRequest) CreateNetworkPayload(createNetworkPayload CreateNetworkPayload) ApiCreateNetworkRequest { + r.createNetworkPayload = &createNetworkPayload return r } -func (r ApiCreateSecurityGroupRequest) Execute() (*SecurityGroup, error) { +func (r ApiCreateNetworkRequest) Execute() (*Network, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *SecurityGroup + localVarReturnValue *Network ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateSecurityGroup") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateNetwork") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) @@ -2304,8 +2260,8 @@ func (r ApiCreateSecurityGroupRequest) Execute() (*SecurityGroup, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if r.createSecurityGroupPayload == nil { - return localVarReturnValue, fmt.Errorf("createSecurityGroupPayload is required and must be specified") + if r.createNetworkPayload == nil { + return localVarReturnValue, fmt.Errorf("createNetworkPayload is required and must be specified") } // to determine the Content-Type header @@ -2326,7 +2282,7 @@ func (r ApiCreateSecurityGroupRequest) Execute() (*SecurityGroup, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createSecurityGroupPayload + localVarPostBody = r.createNetworkPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -2403,6 +2359,17 @@ func (r ApiCreateSecurityGroupRequest) Execute() (*SecurityGroup, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2430,24 +2397,24 @@ func (r ApiCreateSecurityGroupRequest) Execute() (*SecurityGroup, error) { } /* -CreateSecurityGroup: Create new security group. +CreateNetwork: Create new network. -Create a new security group in a project. +Create a new network in a project. `nameservers` will be filled from `defaultNameservers` of the respective area if not specified. If the project has `internetAccess` enabled and this is the first network in the project this might incur cost. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiCreateSecurityGroupRequest + @return ApiCreateNetworkRequest */ -func (a *APIClient) CreateSecurityGroup(ctx context.Context, projectId string) ApiCreateSecurityGroupRequest { - return ApiCreateSecurityGroupRequest{ +func (a *APIClient) CreateNetwork(ctx context.Context, projectId string) ApiCreateNetworkRequest { + return ApiCreateNetworkRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, } } -func (a *APIClient) CreateSecurityGroupExecute(ctx context.Context, projectId string) (*SecurityGroup, error) { - r := ApiCreateSecurityGroupRequest{ +func (a *APIClient) CreateNetworkExecute(ctx context.Context, projectId string) (*Network, error) { + r := ApiCreateNetworkRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -2455,55 +2422,47 @@ func (a *APIClient) CreateSecurityGroupExecute(ctx context.Context, projectId st return r.Execute() } -type ApiCreateSecurityGroupRuleRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string - createSecurityGroupRulePayload *CreateSecurityGroupRulePayload +type ApiCreateNetworkAreaRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + createNetworkAreaPayload *CreateNetworkAreaPayload } -// Request for a security group rule creation. +// Request an Area creation. -func (r ApiCreateSecurityGroupRuleRequest) CreateSecurityGroupRulePayload(createSecurityGroupRulePayload CreateSecurityGroupRulePayload) ApiCreateSecurityGroupRuleRequest { - r.createSecurityGroupRulePayload = &createSecurityGroupRulePayload +func (r ApiCreateNetworkAreaRequest) CreateNetworkAreaPayload(createNetworkAreaPayload CreateNetworkAreaPayload) ApiCreateNetworkAreaRequest { + r.createNetworkAreaPayload = &createNetworkAreaPayload return r } -func (r ApiCreateSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { +func (r ApiCreateNetworkAreaRequest) Execute() (*NetworkArea, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *SecurityGroupRule + localVarReturnValue *NetworkArea ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateSecurityGroupRule") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateNetworkArea") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules" - 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 := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -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.securityGroupId) < 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.securityGroupId) > 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } - if r.createSecurityGroupRulePayload == nil { - return localVarReturnValue, fmt.Errorf("createSecurityGroupRulePayload is required and must be specified") + if r.createNetworkAreaPayload == nil { + return localVarReturnValue, fmt.Errorf("createNetworkAreaPayload is required and must be specified") } // to determine the Content-Type header @@ -2524,7 +2483,7 @@ func (r ApiCreateSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createSecurityGroupRulePayload + localVarPostBody = r.createNetworkAreaPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -2628,75 +2587,80 @@ func (r ApiCreateSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) } /* -CreateSecurityGroupRule: Create new security group rule. +CreateNetworkArea: Create new network area in an organization. -Create a new security group rule in a project. +Create a new network area in an organization. @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 ApiCreateSecurityGroupRuleRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @return ApiCreateNetworkAreaRequest */ -func (a *APIClient) CreateSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string) ApiCreateSecurityGroupRuleRequest { - return ApiCreateSecurityGroupRuleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) CreateNetworkArea(ctx context.Context, organizationId string) ApiCreateNetworkAreaRequest { + return ApiCreateNetworkAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, } } -func (a *APIClient) CreateSecurityGroupRuleExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroupRule, error) { - r := ApiCreateSecurityGroupRuleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) CreateNetworkAreaExecute(ctx context.Context, organizationId string) (*NetworkArea, error) { + r := ApiCreateNetworkAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, } return r.Execute() } -type ApiCreateServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createServerPayload *CreateServerPayload +type ApiCreateNetworkAreaRangeRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + createNetworkAreaRangePayload *CreateNetworkAreaRangePayload } -// Request a server creation. +// Request an addition of network ranges to an area. -func (r ApiCreateServerRequest) CreateServerPayload(createServerPayload CreateServerPayload) ApiCreateServerRequest { - r.createServerPayload = &createServerPayload +func (r ApiCreateNetworkAreaRangeRequest) CreateNetworkAreaRangePayload(createNetworkAreaRangePayload CreateNetworkAreaRangePayload) ApiCreateNetworkAreaRangeRequest { + r.createNetworkAreaRangePayload = &createNetworkAreaRangePayload return r } -func (r ApiCreateServerRequest) Execute() (*Server, error) { +func (r ApiCreateNetworkAreaRangeRequest) Execute() (*NetworkRangeListResponse, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Server + localVarReturnValue *NetworkRangeListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateServer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateNetworkAreaRange") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/network-ranges" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -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.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId 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.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } - if r.createServerPayload == nil { - return localVarReturnValue, fmt.Errorf("createServerPayload is required and must be specified") + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + } + if r.createNetworkAreaRangePayload == nil { + return localVarReturnValue, fmt.Errorf("createNetworkAreaRangePayload is required and must be specified") } // to determine the Content-Type header @@ -2717,7 +2681,7 @@ func (r ApiCreateServerRequest) Execute() (*Server, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createServerPayload + localVarPostBody = r.createNetworkAreaRangePayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -2794,6 +2758,17 @@ func (r ApiCreateServerRequest) Execute() (*Server, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2821,80 +2796,83 @@ func (r ApiCreateServerRequest) Execute() (*Server, error) { } /* -CreateServer: Create new server. +CreateNetworkAreaRange: Create new network range in a network area. -Create a new server in a project. +Create a new network range in an existing network area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @return ApiCreateServerRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiCreateNetworkAreaRangeRequest */ -func (a *APIClient) CreateServer(ctx context.Context, projectId string) ApiCreateServerRequest { - return ApiCreateServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) CreateNetworkAreaRange(ctx context.Context, organizationId string, areaId string) ApiCreateNetworkAreaRangeRequest { + return ApiCreateNetworkAreaRangeRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } } -func (a *APIClient) CreateServerExecute(ctx context.Context, projectId string) (*Server, error) { - r := ApiCreateServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) CreateNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string) (*NetworkRangeListResponse, error) { + r := ApiCreateNetworkAreaRangeRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } return r.Execute() } -type ApiCreateVirtualIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - createVirtualIPPayload *CreateVirtualIPPayload +type ApiCreateNetworkAreaRouteRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + createNetworkAreaRoutePayload *CreateNetworkAreaRoutePayload } -// Request a virtual IP creation. +// Request an addition of routes to an area. -func (r ApiCreateVirtualIPRequest) CreateVirtualIPPayload(createVirtualIPPayload CreateVirtualIPPayload) ApiCreateVirtualIPRequest { - r.createVirtualIPPayload = &createVirtualIPPayload +func (r ApiCreateNetworkAreaRouteRequest) CreateNetworkAreaRoutePayload(createNetworkAreaRoutePayload CreateNetworkAreaRoutePayload) ApiCreateNetworkAreaRouteRequest { + r.createNetworkAreaRoutePayload = &createNetworkAreaRoutePayload return r } -func (r ApiCreateVirtualIPRequest) Execute() (*VirtualIp, error) { +func (r ApiCreateNetworkAreaRouteRequest) Execute() (*RouteListResponse, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *VirtualIp + localVarReturnValue *RouteListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateVirtualIP") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateNetworkAreaRoute") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips" - 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 := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/routes" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -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.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId 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.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } - if strlen(r.networkId) < 36 { - return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") } - if strlen(r.networkId) > 36 { - return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") } - if r.createVirtualIPPayload == nil { - return localVarReturnValue, fmt.Errorf("createVirtualIPPayload is required and must be specified") + if r.createNetworkAreaRoutePayload == nil { + return localVarReturnValue, fmt.Errorf("createNetworkAreaRoutePayload is required and must be specified") } // to determine the Content-Type header @@ -2915,7 +2893,7 @@ func (r ApiCreateVirtualIPRequest) Execute() (*VirtualIp, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createVirtualIPPayload + localVarPostBody = r.createNetworkAreaRoutePayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -2992,7 +2970,7 @@ func (r ApiCreateVirtualIPRequest) Execute() (*VirtualIp, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 429 { + if localVarHTTPResponse.StatusCode == 409 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -3030,63 +3008,65 @@ func (r ApiCreateVirtualIPRequest) Execute() (*VirtualIp, error) { } /* -CreateVirtualIP: Create new virtual IP. +CreateNetworkAreaRoute: Create new network routes. -Create a new virtual IP in a project. +Create one or several new network routes in a network area. @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. - @return ApiCreateVirtualIPRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiCreateNetworkAreaRouteRequest */ -func (a *APIClient) CreateVirtualIP(ctx context.Context, projectId string, networkId string) ApiCreateVirtualIPRequest { - return ApiCreateVirtualIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, +func (a *APIClient) CreateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string) ApiCreateNetworkAreaRouteRequest { + return ApiCreateNetworkAreaRouteRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } } -func (a *APIClient) CreateVirtualIPExecute(ctx context.Context, projectId string, networkId string) (*VirtualIp, error) { - r := ApiCreateVirtualIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, +func (a *APIClient) CreateNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string) (*RouteListResponse, error) { + r := ApiCreateNetworkAreaRouteRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } return r.Execute() } -type ApiCreateVolumeRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createVolumePayload *CreateVolumePayload +type ApiCreateNicRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + networkId string + createNicPayload *CreateNicPayload } -// Request a volume creation. +// Request a network interface creation. -func (r ApiCreateVolumeRequest) CreateVolumePayload(createVolumePayload CreateVolumePayload) ApiCreateVolumeRequest { - r.createVolumePayload = &createVolumePayload +func (r ApiCreateNicRequest) CreateNicPayload(createNicPayload CreateNicPayload) ApiCreateNicRequest { + r.createNicPayload = &createNicPayload return r } -func (r ApiCreateVolumeRequest) Execute() (*Volume, error) { +func (r ApiCreateNicRequest) Execute() (*NIC, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Volume + localVarReturnValue *NIC ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateVolume") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateNic") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/nics" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3097,8 +3077,14 @@ func (r ApiCreateVolumeRequest) Execute() (*Volume, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if r.createVolumePayload == nil { - return localVarReturnValue, fmt.Errorf("createVolumePayload is required and must be specified") + if strlen(r.networkId) < 36 { + return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") + } + if r.createNicPayload == nil { + return localVarReturnValue, fmt.Errorf("createNicPayload is required and must be specified") } // to determine the Content-Type header @@ -3119,7 +3105,7 @@ func (r ApiCreateVolumeRequest) Execute() (*Volume, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.createVolumePayload + localVarPostBody = r.createNicPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -3196,6 +3182,28 @@ func (r ApiCreateVolumeRequest) Execute() (*Volume, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + 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")) @@ -3223,72 +3231,79 @@ func (r ApiCreateVolumeRequest) Execute() (*Volume, error) { } /* -CreateVolume: Create new volume. +CreateNic: Create new network interface. -Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. +Create a new network interface in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiCreateVolumeRequest + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiCreateNicRequest */ -func (a *APIClient) CreateVolume(ctx context.Context, projectId string) ApiCreateVolumeRequest { - return ApiCreateVolumeRequest{ +func (a *APIClient) CreateNic(ctx context.Context, projectId string, networkId string) ApiCreateNicRequest { + return ApiCreateNicRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + networkId: networkId, } } -func (a *APIClient) CreateVolumeExecute(ctx context.Context, projectId string) (*Volume, error) { - r := ApiCreateVolumeRequest{ +func (a *APIClient) CreateNicExecute(ctx context.Context, projectId string, networkId string) (*NIC, error) { + r := ApiCreateNicRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + networkId: networkId, } return r.Execute() } -type ApiDeallocateServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string +type ApiCreatePublicIPRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + createPublicIPPayload *CreatePublicIPPayload } -func (r ApiDeallocateServerRequest) Execute() error { +// Request a public IP creation. + +func (r ApiCreatePublicIPRequest) CreatePublicIPPayload(createPublicIPPayload CreatePublicIPPayload) ApiCreatePublicIPRequest { + r.createPublicIPPayload = &createPublicIPPayload + return r +} + +func (r ApiCreatePublicIPRequest) Execute() (*PublicIp, error) { var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PublicIp ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeallocateServer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreatePublicIP") if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/deallocate" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/public-ips" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if strlen(r.projectId) < 36 { - return fmt.Errorf("projectId must have at least 36 elements") + 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") - } - if strlen(r.serverId) < 36 { - return fmt.Errorf("serverId must have at least 36 elements") + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.serverId) > 36 { - return fmt.Errorf("serverId must have less than 36 elements") + if r.createPublicIPPayload == nil { + return localVarReturnValue, fmt.Errorf("createPublicIPPayload is required and must be specified") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -3304,9 +3319,11 @@ func (r ApiDeallocateServerRequest) Execute() error { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createPublicIPPayload 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) @@ -3320,14 +3337,14 @@ func (r ApiDeallocateServerRequest) 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 { @@ -3341,142 +3358,153 @@ func (r ApiDeallocateServerRequest) 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 + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 409 { + if localVarHTTPResponse.StatusCode == 429 { 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 } /* -DeallocateServer: Deallocate an existing server. +CreatePublicIP: Create new public IP. -Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. +Create a new public IP in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param serverId The identifier (ID) of a STACKIT Server. - @return ApiDeallocateServerRequest + @return ApiCreatePublicIPRequest */ -func (a *APIClient) DeallocateServer(ctx context.Context, projectId string, serverId string) ApiDeallocateServerRequest { - return ApiDeallocateServerRequest{ +func (a *APIClient) CreatePublicIP(ctx context.Context, projectId string) ApiCreatePublicIPRequest { + return ApiCreatePublicIPRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, } } -func (a *APIClient) DeallocateServerExecute(ctx context.Context, projectId string, serverId string) error { - r := ApiDeallocateServerRequest{ +func (a *APIClient) CreatePublicIPExecute(ctx context.Context, projectId string) (*PublicIp, error) { + r := ApiCreatePublicIPRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, } return r.Execute() } -type ApiDeleteImageRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - imageId string +type ApiCreateSecurityGroupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + createSecurityGroupPayload *CreateSecurityGroupPayload } -func (r ApiDeleteImageRequest) Execute() error { +// Request a security group creation. + +func (r ApiCreateSecurityGroupRequest) CreateSecurityGroupPayload(createSecurityGroupPayload CreateSecurityGroupPayload) ApiCreateSecurityGroupRequest { + r.createSecurityGroupPayload = &createSecurityGroupPayload + return r +} + +func (r ApiCreateSecurityGroupRequest) Execute() (*SecurityGroup, error) { var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroup ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteImage") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateSecurityGroup") if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images/{imageId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups" 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") - } - if strlen(r.imageId) < 36 { - return fmt.Errorf("imageId must have at least 36 elements") + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.imageId) > 36 { - return fmt.Errorf("imageId must have less than 36 elements") + if r.createSecurityGroupPayload == nil { + return localVarReturnValue, fmt.Errorf("createSecurityGroupPayload is required and must be specified") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -3492,9 +3520,11 @@ func (r ApiDeleteImageRequest) Execute() error { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createSecurityGroupPayload 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) @@ -3508,14 +3538,14 @@ func (r ApiDeleteImageRequest) 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 { @@ -3529,131 +3559,150 @@ func (r ApiDeleteImageRequest) 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 + 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 } /* -DeleteImage: Delete an Image. +CreateSecurityGroup: Create new security group. -Delete an image that is part of the project. +Create a new security group in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param imageId The identifier (ID) of a STACKIT Image. - @return ApiDeleteImageRequest + @return ApiCreateSecurityGroupRequest */ -func (a *APIClient) DeleteImage(ctx context.Context, projectId string, imageId string) ApiDeleteImageRequest { - return ApiDeleteImageRequest{ +func (a *APIClient) CreateSecurityGroup(ctx context.Context, projectId string) ApiCreateSecurityGroupRequest { + return ApiCreateSecurityGroupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - imageId: imageId, } } -func (a *APIClient) DeleteImageExecute(ctx context.Context, projectId string, imageId string) error { - r := ApiDeleteImageRequest{ +func (a *APIClient) CreateSecurityGroupExecute(ctx context.Context, projectId string) (*SecurityGroup, error) { + r := ApiCreateSecurityGroupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - imageId: imageId, } return r.Execute() } -type ApiDeleteImageShareRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - imageId string +type ApiCreateSecurityGroupRuleRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + securityGroupId string + createSecurityGroupRulePayload *CreateSecurityGroupRulePayload } -func (r ApiDeleteImageShareRequest) Execute() error { +// Request for a security group rule creation. + +func (r ApiCreateSecurityGroupRuleRequest) CreateSecurityGroupRulePayload(createSecurityGroupRulePayload CreateSecurityGroupRulePayload) ApiCreateSecurityGroupRuleRequest { + r.createSecurityGroupRulePayload = &createSecurityGroupRulePayload + return r +} + +func (r ApiCreateSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroupRule ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteImageShare") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateSecurityGroupRule") if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images/{imageId}/share" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules" 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, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -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") - } - if strlen(r.imageId) < 36 { - return fmt.Errorf("imageId must have at least 36 elements") + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.imageId) > 36 { - return fmt.Errorf("imageId must have less than 36 elements") + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, fmt.Errorf("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") + } + if r.createSecurityGroupRulePayload == nil { + return localVarReturnValue, fmt.Errorf("createSecurityGroupRulePayload is required and must be specified") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -3669,9 +3718,11 @@ func (r ApiDeleteImageShareRequest) Execute() error { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createSecurityGroupRulePayload 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) @@ -3685,14 +3736,14 @@ func (r ApiDeleteImageShareRequest) 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 { @@ -3706,139 +3757,145 @@ func (r ApiDeleteImageShareRequest) 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 + 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 } /* -DeleteImageShare: Remove image share. +CreateSecurityGroupRule: Create new security group rule. -Remove the image share. New scope will be local. +Create a new security group rule in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param imageId The identifier (ID) of a STACKIT Image. - @return ApiDeleteImageShareRequest + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiCreateSecurityGroupRuleRequest */ -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) CreateSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string) ApiCreateSecurityGroupRuleRequest { + return ApiCreateSecurityGroupRuleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, } } -func (a *APIClient) DeleteImageShareExecute(ctx context.Context, projectId string, imageId string) error { - r := ApiDeleteImageShareRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - imageId: imageId, +func (a *APIClient) CreateSecurityGroupRuleExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroupRule, error) { + r := ApiCreateSecurityGroupRuleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, } return r.Execute() } -type ApiDeleteImageShareConsumerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - imageId string - consumerProjectId string +type ApiCreateServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + createServerPayload *CreateServerPayload } -func (r ApiDeleteImageShareConsumerRequest) Execute() error { +// Request a server creation. + +func (r ApiCreateServerRequest) CreateServerPayload(createServerPayload CreateServerPayload) ApiCreateServerRequest { + r.createServerPayload = &createServerPayload + return r +} + +func (r ApiCreateServerRequest) Execute() (*Server, error) { var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Server ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteImageShareConsumer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateServer") if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers" 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{} 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") - } - 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") - } - if strlen(r.consumerProjectId) < 36 { - return fmt.Errorf("consumerProjectId must have at least 36 elements") + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.consumerProjectId) > 36 { - return fmt.Errorf("consumerProjectId must have less than 36 elements") + if r.createServerPayload == nil { + return localVarReturnValue, fmt.Errorf("createServerPayload is required and must be specified") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -3854,9 +3911,11 @@ func (r ApiDeleteImageShareConsumerRequest) Execute() error { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createServerPayload 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) @@ -3870,14 +3929,14 @@ func (r ApiDeleteImageShareConsumerRequest) 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 { @@ -3891,123 +3950,142 @@ func (r ApiDeleteImageShareConsumerRequest) 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 + 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 } /* -DeleteImageShareConsumer: Remove an image share consumer. +CreateServer: Create new server. -Remove consumer from a shared image. +Create a new server in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @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 + @return ApiCreateServerRequest */ -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) CreateServer(ctx context.Context, projectId string) ApiCreateServerRequest { + return ApiCreateServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, } } -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, +func (a *APIClient) CreateServerExecute(ctx context.Context, projectId string) (*Server, error) { + r := ApiCreateServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, } return r.Execute() } -type ApiDeleteKeyPairRequest struct { - ctx context.Context - apiService *DefaultApiService - keypairName string +type ApiCreateSnapshotRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + createSnapshotPayload *CreateSnapshotPayload } -func (r ApiDeleteKeyPairRequest) Execute() error { +// Request a snapshot creation. + +func (r ApiCreateSnapshotRequest) CreateSnapshotPayload(createSnapshotPayload CreateSnapshotPayload) ApiCreateSnapshotRequest { + r.createSnapshotPayload = &createSnapshotPayload + return r +} + +func (r ApiCreateSnapshotRequest) Execute() (*Snapshot, error) { var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Snapshot ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteKeyPair") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateSnapshot") if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &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}/snapshots" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.keypairName) > 127 { - return fmt.Errorf("keypairName must have less than 127 elements") + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + } + if r.createSnapshotPayload == nil { + return localVarReturnValue, fmt.Errorf("createSnapshotPayload is required and must be specified") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -4023,9 +4101,11 @@ func (r ApiDeleteKeyPairRequest) Execute() error { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createSnapshotPayload 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) @@ -4039,14 +4119,14 @@ func (r ApiDeleteKeyPairRequest) 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 { @@ -4060,136 +4140,150 @@ func (r ApiDeleteKeyPairRequest) 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 + 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 } /* -DeleteKeyPair: Delete an SSH keypair. +CreateSnapshot: Create new Snapshot. -Delete an SSH keypair from a user. +Create a new Snapshot from a Volume in a project. @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. + @return ApiCreateSnapshotRequest */ -func (a *APIClient) DeleteKeyPair(ctx context.Context, keypairName string) ApiDeleteKeyPairRequest { - return ApiDeleteKeyPairRequest{ - apiService: a.defaultApi, - ctx: ctx, - keypairName: keypairName, +func (a *APIClient) CreateSnapshot(ctx context.Context, projectId string) ApiCreateSnapshotRequest { + return ApiCreateSnapshotRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, } } -func (a *APIClient) DeleteKeyPairExecute(ctx context.Context, keypairName string) error { - r := ApiDeleteKeyPairRequest{ - apiService: a.defaultApi, - ctx: ctx, - keypairName: keypairName, +func (a *APIClient) CreateSnapshotExecute(ctx context.Context, projectId string) (*Snapshot, error) { + r := ApiCreateSnapshotRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, } return r.Execute() } -type ApiDeleteNicRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - nicId string +type ApiCreateVirtualIPRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + networkId string + createVirtualIPPayload *CreateVirtualIPPayload } -func (r ApiDeleteNicRequest) Execute() error { +// Request a virtual IP creation. + +func (r ApiCreateVirtualIPRequest) CreateVirtualIPPayload(createVirtualIPPayload CreateVirtualIPPayload) ApiCreateVirtualIPRequest { + r.createVirtualIPPayload = &createVirtualIPPayload + return r +} + +func (r ApiCreateVirtualIPRequest) Execute() (*VirtualIp, error) { var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualIp ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteNic") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateVirtualIP") if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips" 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) 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.networkId) < 36 { - return fmt.Errorf("networkId must have at least 36 elements") + return localVarReturnValue, 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.nicId) < 36 { - return fmt.Errorf("nicId must have at least 36 elements") + return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") } - if strlen(r.nicId) > 36 { - return fmt.Errorf("nicId must have less than 36 elements") + if r.createVirtualIPPayload == nil { + return localVarReturnValue, fmt.Errorf("createVirtualIPPayload is required and must be specified") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -4205,9 +4299,11 @@ func (r ApiDeleteNicRequest) Execute() error { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createVirtualIPPayload 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) @@ -4221,14 +4317,14 @@ func (r ApiDeleteNicRequest) 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 { @@ -4242,134 +4338,156 @@ func (r ApiDeleteNicRequest) 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 + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + 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 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 } /* -DeleteNic: Delete a network interface. +CreateVirtualIP: Create new virtual IP. -Delete a network interface that is part of the project. +Create a new virtual IP in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @param networkId The identifier (ID) of a STACKIT Network. - @param nicId The identifier (ID) of a network interface. - @return ApiDeleteNicRequest + @return ApiCreateVirtualIPRequest */ -func (a *APIClient) DeleteNic(ctx context.Context, projectId string, networkId string, nicId string) ApiDeleteNicRequest { - return ApiDeleteNicRequest{ +func (a *APIClient) CreateVirtualIP(ctx context.Context, projectId string, networkId string) ApiCreateVirtualIPRequest { + return ApiCreateVirtualIPRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, networkId: networkId, - nicId: nicId, } } -func (a *APIClient) DeleteNicExecute(ctx context.Context, projectId string, networkId string, nicId string) error { - r := ApiDeleteNicRequest{ +func (a *APIClient) CreateVirtualIPExecute(ctx context.Context, projectId string, networkId string) (*VirtualIp, error) { + r := ApiCreateVirtualIPRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, networkId: networkId, - nicId: nicId, } return r.Execute() } -type ApiDeletePublicIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - publicIpId string +type ApiCreateVolumeRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + createVolumePayload *CreateVolumePayload } -func (r ApiDeletePublicIPRequest) Execute() error { +// Request a volume creation. + +func (r ApiCreateVolumeRequest) CreateVolumePayload(createVolumePayload CreateVolumePayload) ApiCreateVolumeRequest { + r.createVolumePayload = &createVolumePayload + return r +} + +func (r ApiCreateVolumeRequest) Execute() (*Volume, error) { var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Volume ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeletePublicIP") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateVolume") if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/public-ips/{publicIpId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(r.publicIpId, "publicIpId")), -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") - } - if strlen(r.publicIpId) < 36 { - return fmt.Errorf("publicIpId must have at least 36 elements") + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.publicIpId) > 36 { - return fmt.Errorf("publicIpId must have less than 36 elements") + if r.createVolumePayload == nil { + return localVarReturnValue, fmt.Errorf("createVolumePayload is required and must be specified") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -4385,9 +4503,11 @@ func (r ApiDeletePublicIPRequest) Execute() error { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createVolumePayload 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) @@ -4401,14 +4521,14 @@ func (r ApiDeletePublicIPRequest) 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 { @@ -4422,112 +4542,119 @@ func (r ApiDeletePublicIPRequest) 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 + 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 } /* -DeletePublicIP: Delete a public IP. +CreateVolume: Create new volume. -Delete a public IP that is part of the project. +Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. @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 + @return ApiCreateVolumeRequest */ -func (a *APIClient) DeletePublicIP(ctx context.Context, projectId string, publicIpId string) ApiDeletePublicIPRequest { - return ApiDeletePublicIPRequest{ +func (a *APIClient) CreateVolume(ctx context.Context, projectId string) ApiCreateVolumeRequest { + return ApiCreateVolumeRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - publicIpId: publicIpId, } } -func (a *APIClient) DeletePublicIPExecute(ctx context.Context, projectId string, publicIpId string) error { - r := ApiDeletePublicIPRequest{ +func (a *APIClient) CreateVolumeExecute(ctx context.Context, projectId string) (*Volume, error) { + r := ApiCreateVolumeRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - publicIpId: publicIpId, } return r.Execute() } -type ApiDeleteSecurityGroupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string +type ApiDeallocateServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string } -func (r ApiDeleteSecurityGroupRequest) Execute() error { +func (r ApiDeallocateServerRequest) Execute() error { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodPost 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.DeallocateServer") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/deallocate" 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, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -4538,11 +4665,11 @@ 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.serverId) < 36 { + return fmt.Errorf("serverId must have at least 36 elements") } - if strlen(r.securityGroupId) > 36 { - return fmt.Errorf("securityGroupId 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 @@ -4666,58 +4793,56 @@ func (r ApiDeleteSecurityGroupRequest) Execute() error { } /* -DeleteSecurityGroup: Delete security group. +DeallocateServer: Deallocate an existing server. -Delete a security group. +Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. @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 serverId The identifier (ID) of a STACKIT Server. + @return ApiDeallocateServerRequest */ -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) DeallocateServer(ctx context.Context, projectId string, serverId string) ApiDeallocateServerRequest { + return ApiDeallocateServerRequest{ + 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, +func (a *APIClient) DeallocateServerExecute(ctx context.Context, projectId string, serverId string) error { + r := ApiDeallocateServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, } return r.Execute() } -type ApiDeleteSecurityGroupRuleRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string - securityGroupRuleId string +type ApiDeleteAffinityGroupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + affinityGroupId string } -func (r ApiDeleteSecurityGroupRuleRequest) Execute() error { +func (r ApiDeleteAffinityGroupRequest) 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.DeleteAffinityGroup") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/affinity-groups/{affinityGroupId}" 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, "{"+"affinityGroupId"+"}", url.PathEscape(ParameterValueToString(r.affinityGroupId, "affinityGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -4728,17 +4853,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.affinityGroupId) < 36 { + return fmt.Errorf("affinityGroupId must have at least 36 elements") } - if strlen(r.securityGroupRuleId) > 36 { - return fmt.Errorf("securityGroupRuleId must have less than 36 elements") + if strlen(r.affinityGroupId) > 36 { + return fmt.Errorf("affinityGroupId must have less than 36 elements") } // to determine the Content-Type header @@ -4851,59 +4970,64 @@ func (r ApiDeleteSecurityGroupRuleRequest) Execute() error { } /* -DeleteSecurityGroupRule: Delete security group rule. +DeleteAffinityGroup: Delete a affinity group in a project. -Delete a security group rule. +Delete a affinity group in the given 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 affinityGroupId The identifier (ID) of a STACKIT Affinity Group. + @return ApiDeleteAffinityGroupRequest */ -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) DeleteAffinityGroup(ctx context.Context, projectId string, affinityGroupId string) ApiDeleteAffinityGroupRequest { + return ApiDeleteAffinityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + affinityGroupId: affinityGroupId, } } -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) DeleteAffinityGroupExecute(ctx context.Context, projectId string, affinityGroupId string) error { + r := ApiDeleteAffinityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + affinityGroupId: affinityGroupId, } return r.Execute() } -type ApiDeleteServerRequest struct { +type ApiDeleteBackupRequest struct { ctx context.Context apiService *DefaultApiService projectId string - serverId string + backupId string + force *bool } -func (r ApiDeleteServerRequest) Execute() error { +// Force action. + +func (r ApiDeleteBackupRequest) Force(force bool) ApiDeleteBackupRequest { + r.force = &force + return r +} + +func (r ApiDeleteBackupRequest) 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.DeleteBackup") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/backups/{backupId}" 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, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -4914,13 +5038,16 @@ 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.backupId) < 36 { + return fmt.Errorf("backupId must have at least 36 elements") } - if strlen(r.serverId) > 36 { - return fmt.Errorf("serverId must have less than 36 elements") + if strlen(r.backupId) > 36 { + return fmt.Errorf("backupId must have less than 36 elements") } + if r.force != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "force", r.force, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -5031,58 +5158,56 @@ func (r ApiDeleteServerRequest) Execute() error { } /* -DeleteServer: Delete a server. +DeleteBackup: Delete a backup. -Delete a server. Volumes won't be deleted. +Delete a backup 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 serverId The identifier (ID) of a STACKIT Server. - @return ApiDeleteServerRequest + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiDeleteBackupRequest */ -func (a *APIClient) DeleteServer(ctx context.Context, projectId string, serverId string) ApiDeleteServerRequest { - return ApiDeleteServerRequest{ +func (a *APIClient) DeleteBackup(ctx context.Context, projectId string, backupId string) ApiDeleteBackupRequest { + return ApiDeleteBackupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + backupId: backupId, } } -func (a *APIClient) DeleteServerExecute(ctx context.Context, projectId string, serverId string) error { - r := ApiDeleteServerRequest{ +func (a *APIClient) DeleteBackupExecute(ctx context.Context, projectId string, backupId string) error { + r := ApiDeleteBackupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + backupId: backupId, } return r.Execute() } -type ApiDeleteVirtualIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - virtualIpId string +type ApiDeleteImageRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + imageId string } -func (r ApiDeleteVirtualIPRequest) Execute() error { +func (r ApiDeleteImageRequest) 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.DeleteImage") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images/{imageId}" 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, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -5093,17 +5218,11 @@ 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.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.imageId) < 36 { + return fmt.Errorf("imageId must have at least 36 elements") } - if strlen(r.virtualIpId) > 36 { - return fmt.Errorf("virtualIpId must have less than 36 elements") + if strlen(r.imageId) > 36 { + return fmt.Errorf("imageId must have less than 36 elements") } // to determine the Content-Type header @@ -5216,59 +5335,56 @@ func (r ApiDeleteVirtualIPRequest) Execute() error { } /* -DeleteVirtualIP: Delete a virtual IP. +DeleteImage: Delete an Image. -Delete a virtual IP that is part of the project. +Delete an image 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 + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiDeleteImageRequest */ -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) DeleteImage(ctx context.Context, projectId string, imageId string) ApiDeleteImageRequest { + return ApiDeleteImageRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + imageId: imageId, } } -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) DeleteImageExecute(ctx context.Context, projectId string, imageId string) error { + r := ApiDeleteImageRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + imageId: imageId, } return r.Execute() } -type ApiDeleteVolumeRequest struct { +type ApiDeleteImageShareRequest struct { ctx context.Context apiService *DefaultApiService projectId string - volumeId string + imageId string } -func (r ApiDeleteVolumeRequest) 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.DeleteVolume") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteImageShare") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes/{volumeId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images/{imageId}/share" 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, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -5279,11 +5395,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.imageId) < 36 { + return 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 fmt.Errorf("imageId must have less than 36 elements") } // to determine the Content-Type header @@ -5379,17 +5495,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")) @@ -5407,59 +5512,6053 @@ func (r ApiDeleteVolumeRequest) Execute() error { } /* -DeleteVolume: Delete a volume. +DeleteImageShare: Remove image share. -Delete a volume inside a project. The deletion will fail if the volume is still in use. +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 projectId The identifier (ID) of a STACKIT Project. - @param volumeId The identifier (ID) of a STACKIT Volume. - @return ApiDeleteVolumeRequest + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiDeleteImageShareRequest */ -func (a *APIClient) DeleteVolume(ctx context.Context, projectId string, volumeId string) ApiDeleteVolumeRequest { - return ApiDeleteVolumeRequest{ - apiService: a.defaultApi, +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) DeleteImageShareExecute(ctx context.Context, projectId string, imageId string) error { + r := ApiDeleteImageShareRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } + return r.Execute() +} + +type ApiDeleteImageShareConsumerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + imageId string + consumerProjectId string +} + +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.DeleteImageShareConsumer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + 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{} + 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.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") + } + if strlen(r.consumerProjectId) < 36 { + return fmt.Errorf("consumerProjectId must have at least 36 elements") + } + if strlen(r.consumerProjectId) > 36 { + return fmt.Errorf("consumerProjectId 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 +} + +/* +DeleteImageShareConsumer: Remove an image share consumer. + +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 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) 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) 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 ApiDeleteKeyPairRequest struct { + ctx context.Context + apiService *DefaultApiService + keypairName string +} + +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.DeleteKeyPair") + 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) + + 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") + } + + // 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 +} + +/* +DeleteKeyPair: Delete an SSH keypair. + +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 keypairName The name of an SSH keypair. + @return ApiDeleteKeyPairRequest +*/ +func (a *APIClient) DeleteKeyPair(ctx context.Context, keypairName string) ApiDeleteKeyPairRequest { + return ApiDeleteKeyPairRequest{ + apiService: a.defaultApi, + ctx: ctx, + keypairName: keypairName, + } +} + +func (a *APIClient) DeleteKeyPairExecute(ctx context.Context, keypairName string) error { + r := ApiDeleteKeyPairRequest{ + apiService: a.defaultApi, + ctx: ctx, + keypairName: keypairName, + } + return r.Execute() +} + +type ApiDeleteNetworkRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + networkId string +} + +func (r ApiDeleteNetworkRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteNetwork") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -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") + } + + // 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 +} + +/* +DeleteNetwork: Delete network. + +Delete a network. If the network is still in use, the deletion will fail. + + @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. + @return ApiDeleteNetworkRequest +*/ +func (a *APIClient) DeleteNetwork(ctx context.Context, projectId string, networkId string) ApiDeleteNetworkRequest { + return ApiDeleteNetworkRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + networkId: networkId, + } +} + +func (a *APIClient) DeleteNetworkExecute(ctx context.Context, projectId string, networkId string) error { + r := ApiDeleteNetworkRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + networkId: networkId, + } + return r.Execute() +} + +type ApiDeleteNetworkAreaRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string +} + +func (r ApiDeleteNetworkAreaRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteNetworkArea") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return fmt.Errorf("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return fmt.Errorf("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return fmt.Errorf("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return fmt.Errorf("areaId 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 +} + +/* +DeleteNetworkArea: Delete a network area. + +Delete an existing network area in an organization. This is only possible if no projects are using the area anymore. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiDeleteNetworkAreaRequest +*/ +func (a *APIClient) DeleteNetworkArea(ctx context.Context, organizationId string, areaId string) ApiDeleteNetworkAreaRequest { + return ApiDeleteNetworkAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +func (a *APIClient) DeleteNetworkAreaExecute(ctx context.Context, organizationId string, areaId string) error { + r := ApiDeleteNetworkAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } + return r.Execute() +} + +type ApiDeleteNetworkAreaRangeRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + networkRangeId string +} + +func (r ApiDeleteNetworkAreaRangeRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteNetworkAreaRange") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkRangeId"+"}", url.PathEscape(ParameterValueToString(r.networkRangeId, "networkRangeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return fmt.Errorf("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return fmt.Errorf("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return fmt.Errorf("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return fmt.Errorf("areaId must have less than 36 elements") + } + if strlen(r.networkRangeId) < 36 { + return fmt.Errorf("networkRangeId must have at least 36 elements") + } + if strlen(r.networkRangeId) > 36 { + return fmt.Errorf("networkRangeId 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 +} + +/* +DeleteNetworkAreaRange: Delete a network range. + +Delete a network range of a network area. The deletion will fail if the network range is still used. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param networkRangeId The identifier (ID) of a STACKIT Network Range. + @return ApiDeleteNetworkAreaRangeRequest +*/ +func (a *APIClient) DeleteNetworkAreaRange(ctx context.Context, organizationId string, areaId string, networkRangeId string) ApiDeleteNetworkAreaRangeRequest { + return ApiDeleteNetworkAreaRangeRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + networkRangeId: networkRangeId, + } +} + +func (a *APIClient) DeleteNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string, networkRangeId string) error { + r := ApiDeleteNetworkAreaRangeRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + networkRangeId: networkRangeId, + } + return r.Execute() +} + +type ApiDeleteNetworkAreaRouteRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + routeId string +} + +func (r ApiDeleteNetworkAreaRouteRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteNetworkAreaRoute") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(r.routeId, "routeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return fmt.Errorf("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return fmt.Errorf("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return fmt.Errorf("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return fmt.Errorf("areaId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return fmt.Errorf("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return fmt.Errorf("routeId 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 +} + +/* +DeleteNetworkAreaRoute: Delete a network route. + +Delete a network route of a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiDeleteNetworkAreaRouteRequest +*/ +func (a *APIClient) DeleteNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, routeId string) ApiDeleteNetworkAreaRouteRequest { + return ApiDeleteNetworkAreaRouteRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + routeId: routeId, + } +} + +func (a *APIClient) DeleteNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, routeId string) error { + r := ApiDeleteNetworkAreaRouteRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + routeId: routeId, + } + return r.Execute() +} + +type ApiDeleteNicRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + networkId string + nicId string +} + +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.DeleteNic") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + 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, "{"+"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{} + 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.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 + 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 +} + +/* +DeleteNic: Delete a network interface. + +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 networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiDeleteNicRequest +*/ +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) 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 ApiDeletePublicIPRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + publicIpId string +} + +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.DeletePublicIP") + 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) + + 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") + } + + // 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 +} + +/* +DeletePublicIP: Delete a public IP. + +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 publicIpId The identifier (ID) of a Public IP. + @return ApiDeletePublicIPRequest +*/ +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) DeletePublicIPExecute(ctx context.Context, projectId string, publicIpId string) error { + r := ApiDeletePublicIPRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + publicIpId: publicIpId, + } + return r.Execute() +} + +type ApiDeleteSecurityGroupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + securityGroupId string +} + +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.DeleteSecurityGroup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -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.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") + } + + // 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 +} + +/* +DeleteSecurityGroup: Delete security group. + +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 securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiDeleteSecurityGroupRequest +*/ +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) DeleteSecurityGroupExecute(ctx context.Context, projectId string, securityGroupId string) error { + r := ApiDeleteSecurityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + } + return r.Execute() +} + +type ApiDeleteSecurityGroupRuleRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + securityGroupId string + securityGroupRuleId string +} + +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.DeleteSecurityGroupRule") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + 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, "{"+"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{} + 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.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.securityGroupRuleId) > 36 { + return fmt.Errorf("securityGroupRuleId 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 +} + +/* +DeleteSecurityGroupRule: Delete security group rule. + +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 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) 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) DeleteSecurityGroupRuleExecute(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) error { + r := ApiDeleteSecurityGroupRuleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, + } + return r.Execute() +} + +type ApiDeleteServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string +} + +func (r ApiDeleteServerRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return fmt.Errorf("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return fmt.Errorf("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return newErr + } + + return nil +} + +/* +DeleteServer: Delete a server. + +Delete a server. Volumes won't be deleted. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiDeleteServerRequest +*/ +func (a *APIClient) DeleteServer(ctx context.Context, projectId string, serverId string) ApiDeleteServerRequest { + return ApiDeleteServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +func (a *APIClient) DeleteServerExecute(ctx context.Context, projectId string, serverId string) error { + r := ApiDeleteServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } + return r.Execute() +} + +type ApiDeleteSnapshotRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + snapshotId string +} + +func (r ApiDeleteSnapshotRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteSnapshot") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/snapshots/{snapshotId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"snapshotId"+"}", url.PathEscape(ParameterValueToString(r.snapshotId, "snapshotId")), -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.snapshotId) < 36 { + return fmt.Errorf("snapshotId must have at least 36 elements") + } + if strlen(r.snapshotId) > 36 { + return fmt.Errorf("snapshotId 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 +} + +/* +DeleteSnapshot: Delete a snapshot. + +Delete a snapshot 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 snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiDeleteSnapshotRequest +*/ +func (a *APIClient) DeleteSnapshot(ctx context.Context, projectId string, snapshotId string) ApiDeleteSnapshotRequest { + return ApiDeleteSnapshotRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + snapshotId: snapshotId, + } +} + +func (a *APIClient) DeleteSnapshotExecute(ctx context.Context, projectId string, snapshotId string) error { + r := ApiDeleteSnapshotRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + snapshotId: snapshotId, + } + return r.Execute() +} + +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 ApiGetAffinityGroupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + affinityGroupId string +} + +func (r ApiGetAffinityGroupRequest) Execute() (*AffinityGroup, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AffinityGroup + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAffinityGroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/affinity-groups/{affinityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"affinityGroupId"+"}", url.PathEscape(ParameterValueToString(r.affinityGroupId, "affinityGroupId")), -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.affinityGroupId) < 36 { + return localVarReturnValue, fmt.Errorf("affinityGroupId must have at least 36 elements") + } + if strlen(r.affinityGroupId) > 36 { + return localVarReturnValue, fmt.Errorf("affinityGroupId 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 +} + +/* +GetAffinityGroup: Get the affinity group. + +Get the affinity group created in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. + @return ApiGetAffinityGroupRequest +*/ +func (a *APIClient) GetAffinityGroup(ctx context.Context, projectId string, affinityGroupId string) ApiGetAffinityGroupRequest { + return ApiGetAffinityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + affinityGroupId: affinityGroupId, + } +} + +func (a *APIClient) GetAffinityGroupExecute(ctx context.Context, projectId string, affinityGroupId string) (*AffinityGroup, error) { + r := ApiGetAffinityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + affinityGroupId: affinityGroupId, + } + 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 ApiGetBackupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + backupId string +} + +func (r ApiGetBackupRequest) Execute() (*Backup, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Backup + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/backups/{backupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -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.backupId) < 36 { + return localVarReturnValue, fmt.Errorf("backupId must have at least 36 elements") + } + if strlen(r.backupId) > 36 { + return localVarReturnValue, fmt.Errorf("backupId 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 +} + +/* +GetBackup: Get details about a backup. + +Get details about a block device backup. + + @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 backupId The identifier (ID) of a STACKIT Backup. + @return ApiGetBackupRequest +*/ +func (a *APIClient) GetBackup(ctx context.Context, projectId string, backupId string) ApiGetBackupRequest { + return ApiGetBackupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + backupId: backupId, + } +} + +func (a *APIClient) GetBackupExecute(ctx context.Context, projectId string, backupId string) (*Backup, error) { + r := ApiGetBackupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + backupId: backupId, + } + 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 *Image + ) + a := r.apiService + 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}/images/{imageId}" + 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") + } + + // 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{} + 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 +} + +/* +GetImageShare: Get share details of an image. + +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 imageId The identifier (ID) of a STACKIT Image. + @return ApiGetImageShareRequest +*/ +func (a *APIClient) GetImageShare(ctx context.Context, projectId string, imageId string) ApiGetImageShareRequest { + return ApiGetImageShareRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } +} + +func (a *APIClient) GetImageShareExecute(ctx context.Context, projectId string, imageId string) (*ImageShare, error) { + r := ApiGetImageShareRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } + return r.Execute() +} + +type ApiGetImageShareConsumerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + imageId string + consumerProjectId string +} + +func (r ApiGetImageShareConsumerRequest) Execute() (*ImageShareConsumer, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageShareConsumer + ) + a := r.apiService + 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}/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{} + 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 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{} + + // 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 +} + +/* +GetImageShareConsumer: Get image share consumer. + +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. + @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. + @return ApiGetImageShareConsumerRequest +*/ +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) 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() +} + +type ApiGetKeyPairRequest struct { + ctx context.Context + apiService *DefaultApiService + keypairName string +} + +func (r ApiGetKeyPairRequest) Execute() (*Keypair, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Keypair + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetKeyPair") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + 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.keypairName) > 127 { + return localVarReturnValue, fmt.Errorf("keypairName must have less than 127 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 +} + +/* +GetKeyPair: Get SSH keypair details. + +Get details about an SSH keypair. + + @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 ApiGetKeyPairRequest +*/ +func (a *APIClient) GetKeyPair(ctx context.Context, keypairName string) ApiGetKeyPairRequest { + return ApiGetKeyPairRequest{ + apiService: a.defaultApi, + ctx: ctx, + keypairName: keypairName, + } +} + +func (a *APIClient) GetKeyPairExecute(ctx context.Context, keypairName string) (*Keypair, error) { + r := ApiGetKeyPairRequest{ + apiService: a.defaultApi, + ctx: ctx, + keypairName: keypairName, + } + return r.Execute() +} + +type ApiGetMachineTypeRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + machineType string +} + +func (r ApiGetMachineTypeRequest) Execute() (*MachineType, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MachineType + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetMachineType") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/machine-types/{machineType}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"machineType"+"}", url.PathEscape(ParameterValueToString(r.machineType, "machineType")), -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.machineType) > 63 { + return localVarReturnValue, fmt.Errorf("machineType must have less than 63 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 +} + +/* +GetMachineType: Get details about a machine type. + +Get details about a specific machine type. + + @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 machineType STACKIT machine type Name. + @return ApiGetMachineTypeRequest +*/ +func (a *APIClient) GetMachineType(ctx context.Context, projectId string, machineType string) ApiGetMachineTypeRequest { + return ApiGetMachineTypeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + machineType: machineType, + } +} + +func (a *APIClient) GetMachineTypeExecute(ctx context.Context, projectId string, machineType string) (*MachineType, error) { + r := ApiGetMachineTypeRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + machineType: machineType, + } + return r.Execute() +} + +type ApiGetNetworkRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + networkId string +} + +func (r ApiGetNetworkRequest) Execute() (*Network, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Network + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNetwork") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -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.networkId) < 36 { + return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, fmt.Errorf("networkId 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 +} + +/* +GetNetwork: Get network details. + +Get details about a network of 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 networkId The identifier (ID) of a STACKIT Network. + @return ApiGetNetworkRequest +*/ +func (a *APIClient) GetNetwork(ctx context.Context, projectId string, networkId string) ApiGetNetworkRequest { + return ApiGetNetworkRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + networkId: networkId, + } +} + +func (a *APIClient) GetNetworkExecute(ctx context.Context, projectId string, networkId string) (*Network, error) { + r := ApiGetNetworkRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + networkId: networkId, + } + return r.Execute() +} + +type ApiGetNetworkAreaRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string +} + +func (r ApiGetNetworkAreaRequest) Execute() (*NetworkArea, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkArea + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNetworkArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId 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 +} + +/* +GetNetworkArea: Get details about a network area. + +Get details about a network area in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiGetNetworkAreaRequest +*/ +func (a *APIClient) GetNetworkArea(ctx context.Context, organizationId string, areaId string) ApiGetNetworkAreaRequest { + return ApiGetNetworkAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +func (a *APIClient) GetNetworkAreaExecute(ctx context.Context, organizationId string, areaId string) (*NetworkArea, error) { + r := ApiGetNetworkAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } + return r.Execute() +} + +type ApiGetNetworkAreaRangeRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + networkRangeId string +} + +func (r ApiGetNetworkAreaRangeRequest) Execute() (*NetworkRange, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkRange + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNetworkAreaRange") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkRangeId"+"}", url.PathEscape(ParameterValueToString(r.networkRangeId, "networkRangeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + } + if strlen(r.networkRangeId) < 36 { + return localVarReturnValue, fmt.Errorf("networkRangeId must have at least 36 elements") + } + if strlen(r.networkRangeId) > 36 { + return localVarReturnValue, fmt.Errorf("networkRangeId 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 +} + +/* +GetNetworkAreaRange: Get details about a network range. + +Get details about a network range in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param networkRangeId The identifier (ID) of a STACKIT Network Range. + @return ApiGetNetworkAreaRangeRequest +*/ +func (a *APIClient) GetNetworkAreaRange(ctx context.Context, organizationId string, areaId string, networkRangeId string) ApiGetNetworkAreaRangeRequest { + return ApiGetNetworkAreaRangeRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + networkRangeId: networkRangeId, + } +} + +func (a *APIClient) GetNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string, networkRangeId string) (*NetworkRange, error) { + r := ApiGetNetworkAreaRangeRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + networkRangeId: networkRangeId, + } + return r.Execute() +} + +type ApiGetNetworkAreaRouteRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + routeId string +} + +func (r ApiGetNetworkAreaRouteRequest) Execute() (*Route, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Route + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNetworkAreaRoute") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(r.routeId, "routeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return localVarReturnValue, fmt.Errorf("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return localVarReturnValue, fmt.Errorf("routeId 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 +} + +/* +GetNetworkAreaRoute: Get details about a network route. + +Get details about a network route defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiGetNetworkAreaRouteRequest +*/ +func (a *APIClient) GetNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, routeId string) ApiGetNetworkAreaRouteRequest { + return ApiGetNetworkAreaRouteRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + routeId: routeId, + } +} + +func (a *APIClient) GetNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, routeId string) (*Route, error) { + r := ApiGetNetworkAreaRouteRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + routeId: routeId, + } + return r.Execute() +} + +type ApiGetNicRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + networkId string + nicId string +} + +func (r ApiGetNicRequest) Execute() (*NIC, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NIC + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNic") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + 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, "{"+"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{} + 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.networkId) < 36 { + return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return localVarReturnValue, fmt.Errorf("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return localVarReturnValue, fmt.Errorf("nicId 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 +} + +/* +GetNic: Get details about a network interface of a network. + +Get details about a network interface inside a network. + + @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 ApiGetNicRequest +*/ +func (a *APIClient) GetNic(ctx context.Context, projectId string, networkId string, nicId string) ApiGetNicRequest { + return ApiGetNicRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + networkId: networkId, + nicId: nicId, + } +} + +func (a *APIClient) GetNicExecute(ctx context.Context, projectId string, networkId string, nicId string) (*NIC, error) { + r := ApiGetNicRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + networkId: networkId, + nicId: nicId, + } + return r.Execute() +} + +type ApiGetOrganizationRequestRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + requestId string +} + +func (r ApiGetOrganizationRequestRequest) Execute() (*Request, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Request + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetOrganizationRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") + } + if strlen(r.requestId) < 36 { + return localVarReturnValue, fmt.Errorf("requestId must have at least 36 elements") + } + if strlen(r.requestId) > 36 { + return localVarReturnValue, fmt.Errorf("requestId 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 +} + +/* +GetOrganizationRequest: Lookup an organization request ID. + +Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param requestId The identifier (ID) of a STACKIT Request. + @return ApiGetOrganizationRequestRequest +*/ +func (a *APIClient) GetOrganizationRequest(ctx context.Context, organizationId string, requestId string) ApiGetOrganizationRequestRequest { + return ApiGetOrganizationRequestRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + requestId: requestId, + } +} + +func (a *APIClient) GetOrganizationRequestExecute(ctx context.Context, organizationId string, requestId string) (*Request, error) { + r := ApiGetOrganizationRequestRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + requestId: requestId, + } + return r.Execute() +} + +type ApiGetProjectDetailsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string +} + +func (r ApiGetProjectDetailsRequest) Execute() (*Project, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Project + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetProjectDetails") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 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 +} + +/* +GetProjectDetails: Get project details. + +Get details about a STACKIT 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. + @return ApiGetProjectDetailsRequest +*/ +func (a *APIClient) GetProjectDetails(ctx context.Context, projectId string) ApiGetProjectDetailsRequest { + return ApiGetProjectDetailsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +func (a *APIClient) GetProjectDetailsExecute(ctx context.Context, projectId string) (*Project, error) { + r := ApiGetProjectDetailsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +type ApiGetProjectNICRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + nicId string +} + +func (r ApiGetProjectNICRequest) Execute() (*NIC, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NIC + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetProjectNIC") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -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.nicId) < 36 { + return localVarReturnValue, fmt.Errorf("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return localVarReturnValue, fmt.Errorf("nicId 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 +} + +/* +GetProjectNIC: Get details about a network interface of a project. + +Get details about a network interface 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 nicId The identifier (ID) of a network interface. + @return ApiGetProjectNICRequest +*/ +func (a *APIClient) GetProjectNIC(ctx context.Context, projectId string, nicId string) ApiGetProjectNICRequest { + return ApiGetProjectNICRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + nicId: nicId, + } +} + +func (a *APIClient) GetProjectNICExecute(ctx context.Context, projectId string, nicId string) (*NIC, error) { + r := ApiGetProjectNICRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + nicId: nicId, + } + return r.Execute() +} + +type ApiGetProjectRequestRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + requestId string +} + +func (r ApiGetProjectRequestRequest) Execute() (*Request, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Request + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetProjectRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(r.requestId, "requestId")), -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.requestId) < 36 { + return localVarReturnValue, fmt.Errorf("requestId must have at least 36 elements") + } + if strlen(r.requestId) > 36 { + return localVarReturnValue, fmt.Errorf("requestId 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 +} + +/* +GetProjectRequest: Lookup a project request ID. + +Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. + + @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 requestId The identifier (ID) of a STACKIT Request. + @return ApiGetProjectRequestRequest +*/ +func (a *APIClient) GetProjectRequest(ctx context.Context, projectId string, requestId string) ApiGetProjectRequestRequest { + return ApiGetProjectRequestRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + requestId: requestId, + } +} + +func (a *APIClient) GetProjectRequestExecute(ctx context.Context, projectId string, requestId string) (*Request, error) { + r := ApiGetProjectRequestRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + requestId: requestId, + } + return r.Execute() +} + +type ApiGetPublicIPRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + publicIpId string +} + +func (r ApiGetPublicIPRequest) Execute() (*PublicIp, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PublicIp + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPublicIP") + if err != nil { + return localVarReturnValue, &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) + + 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.publicIpId) < 36 { + return localVarReturnValue, fmt.Errorf("publicIpId must have at least 36 elements") + } + if strlen(r.publicIpId) > 36 { + return localVarReturnValue, fmt.Errorf("publicIpId 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 +} + +/* +GetPublicIP: Get details about a public IP. + +Get details about a public IP inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiGetPublicIPRequest +*/ +func (a *APIClient) GetPublicIP(ctx context.Context, projectId string, publicIpId string) ApiGetPublicIPRequest { + return ApiGetPublicIPRequest{ + apiService: a.defaultApi, ctx: ctx, projectId: projectId, - volumeId: volumeId, + publicIpId: publicIpId, } } -func (a *APIClient) DeleteVolumeExecute(ctx context.Context, projectId string, volumeId string) error { - r := ApiDeleteVolumeRequest{ +func (a *APIClient) GetPublicIPExecute(ctx context.Context, projectId string, publicIpId string) (*PublicIp, error) { + r := ApiGetPublicIPRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - volumeId: volumeId, + publicIpId: publicIpId, } return r.Execute() } -type ApiGetAttachedVolumeRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - volumeId string +type ApiGetSecurityGroupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + securityGroupId string } -func (r ApiGetAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { +func (r ApiGetSecurityGroupRequest) Execute() (*SecurityGroup, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *VolumeAttachment + localVarReturnValue *SecurityGroup ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAttachedVolume") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetSecurityGroup") 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}/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, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -5470,17 +11569,207 @@ 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.securityGroupId) < 36 { + return localVarReturnValue, fmt.Errorf("securityGroupId 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.securityGroupId) > 36 { + return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") } - if strlen(r.volumeId) < 36 { - return localVarReturnValue, fmt.Errorf("volumeId must have at least 36 elements") + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType } - if strlen(r.volumeId) > 36 { - return localVarReturnValue, fmt.Errorf("volumeId must have less than 36 elements") + + // 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 +} + +/* +GetSecurityGroup: Get security group details. + +Get details about a security group of 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 securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiGetSecurityGroupRequest +*/ +func (a *APIClient) GetSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiGetSecurityGroupRequest { + return ApiGetSecurityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + } +} + +func (a *APIClient) GetSecurityGroupExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroup, error) { + r := ApiGetSecurityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + } + return r.Execute() +} + +type ApiGetSecurityGroupRuleRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + securityGroupId string + securityGroupRuleId string +} + +func (r ApiGetSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroupRule + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetSecurityGroupRule") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + 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, "{"+"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{} + 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.securityGroupId) < 36 { + return localVarReturnValue, fmt.Errorf("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") + } + if strlen(r.securityGroupRuleId) < 36 { + return localVarReturnValue, fmt.Errorf("securityGroupRuleId must have at least 36 elements") + } + if strlen(r.securityGroupRuleId) > 36 { + return localVarReturnValue, fmt.Errorf("securityGroupRuleId must have less than 36 elements") } // to determine the Content-Type header @@ -5603,60 +11892,68 @@ func (r ApiGetAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { } /* -GetAttachedVolume: Get Volume Attachment details. +GetSecurityGroupRule: Get security group rule details. -Get the details of an existing Volume Attachment. +Get details about a security group rule of 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 serverId The identifier (ID) of a STACKIT Server. - @param volumeId The identifier (ID) of a STACKIT Volume. - @return ApiGetAttachedVolumeRequest + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. + @return ApiGetSecurityGroupRuleRequest */ -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) GetSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) ApiGetSecurityGroupRuleRequest { + return ApiGetSecurityGroupRuleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, } } -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, +func (a *APIClient) GetSecurityGroupRuleExecute(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) (*SecurityGroupRule, error) { + r := ApiGetSecurityGroupRuleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, } return r.Execute() } -type ApiGetImageRequest struct { +type ApiGetServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string - imageId string + serverId string + details *bool } -func (r ApiGetImageRequest) Execute() (*Image, error) { +// Show detailed information about server. + +func (r ApiGetServerRequest) Details(details bool) ApiGetServerRequest { + r.details = &details + return r +} + +func (r ApiGetServerRequest) Execute() (*Server, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Image + localVarReturnValue *Server ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetImage") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServer") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images/{imageId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}" 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, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -5667,13 +11964,16 @@ func (r ApiGetImageRequest) Execute() (*Image, error) { 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.serverId) < 36 { + return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") } - if strlen(r.imageId) > 36 { - return localVarReturnValue, fmt.Errorf("imageId must have less than 36 elements") + if strlen(r.serverId) > 36 { + return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") } + if r.details != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "details", r.details, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -5794,57 +12094,57 @@ func (r ApiGetImageRequest) Execute() (*Image, error) { } /* -GetImage: Get details about an image. +GetServer: Get server details. -Get details about a specific Image inside a project. +Get details about a server by its ID. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param imageId The identifier (ID) of a STACKIT Image. - @return ApiGetImageRequest + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerRequest */ -func (a *APIClient) GetImage(ctx context.Context, projectId string, imageId string) ApiGetImageRequest { - return ApiGetImageRequest{ +func (a *APIClient) GetServer(ctx context.Context, projectId string, serverId string) ApiGetServerRequest { + return ApiGetServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - imageId: imageId, + serverId: serverId, } } -func (a *APIClient) GetImageExecute(ctx context.Context, projectId string, imageId string) (*Image, error) { - r := ApiGetImageRequest{ +func (a *APIClient) GetServerExecute(ctx context.Context, projectId string, serverId string) (*Server, error) { + r := ApiGetServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - imageId: imageId, + serverId: serverId, } return r.Execute() } -type ApiGetImageShareRequest struct { +type ApiGetServerConsoleRequest struct { ctx context.Context apiService *DefaultApiService projectId string - imageId string + serverId string } -func (r ApiGetImageShareRequest) Execute() (*ImageShare, error) { +func (r ApiGetServerConsoleRequest) Execute() (*ServerConsoleUrl, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ImageShare + localVarReturnValue *ServerConsoleUrl ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetImageShare") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServerConsole") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images/{imageId}/share" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/console" 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, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -5855,11 +12155,11 @@ func (r ApiGetImageShareRequest) Execute() (*ImageShare, error) { 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.serverId) < 36 { + return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") } - if strlen(r.imageId) > 36 { - return localVarReturnValue, fmt.Errorf("imageId must have less than 36 elements") + if strlen(r.serverId) > 36 { + return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") } // to determine the Content-Type header @@ -5982,59 +12282,65 @@ func (r ApiGetImageShareRequest) Execute() (*ImageShare, error) { } /* -GetImageShare: Get share details of an image. +GetServerConsole: Get server console. -Get share details about an shared image. +Get a URL for server remote console. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param imageId The identifier (ID) of a STACKIT Image. - @return ApiGetImageShareRequest + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerConsoleRequest */ -func (a *APIClient) GetImageShare(ctx context.Context, projectId string, imageId string) ApiGetImageShareRequest { - return ApiGetImageShareRequest{ +func (a *APIClient) GetServerConsole(ctx context.Context, projectId string, serverId string) ApiGetServerConsoleRequest { + return ApiGetServerConsoleRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - imageId: imageId, + serverId: serverId, } } -func (a *APIClient) GetImageShareExecute(ctx context.Context, projectId string, imageId string) (*ImageShare, error) { - r := ApiGetImageShareRequest{ +func (a *APIClient) GetServerConsoleExecute(ctx context.Context, projectId string, serverId string) (*ServerConsoleUrl, error) { + r := ApiGetServerConsoleRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - imageId: imageId, + serverId: serverId, } return r.Execute() } -type ApiGetImageShareConsumerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - imageId string - consumerProjectId string +type ApiGetServerLogRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string + length *int64 } -func (r ApiGetImageShareConsumerRequest) Execute() (*ImageShareConsumer, error) { +// Request the server log. By default the length is limited to 2000 lines. Set to 0 to retrieve the complete log. + +func (r ApiGetServerLogRequest) Length(length int64) ApiGetServerLogRequest { + r.length = &length + return r +} + +func (r ApiGetServerLogRequest) Execute() (*GetServerLog200Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ImageShareConsumer + localVarReturnValue *GetServerLog200Response ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetImageShareConsumer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServerLog") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/log" 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) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -6045,19 +12351,16 @@ func (r ApiGetImageShareConsumerRequest) Execute() (*ImageShareConsumer, error) 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 strlen(r.consumerProjectId) < 36 { - return localVarReturnValue, fmt.Errorf("consumerProjectId must have at least 36 elements") + if strlen(r.serverId) < 36 { + return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") } - if strlen(r.consumerProjectId) > 36 { - return localVarReturnValue, fmt.Errorf("consumerProjectId must have less than 36 elements") + if strlen(r.serverId) > 36 { + 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{} @@ -6178,64 +12481,72 @@ func (r ApiGetImageShareConsumerRequest) Execute() (*ImageShareConsumer, error) } /* -GetImageShareConsumer: Get image share consumer. +GetServerLog: Get server log. -Get details about an image share consumer. +Get server console log. @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. - @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. - @return ApiGetImageShareConsumerRequest + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerLogRequest */ -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) GetServerLog(ctx context.Context, projectId string, serverId string) ApiGetServerLogRequest { + return ApiGetServerLogRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, } } -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, +func (a *APIClient) GetServerLogExecute(ctx context.Context, projectId string, serverId string) (*GetServerLog200Response, error) { + r := ApiGetServerLogRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, } return r.Execute() } -type ApiGetKeyPairRequest struct { - ctx context.Context - apiService *DefaultApiService - keypairName string +type ApiGetSnapshotRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + snapshotId string } -func (r ApiGetKeyPairRequest) Execute() (*Keypair, error) { +func (r ApiGetSnapshotRequest) Execute() (*Snapshot, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Keypair + localVarReturnValue *Snapshot ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetKeyPair") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetSnapshot") if err != nil { return localVarReturnValue, &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}/snapshots/{snapshotId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"snapshotId"+"}", url.PathEscape(ParameterValueToString(r.snapshotId, "snapshotId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.keypairName) > 127 { - return localVarReturnValue, fmt.Errorf("keypairName must have less than 127 elements") + 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.snapshotId) < 36 { + return localVarReturnValue, fmt.Errorf("snapshotId must have at least 36 elements") + } + if strlen(r.snapshotId) > 36 { + return localVarReturnValue, fmt.Errorf("snapshotId must have less than 36 elements") } // to determine the Content-Type header @@ -6358,54 +12669,59 @@ func (r ApiGetKeyPairRequest) Execute() (*Keypair, error) { } /* -GetKeyPair: Get SSH keypair details. +GetSnapshot: Get details about a snapshot. -Get details about an SSH keypair. +Get details about a block device snapshot. @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 ApiGetKeyPairRequest + @param projectId The identifier (ID) of a STACKIT Project. + @param snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiGetSnapshotRequest */ -func (a *APIClient) GetKeyPair(ctx context.Context, keypairName string) ApiGetKeyPairRequest { - return ApiGetKeyPairRequest{ - apiService: a.defaultApi, - ctx: ctx, - keypairName: keypairName, +func (a *APIClient) GetSnapshot(ctx context.Context, projectId string, snapshotId string) ApiGetSnapshotRequest { + return ApiGetSnapshotRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + snapshotId: snapshotId, } } -func (a *APIClient) GetKeyPairExecute(ctx context.Context, keypairName string) (*Keypair, error) { - r := ApiGetKeyPairRequest{ - apiService: a.defaultApi, - ctx: ctx, - keypairName: keypairName, +func (a *APIClient) GetSnapshotExecute(ctx context.Context, projectId string, snapshotId string) (*Snapshot, error) { + r := ApiGetSnapshotRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + snapshotId: snapshotId, } return r.Execute() } -type ApiGetMachineTypeRequest struct { +type ApiGetVirtualIPRequest struct { ctx context.Context apiService *DefaultApiService projectId string - machineType string + networkId string + virtualIpId string } -func (r ApiGetMachineTypeRequest) Execute() (*MachineType, error) { +func (r ApiGetVirtualIPRequest) Execute() (*VirtualIp, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *MachineType + localVarReturnValue *VirtualIp ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetMachineType") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetVirtualIP") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/machine-types/{machineType}" + 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, "{"+"machineType"+"}", url.PathEscape(ParameterValueToString(r.machineType, "machineType")), -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{} @@ -6416,8 +12732,17 @@ func (r ApiGetMachineTypeRequest) Execute() (*MachineType, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.machineType) > 63 { - return localVarReturnValue, fmt.Errorf("machineType must have less than 63 elements") + if strlen(r.networkId) < 36 { + return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") + } + if strlen(r.virtualIpId) < 36 { + return localVarReturnValue, fmt.Errorf("virtualIpId must have at least 36 elements") + } + if strlen(r.virtualIpId) > 36 { + return localVarReturnValue, fmt.Errorf("virtualIpId must have less than 36 elements") } // to determine the Content-Type header @@ -6540,57 +12865,60 @@ func (r ApiGetMachineTypeRequest) Execute() (*MachineType, error) { } /* -GetMachineType: Get details about a machine type. +GetVirtualIP: Get details about a virtual IP. -Get details about a specific machine type. +Get details about a virtual IP inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param machineType STACKIT machine type Name. - @return ApiGetMachineTypeRequest + @param networkId The identifier (ID) of a STACKIT Network. + @param virtualIpId The identifier (ID) of a Virtual IP. + @return ApiGetVirtualIPRequest */ -func (a *APIClient) GetMachineType(ctx context.Context, projectId string, machineType string) ApiGetMachineTypeRequest { - return ApiGetMachineTypeRequest{ +func (a *APIClient) GetVirtualIP(ctx context.Context, projectId string, networkId string, virtualIpId string) ApiGetVirtualIPRequest { + return ApiGetVirtualIPRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - machineType: machineType, + networkId: networkId, + virtualIpId: virtualIpId, } } -func (a *APIClient) GetMachineTypeExecute(ctx context.Context, projectId string, machineType string) (*MachineType, error) { - r := ApiGetMachineTypeRequest{ +func (a *APIClient) GetVirtualIPExecute(ctx context.Context, projectId string, networkId string, virtualIpId string) (*VirtualIp, error) { + r := ApiGetVirtualIPRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - machineType: machineType, + networkId: networkId, + virtualIpId: virtualIpId, } return r.Execute() } -type ApiGetNetworkRequest struct { +type ApiGetVolumeRequest struct { ctx context.Context apiService *DefaultApiService projectId string - networkId string + volumeId string } -func (r ApiGetNetworkRequest) Execute() (*Network, error) { +func (r ApiGetVolumeRequest) Execute() (*Volume, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Network + localVarReturnValue *Volume ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNetwork") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetVolume") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes/{volumeId}" 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, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -6601,11 +12929,11 @@ func (r ApiGetNetworkRequest) Execute() (*Network, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.networkId) < 36 { - return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") + if strlen(r.volumeId) < 36 { + return localVarReturnValue, fmt.Errorf("volumeId must have at least 36 elements") } - if strlen(r.networkId) > 36 { - return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") + if strlen(r.volumeId) > 36 { + return localVarReturnValue, fmt.Errorf("volumeId must have less than 36 elements") } // to determine the Content-Type header @@ -6728,72 +13056,69 @@ func (r ApiGetNetworkRequest) Execute() (*Network, error) { } /* -GetNetwork: Get network details. +GetVolume: Get details about a volume. -Get details about a network of a project. +Get details about a block device volume. @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. - @return ApiGetNetworkRequest + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiGetVolumeRequest */ -func (a *APIClient) GetNetwork(ctx context.Context, projectId string, networkId string) ApiGetNetworkRequest { - return ApiGetNetworkRequest{ +func (a *APIClient) GetVolume(ctx context.Context, projectId string, volumeId string) ApiGetVolumeRequest { + return ApiGetVolumeRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - networkId: networkId, + volumeId: volumeId, } } -func (a *APIClient) GetNetworkExecute(ctx context.Context, projectId string, networkId string) (*Network, error) { - r := ApiGetNetworkRequest{ +func (a *APIClient) GetVolumeExecute(ctx context.Context, projectId string, volumeId string) (*Volume, error) { + r := ApiGetVolumeRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - networkId: networkId, + volumeId: volumeId, } return r.Execute() } -type ApiGetNetworkAreaRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string +type ApiGetVolumePerformanceClassRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + volumePerformanceClass string } -func (r ApiGetNetworkAreaRequest) Execute() (*NetworkArea, error) { +func (r ApiGetVolumePerformanceClassRequest) Execute() (*VolumePerformanceClass, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NetworkArea + localVarReturnValue *VolumePerformanceClass ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNetworkArea") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetVolumePerformanceClass") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}" - localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumePerformanceClass"+"}", url.PathEscape(ParameterValueToString(r.volumePerformanceClass, "volumePerformanceClass")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.organizationId) < 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") } - if strlen(r.areaId) < 36 { - return localVarReturnValue, fmt.Errorf("areaId 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.areaId) > 36 { - return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + if strlen(r.volumePerformanceClass) > 63 { + return localVarReturnValue, fmt.Errorf("volumePerformanceClass must have less than 63 elements") } // to determine the Content-Type header @@ -6916,59 +13241,55 @@ func (r ApiGetNetworkAreaRequest) Execute() (*NetworkArea, error) { } /* -GetNetworkArea: Get details about a network area. +GetVolumePerformanceClass: Get details about a volume performance class. -Get details about a network area in an organization. +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 organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @return ApiGetNetworkAreaRequest + @param projectId The identifier (ID) of a STACKIT Project. + @param volumePerformanceClass The name of a STACKIT Volume performance class. + @return ApiGetVolumePerformanceClassRequest */ -func (a *APIClient) GetNetworkArea(ctx context.Context, organizationId string, areaId string) ApiGetNetworkAreaRequest { - return ApiGetNetworkAreaRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, +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) GetNetworkAreaExecute(ctx context.Context, organizationId string, areaId string) (*NetworkArea, error) { - r := ApiGetNetworkAreaRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, +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 ApiGetNicRequest struct { +type ApiListAffinityGroupsRequest struct { ctx context.Context apiService *DefaultApiService projectId string - networkId string - nicId string } -func (r ApiGetNicRequest) Execute() (*NIC, error) { +func (r ApiListAffinityGroupsRequest) Execute() (*AffinityGroupListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NIC + localVarReturnValue *AffinityGroupListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNic") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAffinityGroups") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/affinity-groups" 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) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -6979,18 +13300,6 @@ func (r ApiGetNicRequest) Execute() (*NIC, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.networkId) < 36 { - return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") - } - if strlen(r.networkId) > 36 { - return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") - } - if strlen(r.nicId) < 36 { - return localVarReturnValue, fmt.Errorf("nicId must have at least 36 elements") - } - if strlen(r.nicId) > 36 { - return localVarReturnValue, fmt.Errorf("nicId must have less than 36 elements") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -7085,6 +13394,17 @@ func (r ApiGetNicRequest) Execute() (*NIC, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -7112,75 +13432,69 @@ func (r ApiGetNicRequest) Execute() (*NIC, error) { } /* -GetNic: Get details about a network interface of a network. +ListAffinityGroups: Get the affinity groups setup for a project. -Get details about a network interface inside a network. +Get the affinity groups created in a project. Affinity groups are an indication of locality of a server relative to another group of servers. They can be either running on the same host (affinity) or on different ones (anti-affinity). @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param networkId The identifier (ID) of a STACKIT Network. - @param nicId The identifier (ID) of a network interface. - @return ApiGetNicRequest + @return ApiListAffinityGroupsRequest */ -func (a *APIClient) GetNic(ctx context.Context, projectId string, networkId string, nicId string) ApiGetNicRequest { - return ApiGetNicRequest{ +func (a *APIClient) ListAffinityGroups(ctx context.Context, projectId string) ApiListAffinityGroupsRequest { + return ApiListAffinityGroupsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - networkId: networkId, - nicId: nicId, } } -func (a *APIClient) GetNicExecute(ctx context.Context, projectId string, networkId string, nicId string) (*NIC, error) { - r := ApiGetNicRequest{ +func (a *APIClient) ListAffinityGroupsExecute(ctx context.Context, projectId string) (*AffinityGroupListResponse, error) { + r := ApiListAffinityGroupsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - networkId: networkId, - nicId: nicId, } return r.Execute() } -type ApiGetOrganizationRequestRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - requestId string +type ApiListAttachedVolumesRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string } -func (r ApiGetOrganizationRequestRequest) Execute() (*Request, error) { +func (r ApiListAttachedVolumesRequest) Execute() (*VolumeAttachmentListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Request + localVarReturnValue *VolumeAttachmentListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetOrganizationRequest") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAttachedVolumes") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/requests/{requestId}" - localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(r.requestId, "requestId")), -1) + 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.organizationId) < 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.requestId) < 36 { - return localVarReturnValue, fmt.Errorf("requestId must have at least 36 elements") + if strlen(r.serverId) < 36 { + return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") } - if strlen(r.requestId) > 36 { - return localVarReturnValue, fmt.Errorf("requestId must have less than 36 elements") + if strlen(r.serverId) > 36 { + return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") } // to determine the Content-Type header @@ -7303,65 +13617,57 @@ func (r ApiGetOrganizationRequestRequest) Execute() (*Request, error) { } /* -GetOrganizationRequest: Lookup an organization request ID. +ListAttachedVolumes: List all volume attachments of a server. -Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. +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 organizationId The identifier (ID) of a STACKIT Organization. - @param requestId The identifier (ID) of a STACKIT Request. - @return ApiGetOrganizationRequestRequest -*/ -func (a *APIClient) GetOrganizationRequest(ctx context.Context, organizationId string, requestId string) ApiGetOrganizationRequestRequest { - return ApiGetOrganizationRequestRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - requestId: requestId, + @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 +*/ +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) GetOrganizationRequestExecute(ctx context.Context, organizationId string, requestId string) (*Request, error) { - r := ApiGetOrganizationRequestRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - requestId: requestId, +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 ApiGetProjectDetailsRequest struct { +type ApiListAvailabilityZonesRequest struct { ctx context.Context apiService *DefaultApiService - projectId string } -func (r ApiGetProjectDetailsRequest) Execute() (*Project, error) { +func (r ApiListAvailabilityZonesRequest) Execute() (*AvailabilityZoneListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Project + localVarReturnValue *AvailabilityZoneListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetProjectDetails") + 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}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -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") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -7483,54 +13789,57 @@ func (r ApiGetProjectDetailsRequest) Execute() (*Project, error) { } /* -GetProjectDetails: Get project details. +ListAvailabilityZones: List all availability zones. -Get details about a STACKIT project. +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. - @return ApiGetProjectDetailsRequest + @return ApiListAvailabilityZonesRequest */ -func (a *APIClient) GetProjectDetails(ctx context.Context, projectId string) ApiGetProjectDetailsRequest { - return ApiGetProjectDetailsRequest{ +func (a *APIClient) ListAvailabilityZones(ctx context.Context) ApiListAvailabilityZonesRequest { + return ApiListAvailabilityZonesRequest{ apiService: a.defaultApi, ctx: ctx, - projectId: projectId, } } -func (a *APIClient) GetProjectDetailsExecute(ctx context.Context, projectId string) (*Project, error) { - r := ApiGetProjectDetailsRequest{ +func (a *APIClient) ListAvailabilityZonesExecute(ctx context.Context) (*AvailabilityZoneListResponse, error) { + r := ApiListAvailabilityZonesRequest{ apiService: a.defaultApi, ctx: ctx, - projectId: projectId, } return r.Execute() } -type ApiGetProjectRequestRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - requestId string +type ApiListBackupsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + labelSelector *string } -func (r ApiGetProjectRequestRequest) Execute() (*Request, error) { +// Filter resources by labels. + +func (r ApiListBackupsRequest) LabelSelector(labelSelector string) ApiListBackupsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListBackupsRequest) Execute() (*BackupListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Request + localVarReturnValue *BackupListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetProjectRequest") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListBackups") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/requests/{requestId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/backups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(r.requestId, "requestId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -7541,13 +13850,10 @@ func (r ApiGetProjectRequestRequest) Execute() (*Request, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.requestId) < 36 { - return localVarReturnValue, fmt.Errorf("requestId must have at least 36 elements") - } - if strlen(r.requestId) > 36 { - return localVarReturnValue, fmt.Errorf("requestId must have less than 36 elements") - } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -7668,57 +13974,60 @@ func (r ApiGetProjectRequestRequest) Execute() (*Request, error) { } /* -GetProjectRequest: Lookup a project request ID. +ListBackups: List all backups inside a project. -Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. +Get a list of all backups 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 requestId The identifier (ID) of a STACKIT Request. - @return ApiGetProjectRequestRequest + @return ApiListBackupsRequest */ -func (a *APIClient) GetProjectRequest(ctx context.Context, projectId string, requestId string) ApiGetProjectRequestRequest { - return ApiGetProjectRequestRequest{ +func (a *APIClient) ListBackups(ctx context.Context, projectId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - requestId: requestId, } } -func (a *APIClient) GetProjectRequestExecute(ctx context.Context, projectId string, requestId string) (*Request, error) { - r := ApiGetProjectRequestRequest{ +func (a *APIClient) ListBackupsExecute(ctx context.Context, projectId string) (*BackupListResponse, error) { + r := ApiListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - requestId: requestId, } return r.Execute() } -type ApiGetPublicIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - publicIpId string +type ApiListImagesRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + labelSelector *string } -func (r ApiGetPublicIPRequest) Execute() (*PublicIp, error) { +// Filter resources by labels. + +func (r ApiListImagesRequest) LabelSelector(labelSelector string) ApiListImagesRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListImagesRequest) Execute() (*ImageListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *PublicIp + localVarReturnValue *ImageListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPublicIP") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListImages") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/public-ips/{publicIpId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(r.publicIpId, "publicIpId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -7729,13 +14038,10 @@ func (r ApiGetPublicIPRequest) Execute() (*PublicIp, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.publicIpId) < 36 { - return localVarReturnValue, fmt.Errorf("publicIpId must have at least 36 elements") - } - if strlen(r.publicIpId) > 36 { - return localVarReturnValue, fmt.Errorf("publicIpId must have less than 36 elements") - } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -7856,74 +14162,66 @@ func (r ApiGetPublicIPRequest) Execute() (*PublicIp, error) { } /* -GetPublicIP: Get details about a public IP. +ListImages: List all Images inside a project. -Get details about a public IP inside a project. +Get a list of all images 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 publicIpId The identifier (ID) of a Public IP. - @return ApiGetPublicIPRequest + @return ApiListImagesRequest */ -func (a *APIClient) GetPublicIP(ctx context.Context, projectId string, publicIpId string) ApiGetPublicIPRequest { - return ApiGetPublicIPRequest{ +func (a *APIClient) ListImages(ctx context.Context, projectId string) ApiListImagesRequest { + return ApiListImagesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - publicIpId: publicIpId, } } -func (a *APIClient) GetPublicIPExecute(ctx context.Context, projectId string, publicIpId string) (*PublicIp, error) { - r := ApiGetPublicIPRequest{ +func (a *APIClient) ListImagesExecute(ctx context.Context, projectId string) (*ImageListResponse, error) { + r := ApiListImagesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - publicIpId: publicIpId, } return r.Execute() } -type ApiGetSecurityGroupRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string +type ApiListKeyPairsRequest struct { + ctx context.Context + apiService *DefaultApiService + labelSelector *string } -func (r ApiGetSecurityGroupRequest) Execute() (*SecurityGroup, error) { +// Filter resources by labels. + +func (r ApiListKeyPairsRequest) LabelSelector(labelSelector string) ApiListKeyPairsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListKeyPairsRequest) Execute() (*KeyPairListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *SecurityGroup + localVarReturnValue *KeyPairListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetSecurityGroup") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListKeyPairs") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}" - 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 := localBasePath + "/v1alpha1/keypairs" 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.securityGroupId) < 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have at least 36 elements") - } - if strlen(r.securityGroupId) > 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") - } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -8044,80 +14342,58 @@ func (r ApiGetSecurityGroupRequest) Execute() (*SecurityGroup, error) { } /* -GetSecurityGroup: Get security group details. +ListKeyPairs: List all SSH keypairs for the requesting user. -Get details about a security group of a project. +Get a list of all SSH keypairs assigned to the requesting 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 securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiGetSecurityGroupRequest + @return ApiListKeyPairsRequest */ -func (a *APIClient) GetSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiGetSecurityGroupRequest { - return ApiGetSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) ListKeyPairs(ctx context.Context) ApiListKeyPairsRequest { + return ApiListKeyPairsRequest{ + apiService: a.defaultApi, + ctx: ctx, } } -func (a *APIClient) GetSecurityGroupExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroup, error) { - r := ApiGetSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) ListKeyPairsExecute(ctx context.Context) (*KeyPairListResponse, error) { + r := ApiListKeyPairsRequest{ + apiService: a.defaultApi, + ctx: ctx, } return r.Execute() } -type ApiGetSecurityGroupRuleRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string - securityGroupRuleId string +type ApiListMachineTypesRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string } -func (r ApiGetSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { +func (r ApiListMachineTypesRequest) Execute() (*MachineTypeListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *SecurityGroupRule + localVarReturnValue *MachineTypeListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetSecurityGroupRule") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListMachineTypes") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/machine-types" 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) - - 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.securityGroupId) < 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have at least 36 elements") - } - if strlen(r.securityGroupId) > 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") - } - if strlen(r.securityGroupRuleId) < 36 { - return localVarReturnValue, fmt.Errorf("securityGroupRuleId must have at least 36 elements") + + 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.securityGroupRuleId) > 36 { - return localVarReturnValue, fmt.Errorf("securityGroupRuleId must have less than 36 elements") + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } // to determine the Content-Type header @@ -8240,88 +14516,71 @@ func (r ApiGetSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { } /* -GetSecurityGroupRule: Get security group rule details. +ListMachineTypes: List all machine types available for a project. -Get details about a security group rule of a project. +Get a list of all machine type available in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @param securityGroupId The identifier (ID) of a STACKIT Security Group. - @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. - @return ApiGetSecurityGroupRuleRequest + @return ApiListMachineTypesRequest */ -func (a *APIClient) GetSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) ApiGetSecurityGroupRuleRequest { - return ApiGetSecurityGroupRuleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, - securityGroupRuleId: securityGroupRuleId, +func (a *APIClient) ListMachineTypes(ctx context.Context, projectId string) ApiListMachineTypesRequest { + return ApiListMachineTypesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, } } -func (a *APIClient) GetSecurityGroupRuleExecute(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) (*SecurityGroupRule, error) { - r := ApiGetSecurityGroupRuleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, - securityGroupRuleId: securityGroupRuleId, +func (a *APIClient) ListMachineTypesExecute(ctx context.Context, projectId string) (*MachineTypeListResponse, error) { + r := ApiListMachineTypesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, } return r.Execute() } -type ApiGetServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - details *bool -} - -// Show detailed information about server. - -func (r ApiGetServerRequest) Details(details bool) ApiGetServerRequest { - r.details = &details - return r +type ApiListNetworkAreaProjectsRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string } -func (r ApiGetServerRequest) Execute() (*Server, error) { +func (r ApiListNetworkAreaProjectsRequest) Execute() (*ProjectListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Server + localVarReturnValue *ProjectListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworkAreaProjects") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/projects" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -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.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId 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.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId 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.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId 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.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") } - if r.details != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "details", r.details, "") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -8442,72 +14701,72 @@ func (r ApiGetServerRequest) Execute() (*Server, error) { } /* -GetServer: Get server details. +ListNetworkAreaProjects: List all projects using a network area. -Get details about a server by its ID. +Get a list of all projects using a network area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param serverId The identifier (ID) of a STACKIT Server. - @return ApiGetServerRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiListNetworkAreaProjectsRequest */ -func (a *APIClient) GetServer(ctx context.Context, projectId string, serverId string) ApiGetServerRequest { - return ApiGetServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, +func (a *APIClient) ListNetworkAreaProjects(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaProjectsRequest { + return ApiListNetworkAreaProjectsRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } } -func (a *APIClient) GetServerExecute(ctx context.Context, projectId string, serverId string) (*Server, error) { - r := ApiGetServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, +func (a *APIClient) ListNetworkAreaProjectsExecute(ctx context.Context, organizationId string, areaId string) (*ProjectListResponse, error) { + r := ApiListNetworkAreaProjectsRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } return r.Execute() } -type ApiGetServerConsoleRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string +type ApiListNetworkAreaRangesRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string } -func (r ApiGetServerConsoleRequest) Execute() (*ServerConsoleUrl, error) { +func (r ApiListNetworkAreaRangesRequest) Execute() (*NetworkRangeListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ServerConsoleUrl + localVarReturnValue *NetworkRangeListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServerConsole") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworkAreaRanges") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/console" - 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/organizations/{organizationId}/network-areas/{areaId}/network-ranges" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -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.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId 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.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId 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.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId 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.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") } // to determine the Content-Type header @@ -8630,84 +14889,84 @@ func (r ApiGetServerConsoleRequest) Execute() (*ServerConsoleUrl, error) { } /* -GetServerConsole: Get server console. +ListNetworkAreaRanges: List all network ranges in a network area. -Get a URL for server remote console. +Get a list of all network ranges in a network area. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The identifier (ID) of a STACKIT Project. - @param serverId The identifier (ID) of a STACKIT Server. - @return ApiGetServerConsoleRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiListNetworkAreaRangesRequest */ -func (a *APIClient) GetServerConsole(ctx context.Context, projectId string, serverId string) ApiGetServerConsoleRequest { - return ApiGetServerConsoleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, +func (a *APIClient) ListNetworkAreaRanges(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaRangesRequest { + return ApiListNetworkAreaRangesRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } } -func (a *APIClient) GetServerConsoleExecute(ctx context.Context, projectId string, serverId string) (*ServerConsoleUrl, error) { - r := ApiGetServerConsoleRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, +func (a *APIClient) ListNetworkAreaRangesExecute(ctx context.Context, organizationId string, areaId string) (*NetworkRangeListResponse, error) { + r := ApiListNetworkAreaRangesRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } return r.Execute() } -type ApiGetServerLogRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - length *int64 +type ApiListNetworkAreaRoutesRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + labelSelector *string } -// Request the server log. By default the length is limited to 2000 lines. Set to 0 to retrieve the complete log. +// Filter resources by labels. -func (r ApiGetServerLogRequest) Length(length int64) ApiGetServerLogRequest { - r.length = &length +func (r ApiListNetworkAreaRoutesRequest) LabelSelector(labelSelector string) ApiListNetworkAreaRoutesRequest { + r.labelSelector = &labelSelector return r } -func (r ApiGetServerLogRequest) Execute() (*GetServerLog200Response, error) { +func (r ApiListNetworkAreaRoutesRequest) Execute() (*RouteListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetServerLog200Response + localVarReturnValue *RouteListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetServerLog") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworkAreaRoutes") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/log" - 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/organizations/{organizationId}/network-areas/{areaId}/routes" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -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.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId 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.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId 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.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId 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.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") } - if r.length != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "length", r.length, "") + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -8829,82 +15088,77 @@ func (r ApiGetServerLogRequest) Execute() (*GetServerLog200Response, error) { } /* -GetServerLog: Get server log. +ListNetworkAreaRoutes: List all network routes in a network area. -Get server console log. +Get a list of all network routes defined in a network area. @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 ApiGetServerLogRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiListNetworkAreaRoutesRequest */ -func (a *APIClient) GetServerLog(ctx context.Context, projectId string, serverId string) ApiGetServerLogRequest { - return ApiGetServerLogRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, +func (a *APIClient) ListNetworkAreaRoutes(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaRoutesRequest { + return ApiListNetworkAreaRoutesRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } } -func (a *APIClient) GetServerLogExecute(ctx context.Context, projectId string, serverId string) (*GetServerLog200Response, error) { - r := ApiGetServerLogRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, +func (a *APIClient) ListNetworkAreaRoutesExecute(ctx context.Context, organizationId string, areaId string) (*RouteListResponse, error) { + r := ApiListNetworkAreaRoutesRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } return r.Execute() } -type ApiGetVirtualIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - virtualIpId string +type ApiListNetworkAreasRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + labelSelector *string } -func (r ApiGetVirtualIPRequest) Execute() (*VirtualIp, error) { +// Filter resources by labels. + +func (r ApiListNetworkAreasRequest) LabelSelector(labelSelector string) ApiListNetworkAreasRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListNetworkAreasRequest) Execute() (*NetworkAreaListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *VirtualIp + localVarReturnValue *NetworkAreaListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetVirtualIP") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworkAreas") if err != nil { return localVarReturnValue, &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) + localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -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.networkId) < 36 { - return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") - } - if strlen(r.networkId) > 36 { - return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") - } - if strlen(r.virtualIpId) < 36 { - return localVarReturnValue, fmt.Errorf("virtualIpId must have at least 36 elements") + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") } - if strlen(r.virtualIpId) > 36 { - return localVarReturnValue, fmt.Errorf("virtualIpId must have less than 36 elements") + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -9025,60 +15279,60 @@ func (r ApiGetVirtualIPRequest) Execute() (*VirtualIp, error) { } /* -GetVirtualIP: Get details about a virtual IP. +ListNetworkAreas: List all network areas in an organization. -Get details about a virtual IP inside a project. +Get a list of all visible network areas defined in an organization. @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 ApiGetVirtualIPRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @return ApiListNetworkAreasRequest */ -func (a *APIClient) GetVirtualIP(ctx context.Context, projectId string, networkId string, virtualIpId string) ApiGetVirtualIPRequest { - return ApiGetVirtualIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - virtualIpId: virtualIpId, +func (a *APIClient) ListNetworkAreas(ctx context.Context, organizationId string) ApiListNetworkAreasRequest { + return ApiListNetworkAreasRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, } } -func (a *APIClient) GetVirtualIPExecute(ctx context.Context, projectId string, networkId string, virtualIpId string) (*VirtualIp, error) { - r := ApiGetVirtualIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - virtualIpId: virtualIpId, +func (a *APIClient) ListNetworkAreasExecute(ctx context.Context, organizationId string) (*NetworkAreaListResponse, error) { + r := ApiListNetworkAreasRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, } return r.Execute() } -type ApiGetVolumeRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - volumeId string +type ApiListNetworksRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + labelSelector *string } -func (r ApiGetVolumeRequest) Execute() (*Volume, error) { +// Filter resources by labels. + +func (r ApiListNetworksRequest) LabelSelector(labelSelector string) ApiListNetworksRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListNetworksRequest) Execute() (*NetworkListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Volume + localVarReturnValue *NetworkListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetVolume") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworks") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes/{volumeId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks" 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{} @@ -9089,13 +15343,10 @@ func (r ApiGetVolumeRequest) Execute() (*Volume, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId 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") - } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -9216,57 +15467,62 @@ func (r ApiGetVolumeRequest) Execute() (*Volume, error) { } /* -GetVolume: Get details about a volume. +ListNetworks: List all networks inside a project. -Get details about a block device volume. +Get a list of all networks 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 volumeId The identifier (ID) of a STACKIT Volume. - @return ApiGetVolumeRequest + @return ApiListNetworksRequest */ -func (a *APIClient) GetVolume(ctx context.Context, projectId string, volumeId string) ApiGetVolumeRequest { - return ApiGetVolumeRequest{ +func (a *APIClient) ListNetworks(ctx context.Context, projectId string) ApiListNetworksRequest { + return ApiListNetworksRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - volumeId: volumeId, } } -func (a *APIClient) GetVolumeExecute(ctx context.Context, projectId string, volumeId string) (*Volume, error) { - r := ApiGetVolumeRequest{ +func (a *APIClient) ListNetworksExecute(ctx context.Context, projectId string) (*NetworkListResponse, error) { + r := ApiListNetworksRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - volumeId: volumeId, } return r.Execute() } -type ApiGetVolumePerformanceClassRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - volumePerformanceClass string +type ApiListNicsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + networkId string + labelSelector *string } -func (r ApiGetVolumePerformanceClassRequest) Execute() (*VolumePerformanceClass, error) { +// Filter resources by labels. + +func (r ApiListNicsRequest) LabelSelector(labelSelector string) ApiListNicsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListNicsRequest) Execute() (*NICListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *VolumePerformanceClass + localVarReturnValue *NICListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetVolumePerformanceClass") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNics") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/nics" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"volumePerformanceClass"+"}", url.PathEscape(ParameterValueToString(r.volumePerformanceClass, "volumePerformanceClass")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -9277,10 +15533,16 @@ func (r ApiGetVolumePerformanceClassRequest) Execute() (*VolumePerformanceClass, if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.volumePerformanceClass) > 63 { - return localVarReturnValue, fmt.Errorf("volumePerformanceClass must have less than 63 elements") + if strlen(r.networkId) < 36 { + return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -9401,57 +15663,63 @@ func (r ApiGetVolumePerformanceClassRequest) Execute() (*VolumePerformanceClass, } /* -GetVolumePerformanceClass: Get details about a volume performance class. +ListNics: List all network interfaces inside a network. -Get details about a specific volume performance class. +Get a list of all network interfaces inside a network. @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 networkId The identifier (ID) of a STACKIT Network. + @return ApiListNicsRequest */ -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) ListNics(ctx context.Context, projectId string, networkId string) ApiListNicsRequest { + return ApiListNicsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + networkId: networkId, } } -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) ListNicsExecute(ctx context.Context, projectId string, networkId string) (*NICListResponse, error) { + r := ApiListNicsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + networkId: networkId, } return r.Execute() } -type ApiListAttachedVolumesRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string +type ApiListProjectNICsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + labelSelector *string } -func (r ApiListAttachedVolumesRequest) Execute() (*VolumeAttachmentListResponse, error) { +// Filter resources by labels. + +func (r ApiListProjectNICsRequest) LabelSelector(labelSelector string) ApiListProjectNICsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListProjectNICsRequest) Execute() (*NICListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *VolumeAttachmentListResponse + localVarReturnValue *NICListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAttachedVolumes") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListProjectNICs") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/nics" 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{} @@ -9462,13 +15730,10 @@ func (r ApiListAttachedVolumesRequest) Execute() (*VolumeAttachmentListResponse, if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.serverId) < 36 { - return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") - } - if strlen(r.serverId) > 36 { - return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") - } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -9589,53 +15854,50 @@ func (r ApiListAttachedVolumesRequest) Execute() (*VolumeAttachmentListResponse, } /* -ListAttachedVolumes: List all volume attachments of a server. +ListProjectNICs: List all network interfaces inside a project. -Get a list of all volume attachments of a server. +Get a list of all network interfaces 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 serverId The identifier (ID) of a STACKIT Server. - @return ApiListAttachedVolumesRequest + @return ApiListProjectNICsRequest */ -func (a *APIClient) ListAttachedVolumes(ctx context.Context, projectId string, serverId string) ApiListAttachedVolumesRequest { - return ApiListAttachedVolumesRequest{ +func (a *APIClient) ListProjectNICs(ctx context.Context, projectId string) ApiListProjectNICsRequest { + return ApiListProjectNICsRequest{ 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) ListProjectNICsExecute(ctx context.Context, projectId string) (*NICListResponse, error) { + r := ApiListProjectNICsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, } return r.Execute() } -type ApiListAvailabilityZonesRequest struct { +type ApiListPublicIPRangesRequest struct { ctx context.Context apiService *DefaultApiService } -func (r ApiListAvailabilityZonesRequest) Execute() (*AvailabilityZoneListResponse, error) { +func (r ApiListPublicIPRangesRequest) Execute() (*PublicNetworkListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AvailabilityZoneListResponse + localVarReturnValue *PublicNetworkListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAvailabilityZones") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListPublicIPRanges") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/availability-zones" + localVarPath := localBasePath + "/v1alpha1/networks/public-ip-ranges" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -9761,29 +16023,29 @@ func (r ApiListAvailabilityZonesRequest) Execute() (*AvailabilityZoneListRespons } /* -ListAvailabilityZones: List all availability zones. +ListPublicIPRanges: List all public IP ranges. -Get a list of all availability zones. +Get a list of all public IP ranges that STACKIT uses. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiListAvailabilityZonesRequest + @return ApiListPublicIPRangesRequest */ -func (a *APIClient) ListAvailabilityZones(ctx context.Context) ApiListAvailabilityZonesRequest { - return ApiListAvailabilityZonesRequest{ +func (a *APIClient) ListPublicIPRanges(ctx context.Context) ApiListPublicIPRangesRequest { + return ApiListPublicIPRangesRequest{ apiService: a.defaultApi, ctx: ctx, } } -func (a *APIClient) ListAvailabilityZonesExecute(ctx context.Context) (*AvailabilityZoneListResponse, error) { - r := ApiListAvailabilityZonesRequest{ +func (a *APIClient) ListPublicIPRangesExecute(ctx context.Context) (*PublicNetworkListResponse, error) { + r := ApiListPublicIPRangesRequest{ apiService: a.defaultApi, ctx: ctx, } return r.Execute() } -type ApiListImagesRequest struct { +type ApiListPublicIPsRequest struct { ctx context.Context apiService *DefaultApiService projectId string @@ -9792,25 +16054,25 @@ type ApiListImagesRequest struct { // Filter resources by labels. -func (r ApiListImagesRequest) LabelSelector(labelSelector string) ApiListImagesRequest { +func (r ApiListPublicIPsRequest) LabelSelector(labelSelector string) ApiListPublicIPsRequest { r.labelSelector = &labelSelector return r } -func (r ApiListImagesRequest) Execute() (*ImageListResponse, error) { +func (r ApiListPublicIPsRequest) Execute() (*PublicIpListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ImageListResponse + localVarReturnValue *PublicIpListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListImages") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListPublicIPs") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/public-ips" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) @@ -9946,24 +16208,24 @@ func (r ApiListImagesRequest) Execute() (*ImageListResponse, error) { } /* -ListImages: List all Images inside a project. +ListPublicIPs: List all public IPs inside a project. -Get a list of all images inside a project. +Get a list of all public IPs inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiListImagesRequest + @return ApiListPublicIPsRequest */ -func (a *APIClient) ListImages(ctx context.Context, projectId string) ApiListImagesRequest { - return ApiListImagesRequest{ +func (a *APIClient) ListPublicIPs(ctx context.Context, projectId string) ApiListPublicIPsRequest { + return ApiListPublicIPsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, } } -func (a *APIClient) ListImagesExecute(ctx context.Context, projectId string) (*ImageListResponse, error) { - r := ApiListImagesRequest{ +func (a *APIClient) ListPublicIPsExecute(ctx context.Context, projectId string) (*PublicIpListResponse, error) { + r := ApiListPublicIPsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -9971,41 +16233,38 @@ func (a *APIClient) ListImagesExecute(ctx context.Context, projectId string) (*I return r.Execute() } -type ApiListKeyPairsRequest struct { - ctx context.Context - apiService *DefaultApiService - labelSelector *string -} - -// Filter resources by labels. - -func (r ApiListKeyPairsRequest) LabelSelector(labelSelector string) ApiListKeyPairsRequest { - r.labelSelector = &labelSelector - return r +type ApiListQuotasRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string } -func (r ApiListKeyPairsRequest) Execute() (*KeyPairListResponse, error) { +func (r ApiListQuotasRequest) Execute() (*QuotaListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *KeyPairListResponse + localVarReturnValue *QuotaListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListKeyPairs") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListQuotas") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/keypairs" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/quotas" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -10126,49 +16385,54 @@ func (r ApiListKeyPairsRequest) Execute() (*KeyPairListResponse, error) { } /* -ListKeyPairs: List all SSH keypairs for the requesting user. +ListQuotas: List project quotas. -Get a list of all SSH keypairs assigned to the requesting user. +List quota limits and usage for project resources. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiListKeyPairsRequest + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListQuotasRequest */ -func (a *APIClient) ListKeyPairs(ctx context.Context) ApiListKeyPairsRequest { - return ApiListKeyPairsRequest{ +func (a *APIClient) ListQuotas(ctx context.Context, projectId string) ApiListQuotasRequest { + return ApiListQuotasRequest{ apiService: a.defaultApi, ctx: ctx, + projectId: projectId, } } -func (a *APIClient) ListKeyPairsExecute(ctx context.Context) (*KeyPairListResponse, error) { - r := ApiListKeyPairsRequest{ +func (a *APIClient) ListQuotasExecute(ctx context.Context, projectId string) (*QuotaListResponse, error) { + r := ApiListQuotasRequest{ apiService: a.defaultApi, ctx: ctx, + projectId: projectId, } return r.Execute() } -type ApiListMachineTypesRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string +type ApiListSecurityGroupRulesRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + securityGroupId string } -func (r ApiListMachineTypesRequest) Execute() (*MachineTypeListResponse, error) { +func (r ApiListSecurityGroupRulesRequest) Execute() (*SecurityGroupRuleListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *MachineTypeListResponse + localVarReturnValue *SecurityGroupRuleListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListMachineTypes") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListSecurityGroupRules") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/machine-types" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -10179,6 +16443,12 @@ func (r ApiListMachineTypesRequest) Execute() (*MachineTypeListResponse, error) if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, fmt.Errorf("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -10300,71 +16570,77 @@ func (r ApiListMachineTypesRequest) Execute() (*MachineTypeListResponse, error) } /* -ListMachineTypes: List all machine types available for a project. +ListSecurityGroupRules: List all rules for a security group. -Get a list of all machine type available in a project. +Get a list of all rules inside 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. - @return ApiListMachineTypesRequest + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiListSecurityGroupRulesRequest */ -func (a *APIClient) ListMachineTypes(ctx context.Context, projectId string) ApiListMachineTypesRequest { - return ApiListMachineTypesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) ListSecurityGroupRules(ctx context.Context, projectId string, securityGroupId string) ApiListSecurityGroupRulesRequest { + return ApiListSecurityGroupRulesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, } } -func (a *APIClient) ListMachineTypesExecute(ctx context.Context, projectId string) (*MachineTypeListResponse, error) { - r := ApiListMachineTypesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) ListSecurityGroupRulesExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroupRuleListResponse, error) { + r := ApiListSecurityGroupRulesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, } return r.Execute() } -type ApiListNetworkAreaProjectsRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - areaId string +type ApiListSecurityGroupsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + labelSelector *string } -func (r ApiListNetworkAreaProjectsRequest) Execute() (*ProjectListResponse, error) { +// Filter resources by labels. + +func (r ApiListSecurityGroupsRequest) LabelSelector(labelSelector string) ApiListSecurityGroupsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListSecurityGroupsRequest) Execute() (*SecurityGroupListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ProjectListResponse + localVarReturnValue *SecurityGroupListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworkAreaProjects") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListSecurityGroups") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/projects" - localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if strlen(r.organizationId) < 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") - } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") - } - if strlen(r.areaId) < 36 { - return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") } - if strlen(r.areaId) > 36 { - return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -10485,77 +16761,71 @@ func (r ApiListNetworkAreaProjectsRequest) Execute() (*ProjectListResponse, erro } /* -ListNetworkAreaProjects: List all projects using a network area. +ListSecurityGroups: List all security groups inside a project. -Get a list of all projects using a network area. +Get a list of all security groups inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @param areaId The identifier (ID) of a STACKIT Network Area. - @return ApiListNetworkAreaProjectsRequest + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListSecurityGroupsRequest */ -func (a *APIClient) ListNetworkAreaProjects(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaProjectsRequest { - return ApiListNetworkAreaProjectsRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, +func (a *APIClient) ListSecurityGroups(ctx context.Context, projectId string) ApiListSecurityGroupsRequest { + return ApiListSecurityGroupsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, } } -func (a *APIClient) ListNetworkAreaProjectsExecute(ctx context.Context, organizationId string, areaId string) (*ProjectListResponse, error) { - r := ApiListNetworkAreaProjectsRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, - areaId: areaId, +func (a *APIClient) ListSecurityGroupsExecute(ctx context.Context, projectId string) (*SecurityGroupListResponse, error) { + r := ApiListSecurityGroupsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, } return r.Execute() } -type ApiListNetworkAreasRequest struct { - ctx context.Context - apiService *DefaultApiService - organizationId string - labelSelector *string -} - -// Filter resources by labels. - -func (r ApiListNetworkAreasRequest) LabelSelector(labelSelector string) ApiListNetworkAreasRequest { - r.labelSelector = &labelSelector - return r +type ApiListServerNicsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string } -func (r ApiListNetworkAreasRequest) Execute() (*NetworkAreaListResponse, error) { +func (r ApiListServerNicsRequest) Execute() (*NICListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NetworkAreaListResponse + localVarReturnValue *NICListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworkAreas") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListServerNics") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas" - localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/nics" + 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.organizationId) < 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") } - if strlen(r.organizationId) > 36 { - return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + 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{} @@ -10676,60 +16946,57 @@ func (r ApiListNetworkAreasRequest) Execute() (*NetworkAreaListResponse, error) } /* -ListNetworkAreas: List all network areas in an organization. +ListServerNics: Get all network interfaces. -Get a list of all visible network areas defined in an organization. +Get all network interfaces attached to the server. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param organizationId The identifier (ID) of a STACKIT Organization. - @return ApiListNetworkAreasRequest + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListServerNicsRequest */ -func (a *APIClient) ListNetworkAreas(ctx context.Context, organizationId string) ApiListNetworkAreasRequest { - return ApiListNetworkAreasRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, +func (a *APIClient) ListServerNics(ctx context.Context, projectId string, serverId string) ApiListServerNicsRequest { + return ApiListServerNicsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, } } -func (a *APIClient) ListNetworkAreasExecute(ctx context.Context, organizationId string) (*NetworkAreaListResponse, error) { - r := ApiListNetworkAreasRequest{ - apiService: a.defaultApi, - ctx: ctx, - organizationId: organizationId, +func (a *APIClient) ListServerNicsExecute(ctx context.Context, projectId string, serverId string) (*NICListResponse, error) { + r := ApiListServerNicsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, } return r.Execute() } -type ApiListNetworksRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - labelSelector *string -} - -// Filter resources by labels. - -func (r ApiListNetworksRequest) LabelSelector(labelSelector string) ApiListNetworksRequest { - r.labelSelector = &labelSelector - return r +type ApiListServerServiceAccountsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string } -func (r ApiListNetworksRequest) Execute() (*NetworkListResponse, error) { +func (r ApiListServerServiceAccountsRequest) Execute() (*ServiceAccountMailListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NetworkListResponse + localVarReturnValue *ServiceAccountMailListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNetworks") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListServerServiceAccounts") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/service-accounts" 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{} @@ -10740,10 +17007,13 @@ func (r ApiListNetworksRequest) Execute() (*NetworkListResponse, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + 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{} @@ -10864,62 +17134,71 @@ func (r ApiListNetworksRequest) Execute() (*NetworkListResponse, error) { } /* -ListNetworks: List all networks inside a project. +ListServerServiceAccounts: List all service accounts of the Server. -Get a list of all networks inside a project. +Get the list of the service accounts of the 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. - @return ApiListNetworksRequest + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListServerServiceAccountsRequest */ -func (a *APIClient) ListNetworks(ctx context.Context, projectId string) ApiListNetworksRequest { - return ApiListNetworksRequest{ +func (a *APIClient) ListServerServiceAccounts(ctx context.Context, projectId string, serverId string) ApiListServerServiceAccountsRequest { + return ApiListServerServiceAccountsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + serverId: serverId, } } -func (a *APIClient) ListNetworksExecute(ctx context.Context, projectId string) (*NetworkListResponse, error) { - r := ApiListNetworksRequest{ +func (a *APIClient) ListServerServiceAccountsExecute(ctx context.Context, projectId string, serverId string) (*ServiceAccountMailListResponse, error) { + r := ApiListServerServiceAccountsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + serverId: serverId, } return r.Execute() } -type ApiListNicsRequest struct { +type ApiListServersRequest struct { ctx context.Context apiService *DefaultApiService projectId string - networkId string + details *bool labelSelector *string } +// Show detailed information about server. + +func (r ApiListServersRequest) Details(details bool) ApiListServersRequest { + r.details = &details + return r +} + // Filter resources by labels. -func (r ApiListNicsRequest) LabelSelector(labelSelector string) ApiListNicsRequest { +func (r ApiListServersRequest) LabelSelector(labelSelector string) ApiListServersRequest { r.labelSelector = &labelSelector return r } -func (r ApiListNicsRequest) Execute() (*NICListResponse, error) { +func (r ApiListServersRequest) Execute() (*ServerListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *NICListResponse + localVarReturnValue *ServerListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListNics") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListServers") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/nics" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -10930,13 +17209,10 @@ func (r ApiListNicsRequest) Execute() (*NICListResponse, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.networkId) < 36 { - return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") - } - if strlen(r.networkId) > 36 { - return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") - } + if r.details != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "details", r.details, "") + } if r.labelSelector != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") } @@ -11060,58 +17336,74 @@ func (r ApiListNicsRequest) Execute() (*NICListResponse, error) { } /* -ListNics: List all network interfaces inside a network. +ListServers: List all servers inside a project. -Get a list of all network interfaces inside a network. +Get a list of all servers 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 networkId The identifier (ID) of a STACKIT Network. - @return ApiListNicsRequest + @return ApiListServersRequest */ -func (a *APIClient) ListNics(ctx context.Context, projectId string, networkId string) ApiListNicsRequest { - return ApiListNicsRequest{ +func (a *APIClient) ListServers(ctx context.Context, projectId string) ApiListServersRequest { + return ApiListServersRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - networkId: networkId, } } -func (a *APIClient) ListNicsExecute(ctx context.Context, projectId string, networkId string) (*NICListResponse, error) { - r := ApiListNicsRequest{ +func (a *APIClient) ListServersExecute(ctx context.Context, projectId string) (*ServerListResponse, error) { + r := ApiListServersRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - networkId: networkId, } return r.Execute() } -type ApiListPublicIPRangesRequest struct { - ctx context.Context - apiService *DefaultApiService +type ApiListSnapshotsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + labelSelector *string } -func (r ApiListPublicIPRangesRequest) Execute() (*PublicNetworkListResponse, error) { +// Filter resources by labels. + +func (r ApiListSnapshotsRequest) LabelSelector(labelSelector string) ApiListSnapshotsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListSnapshotsRequest) Execute() (*SnapshotListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *PublicNetworkListResponse + localVarReturnValue *SnapshotListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListPublicIPRanges") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListSnapshots") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/networks/public-ip-ranges" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/snapshots" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -11232,57 +17524,62 @@ func (r ApiListPublicIPRangesRequest) Execute() (*PublicNetworkListResponse, err } /* -ListPublicIPRanges: List all public IP ranges. +ListSnapshots: List all snapshots inside a project. -Get a list of all public IP ranges that STACKIT uses. +Get a list of all snapshots inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiListPublicIPRangesRequest + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListSnapshotsRequest */ -func (a *APIClient) ListPublicIPRanges(ctx context.Context) ApiListPublicIPRangesRequest { - return ApiListPublicIPRangesRequest{ +func (a *APIClient) ListSnapshots(ctx context.Context, projectId string) ApiListSnapshotsRequest { + return ApiListSnapshotsRequest{ apiService: a.defaultApi, ctx: ctx, + projectId: projectId, } } -func (a *APIClient) ListPublicIPRangesExecute(ctx context.Context) (*PublicNetworkListResponse, error) { - r := ApiListPublicIPRangesRequest{ +func (a *APIClient) ListSnapshotsExecute(ctx context.Context, projectId string) (*SnapshotListResponse, error) { + r := ApiListSnapshotsRequest{ apiService: a.defaultApi, ctx: ctx, + projectId: projectId, } return r.Execute() } -type ApiListPublicIPsRequest struct { +type ApiListVirtualIPsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + networkId string labelSelector *string } // Filter resources by labels. -func (r ApiListPublicIPsRequest) LabelSelector(labelSelector string) ApiListPublicIPsRequest { +func (r ApiListVirtualIPsRequest) LabelSelector(labelSelector string) ApiListVirtualIPsRequest { r.labelSelector = &labelSelector return r } -func (r ApiListPublicIPsRequest) Execute() (*PublicIpListResponse, error) { +func (r ApiListVirtualIPsRequest) Execute() (*VirtualIpListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *PublicIpListResponse + localVarReturnValue *VirtualIpListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListPublicIPs") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListVirtualIPs") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/public-ips" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -11293,6 +17590,12 @@ func (r ApiListPublicIPsRequest) Execute() (*PublicIpListResponse, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } + if strlen(r.networkId) < 36 { + return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") + } if r.labelSelector != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") @@ -11417,54 +17720,63 @@ func (r ApiListPublicIPsRequest) Execute() (*PublicIpListResponse, error) { } /* -ListPublicIPs: List all public IPs inside a project. +ListVirtualIPs: List all virtual IPs inside a project. -Get a list of all public IPs inside a project. +Get a list of all virtual IPs inside a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiListPublicIPsRequest + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiListVirtualIPsRequest */ -func (a *APIClient) ListPublicIPs(ctx context.Context, projectId string) ApiListPublicIPsRequest { - return ApiListPublicIPsRequest{ +func (a *APIClient) ListVirtualIPs(ctx context.Context, projectId string, networkId string) ApiListVirtualIPsRequest { + return ApiListVirtualIPsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + networkId: networkId, } } -func (a *APIClient) ListPublicIPsExecute(ctx context.Context, projectId string) (*PublicIpListResponse, error) { - r := ApiListPublicIPsRequest{ +func (a *APIClient) ListVirtualIPsExecute(ctx context.Context, projectId string, networkId string) (*VirtualIpListResponse, error) { + r := ApiListVirtualIPsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + networkId: networkId, } return r.Execute() } -type ApiListSecurityGroupRulesRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - securityGroupId string +type ApiListVolumePerformanceClassesRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + labelSelector *string } -func (r ApiListSecurityGroupRulesRequest) Execute() (*SecurityGroupRuleListResponse, error) { +// Filter resources by labels. + +func (r ApiListVolumePerformanceClassesRequest) LabelSelector(labelSelector string) ApiListVolumePerformanceClassesRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListVolumePerformanceClassesRequest) Execute() (*VolumePerformanceClassListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *SecurityGroupRuleListResponse + localVarReturnValue *VolumePerformanceClassListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListSecurityGroupRules") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListVolumePerformanceClasses") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volume-performance-classes" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(r.securityGroupId, "securityGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -11475,13 +17787,10 @@ func (r ApiListSecurityGroupRulesRequest) Execute() (*SecurityGroupRuleListRespo if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.securityGroupId) < 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have at least 36 elements") - } - if strlen(r.securityGroupId) > 36 { - return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") - } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -11602,35 +17911,32 @@ func (r ApiListSecurityGroupRulesRequest) Execute() (*SecurityGroupRuleListRespo } /* -ListSecurityGroupRules: List all rules for a security group. +ListVolumePerformanceClasses: List all volume performance classes available for a project. -Get a list of all rules inside a security group. +Get a list of all volume performance classes available 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 securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiListSecurityGroupRulesRequest + @return ApiListVolumePerformanceClassesRequest */ -func (a *APIClient) ListSecurityGroupRules(ctx context.Context, projectId string, securityGroupId string) ApiListSecurityGroupRulesRequest { - return ApiListSecurityGroupRulesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) ListVolumePerformanceClasses(ctx context.Context, projectId string) ApiListVolumePerformanceClassesRequest { + return ApiListVolumePerformanceClassesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, } } -func (a *APIClient) ListSecurityGroupRulesExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroupRuleListResponse, error) { - r := ApiListSecurityGroupRulesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) ListVolumePerformanceClassesExecute(ctx context.Context, projectId string) (*VolumePerformanceClassListResponse, error) { + r := ApiListVolumePerformanceClassesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, } return r.Execute() } -type ApiListSecurityGroupsRequest struct { +type ApiListVolumesRequest struct { ctx context.Context apiService *DefaultApiService projectId string @@ -11639,25 +17945,25 @@ type ApiListSecurityGroupsRequest struct { // Filter resources by labels. -func (r ApiListSecurityGroupsRequest) LabelSelector(labelSelector string) ApiListSecurityGroupsRequest { +func (r ApiListVolumesRequest) LabelSelector(labelSelector string) ApiListVolumesRequest { r.labelSelector = &labelSelector return r } -func (r ApiListSecurityGroupsRequest) Execute() (*SecurityGroupListResponse, error) { +func (r ApiListVolumesRequest) Execute() (*VolumeListResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *SecurityGroupListResponse + localVarReturnValue *VolumeListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListSecurityGroups") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListVolumes") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/security-groups" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) @@ -11793,24 +18099,24 @@ func (r ApiListSecurityGroupsRequest) Execute() (*SecurityGroupListResponse, err } /* -ListSecurityGroups: List all security groups inside a project. +ListVolumes: List all volumes inside a project. -Get a list of all security groups inside a project. +Get a list of all volumes 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. - @return ApiListSecurityGroupsRequest + @return ApiListVolumesRequest */ -func (a *APIClient) ListSecurityGroups(ctx context.Context, projectId string) ApiListSecurityGroupsRequest { - return ApiListSecurityGroupsRequest{ +func (a *APIClient) ListVolumes(ctx context.Context, projectId string) ApiListVolumesRequest { + return ApiListVolumesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, } } -func (a *APIClient) ListSecurityGroupsExecute(ctx context.Context, projectId string) (*SecurityGroupListResponse, error) { - r := ApiListSecurityGroupsRequest{ +func (a *APIClient) ListVolumesExecute(ctx context.Context, projectId string) (*VolumeListResponse, error) { + r := ApiListVolumesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -11818,48 +18124,58 @@ func (a *APIClient) ListSecurityGroupsExecute(ctx context.Context, projectId str return r.Execute() } -type ApiListServerNicsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string +type ApiPartialUpdateNetworkRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + networkId string + partialUpdateNetworkPayload *PartialUpdateNetworkPayload } -func (r ApiListServerNicsRequest) Execute() (*NICListResponse, error) { +// Request an update of a network. + +func (r ApiPartialUpdateNetworkRequest) PartialUpdateNetworkPayload(partialUpdateNetworkPayload PartialUpdateNetworkPayload) ApiPartialUpdateNetworkRequest { + r.partialUpdateNetworkPayload = &partialUpdateNetworkPayload + return r +} + +func (r ApiPartialUpdateNetworkRequest) Execute() error { var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *NICListResponse + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListServerNics") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.PartialUpdateNetwork") if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/nics" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}" 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, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -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") + return 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") + return 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.networkId) < 36 { + return fmt.Errorf("networkId 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.networkId) > 36 { + return fmt.Errorf("networkId must have less than 36 elements") + } + if r.partialUpdateNetworkPayload == nil { + return fmt.Errorf("partialUpdateNetworkPayload is required and must be specified") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -11875,9 +18191,11 @@ func (r ApiListServerNicsRequest) Execute() (*NICListResponse, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.partialUpdateNetworkPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, err + return err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -11891,14 +18209,14 @@ func (r ApiListServerNicsRequest) Execute() (*NICListResponse, error) { *contextHTTPResponse = localVarHTTPResponse } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err + return err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, err + return err } if localVarHTTPResponse.StatusCode >= 300 { @@ -11912,142 +18230,143 @@ func (r ApiListServerNicsRequest) Execute() (*NICListResponse, error) { err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 404 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 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 + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr + return newErr } - return localVarReturnValue, nil + return nil } /* -ListServerNics: Get all network interfaces. +PartialUpdateNetwork: Update network settings. -Get all network interfaces attached to the server. +Update the settings of a network 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 serverId The identifier (ID) of a STACKIT Server. - @return ApiListServerNicsRequest + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiPartialUpdateNetworkRequest */ -func (a *APIClient) ListServerNics(ctx context.Context, projectId string, serverId string) ApiListServerNicsRequest { - return ApiListServerNicsRequest{ +func (a *APIClient) PartialUpdateNetwork(ctx context.Context, projectId string, networkId string) ApiPartialUpdateNetworkRequest { + return ApiPartialUpdateNetworkRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + networkId: networkId, } } -func (a *APIClient) ListServerNicsExecute(ctx context.Context, projectId string, serverId string) (*NICListResponse, error) { - r := ApiListServerNicsRequest{ +func (a *APIClient) PartialUpdateNetworkExecute(ctx context.Context, projectId string, networkId string) error { + r := ApiPartialUpdateNetworkRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + networkId: networkId, } return r.Execute() } -type ApiListServerServiceAccountsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string +type ApiPartialUpdateNetworkAreaRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + partialUpdateNetworkAreaPayload *PartialUpdateNetworkAreaPayload } -func (r ApiListServerServiceAccountsRequest) Execute() (*ServiceAccountMailListResponse, error) { +// Request to update an Area. + +func (r ApiPartialUpdateNetworkAreaRequest) PartialUpdateNetworkAreaPayload(partialUpdateNetworkAreaPayload PartialUpdateNetworkAreaPayload) ApiPartialUpdateNetworkAreaRequest { + r.partialUpdateNetworkAreaPayload = &partialUpdateNetworkAreaPayload + return r +} + +func (r ApiPartialUpdateNetworkAreaRequest) Execute() (*NetworkArea, error) { var ( - localVarHTTPMethod = http.MethodGet + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ServiceAccountMailListResponse + localVarReturnValue *NetworkArea ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListServerServiceAccounts") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.PartialUpdateNetworkArea") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/service-accounts" - 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/organizations/{organizationId}/network-areas/{areaId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -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.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId 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.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId 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.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId 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.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + } + if r.partialUpdateNetworkAreaPayload == nil { + return localVarReturnValue, fmt.Errorf("partialUpdateNetworkAreaPayload is required and must be specified") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -12063,6 +18382,8 @@ func (r ApiListServerServiceAccountsRequest) Execute() (*ServiceAccountMailListR if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.partialUpdateNetworkAreaPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -12166,87 +18487,83 @@ func (r ApiListServerServiceAccountsRequest) Execute() (*ServiceAccountMailListR } /* -ListServerServiceAccounts: List all service accounts of the Server. +PartialUpdateNetworkArea: Update network area settings. -Get the list of the service accounts of the server. +Update the settings of a network area in an organization. @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 ApiListServerServiceAccountsRequest + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiPartialUpdateNetworkAreaRequest */ -func (a *APIClient) ListServerServiceAccounts(ctx context.Context, projectId string, serverId string) ApiListServerServiceAccountsRequest { - return ApiListServerServiceAccountsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, +func (a *APIClient) PartialUpdateNetworkArea(ctx context.Context, organizationId string, areaId string) ApiPartialUpdateNetworkAreaRequest { + return ApiPartialUpdateNetworkAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } } -func (a *APIClient) ListServerServiceAccountsExecute(ctx context.Context, projectId string, serverId string) (*ServiceAccountMailListResponse, error) { - r := ApiListServerServiceAccountsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, +func (a *APIClient) PartialUpdateNetworkAreaExecute(ctx context.Context, organizationId string, areaId string) (*NetworkArea, error) { + r := ApiPartialUpdateNetworkAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, } return r.Execute() } -type ApiListServersRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - details *bool - labelSelector *string -} - -// Show detailed information about server. - -func (r ApiListServersRequest) Details(details bool) ApiListServersRequest { - r.details = &details - return r +type ApiRebootServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string + action *string } -// Filter resources by labels. +// Defines if it is a soft or a hard reboot. -func (r ApiListServersRequest) LabelSelector(labelSelector string) ApiListServersRequest { - r.labelSelector = &labelSelector +func (r ApiRebootServerRequest) Action(action string) ApiRebootServerRequest { + r.action = &action return r } -func (r ApiListServersRequest) Execute() (*ServerListResponse, error) { +func (r ApiRebootServerRequest) Execute() error { var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ServerListResponse + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListServers") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RebootServer") if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/reboot" 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") + return 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") + return fmt.Errorf("projectId must have less than 36 elements") } - - if r.details != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "details", r.details, "") + if strlen(r.serverId) < 36 { + return fmt.Errorf("serverId must have at least 36 elements") } - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + if strlen(r.serverId) > 36 { + return fmt.Errorf("serverId must have less than 36 elements") + } + + if r.action != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "action", r.action, "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -12267,7 +18584,7 @@ func (r ApiListServersRequest) Execute() (*ServerListResponse, error) { } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, err + return err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -12281,14 +18598,14 @@ func (r ApiListServersRequest) Execute() (*ServerListResponse, error) { *contextHTTPResponse = localVarHTTPResponse } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err + return err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, err + return err } if localVarHTTPResponse.StatusCode >= 300 { @@ -12302,128 +18619,134 @@ func (r ApiListServersRequest) Execute() (*ServerListResponse, error) { err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 404 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } - if localVarHTTPResponse.StatusCode == 500 { + if localVarHTTPResponse.StatusCode == 409 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr } - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), + 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 localVarReturnValue, newErr + return newErr } - return localVarReturnValue, nil + return nil } /* -ListServers: List all servers inside a project. +RebootServer: Reboot the server. -Get a list of all servers inside a project. +Reboot the server. A soft reboot will attempt to gracefully shut down the server by passing the command to the operating system. A hard reboot will power cycle the server without waiting for the operating system to shutdown properly. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. - @return ApiListServersRequest + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiRebootServerRequest */ -func (a *APIClient) ListServers(ctx context.Context, projectId string) ApiListServersRequest { - return ApiListServersRequest{ +func (a *APIClient) RebootServer(ctx context.Context, projectId string, serverId string) ApiRebootServerRequest { + return ApiRebootServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + serverId: serverId, } } -func (a *APIClient) ListServersExecute(ctx context.Context, projectId string) (*ServerListResponse, error) { - r := ApiListServersRequest{ +func (a *APIClient) RebootServerExecute(ctx context.Context, projectId string, serverId string) error { + r := ApiRebootServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + serverId: serverId, } return r.Execute() } -type ApiListVirtualIPsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - labelSelector *string +type ApiRemoveMemberFromVirtualIPRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + networkId string + virtualIpId string + removeMemberFromVirtualIPPayload *RemoveMemberFromVirtualIPPayload } -// Filter resources by labels. +// Request to remove a member from a virtual IP. -func (r ApiListVirtualIPsRequest) LabelSelector(labelSelector string) ApiListVirtualIPsRequest { - r.labelSelector = &labelSelector +func (r ApiRemoveMemberFromVirtualIPRequest) RemoveMemberFromVirtualIPPayload(removeMemberFromVirtualIPPayload RemoveMemberFromVirtualIPPayload) ApiRemoveMemberFromVirtualIPRequest { + r.removeMemberFromVirtualIPPayload = &removeMemberFromVirtualIPPayload return r } -func (r ApiListVirtualIPsRequest) Execute() (*VirtualIpListResponse, error) { +func (r ApiRemoveMemberFromVirtualIPRequest) Execute() (*VirtualIp, error) { var ( - localVarHTTPMethod = http.MethodGet + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile - localVarReturnValue *VirtualIpListResponse + localVarReturnValue *VirtualIp ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListVirtualIPs") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RemoveMemberFromVirtualIP") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}/remove-member" 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{} @@ -12440,12 +18763,18 @@ func (r ApiListVirtualIPsRequest) Execute() (*VirtualIpListResponse, error) { if strlen(r.networkId) > 36 { return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") } - - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + if strlen(r.virtualIpId) < 36 { + return localVarReturnValue, fmt.Errorf("virtualIpId must have at least 36 elements") } + if strlen(r.virtualIpId) > 36 { + return localVarReturnValue, fmt.Errorf("virtualIpId must have less than 36 elements") + } + if r.removeMemberFromVirtualIPPayload == nil { + return localVarReturnValue, fmt.Errorf("removeMemberFromVirtualIPPayload is required and must be specified") + } + // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -12461,6 +18790,8 @@ func (r ApiListVirtualIPsRequest) Execute() (*VirtualIpListResponse, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.removeMemberFromVirtualIPPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -12564,77 +18895,84 @@ func (r ApiListVirtualIPsRequest) Execute() (*VirtualIpListResponse, error) { } /* -ListVirtualIPs: List all virtual IPs inside a project. +RemoveMemberFromVirtualIP: Remove a member from the virtual IP. -Get a list of all virtual IPs inside a project. +Atomically remove a member from the virtual IP. @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. - @return ApiListVirtualIPsRequest + @param virtualIpId The identifier (ID) of a Virtual IP. + @return ApiRemoveMemberFromVirtualIPRequest */ -func (a *APIClient) ListVirtualIPs(ctx context.Context, projectId string, networkId string) ApiListVirtualIPsRequest { - return ApiListVirtualIPsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, +func (a *APIClient) RemoveMemberFromVirtualIP(ctx context.Context, projectId string, networkId string, virtualIpId string) ApiRemoveMemberFromVirtualIPRequest { + return ApiRemoveMemberFromVirtualIPRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + networkId: networkId, + virtualIpId: virtualIpId, } } -func (a *APIClient) ListVirtualIPsExecute(ctx context.Context, projectId string, networkId string) (*VirtualIpListResponse, error) { - r := ApiListVirtualIPsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, +func (a *APIClient) RemoveMemberFromVirtualIPExecute(ctx context.Context, projectId string, networkId string, virtualIpId string) (*VirtualIp, error) { + r := ApiRemoveMemberFromVirtualIPRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + networkId: networkId, + virtualIpId: virtualIpId, } return r.Execute() } -type ApiListVolumePerformanceClassesRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - labelSelector *string -} - -// Filter resources by labels. - -func (r ApiListVolumePerformanceClassesRequest) LabelSelector(labelSelector string) ApiListVolumePerformanceClassesRequest { - r.labelSelector = &labelSelector - return r +type ApiRemoveNetworkFromServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string + networkId string } -func (r ApiListVolumePerformanceClassesRequest) Execute() (*VolumePerformanceClassListResponse, error) { +func (r ApiRemoveNetworkFromServerRequest) Execute() error { var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VolumePerformanceClassListResponse + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListVolumePerformanceClasses") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RemoveNetworkFromServer") if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volume-performance-classes" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/networks/{networkId}" 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, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -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") + return 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") + return fmt.Errorf("projectId must have less than 36 elements") } - - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + if strlen(r.serverId) < 36 { + return fmt.Errorf("serverId must have at least 36 elements") } + if strlen(r.serverId) > 36 { + return fmt.Errorf("serverId must have less than 36 elements") + } + 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") + } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -12654,7 +18992,7 @@ func (r ApiListVolumePerformanceClassesRequest) Execute() (*VolumePerformanceCla } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, err + return err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -12668,14 +19006,14 @@ func (r ApiListVolumePerformanceClassesRequest) Execute() (*VolumePerformanceCla *contextHTTPResponse = localVarHTTPResponse } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err + return err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, err + return err } if localVarHTTPResponse.StatusCode >= 300 { @@ -12689,140 +19027,140 @@ func (r ApiListVolumePerformanceClassesRequest) Execute() (*VolumePerformanceCla err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 404 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 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 + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr + return newErr } - return localVarReturnValue, nil + return nil } /* -ListVolumePerformanceClasses: List all volume performance classes available for a project. +RemoveNetworkFromServer: Detach and delete all network interfaces associated with the specified network. -Get a list of all volume performance classes available inside a project. +Detach and delete all network interfaces associated with the specified network from the 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. - @return ApiListVolumePerformanceClassesRequest + @param serverId The identifier (ID) of a STACKIT Server. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiRemoveNetworkFromServerRequest */ -func (a *APIClient) ListVolumePerformanceClasses(ctx context.Context, projectId string) ApiListVolumePerformanceClassesRequest { - return ApiListVolumePerformanceClassesRequest{ +func (a *APIClient) RemoveNetworkFromServer(ctx context.Context, projectId string, serverId string, networkId string) ApiRemoveNetworkFromServerRequest { + return ApiRemoveNetworkFromServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + serverId: serverId, + networkId: networkId, } } -func (a *APIClient) ListVolumePerformanceClassesExecute(ctx context.Context, projectId string) (*VolumePerformanceClassListResponse, error) { - r := ApiListVolumePerformanceClassesRequest{ +func (a *APIClient) RemoveNetworkFromServerExecute(ctx context.Context, projectId string, serverId string, networkId string) error { + r := ApiRemoveNetworkFromServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + serverId: serverId, + networkId: networkId, } return r.Execute() } -type ApiListVolumesRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - labelSelector *string -} - -// Filter resources by labels. - -func (r ApiListVolumesRequest) LabelSelector(labelSelector string) ApiListVolumesRequest { - r.labelSelector = &labelSelector - return r +type ApiRemoveNicFromServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string + nicId string } -func (r ApiListVolumesRequest) Execute() (*VolumeListResponse, error) { +func (r ApiRemoveNicFromServerRequest) Execute() error { var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VolumeListResponse + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListVolumes") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RemoveNicFromServer") if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/nics/{nicId}" 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, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -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") + return 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") + return fmt.Errorf("projectId must have less than 36 elements") } - - if r.labelSelector != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "") + if strlen(r.serverId) < 36 { + return fmt.Errorf("serverId must have at least 36 elements") } + if strlen(r.serverId) > 36 { + return fmt.Errorf("serverId must have less than 36 elements") + } + 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 localVarHTTPContentTypes := []string{} @@ -12842,7 +19180,7 @@ func (r ApiListVolumesRequest) Execute() (*VolumeListResponse, error) { } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, err + return err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -12856,14 +19194,14 @@ func (r ApiListVolumesRequest) Execute() (*VolumeListResponse, error) { *contextHTTPResponse = localVarHTTPResponse } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err + return err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, err + return err } if localVarHTTPResponse.StatusCode >= 300 { @@ -12877,127 +19215,117 @@ func (r ApiListVolumesRequest) Execute() (*VolumeListResponse, error) { err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 404 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 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 + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr + return newErr } - return localVarReturnValue, nil + return nil } /* -ListVolumes: List all volumes inside a project. +RemoveNicFromServer: Detach a network interface. -Get a list of all volumes inside a project. +Detach a network interface from 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. - @return ApiListVolumesRequest + @param serverId The identifier (ID) of a STACKIT Server. + @param nicId The identifier (ID) of a network interface. + @return ApiRemoveNicFromServerRequest */ -func (a *APIClient) ListVolumes(ctx context.Context, projectId string) ApiListVolumesRequest { - return ApiListVolumesRequest{ +func (a *APIClient) RemoveNicFromServer(ctx context.Context, projectId string, serverId string, nicId string) ApiRemoveNicFromServerRequest { + return ApiRemoveNicFromServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + serverId: serverId, + nicId: nicId, } } -func (a *APIClient) ListVolumesExecute(ctx context.Context, projectId string) (*VolumeListResponse, error) { - r := ApiListVolumesRequest{ +func (a *APIClient) RemoveNicFromServerExecute(ctx context.Context, projectId string, serverId string, nicId string) error { + r := ApiRemoveNicFromServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + serverId: serverId, + nicId: nicId, } return r.Execute() } -type ApiRebootServerRequest struct { +type ApiRemovePublicIpFromServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string serverId string - action *string -} - -// Defines if it is a soft or a hard reboot. - -func (r ApiRebootServerRequest) Action(action string) ApiRebootServerRequest { - r.action = &action - return r + publicIpId string } -func (r ApiRebootServerRequest) Execute() error { +func (r ApiRemovePublicIpFromServerRequest) Execute() error { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RebootServer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RemovePublicIpFromServer") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/reboot" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}" 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, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(r.publicIpId, "publicIpId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -13014,10 +19342,13 @@ func (r ApiRebootServerRequest) Execute() error { if strlen(r.serverId) > 36 { return fmt.Errorf("serverId must have less than 36 elements") } - - if r.action != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "action", r.action, "") + 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") } + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -13139,95 +19470,86 @@ func (r ApiRebootServerRequest) Execute() error { } /* -RebootServer: Reboot the server. +RemovePublicIpFromServer: Dissociate a public IP from a server. -Reboot the server. A soft reboot will attempt to gracefully shut down the server by passing the command to the operating system. A hard reboot will power cycle the server without waiting for the operating system to shutdown properly. +Dissociate a public IP on an existing 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 serverId The identifier (ID) of a STACKIT Server. - @return ApiRebootServerRequest + @param publicIpId The identifier (ID) of a Public IP. + @return ApiRemovePublicIpFromServerRequest */ -func (a *APIClient) RebootServer(ctx context.Context, projectId string, serverId string) ApiRebootServerRequest { - return ApiRebootServerRequest{ +func (a *APIClient) RemovePublicIpFromServer(ctx context.Context, projectId string, serverId string, publicIpId string) ApiRemovePublicIpFromServerRequest { + return ApiRemovePublicIpFromServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, + publicIpId: publicIpId, } } -func (a *APIClient) RebootServerExecute(ctx context.Context, projectId string, serverId string) error { - r := ApiRebootServerRequest{ +func (a *APIClient) RemovePublicIpFromServerExecute(ctx context.Context, projectId string, serverId string, publicIpId string) error { + r := ApiRemovePublicIpFromServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, + publicIpId: publicIpId, } return r.Execute() } -type ApiRemoveMemberFromVirtualIPRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - networkId string - virtualIpId string - removeMemberFromVirtualIPPayload *RemoveMemberFromVirtualIPPayload -} - -// Request to remove a member from a virtual IP. - -func (r ApiRemoveMemberFromVirtualIPRequest) RemoveMemberFromVirtualIPPayload(removeMemberFromVirtualIPPayload RemoveMemberFromVirtualIPPayload) ApiRemoveMemberFromVirtualIPRequest { - r.removeMemberFromVirtualIPPayload = &removeMemberFromVirtualIPPayload - return r +type ApiRemoveSecurityGroupFromServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string + securityGroupId string } -func (r ApiRemoveMemberFromVirtualIPRequest) Execute() (*VirtualIp, error) { +func (r ApiRemoveSecurityGroupFromServerRequest) Execute() error { var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *VirtualIp + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RemoveMemberFromVirtualIP") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RemoveSecurityGroupFromServer") if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}/remove-member" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}" 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, "{"+"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{} localVarFormParams := url.Values{} if strlen(r.projectId) < 36 { - return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + return 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.networkId) < 36 { - return localVarReturnValue, fmt.Errorf("networkId must have at least 36 elements") + return fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.networkId) > 36 { - return localVarReturnValue, fmt.Errorf("networkId must have less than 36 elements") + if strlen(r.serverId) < 36 { + return fmt.Errorf("serverId must have at least 36 elements") } - if strlen(r.virtualIpId) < 36 { - return localVarReturnValue, fmt.Errorf("virtualIpId must have at least 36 elements") + if strlen(r.serverId) > 36 { + return fmt.Errorf("serverId must have less than 36 elements") } - if strlen(r.virtualIpId) > 36 { - return localVarReturnValue, fmt.Errorf("virtualIpId must have less than 36 elements") + if strlen(r.securityGroupId) < 36 { + return fmt.Errorf("securityGroupId must have at least 36 elements") } - if r.removeMemberFromVirtualIPPayload == nil { - return localVarReturnValue, fmt.Errorf("removeMemberFromVirtualIPPayload is required and must be specified") + if strlen(r.securityGroupId) > 36 { + return fmt.Errorf("securityGroupId must have less than 36 elements") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -13243,11 +19565,9 @@ func (r ApiRemoveMemberFromVirtualIPRequest) Execute() (*VirtualIp, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.removeMemberFromVirtualIPPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, err + return err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -13261,14 +19581,14 @@ func (r ApiRemoveMemberFromVirtualIPRequest) Execute() (*VirtualIp, error) { *contextHTTPResponse = localVarHTTPResponse } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err + return err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, err + return err } if localVarHTTPResponse.StatusCode >= 300 { @@ -13282,148 +19602,147 @@ func (r ApiRemoveMemberFromVirtualIPRequest) Execute() (*VirtualIp, error) { err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr } - if localVarHTTPResponse.StatusCode == 404 { + if localVarHTTPResponse.StatusCode == 409 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr + return newErr } - return localVarReturnValue, nil + return nil } /* -RemoveMemberFromVirtualIP: Remove a member from the virtual IP. +RemoveSecurityGroupFromServer: Remove a server from a security group. -Atomically remove a member from the virtual IP. +Remove a server from a attached 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 networkId The identifier (ID) of a STACKIT Network. - @param virtualIpId The identifier (ID) of a Virtual IP. - @return ApiRemoveMemberFromVirtualIPRequest + @param serverId The identifier (ID) of a STACKIT Server. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiRemoveSecurityGroupFromServerRequest */ -func (a *APIClient) RemoveMemberFromVirtualIP(ctx context.Context, projectId string, networkId string, virtualIpId string) ApiRemoveMemberFromVirtualIPRequest { - return ApiRemoveMemberFromVirtualIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - virtualIpId: virtualIpId, +func (a *APIClient) RemoveSecurityGroupFromServer(ctx context.Context, projectId string, serverId string, securityGroupId string) ApiRemoveSecurityGroupFromServerRequest { + return ApiRemoveSecurityGroupFromServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, + securityGroupId: securityGroupId, } } -func (a *APIClient) RemoveMemberFromVirtualIPExecute(ctx context.Context, projectId string, networkId string, virtualIpId string) (*VirtualIp, error) { - r := ApiRemoveMemberFromVirtualIPRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - networkId: networkId, - virtualIpId: virtualIpId, +func (a *APIClient) RemoveSecurityGroupFromServerExecute(ctx context.Context, projectId string, serverId string, securityGroupId string) error { + r := ApiRemoveSecurityGroupFromServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, + securityGroupId: securityGroupId, } return r.Execute() } -type ApiRemoveNetworkFromServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - networkId string +type ApiRemoveServiceAccountFromServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string + serviceAccountMail string } -func (r ApiRemoveNetworkFromServerRequest) Execute() error { +func (r ApiRemoveServiceAccountFromServerRequest) Execute() (*ServiceAccountMailListResponse, error) { var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServiceAccountMailListResponse ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RemoveNetworkFromServer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RemoveServiceAccountFromServer") if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/networks/{networkId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}" 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, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(r.networkId, "networkId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serviceAccountMail"+"}", url.PathEscape(ParameterValueToString(r.serviceAccountMail, "serviceAccountMail")), -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.serverId) < 36 { - return fmt.Errorf("serverId must have at least 36 elements") + return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") } if strlen(r.serverId) > 36 { - return fmt.Errorf("serverId must have less than 36 elements") - } - if strlen(r.networkId) < 36 { - return fmt.Errorf("networkId must have at least 36 elements") + return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") } - if strlen(r.networkId) > 36 { - return fmt.Errorf("networkId must have less than 36 elements") + if strlen(r.serviceAccountMail) > 255 { + return localVarReturnValue, fmt.Errorf("serviceAccountMail must have less than 255 elements") } // to determine the Content-Type header @@ -13445,7 +19764,7 @@ func (r ApiRemoveNetworkFromServerRequest) Execute() error { } 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) @@ -13459,14 +19778,14 @@ func (r ApiRemoveNetworkFromServerRequest) 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 { @@ -13480,117 +19799,138 @@ func (r ApiRemoveNetworkFromServerRequest) 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 + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return 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 } /* -RemoveNetworkFromServer: Detach and delete all network interfaces associated with the specified network. +RemoveServiceAccountFromServer: Detach a service account from a server. -Detach and delete all network interfaces associated with the specified network from the server. +Detach an additional service account from the 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 serverId The identifier (ID) of a STACKIT Server. - @param networkId The identifier (ID) of a STACKIT Network. - @return ApiRemoveNetworkFromServerRequest + @param serviceAccountMail The e-mail address of a service account. + @return ApiRemoveServiceAccountFromServerRequest */ -func (a *APIClient) RemoveNetworkFromServer(ctx context.Context, projectId string, serverId string, networkId string) ApiRemoveNetworkFromServerRequest { - return ApiRemoveNetworkFromServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - networkId: networkId, +func (a *APIClient) RemoveServiceAccountFromServer(ctx context.Context, projectId string, serverId string, serviceAccountMail string) ApiRemoveServiceAccountFromServerRequest { + return ApiRemoveServiceAccountFromServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, + serviceAccountMail: serviceAccountMail, } } -func (a *APIClient) RemoveNetworkFromServerExecute(ctx context.Context, projectId string, serverId string, networkId string) error { - r := ApiRemoveNetworkFromServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - networkId: networkId, +func (a *APIClient) RemoveServiceAccountFromServerExecute(ctx context.Context, projectId string, serverId string, serviceAccountMail string) (*ServiceAccountMailListResponse, error) { + r := ApiRemoveServiceAccountFromServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, + serviceAccountMail: serviceAccountMail, } return r.Execute() } -type ApiRemoveNicFromServerRequest struct { +type ApiRemoveVolumeFromServerRequest struct { ctx context.Context apiService *DefaultApiService projectId string serverId string - nicId string + volumeId string } -func (r ApiRemoveNicFromServerRequest) Execute() error { +func (r ApiRemoveVolumeFromServerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RemoveNicFromServer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RemoveVolumeFromServer") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/nics/{nicId}" + 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, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(r.nicId, "nicId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(r.volumeId, "volumeId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -13607,11 +19947,11 @@ func (r ApiRemoveNicFromServerRequest) Execute() error { if strlen(r.serverId) > 36 { return fmt.Errorf("serverId must have less than 36 elements") } - if strlen(r.nicId) < 36 { - return fmt.Errorf("nicId must have at least 36 elements") + if strlen(r.volumeId) < 36 { + return fmt.Errorf("volumeId must have at least 36 elements") } - if strlen(r.nicId) > 36 { - return fmt.Errorf("nicId must have less than 36 elements") + if strlen(r.volumeId) > 36 { + return fmt.Errorf("volumeId must have less than 36 elements") } // to determine the Content-Type header @@ -13707,6 +20047,17 @@ func (r ApiRemoveNicFromServerRequest) 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")) @@ -13724,61 +20075,67 @@ func (r ApiRemoveNicFromServerRequest) Execute() error { } /* -RemoveNicFromServer: Detach a network interface. +RemoveVolumeFromServer: Detach a volume from a server. -Detach a network interface from a server. +Detach an existing volume from an existing 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 serverId The identifier (ID) of a STACKIT Server. - @param nicId The identifier (ID) of a network interface. - @return ApiRemoveNicFromServerRequest + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiRemoveVolumeFromServerRequest */ -func (a *APIClient) RemoveNicFromServer(ctx context.Context, projectId string, serverId string, nicId string) ApiRemoveNicFromServerRequest { - return ApiRemoveNicFromServerRequest{ +func (a *APIClient) RemoveVolumeFromServer(ctx context.Context, projectId string, serverId string, volumeId string) ApiRemoveVolumeFromServerRequest { + return ApiRemoveVolumeFromServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, - nicId: nicId, + volumeId: volumeId, } } -func (a *APIClient) RemoveNicFromServerExecute(ctx context.Context, projectId string, serverId string, nicId string) error { - r := ApiRemoveNicFromServerRequest{ +func (a *APIClient) RemoveVolumeFromServerExecute(ctx context.Context, projectId string, serverId string, volumeId string) error { + r := ApiRemoveVolumeFromServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, - nicId: nicId, + volumeId: volumeId, } return r.Execute() } -type ApiRemovePublicIpFromServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - publicIpId string +type ApiRescueServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string + rescueServerPayload *RescueServerPayload +} + +// Request a server rescue. + +func (r ApiRescueServerRequest) RescueServerPayload(rescueServerPayload RescueServerPayload) ApiRescueServerRequest { + r.rescueServerPayload = &rescueServerPayload + return r } -func (r ApiRemovePublicIpFromServerRequest) Execute() error { +func (r ApiRescueServerRequest) Execute() error { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RemovePublicIpFromServer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RescueServer") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/rescue" 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, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(r.publicIpId, "publicIpId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -13795,15 +20152,12 @@ func (r ApiRemovePublicIpFromServerRequest) Execute() error { if strlen(r.serverId) > 36 { return fmt.Errorf("serverId 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 r.rescueServerPayload == nil { + return fmt.Errorf("rescueServerPayload is required and must be specified") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -13819,6 +20173,8 @@ func (r ApiRemovePublicIpFromServerRequest) Execute() error { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.rescueServerPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return err @@ -13923,61 +20279,64 @@ func (r ApiRemovePublicIpFromServerRequest) Execute() error { } /* -RemovePublicIpFromServer: Dissociate a public IP from a server. +RescueServer: Rescue an existing server. -Dissociate a public IP on an existing server. +Rescue an existing server. It is shutdown and the initial image is attached as the boot volume, while the boot volume is attached as secondary volume and the server is booted. @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 publicIpId The identifier (ID) of a Public IP. - @return ApiRemovePublicIpFromServerRequest + @return ApiRescueServerRequest */ -func (a *APIClient) RemovePublicIpFromServer(ctx context.Context, projectId string, serverId string, publicIpId string) ApiRemovePublicIpFromServerRequest { - return ApiRemovePublicIpFromServerRequest{ +func (a *APIClient) RescueServer(ctx context.Context, projectId string, serverId string) ApiRescueServerRequest { + return ApiRescueServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, - publicIpId: publicIpId, } } -func (a *APIClient) RemovePublicIpFromServerExecute(ctx context.Context, projectId string, serverId string, publicIpId string) error { - r := ApiRemovePublicIpFromServerRequest{ +func (a *APIClient) RescueServerExecute(ctx context.Context, projectId string, serverId string) error { + r := ApiRescueServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, - publicIpId: publicIpId, } return r.Execute() } -type ApiRemoveSecurityGroupFromServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - securityGroupId string +type ApiResizeServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string + resizeServerPayload *ResizeServerPayload } -func (r ApiRemoveSecurityGroupFromServerRequest) Execute() error { +// Request a resize of a server. + +func (r ApiResizeServerRequest) ResizeServerPayload(resizeServerPayload ResizeServerPayload) ApiResizeServerRequest { + r.resizeServerPayload = &resizeServerPayload + return r +} + +func (r ApiResizeServerRequest) Execute() error { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RemoveSecurityGroupFromServer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ResizeServer") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/resize" 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{} @@ -13994,15 +20353,12 @@ func (r ApiRemoveSecurityGroupFromServerRequest) Execute() error { 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 at least 36 elements") - } - if strlen(r.securityGroupId) > 36 { - return fmt.Errorf("securityGroupId must have less than 36 elements") + if r.resizeServerPayload == nil { + return fmt.Errorf("resizeServerPayload is required and must be specified") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -14018,6 +20374,8 @@ func (r ApiRemoveSecurityGroupFromServerRequest) Execute() error { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.resizeServerPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return err @@ -14122,84 +20480,83 @@ func (r ApiRemoveSecurityGroupFromServerRequest) Execute() error { } /* -RemoveSecurityGroupFromServer: Remove a server from a security group. +ResizeServer: Resize a server. -Remove a server from a attached security group. +Resize the server to the given machine type. @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 securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiRemoveSecurityGroupFromServerRequest + @return ApiResizeServerRequest */ -func (a *APIClient) RemoveSecurityGroupFromServer(ctx context.Context, projectId string, serverId string, securityGroupId string) ApiRemoveSecurityGroupFromServerRequest { - return ApiRemoveSecurityGroupFromServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - securityGroupId: securityGroupId, +func (a *APIClient) ResizeServer(ctx context.Context, projectId string, serverId string) ApiResizeServerRequest { + return ApiResizeServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, } } -func (a *APIClient) RemoveSecurityGroupFromServerExecute(ctx context.Context, projectId string, serverId string, securityGroupId string) error { - r := ApiRemoveSecurityGroupFromServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - securityGroupId: securityGroupId, +func (a *APIClient) ResizeServerExecute(ctx context.Context, projectId string, serverId string) error { + r := ApiResizeServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, } return r.Execute() } -type ApiRemoveServiceAccountFromServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - serviceAccountMail string +type ApiResizeVolumeRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + volumeId string + resizeVolumePayload *ResizeVolumePayload } -func (r ApiRemoveServiceAccountFromServerRequest) Execute() (*ServiceAccountMailListResponse, error) { +// Request a volume resize. + +func (r ApiResizeVolumeRequest) ResizeVolumePayload(resizeVolumePayload ResizeVolumePayload) ApiResizeVolumeRequest { + r.resizeVolumePayload = &resizeVolumePayload + return r +} + +func (r ApiResizeVolumeRequest) Execute() error { var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ServiceAccountMailListResponse + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RemoveServiceAccountFromServer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ResizeVolume") if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes/{volumeId}/resize" 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, "{"+"serviceAccountMail"+"}", url.PathEscape(ParameterValueToString(r.serviceAccountMail, "serviceAccountMail")), -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") + return 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") + return fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.serverId) > 36 { - return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") + if strlen(r.volumeId) < 36 { + return fmt.Errorf("volumeId must have at least 36 elements") } - if strlen(r.serviceAccountMail) > 255 { - return localVarReturnValue, fmt.Errorf("serviceAccountMail must have less than 255 elements") + if strlen(r.volumeId) > 36 { + return fmt.Errorf("volumeId must have less than 36 elements") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -14215,9 +20572,11 @@ func (r ApiRemoveServiceAccountFromServerRequest) Execute() (*ServiceAccountMail 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 localVarReturnValue, err + return err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -14231,14 +20590,14 @@ func (r ApiRemoveServiceAccountFromServerRequest) Execute() (*ServiceAccountMail *contextHTTPResponse = localVarHTTPResponse } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err + return err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, err + return err } if localVarHTTPResponse.StatusCode >= 300 { @@ -14252,138 +20611,123 @@ func (r ApiRemoveServiceAccountFromServerRequest) Execute() (*ServiceAccountMail err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 404 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 409 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, newErr + return newErr } - return localVarReturnValue, nil + return nil } /* -RemoveServiceAccountFromServer: Detach a service account from a server. +ResizeVolume: Update the size of a volume. -Detach an additional service account from the server. +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 serverId The identifier (ID) of a STACKIT Server. - @param serviceAccountMail The e-mail address of a service account. - @return ApiRemoveServiceAccountFromServerRequest + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiResizeVolumeRequest */ -func (a *APIClient) RemoveServiceAccountFromServer(ctx context.Context, projectId string, serverId string, serviceAccountMail string) ApiRemoveServiceAccountFromServerRequest { - return ApiRemoveServiceAccountFromServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - serviceAccountMail: serviceAccountMail, +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) RemoveServiceAccountFromServerExecute(ctx context.Context, projectId string, serverId string, serviceAccountMail string) (*ServiceAccountMailListResponse, error) { - r := ApiRemoveServiceAccountFromServerRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - serverId: serverId, - serviceAccountMail: serviceAccountMail, +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 ApiRemoveVolumeFromServerRequest struct { +type ApiRestoreBackupRequest struct { ctx context.Context apiService *DefaultApiService projectId string - serverId string - volumeId string + backupId string } -func (r ApiRemoveVolumeFromServerRequest) Execute() error { +func (r ApiRestoreBackupRequest) Execute() error { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RemoveVolumeFromServer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RestoreBackup") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/backups/{backupId}/restore" 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, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -14394,17 +20738,11 @@ func (r ApiRemoveVolumeFromServerRequest) 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.serverId) > 36 { - return fmt.Errorf("serverId must have less than 36 elements") - } - if strlen(r.volumeId) < 36 { - return fmt.Errorf("volumeId must have at least 36 elements") + if strlen(r.backupId) < 36 { + return fmt.Errorf("backupId must have at least 36 elements") } - if strlen(r.volumeId) > 36 { - return fmt.Errorf("volumeId must have less than 36 elements") + if strlen(r.backupId) > 36 { + return fmt.Errorf("backupId must have less than 36 elements") } // to determine the Content-Type header @@ -14500,17 +20838,6 @@ func (r ApiRemoveVolumeFromServerRequest) 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")) @@ -14528,85 +20855,83 @@ func (r ApiRemoveVolumeFromServerRequest) Execute() error { } /* -RemoveVolumeFromServer: Detach a volume from a server. +RestoreBackup: Restore Backup to the referenced source Volume. -Detach an existing volume from an existing server. +Restores a Backup to the existing Volume it references to. The use of this endpoint is disruptive as the volume needs to be detached. If a new volume is to be created use the volumes endpoint with the option to create from backup. @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 ApiRemoveVolumeFromServerRequest + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiRestoreBackupRequest */ -func (a *APIClient) RemoveVolumeFromServer(ctx context.Context, projectId string, serverId string, volumeId string) ApiRemoveVolumeFromServerRequest { - return ApiRemoveVolumeFromServerRequest{ +func (a *APIClient) RestoreBackup(ctx context.Context, projectId string, backupId string) ApiRestoreBackupRequest { + return ApiRestoreBackupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, - volumeId: volumeId, + backupId: backupId, } } -func (a *APIClient) RemoveVolumeFromServerExecute(ctx context.Context, projectId string, serverId string, volumeId string) error { - r := ApiRemoveVolumeFromServerRequest{ +func (a *APIClient) RestoreBackupExecute(ctx context.Context, projectId string, backupId string) error { + r := ApiRestoreBackupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, - volumeId: volumeId, + backupId: backupId, } return r.Execute() } -type ApiRescueServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - rescueServerPayload *RescueServerPayload +type ApiSetImageShareRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + imageId string + setImageSharePayload *SetImageSharePayload } -// Request a server rescue. +// Settings for an Image Share. -func (r ApiRescueServerRequest) RescueServerPayload(rescueServerPayload RescueServerPayload) ApiRescueServerRequest { - r.rescueServerPayload = &rescueServerPayload +func (r ApiSetImageShareRequest) SetImageSharePayload(setImageSharePayload SetImageSharePayload) ApiSetImageShareRequest { + r.setImageSharePayload = &setImageSharePayload return r } -func (r ApiRescueServerRequest) Execute() error { +func (r ApiSetImageShareRequest) Execute() (*ImageShare, error) { var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageShare ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RescueServer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.SetImageShare") if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/rescue" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images/{imageId}/share" 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, "{"+"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.serverId) < 36 { - return fmt.Errorf("serverId 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.serverId) > 36 { - return fmt.Errorf("serverId must have less than 36 elements") + if strlen(r.imageId) > 36 { + return localVarReturnValue, fmt.Errorf("imageId must have less than 36 elements") } - if r.rescueServerPayload == nil { - return fmt.Errorf("rescueServerPayload is required and must be specified") + if r.setImageSharePayload == nil { + return localVarReturnValue, fmt.Errorf("setImageSharePayload is required and must be specified") } // to determine the Content-Type header @@ -14627,10 +20952,10 @@ func (r ApiRescueServerRequest) Execute() error { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.rescueServerPayload + 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) @@ -14644,14 +20969,14 @@ func (r ApiRescueServerRequest) 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 { @@ -14665,129 +20990,120 @@ func (r ApiRescueServerRequest) 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 } /* -RescueServer: Rescue an existing server. +SetImageShare: Set image share. -Rescue an existing server. It is shutdown and the initial image is attached as the boot volume, while the boot volume is attached as secondary volume and the server is booted. +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 serverId The identifier (ID) of a STACKIT Server. - @return ApiRescueServerRequest + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiSetImageShareRequest */ -func (a *APIClient) RescueServer(ctx context.Context, projectId string, serverId string) ApiRescueServerRequest { - return ApiRescueServerRequest{ +func (a *APIClient) SetImageShare(ctx context.Context, projectId string, imageId string) ApiSetImageShareRequest { + return ApiSetImageShareRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + imageId: imageId, } } -func (a *APIClient) RescueServerExecute(ctx context.Context, projectId string, serverId string) error { - r := ApiRescueServerRequest{ +func (a *APIClient) SetImageShareExecute(ctx context.Context, projectId string, imageId string) (*ImageShare, error) { + r := ApiSetImageShareRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + imageId: imageId, } return r.Execute() } -type ApiResizeServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - resizeServerPayload *ResizeServerPayload -} - -// Request a resize of a server. - -func (r ApiResizeServerRequest) ResizeServerPayload(resizeServerPayload ResizeServerPayload) ApiResizeServerRequest { - r.resizeServerPayload = &resizeServerPayload - return r +type ApiStartServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string } -func (r ApiResizeServerRequest) Execute() error { +func (r ApiStartServerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ResizeServer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.StartServer") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/resize" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/start" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) @@ -14806,12 +21122,9 @@ func (r ApiResizeServerRequest) Execute() error { if strlen(r.serverId) > 36 { return fmt.Errorf("serverId must have less than 36 elements") } - if r.resizeServerPayload == nil { - return fmt.Errorf("resizeServerPayload is required and must be specified") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -14827,8 +21140,6 @@ func (r ApiResizeServerRequest) Execute() error { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.resizeServerPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return err @@ -14933,17 +21244,17 @@ func (r ApiResizeServerRequest) Execute() error { } /* -ResizeServer: Resize a server. +StartServer: Boot up a server. -Resize the server to the given machine type. +Start an existing server or allocates the server if deallocated. @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 ApiResizeServerRequest + @return ApiStartServerRequest */ -func (a *APIClient) ResizeServer(ctx context.Context, projectId string, serverId string) ApiResizeServerRequest { - return ApiResizeServerRequest{ +func (a *APIClient) StartServer(ctx context.Context, projectId string, serverId string) ApiStartServerRequest { + return ApiStartServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -14951,8 +21262,8 @@ func (a *APIClient) ResizeServer(ctx context.Context, projectId string, serverId } } -func (a *APIClient) ResizeServerExecute(ctx context.Context, projectId string, serverId string) error { - r := ApiResizeServerRequest{ +func (a *APIClient) StartServerExecute(ctx context.Context, projectId string, serverId string) error { + r := ApiStartServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -14961,36 +21272,28 @@ func (a *APIClient) ResizeServerExecute(ctx context.Context, projectId string, s return r.Execute() } -type ApiResizeVolumeRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - volumeId string - resizeVolumePayload *ResizeVolumePayload -} - -// Request a volume resize. - -func (r ApiResizeVolumeRequest) ResizeVolumePayload(resizeVolumePayload ResizeVolumePayload) ApiResizeVolumeRequest { - r.resizeVolumePayload = &resizeVolumePayload - return r +type ApiStopServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string } -func (r ApiResizeVolumeRequest) Execute() error { +func (r ApiStopServerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ResizeVolume") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.StopServer") if err != nil { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/volumes/{volumeId}/resize" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/stop" 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{} @@ -15001,15 +21304,15 @@ func (r ApiResizeVolumeRequest) 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 - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -15025,8 +21328,6 @@ func (r ApiResizeVolumeRequest) Execute() error { 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 @@ -15131,87 +21432,75 @@ func (r ApiResizeVolumeRequest) Execute() error { } /* -ResizeVolume: Update the size of a volume. +StopServer: Stop an existing server. -Update the size of a block device volume. The new volume size must be larger than the current size. +Stops an existing server. The server will remain on the Hypervisor and will be charged full price for all resources attached to it. The attached resources will remain reserved. Useful particularly for vGPU servers. @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 serverId The identifier (ID) of a STACKIT Server. + @return ApiStopServerRequest */ -func (a *APIClient) ResizeVolume(ctx context.Context, projectId string, volumeId string) ApiResizeVolumeRequest { - return ApiResizeVolumeRequest{ +func (a *APIClient) StopServer(ctx context.Context, projectId string, serverId string) ApiStopServerRequest { + return ApiStopServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - volumeId: volumeId, + serverId: serverId, } } - -func (a *APIClient) ResizeVolumeExecute(ctx context.Context, projectId string, volumeId string) error { - r := ApiResizeVolumeRequest{ + +func (a *APIClient) StopServerExecute(ctx context.Context, projectId string, serverId string) error { + r := ApiStopServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - volumeId: volumeId, + serverId: serverId, } 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 +type ApiUnrescueServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string } -func (r ApiSetImageShareRequest) Execute() (*ImageShare, error) { +func (r ApiUnrescueServerRequest) Execute() error { var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ImageShare + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.SetImageShare") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UnrescueServer") if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images/{imageId}/share" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/unrescue" 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, "{"+"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") + return 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") + return fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.imageId) > 36 { - return localVarReturnValue, fmt.Errorf("imageId must have less than 36 elements") + if strlen(r.serverId) < 36 { + return fmt.Errorf("serverId must have at least 36 elements") } - if r.setImageSharePayload == nil { - return localVarReturnValue, fmt.Errorf("setImageSharePayload is required and must be specified") + if strlen(r.serverId) > 36 { + return fmt.Errorf("serverId must have less than 36 elements") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -15227,11 +21516,9 @@ func (r ApiSetImageShareRequest) Execute() (*ImageShare, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.setImageSharePayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, err + return err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -15245,14 +21532,14 @@ func (r ApiSetImageShareRequest) Execute() (*ImageShare, error) { *contextHTTPResponse = localVarHTTPResponse } if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err + return err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, err + return err } if localVarHTTPResponse.StatusCode >= 300 { @@ -15266,141 +21553,162 @@ func (r ApiSetImageShareRequest) Execute() (*ImageShare, error) { err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } if localVarHTTPResponse.StatusCode == 404 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return localVarReturnValue, newErr + return newErr } - if localVarHTTPResponse.StatusCode == 500 { + if localVarHTTPResponse.StatusCode == 409 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr + return newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return newErr } - return localVarReturnValue, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: err.Error(), + 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 localVarReturnValue, newErr + return newErr } - return localVarReturnValue, nil + return nil } /* -SetImageShare: Set image share. +UnrescueServer: Unrescue an existing server. -Set share of an Image. New Options will replace existing settings. +Unrescue an existing server. The original boot volume is attached as boot volume of the server and the server is booted up. @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 ApiSetImageShareRequest + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiUnrescueServerRequest */ -func (a *APIClient) SetImageShare(ctx context.Context, projectId string, imageId string) ApiSetImageShareRequest { - return ApiSetImageShareRequest{ +func (a *APIClient) UnrescueServer(ctx context.Context, projectId string, serverId string) ApiUnrescueServerRequest { + return ApiUnrescueServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - imageId: imageId, + serverId: serverId, } } -func (a *APIClient) SetImageShareExecute(ctx context.Context, projectId string, imageId string) (*ImageShare, error) { - r := ApiSetImageShareRequest{ +func (a *APIClient) UnrescueServerExecute(ctx context.Context, projectId string, serverId string) error { + r := ApiUnrescueServerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - imageId: imageId, + serverId: serverId, } return r.Execute() } -type ApiStartServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string +type ApiUpdateAttachedVolumeRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string + volumeId string + updateAttachedVolumePayload *UpdateAttachedVolumePayload } -func (r ApiStartServerRequest) Execute() error { +// Request a volume attachment update. + +func (r ApiUpdateAttachedVolumeRequest) UpdateAttachedVolumePayload(updateAttachedVolumePayload UpdateAttachedVolumePayload) ApiUpdateAttachedVolumeRequest { + r.updateAttachedVolumePayload = &updateAttachedVolumePayload + return r +} + +func (r ApiUpdateAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumeAttachment ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.StartServer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateAttachedVolume") if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/start" + 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 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.serverId) < 36 { - return fmt.Errorf("serverId must have at least 36 elements") + return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") } if strlen(r.serverId) > 36 { - return fmt.Errorf("serverId must have less than 36 elements") + 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") + } + if r.updateAttachedVolumePayload == nil { + return localVarReturnValue, fmt.Errorf("updateAttachedVolumePayload is required and must be specified") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -15416,9 +21724,11 @@ func (r ApiStartServerRequest) Execute() error { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.updateAttachedVolumePayload 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) @@ -15432,14 +21742,14 @@ func (r ApiStartServerRequest) 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 { @@ -15453,142 +21763,156 @@ func (r ApiStartServerRequest) 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 } /* -StartServer: Boot up a server. +UpdateAttachedVolume: Update Volume Attachment Parameters. -Start an existing server or allocates the server if deallocated. +Update the properties 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. - @return ApiStartServerRequest + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiUpdateAttachedVolumeRequest */ -func (a *APIClient) StartServer(ctx context.Context, projectId string, serverId string) ApiStartServerRequest { - return ApiStartServerRequest{ +func (a *APIClient) UpdateAttachedVolume(ctx context.Context, projectId string, serverId string, volumeId string) ApiUpdateAttachedVolumeRequest { + return ApiUpdateAttachedVolumeRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, + volumeId: volumeId, } } -func (a *APIClient) StartServerExecute(ctx context.Context, projectId string, serverId string) error { - r := ApiStartServerRequest{ +func (a *APIClient) UpdateAttachedVolumeExecute(ctx context.Context, projectId string, serverId string, volumeId string) (*VolumeAttachment, error) { + r := ApiUpdateAttachedVolumeRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, serverId: serverId, + volumeId: volumeId, } return r.Execute() } -type ApiStopServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string +type ApiUpdateBackupRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + backupId string + updateBackupPayload *UpdateBackupPayload +} + +// Request an update of a backup. + +func (r ApiUpdateBackupRequest) UpdateBackupPayload(updateBackupPayload UpdateBackupPayload) ApiUpdateBackupRequest { + r.updateBackupPayload = &updateBackupPayload + return r } -func (r ApiStopServerRequest) Execute() error { +func (r ApiUpdateBackupRequest) Execute() (*Backup, error) { var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Backup ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.StopServer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateBackup") if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/stop" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/backups/{backupId}" 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, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -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.serverId) < 36 { - return fmt.Errorf("serverId must have at least 36 elements") + if strlen(r.backupId) < 36 { + return localVarReturnValue, fmt.Errorf("backupId must have at least 36 elements") } - if strlen(r.serverId) > 36 { - return fmt.Errorf("serverId must have less than 36 elements") + if strlen(r.backupId) > 36 { + return localVarReturnValue, fmt.Errorf("backupId must have less than 36 elements") + } + if r.updateBackupPayload == nil { + return localVarReturnValue, fmt.Errorf("updateBackupPayload is required and must be specified") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -15604,9 +21928,11 @@ func (r ApiStopServerRequest) Execute() error { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.updateBackupPayload 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) @@ -15620,14 +21946,14 @@ func (r ApiStopServerRequest) 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 { @@ -15641,142 +21967,153 @@ func (r ApiStopServerRequest) 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 } /* -StopServer: Stop an existing server. +UpdateBackup: Update information of a backup. -Stops an existing server. The server will remain on the Hypervisor and will be charged full price for all resources attached to it. The attached resources will remain reserved. Useful particularly for vGPU servers. +Update name or labels of the backup. @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 ApiStopServerRequest + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiUpdateBackupRequest */ -func (a *APIClient) StopServer(ctx context.Context, projectId string, serverId string) ApiStopServerRequest { - return ApiStopServerRequest{ +func (a *APIClient) UpdateBackup(ctx context.Context, projectId string, backupId string) ApiUpdateBackupRequest { + return ApiUpdateBackupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + backupId: backupId, } } -func (a *APIClient) StopServerExecute(ctx context.Context, projectId string, serverId string) error { - r := ApiStopServerRequest{ +func (a *APIClient) UpdateBackupExecute(ctx context.Context, projectId string, backupId string) (*Backup, error) { + r := ApiUpdateBackupRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + backupId: backupId, } return r.Execute() } -type ApiUnrescueServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string +type ApiUpdateImageRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + imageId string + updateImagePayload *UpdateImagePayload } -func (r ApiUnrescueServerRequest) Execute() error { +// Request an update of an Image. + +func (r ApiUpdateImageRequest) UpdateImagePayload(updateImagePayload UpdateImagePayload) ApiUpdateImageRequest { + r.updateImagePayload = &updateImagePayload + return r +} + +func (r ApiUpdateImageRequest) Execute() (*Image, error) { var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Image ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UnrescueServer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateImage") if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}/unrescue" + 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, "{"+"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.serverId) < 36 { - return fmt.Errorf("serverId 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.serverId) > 36 { - return fmt.Errorf("serverId must have less than 36 elements") + if strlen(r.imageId) > 36 { + return localVarReturnValue, fmt.Errorf("imageId must have less than 36 elements") + } + if r.updateImagePayload == nil { + return localVarReturnValue, fmt.Errorf("updateImagePayload is required and must be specified") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -15792,9 +22129,11 @@ func (r ApiUnrescueServerRequest) Execute() error { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.updateImagePayload 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) @@ -15808,14 +22147,14 @@ func (r ApiUnrescueServerRequest) 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 { @@ -15829,134 +22168,123 @@ func (r ApiUnrescueServerRequest) 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 } /* -UnrescueServer: Unrescue an existing server. +UpdateImage: Update Image Parameters. -Unrescue an existing server. The original boot volume is attached as boot volume of the server and the server is booted up. +Update the properties of an existing 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 serverId The identifier (ID) of a STACKIT Server. - @return ApiUnrescueServerRequest + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiUpdateImageRequest */ -func (a *APIClient) UnrescueServer(ctx context.Context, projectId string, serverId string) ApiUnrescueServerRequest { - return ApiUnrescueServerRequest{ +func (a *APIClient) UpdateImage(ctx context.Context, projectId string, imageId string) ApiUpdateImageRequest { + return ApiUpdateImageRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + imageId: imageId, } } -func (a *APIClient) UnrescueServerExecute(ctx context.Context, projectId string, serverId string) error { - r := ApiUnrescueServerRequest{ +func (a *APIClient) UpdateImageExecute(ctx context.Context, projectId string, imageId string) (*Image, error) { + r := ApiUpdateImageRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + imageId: imageId, } return r.Execute() } -type ApiUpdateAttachedVolumeRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - volumeId string - updateAttachedVolumePayload *UpdateAttachedVolumePayload -} - -// Request a volume attachment update. - -func (r ApiUpdateAttachedVolumeRequest) UpdateAttachedVolumePayload(updateAttachedVolumePayload UpdateAttachedVolumePayload) ApiUpdateAttachedVolumeRequest { - r.updateAttachedVolumePayload = &updateAttachedVolumePayload - return r +type ApiUpdateImageScopeLocalRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + imageId string } -func (r ApiUpdateAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { +func (r ApiUpdateImageScopeLocalRequest) Execute() (*Image, error) { var ( - localVarHTTPMethod = http.MethodPatch + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile - localVarReturnValue *VolumeAttachment + localVarReturnValue *Image ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateAttachedVolume") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateImageScopeLocal") 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}/publish" 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{} @@ -15967,24 +22295,15 @@ func (r ApiUpdateAttachedVolumeRequest) 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.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 at least 36 elements") } - if r.updateAttachedVolumePayload == nil { - return localVarReturnValue, fmt.Errorf("updateAttachedVolumePayload is required and must be specified") + if strlen(r.imageId) > 36 { + return localVarReturnValue, fmt.Errorf("imageId must have less than 36 elements") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -16000,8 +22319,6 @@ func (r ApiUpdateAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.updateAttachedVolumePayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -16105,66 +22422,55 @@ func (r ApiUpdateAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { } /* -UpdateAttachedVolume: Update Volume Attachment Parameters. +UpdateImageScopeLocal: Update Image Scope to Local. -Update the properties of an existing Volume Attachment. +Update the scope property of an existing Image inside a project to local. @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 ApiUpdateAttachedVolumeRequest + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiUpdateImageScopeLocalRequest */ -func (a *APIClient) UpdateAttachedVolume(ctx context.Context, projectId string, serverId string, volumeId string) ApiUpdateAttachedVolumeRequest { - return ApiUpdateAttachedVolumeRequest{ +func (a *APIClient) UpdateImageScopeLocal(ctx context.Context, projectId string, imageId string) ApiUpdateImageScopeLocalRequest { + return ApiUpdateImageScopeLocalRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, - volumeId: volumeId, + imageId: imageId, } } -func (a *APIClient) UpdateAttachedVolumeExecute(ctx context.Context, projectId string, serverId string, volumeId string) (*VolumeAttachment, error) { - r := ApiUpdateAttachedVolumeRequest{ +func (a *APIClient) UpdateImageScopeLocalExecute(ctx context.Context, projectId string, imageId string) (*Image, error) { + r := ApiUpdateImageScopeLocalRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, - volumeId: volumeId, + imageId: imageId, } return r.Execute() } -type ApiUpdateImageRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - imageId string - updateImagePayload *UpdateImagePayload -} - -// Request an update of an Image. - -func (r ApiUpdateImageRequest) UpdateImagePayload(updateImagePayload UpdateImagePayload) ApiUpdateImageRequest { - r.updateImagePayload = &updateImagePayload - return r +type ApiUpdateImageScopePublicRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + imageId string } -func (r ApiUpdateImageRequest) Execute() (*Image, error) { +func (r ApiUpdateImageScopePublicRequest) Execute() (*Image, error) { var ( - localVarHTTPMethod = http.MethodPatch + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile localVarReturnValue *Image ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateImage") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateImageScopePublic") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images/{imageId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/images/{imageId}/publish" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(r.imageId, "imageId")), -1) @@ -16183,12 +22489,9 @@ func (r ApiUpdateImageRequest) Execute() (*Image, error) { if strlen(r.imageId) > 36 { return localVarReturnValue, fmt.Errorf("imageId must have less than 36 elements") } - if r.updateImagePayload == nil { - return localVarReturnValue, fmt.Errorf("updateImagePayload is required and must be specified") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -16204,8 +22507,6 @@ func (r ApiUpdateImageRequest) Execute() (*Image, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.updateImagePayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -16309,17 +22610,17 @@ func (r ApiUpdateImageRequest) Execute() (*Image, error) { } /* -UpdateImage: Update Image Parameters. +UpdateImageScopePublic: Update Image Scope to Public. -Update the properties of an existing Image inside a project. +Update the scope property of an existing Image inside a project to public. @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 ApiUpdateImageRequest + @return ApiUpdateImageScopePublicRequest */ -func (a *APIClient) UpdateImage(ctx context.Context, projectId string, imageId string) ApiUpdateImageRequest { - return ApiUpdateImageRequest{ +func (a *APIClient) UpdateImageScopePublic(ctx context.Context, projectId string, imageId string) ApiUpdateImageScopePublicRequest { + return ApiUpdateImageScopePublicRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -16327,8 +22628,8 @@ func (a *APIClient) UpdateImage(ctx context.Context, projectId string, imageId s } } -func (a *APIClient) UpdateImageExecute(ctx context.Context, projectId string, imageId string) (*Image, error) { - r := ApiUpdateImageRequest{ +func (a *APIClient) UpdateImageScopePublicExecute(ctx context.Context, projectId string, imageId string) (*Image, error) { + r := ApiUpdateImageScopePublicRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -17196,8 +23497,209 @@ func (r ApiUpdateSecurityGroupRequest) Execute() (*SecurityGroup, error) { if strlen(r.securityGroupId) > 36 { return localVarReturnValue, fmt.Errorf("securityGroupId must have less than 36 elements") } - if r.updateSecurityGroupPayload == nil { - return localVarReturnValue, fmt.Errorf("updateSecurityGroupPayload is required and must be specified") + if r.updateSecurityGroupPayload == nil { + return localVarReturnValue, fmt.Errorf("updateSecurityGroupPayload 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.updateSecurityGroupPayload + 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 +} + +/* +UpdateSecurityGroup: Update information of a security group. + +Update labels of the 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 securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiUpdateSecurityGroupRequest +*/ +func (a *APIClient) UpdateSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiUpdateSecurityGroupRequest { + return ApiUpdateSecurityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + } +} + +func (a *APIClient) UpdateSecurityGroupExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroup, error) { + r := ApiUpdateSecurityGroupRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + } + return r.Execute() +} + +type ApiUpdateServerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + serverId string + updateServerPayload *UpdateServerPayload +} + +// Request an update of a server. + +func (r ApiUpdateServerRequest) UpdateServerPayload(updateServerPayload UpdateServerPayload) ApiUpdateServerRequest { + r.updateServerPayload = &updateServerPayload + return r +} + +func (r ApiUpdateServerRequest) Execute() (*Server, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Server + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateServer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, fmt.Errorf("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, fmt.Errorf("serverId must have less than 36 elements") + } + if r.updateServerPayload == nil { + return localVarReturnValue, fmt.Errorf("updateServerPayload is required and must be specified") } // to determine the Content-Type header @@ -17218,7 +23720,7 @@ func (r ApiUpdateSecurityGroupRequest) Execute() (*SecurityGroup, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateSecurityGroupPayload + localVarPostBody = r.updateServerPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -17322,65 +23824,65 @@ func (r ApiUpdateSecurityGroupRequest) Execute() (*SecurityGroup, error) { } /* -UpdateSecurityGroup: Update information of a security group. +UpdateServer: Update information of a server. -Update labels of the security group. +Update name or labels of the 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 securityGroupId The identifier (ID) of a STACKIT Security Group. - @return ApiUpdateSecurityGroupRequest + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiUpdateServerRequest */ -func (a *APIClient) UpdateSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiUpdateSecurityGroupRequest { - return ApiUpdateSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) UpdateServer(ctx context.Context, projectId string, serverId string) ApiUpdateServerRequest { + return ApiUpdateServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, } } -func (a *APIClient) UpdateSecurityGroupExecute(ctx context.Context, projectId string, securityGroupId string) (*SecurityGroup, error) { - r := ApiUpdateSecurityGroupRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - securityGroupId: securityGroupId, +func (a *APIClient) UpdateServerExecute(ctx context.Context, projectId string, serverId string) (*Server, error) { + r := ApiUpdateServerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + serverId: serverId, } return r.Execute() } -type ApiUpdateServerRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - serverId string - updateServerPayload *UpdateServerPayload +type ApiUpdateSnapshotRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + snapshotId string + updateSnapshotPayload *UpdateSnapshotPayload } -// Request an update of a server. +// Request an update of a snapshot. -func (r ApiUpdateServerRequest) UpdateServerPayload(updateServerPayload UpdateServerPayload) ApiUpdateServerRequest { - r.updateServerPayload = &updateServerPayload +func (r ApiUpdateSnapshotRequest) UpdateSnapshotPayload(updateSnapshotPayload UpdateSnapshotPayload) ApiUpdateSnapshotRequest { + r.updateSnapshotPayload = &updateSnapshotPayload return r } -func (r ApiUpdateServerRequest) Execute() (*Server, error) { +func (r ApiUpdateSnapshotRequest) Execute() (*Snapshot, error) { var ( localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Server + localVarReturnValue *Snapshot ) a := r.apiService - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateServer") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateSnapshot") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/servers/{serverId}" + localVarPath := localBasePath + "/v1alpha1/projects/{projectId}/snapshots/{snapshotId}" 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, "{"+"snapshotId"+"}", url.PathEscape(ParameterValueToString(r.snapshotId, "snapshotId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -17391,14 +23893,14 @@ func (r ApiUpdateServerRequest) Execute() (*Server, 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.snapshotId) < 36 { + return localVarReturnValue, fmt.Errorf("snapshotId 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.snapshotId) > 36 { + return localVarReturnValue, fmt.Errorf("snapshotId must have less than 36 elements") } - if r.updateServerPayload == nil { - return localVarReturnValue, fmt.Errorf("updateServerPayload is required and must be specified") + if r.updateSnapshotPayload == nil { + return localVarReturnValue, fmt.Errorf("updateSnapshotPayload is required and must be specified") } // to determine the Content-Type header @@ -17419,7 +23921,7 @@ func (r ApiUpdateServerRequest) Execute() (*Server, error) { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.updateServerPayload + localVarPostBody = r.updateSnapshotPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -17523,30 +24025,30 @@ func (r ApiUpdateServerRequest) Execute() (*Server, error) { } /* -UpdateServer: Update information of a server. +UpdateSnapshot: Update information of the snapshot. -Update name or labels of the server. +Update information like name or labels of the snapshot. @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 ApiUpdateServerRequest + @param snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiUpdateSnapshotRequest */ -func (a *APIClient) UpdateServer(ctx context.Context, projectId string, serverId string) ApiUpdateServerRequest { - return ApiUpdateServerRequest{ +func (a *APIClient) UpdateSnapshot(ctx context.Context, projectId string, snapshotId string) ApiUpdateSnapshotRequest { + return ApiUpdateSnapshotRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + snapshotId: snapshotId, } } -func (a *APIClient) UpdateServerExecute(ctx context.Context, projectId string, serverId string) (*Server, error) { - r := ApiUpdateServerRequest{ +func (a *APIClient) UpdateSnapshotExecute(ctx context.Context, projectId string, snapshotId string) (*Snapshot, error) { + r := ApiUpdateSnapshotRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - serverId: serverId, + snapshotId: snapshotId, } return r.Execute() } @@ -17952,3 +24454,215 @@ func (a *APIClient) UpdateVolumeExecute(ctx context.Context, projectId string, v } return r.Execute() } + +type ApiV1alpha1UpdateRouteOfAreaRequest struct { + ctx context.Context + apiService *DefaultApiService + organizationId string + areaId string + routeId string + v1alpha1UpdateRouteOfAreaPayload *V1alpha1UpdateRouteOfAreaPayload +} + +// Request an update of a network route. + +func (r ApiV1alpha1UpdateRouteOfAreaRequest) V1alpha1UpdateRouteOfAreaPayload(v1alpha1UpdateRouteOfAreaPayload V1alpha1UpdateRouteOfAreaPayload) ApiV1alpha1UpdateRouteOfAreaRequest { + r.v1alpha1UpdateRouteOfAreaPayload = &v1alpha1UpdateRouteOfAreaPayload + return r +} + +func (r ApiV1alpha1UpdateRouteOfAreaRequest) Execute() (*Route, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Route + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.V1alpha1UpdateRouteOfArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(r.routeId, "routeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, fmt.Errorf("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, fmt.Errorf("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, fmt.Errorf("areaId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return localVarReturnValue, fmt.Errorf("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return localVarReturnValue, fmt.Errorf("routeId must have less than 36 elements") + } + if r.v1alpha1UpdateRouteOfAreaPayload == nil { + return localVarReturnValue, fmt.Errorf("v1alpha1UpdateRouteOfAreaPayload 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.v1alpha1UpdateRouteOfAreaPayload + 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 +} + +/* +V1alpha1UpdateRouteOfArea: Update a network route. + +Update a network route defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiV1alpha1UpdateRouteOfAreaRequest +*/ +func (a *APIClient) V1alpha1UpdateRouteOfArea(ctx context.Context, organizationId string, areaId string, routeId string) ApiV1alpha1UpdateRouteOfAreaRequest { + return ApiV1alpha1UpdateRouteOfAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + routeId: routeId, + } +} + +func (a *APIClient) V1alpha1UpdateRouteOfAreaExecute(ctx context.Context, organizationId string, areaId string, routeId string) (*Route, error) { + r := ApiV1alpha1UpdateRouteOfAreaRequest{ + apiService: a.defaultApi, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + routeId: routeId, + } + return r.Execute() +} diff --git a/services/iaasalpha/api_default_test.go b/services/iaasalpha/api_default_test.go index f0b6d826..642e2c21 100644 --- a/services/iaasalpha/api_default_test.go +++ b/services/iaasalpha/api_default_test.go @@ -406,14 +406,14 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService CreateImage", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/images" + t.Run("Test DefaultApiService CreateAffinityGroup", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/affinity-groups" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := ImageCreateResponse{} + data := AffinityGroup{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -447,9 +447,9 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - createImagePayload := CreateImagePayload{} + createAffinityGroupPayload := CreateAffinityGroupPayload{} - resp, reqErr := apiClient.CreateImage(context.Background(), projectId).CreateImagePayload(createImagePayload).Execute() + resp, reqErr := apiClient.CreateAffinityGroup(context.Background(), projectId).CreateAffinityGroupPayload(createAffinityGroupPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -459,12 +459,14 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService CreateKeyPair", func(t *testing.T) { - path := "/v1alpha1/keypairs" + t.Run("Test DefaultApiService CreateBackup", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/backups" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := Keypair{} + data := Backup{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -497,9 +499,10 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - createKeyPairPayload := CreateKeyPairPayload{} + projectId := "projectId" + createBackupPayload := CreateBackupPayload{} - resp, reqErr := apiClient.CreateKeyPair(context.Background()).CreateKeyPairPayload(createKeyPairPayload).Execute() + resp, reqErr := apiClient.CreateBackup(context.Background(), projectId).CreateBackupPayload(createBackupPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -509,16 +512,14 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService CreateNic", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/networks/{networkId}/nics" + t.Run("Test DefaultApiService CreateImage", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/images" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - networkIdValue := "networkId" - path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := NIC{} + data := ImageCreateResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -552,10 +553,9 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - networkId := "networkId" - createNicPayload := CreateNicPayload{} + createImagePayload := CreateImagePayload{} - resp, reqErr := apiClient.CreateNic(context.Background(), projectId, networkId).CreateNicPayload(createNicPayload).Execute() + resp, reqErr := apiClient.CreateImage(context.Background(), projectId).CreateImagePayload(createImagePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -565,14 +565,12 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService CreatePublicIP", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/public-ips" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + t.Run("Test DefaultApiService CreateKeyPair", func(t *testing.T) { + path := "/v1alpha1/keypairs" testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := PublicIp{} + data := Keypair{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -605,10 +603,9 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - createPublicIPPayload := CreatePublicIPPayload{} + createKeyPairPayload := CreateKeyPairPayload{} - resp, reqErr := apiClient.CreatePublicIP(context.Background(), projectId).CreatePublicIPPayload(createPublicIPPayload).Execute() + resp, reqErr := apiClient.CreateKeyPair(context.Background()).CreateKeyPairPayload(createKeyPairPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -618,14 +615,14 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService CreateSecurityGroup", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/security-groups" + t.Run("Test DefaultApiService CreateNetwork", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/networks" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := SecurityGroup{} + data := Network{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -659,9 +656,9 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - createSecurityGroupPayload := CreateSecurityGroupPayload{} + createNetworkPayload := CreateNetworkPayload{} - resp, reqErr := apiClient.CreateSecurityGroup(context.Background(), projectId).CreateSecurityGroupPayload(createSecurityGroupPayload).Execute() + resp, reqErr := apiClient.CreateNetwork(context.Background(), projectId).CreateNetworkPayload(createNetworkPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -671,16 +668,14 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService CreateSecurityGroupRule", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - securityGroupIdValue := "securityGroupId" - path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) + t.Run("Test DefaultApiService CreateNetworkArea", func(t *testing.T) { + path := "/v1alpha1/organizations/{organizationId}/network-areas" + organizationIdValue := "organizationId" + path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := SecurityGroupRule{} + data := NetworkArea{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -713,11 +708,10 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - securityGroupId := "securityGroupId" - createSecurityGroupRulePayload := CreateSecurityGroupRulePayload{} + organizationId := "organizationId" + createNetworkAreaPayload := CreateNetworkAreaPayload{} - resp, reqErr := apiClient.CreateSecurityGroupRule(context.Background(), projectId, securityGroupId).CreateSecurityGroupRulePayload(createSecurityGroupRulePayload).Execute() + resp, reqErr := apiClient.CreateNetworkArea(context.Background(), organizationId).CreateNetworkAreaPayload(createNetworkAreaPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -727,14 +721,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService CreateServer", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + t.Run("Test DefaultApiService CreateNetworkAreaRange", func(t *testing.T) { + path := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/network-ranges" + organizationIdValue := "organizationId" + path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := "areaId" + path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := Server{} + data := NetworkRangeListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -767,10 +763,11 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - createServerPayload := CreateServerPayload{} + organizationId := "organizationId" + areaId := "areaId" + createNetworkAreaRangePayload := CreateNetworkAreaRangePayload{} - resp, reqErr := apiClient.CreateServer(context.Background(), projectId).CreateServerPayload(createServerPayload).Execute() + resp, reqErr := apiClient.CreateNetworkAreaRange(context.Background(), organizationId, areaId).CreateNetworkAreaRangePayload(createNetworkAreaRangePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -780,16 +777,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService CreateVirtualIP", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - networkIdValue := "networkId" - path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + t.Run("Test DefaultApiService CreateNetworkAreaRoute", func(t *testing.T) { + path := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/routes" + organizationIdValue := "organizationId" + path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := "areaId" + path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := VirtualIp{} + data := RouteListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -822,11 +819,11 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - networkId := "networkId" - createVirtualIPPayload := CreateVirtualIPPayload{} + organizationId := "organizationId" + areaId := "areaId" + createNetworkAreaRoutePayload := CreateNetworkAreaRoutePayload{} - resp, reqErr := apiClient.CreateVirtualIP(context.Background(), projectId, networkId).CreateVirtualIPPayload(createVirtualIPPayload).Execute() + resp, reqErr := apiClient.CreateNetworkAreaRoute(context.Background(), organizationId, areaId).CreateNetworkAreaRoutePayload(createNetworkAreaRoutePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -836,14 +833,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService CreateVolume", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/volumes" + t.Run("Test DefaultApiService CreateNic", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/networks/{networkId}/nics" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + networkIdValue := "networkId" + path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := Volume{} + data := NIC{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -877,9 +876,10 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - createVolumePayload := CreateVolumePayload{} + networkId := "networkId" + createNicPayload := CreateNicPayload{} - resp, reqErr := apiClient.CreateVolume(context.Background(), projectId).CreateVolumePayload(createVolumePayload).Execute() + resp, reqErr := apiClient.CreateNic(context.Background(), projectId, networkId).CreateNicPayload(createNicPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -889,15 +889,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService DeallocateServer", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers/{serverId}/deallocate" + t.Run("Test DefaultApiService CreatePublicIP", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/public-ips" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := PublicIp{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -929,24 +930,28 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - serverId := "serverId" + createPublicIPPayload := CreatePublicIPPayload{} - reqErr := apiClient.DeallocateServer(context.Background(), projectId, serverId).Execute() + resp, reqErr := apiClient.CreatePublicIP(context.Background(), projectId).CreatePublicIPPayload(createPublicIPPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } + if resp == nil { + t.Fatalf("response not present") + } }) - t.Run("Test DefaultApiService DeleteImage", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/images/{imageId}" + t.Run("Test DefaultApiService CreateSecurityGroup", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/security-groups" 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 := SecurityGroup{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -978,24 +983,30 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - imageId := "imageId" + createSecurityGroupPayload := CreateSecurityGroupPayload{} - reqErr := apiClient.DeleteImage(context.Background(), projectId, imageId).Execute() + resp, reqErr := apiClient.CreateSecurityGroup(context.Background(), projectId).CreateSecurityGroupPayload(createSecurityGroupPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } + if resp == nil { + t.Fatalf("response not present") + } }) - t.Run("Test DefaultApiService DeleteImageShare", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/images/{imageId}/share" + t.Run("Test DefaultApiService CreateSecurityGroupRule", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules" 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) + securityGroupIdValue := "securityGroupId" + path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := SecurityGroupRule{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -1027,26 +1038,29 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - imageId := "imageId" + securityGroupId := "securityGroupId" + createSecurityGroupRulePayload := CreateSecurityGroupRulePayload{} - reqErr := apiClient.DeleteImageShare(context.Background(), projectId, imageId).Execute() + resp, reqErr := apiClient.CreateSecurityGroupRule(context.Background(), projectId, securityGroupId).CreateSecurityGroupRulePayload(createSecurityGroupRulePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } + if resp == nil { + t.Fatalf("response not present") + } }) - t.Run("Test DefaultApiService DeleteImageShareConsumer", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" + t.Run("Test DefaultApiService CreateServer", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers" 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 := Server{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -1078,23 +1092,28 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - imageId := "imageId" - consumerProjectId := "consumerProjectId" + createServerPayload := CreateServerPayload{} - reqErr := apiClient.DeleteImageShareConsumer(context.Background(), projectId, imageId, consumerProjectId).Execute() + resp, reqErr := apiClient.CreateServer(context.Background(), projectId).CreateServerPayload(createServerPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } + if resp == nil { + t.Fatalf("response not present") + } }) - t.Run("Test DefaultApiService DeleteKeyPair", func(t *testing.T) { - path := "/v1alpha1/keypairs/{keypairName}" - keypairNameValue := "keypairName" - path = strings.Replace(path, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(keypairNameValue, "keypairName")), -1) + t.Run("Test DefaultApiService CreateSnapshot", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/snapshots" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := Snapshot{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -1125,26 +1144,31 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - keypairName := "keypairName" + projectId := "projectId" + createSnapshotPayload := CreateSnapshotPayload{} - reqErr := apiClient.DeleteKeyPair(context.Background(), keypairName).Execute() + resp, reqErr := apiClient.CreateSnapshot(context.Background(), projectId).CreateSnapshotPayload(createSnapshotPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } + if resp == nil { + t.Fatalf("response not present") + } }) - t.Run("Test DefaultApiService DeleteNic", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + t.Run("Test DefaultApiService CreateVirtualIP", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) networkIdValue := "networkId" path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) - nicIdValue := "nicId" - path = strings.Replace(path, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := VirtualIp{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -1177,24 +1201,28 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { projectId := "projectId" networkId := "networkId" - nicId := "nicId" + createVirtualIPPayload := CreateVirtualIPPayload{} - reqErr := apiClient.DeleteNic(context.Background(), projectId, networkId, nicId).Execute() + resp, reqErr := apiClient.CreateVirtualIP(context.Background(), projectId, networkId).CreateVirtualIPPayload(createVirtualIPPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } + if resp == nil { + t.Fatalf("response not present") + } }) - t.Run("Test DefaultApiService DeletePublicIP", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/public-ips/{publicIpId}" + t.Run("Test DefaultApiService CreateVolume", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/volumes" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - publicIpIdValue := "publicIpId" - path = strings.Replace(path, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := Volume{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -1226,21 +1254,24 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - publicIpId := "publicIpId" + createVolumePayload := CreateVolumePayload{} - reqErr := apiClient.DeletePublicIP(context.Background(), projectId, publicIpId).Execute() + resp, reqErr := apiClient.CreateVolume(context.Background(), projectId).CreateVolumePayload(createVolumePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } + if resp == nil { + t.Fatalf("response not present") + } }) - t.Run("Test DefaultApiService DeleteSecurityGroup", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}" + t.Run("Test DefaultApiService DeallocateServer", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}/deallocate" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - securityGroupIdValue := "securityGroupId" - path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) + serverIdValue := "serverId" + path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { @@ -1275,23 +1306,21 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - securityGroupId := "securityGroupId" + serverId := "serverId" - reqErr := apiClient.DeleteSecurityGroup(context.Background(), projectId, securityGroupId).Execute() + reqErr := apiClient.DeallocateServer(context.Background(), projectId, serverId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } }) - t.Run("Test DefaultApiService DeleteSecurityGroupRule", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + t.Run("Test DefaultApiService DeleteAffinityGroup", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/affinity-groups/{affinityGroupId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - securityGroupIdValue := "securityGroupId" - path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) - securityGroupRuleIdValue := "securityGroupRuleId" - path = strings.Replace(path, "{"+"securityGroupRuleId"+"}", url.PathEscape(ParameterValueToString(securityGroupRuleIdValue, "securityGroupRuleId")), -1) + affinityGroupIdValue := "affinityGroupId" + path = strings.Replace(path, "{"+"affinityGroupId"+"}", url.PathEscape(ParameterValueToString(affinityGroupIdValue, "affinityGroupId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { @@ -1326,22 +1355,21 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - securityGroupId := "securityGroupId" - securityGroupRuleId := "securityGroupRuleId" + affinityGroupId := "affinityGroupId" - reqErr := apiClient.DeleteSecurityGroupRule(context.Background(), projectId, securityGroupId, securityGroupRuleId).Execute() + reqErr := apiClient.DeleteAffinityGroup(context.Background(), projectId, affinityGroupId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } }) - t.Run("Test DefaultApiService DeleteServer", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers/{serverId}" + t.Run("Test DefaultApiService DeleteBackup", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/backups/{backupId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + backupIdValue := "backupId" + path = strings.Replace(path, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { @@ -1376,22 +1404,720 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - serverId := "serverId" + backupId := "backupId" - reqErr := apiClient.DeleteServer(context.Background(), projectId, serverId).Execute() + reqErr := apiClient.DeleteBackup(context.Background(), projectId, backupId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } }) - t.Run("Test DefaultApiService DeleteVirtualIP", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}" + t.Run("Test DefaultApiService DeleteImage", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/images/{imageId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - networkIdValue := "networkId" - path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) - virtualIpIdValue := "virtualIpId" + 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.DeleteImage(context.Background(), projectId, imageId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + 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" + path = strings.Replace(path, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(keypairNameValue, "keypairName")), -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) + } + + keypairName := "keypairName" + + reqErr := apiClient.DeleteKeyPair(context.Background(), keypairName).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + t.Run("Test DefaultApiService DeleteNetwork", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/networks/{networkId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + networkIdValue := "networkId" + path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -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" + networkId := "networkId" + + reqErr := apiClient.DeleteNetwork(context.Background(), projectId, networkId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + t.Run("Test DefaultApiService DeleteNetworkArea", func(t *testing.T) { + path := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}" + organizationIdValue := "organizationId" + path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := "areaId" + path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -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) + } + + organizationId := "organizationId" + areaId := "areaId" + + reqErr := apiClient.DeleteNetworkArea(context.Background(), organizationId, areaId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + t.Run("Test DefaultApiService DeleteNetworkAreaRange", func(t *testing.T) { + path := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}" + organizationIdValue := "organizationId" + path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := "areaId" + path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + networkRangeIdValue := "networkRangeId" + path = strings.Replace(path, "{"+"networkRangeId"+"}", url.PathEscape(ParameterValueToString(networkRangeIdValue, "networkRangeId")), -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) + } + + organizationId := "organizationId" + areaId := "areaId" + networkRangeId := "networkRangeId" + + reqErr := apiClient.DeleteNetworkAreaRange(context.Background(), organizationId, areaId, networkRangeId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + t.Run("Test DefaultApiService DeleteNetworkAreaRoute", func(t *testing.T) { + path := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" + organizationIdValue := "organizationId" + path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := "areaId" + path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + routeIdValue := "routeId" + path = strings.Replace(path, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(routeIdValue, "routeId")), -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) + } + + organizationId := "organizationId" + areaId := "areaId" + routeId := "routeId" + + reqErr := apiClient.DeleteNetworkAreaRoute(context.Background(), organizationId, areaId, routeId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + t.Run("Test DefaultApiService DeleteNic", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + networkIdValue := "networkId" + path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + nicIdValue := "nicId" + path = strings.Replace(path, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -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" + networkId := "networkId" + nicId := "nicId" + + reqErr := apiClient.DeleteNic(context.Background(), projectId, networkId, nicId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + t.Run("Test DefaultApiService DeletePublicIP", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/public-ips/{publicIpId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + publicIpIdValue := "publicIpId" + path = strings.Replace(path, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -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" + publicIpId := "publicIpId" + + reqErr := apiClient.DeletePublicIP(context.Background(), projectId, publicIpId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + t.Run("Test DefaultApiService DeleteSecurityGroup", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + securityGroupIdValue := "securityGroupId" + path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -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" + securityGroupId := "securityGroupId" + + reqErr := apiClient.DeleteSecurityGroup(context.Background(), projectId, securityGroupId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + t.Run("Test DefaultApiService DeleteSecurityGroupRule", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + securityGroupIdValue := "securityGroupId" + path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) + securityGroupRuleIdValue := "securityGroupRuleId" + path = strings.Replace(path, "{"+"securityGroupRuleId"+"}", url.PathEscape(ParameterValueToString(securityGroupRuleIdValue, "securityGroupRuleId")), -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" + securityGroupId := "securityGroupId" + securityGroupRuleId := "securityGroupRuleId" + + reqErr := apiClient.DeleteSecurityGroupRule(context.Background(), projectId, securityGroupId, securityGroupRuleId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + t.Run("Test DefaultApiService DeleteServer", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := "serverId" + path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for 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" + serverId := "serverId" + + reqErr := apiClient.DeleteServer(context.Background(), projectId, serverId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + t.Run("Test DefaultApiService DeleteSnapshot", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/snapshots/{snapshotId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + snapshotIdValue := "snapshotId" + path = strings.Replace(path, "{"+"snapshotId"+"}", url.PathEscape(ParameterValueToString(snapshotIdValue, "snapshotId")), -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" + snapshotId := "snapshotId" + + reqErr := apiClient.DeleteSnapshot(context.Background(), projectId, snapshotId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + t.Run("Test DefaultApiService DeleteVirtualIP", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + networkIdValue := "networkId" + path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + virtualIpIdValue := "virtualIpId" path = strings.Replace(path, "{"+"virtualIpId"+"}", url.PathEscape(ParameterValueToString(virtualIpIdValue, "virtualIpId")), -1) testDefaultApiServeMux := http.NewServeMux() @@ -1427,25 +2153,966 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - networkId := "networkId" - virtualIpId := "virtualIpId" + networkId := "networkId" + virtualIpId := "virtualIpId" + + reqErr := apiClient.DeleteVirtualIP(context.Background(), projectId, networkId, virtualIpId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + t.Run("Test DefaultApiService DeleteVolume", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/volumes/{volumeId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + volumeIdValue := "volumeId" + path = strings.Replace(path, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -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" + volumeId := "volumeId" + + reqErr := apiClient.DeleteVolume(context.Background(), projectId, volumeId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + }) + + t.Run("Test DefaultApiService GetAffinityGroup", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/affinity-groups/{affinityGroupId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + affinityGroupIdValue := "affinityGroupId" + path = strings.Replace(path, "{"+"affinityGroupId"+"}", url.PathEscape(ParameterValueToString(affinityGroupIdValue, "affinityGroupId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := AffinityGroup{} + 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" + affinityGroupId := "affinityGroupId" + + resp, reqErr := apiClient.GetAffinityGroup(context.Background(), projectId, affinityGroupId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetAttachedVolume", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := "serverId" + path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + volumeIdValue := "volumeId" + path = strings.Replace(path, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := VolumeAttachment{} + 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" + serverId := "serverId" + volumeId := "volumeId" + + resp, reqErr := apiClient.GetAttachedVolume(context.Background(), projectId, serverId, volumeId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetBackup", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/backups/{backupId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + backupIdValue := "backupId" + path = strings.Replace(path, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := Backup{} + 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" + backupId := "backupId" + + resp, reqErr := apiClient.GetBackup(context.Background(), projectId, backupId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetImage", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/images/{imageId}" + 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 := Image{} + 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.GetImage(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 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" + path = strings.Replace(path, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(keypairNameValue, "keypairName")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := Keypair{} + 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) + } + + keypairName := "keypairName" + + resp, reqErr := apiClient.GetKeyPair(context.Background(), keypairName).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetMachineType", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/machine-types/{machineType}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + machineTypeValue := "machineType" + path = strings.Replace(path, "{"+"machineType"+"}", url.PathEscape(ParameterValueToString(machineTypeValue, "machineType")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := MachineType{} + 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" + machineType := "machineType" + + resp, reqErr := apiClient.GetMachineType(context.Background(), projectId, machineType).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetNetwork", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/networks/{networkId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + networkIdValue := "networkId" + path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := Network{} + 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" + networkId := "networkId" + + resp, reqErr := apiClient.GetNetwork(context.Background(), projectId, networkId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetNetworkArea", func(t *testing.T) { + path := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}" + organizationIdValue := "organizationId" + path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := "areaId" + path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := NetworkArea{} + 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) + } + + organizationId := "organizationId" + areaId := "areaId" + + resp, reqErr := apiClient.GetNetworkArea(context.Background(), organizationId, areaId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetNetworkAreaRange", func(t *testing.T) { + path := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}" + organizationIdValue := "organizationId" + path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := "areaId" + path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + networkRangeIdValue := "networkRangeId" + path = strings.Replace(path, "{"+"networkRangeId"+"}", url.PathEscape(ParameterValueToString(networkRangeIdValue, "networkRangeId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := NetworkRange{} + 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) + } + + organizationId := "organizationId" + areaId := "areaId" + networkRangeId := "networkRangeId" + + resp, reqErr := apiClient.GetNetworkAreaRange(context.Background(), organizationId, areaId, networkRangeId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetNetworkAreaRoute", func(t *testing.T) { + path := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" + organizationIdValue := "organizationId" + path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := "areaId" + path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + routeIdValue := "routeId" + path = strings.Replace(path, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(routeIdValue, "routeId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := Route{} + 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) + } + + organizationId := "organizationId" + areaId := "areaId" + routeId := "routeId" + + resp, reqErr := apiClient.GetNetworkAreaRoute(context.Background(), organizationId, areaId, routeId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetNic", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + networkIdValue := "networkId" + path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + nicIdValue := "nicId" + path = strings.Replace(path, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := NIC{} + 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" + networkId := "networkId" + nicId := "nicId" + + resp, reqErr := apiClient.GetNic(context.Background(), projectId, networkId, nicId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetOrganizationRequest", func(t *testing.T) { + path := "/v1alpha1/organizations/{organizationId}/requests/{requestId}" + organizationIdValue := "organizationId" + path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + requestIdValue := "requestId" + path = strings.Replace(path, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(requestIdValue, "requestId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := Request{} + 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) + } + + organizationId := "organizationId" + requestId := "requestId" + + resp, reqErr := apiClient.GetOrganizationRequest(context.Background(), organizationId, requestId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetProjectDetails", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := Project{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for iaasalpha_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := "projectId" + + resp, reqErr := apiClient.GetProjectDetails(context.Background(), projectId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetProjectNIC", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/nics/{nicId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + nicIdValue := "nicId" + path = strings.Replace(path, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := NIC{} + 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" + nicId := "nicId" - reqErr := apiClient.DeleteVirtualIP(context.Background(), projectId, networkId, virtualIpId).Execute() + resp, reqErr := apiClient.GetProjectNIC(context.Background(), projectId, nicId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } + if resp == nil { + t.Fatalf("response not present") + } }) - t.Run("Test DefaultApiService DeleteVolume", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/volumes/{volumeId}" + t.Run("Test DefaultApiService GetProjectRequest", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/requests/{requestId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - volumeIdValue := "volumeId" - path = strings.Replace(path, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) + requestIdValue := "requestId" + path = strings.Replace(path, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(requestIdValue, "requestId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := Request{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -1477,27 +3144,28 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - volumeId := "volumeId" + requestId := "requestId" - reqErr := apiClient.DeleteVolume(context.Background(), projectId, volumeId).Execute() + resp, reqErr := apiClient.GetProjectRequest(context.Background(), projectId, requestId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } + if resp == nil { + t.Fatalf("response not present") + } }) - t.Run("Test DefaultApiService GetAttachedVolume", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + t.Run("Test DefaultApiService GetPublicIP", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/public-ips/{publicIpId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - volumeIdValue := "volumeId" - path = strings.Replace(path, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) + publicIpIdValue := "publicIpId" + path = strings.Replace(path, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := VolumeAttachment{} + data := PublicIp{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -1531,10 +3199,9 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - serverId := "serverId" - volumeId := "volumeId" + publicIpId := "publicIpId" - resp, reqErr := apiClient.GetAttachedVolume(context.Background(), projectId, serverId, volumeId).Execute() + resp, reqErr := apiClient.GetPublicIP(context.Background(), projectId, publicIpId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1544,16 +3211,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetImage", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/images/{imageId}" + t.Run("Test DefaultApiService GetSecurityGroup", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}" 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) + securityGroupIdValue := "securityGroupId" + path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := Image{} + data := SecurityGroup{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -1587,9 +3254,9 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - imageId := "imageId" + securityGroupId := "securityGroupId" - resp, reqErr := apiClient.GetImage(context.Background(), projectId, imageId).Execute() + resp, reqErr := apiClient.GetSecurityGroup(context.Background(), projectId, securityGroupId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1599,16 +3266,18 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetImageShare", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/images/{imageId}/share" + t.Run("Test DefaultApiService GetSecurityGroupRule", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" 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) + securityGroupIdValue := "securityGroupId" + path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) + securityGroupRuleIdValue := "securityGroupRuleId" + path = strings.Replace(path, "{"+"securityGroupRuleId"+"}", url.PathEscape(ParameterValueToString(securityGroupRuleIdValue, "securityGroupRuleId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := ImageShare{} + data := SecurityGroupRule{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -1642,9 +3311,10 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - imageId := "imageId" + securityGroupId := "securityGroupId" + securityGroupRuleId := "securityGroupRuleId" - resp, reqErr := apiClient.GetImageShare(context.Background(), projectId, imageId).Execute() + resp, reqErr := apiClient.GetSecurityGroupRule(context.Background(), projectId, securityGroupId, securityGroupRuleId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1654,18 +3324,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetImageShareConsumer", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" + t.Run("Test DefaultApiService GetServer", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}" 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) + serverIdValue := "serverId" + path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := ImageShareConsumer{} + data := Server{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -1699,10 +3367,9 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - imageId := "imageId" - consumerProjectId := "consumerProjectId" + serverId := "serverId" - resp, reqErr := apiClient.GetImageShareConsumer(context.Background(), projectId, imageId, consumerProjectId).Execute() + resp, reqErr := apiClient.GetServer(context.Background(), projectId, serverId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1712,14 +3379,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetKeyPair", func(t *testing.T) { - path := "/v1alpha1/keypairs/{keypairName}" - keypairNameValue := "keypairName" - path = strings.Replace(path, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(keypairNameValue, "keypairName")), -1) + t.Run("Test DefaultApiService GetServerConsole", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}/console" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := "serverId" + path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := Keypair{} + data := ServerConsoleUrl{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -1752,9 +3421,10 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - keypairName := "keypairName" + projectId := "projectId" + serverId := "serverId" - resp, reqErr := apiClient.GetKeyPair(context.Background(), keypairName).Execute() + resp, reqErr := apiClient.GetServerConsole(context.Background(), projectId, serverId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1764,16 +3434,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetMachineType", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/machine-types/{machineType}" + t.Run("Test DefaultApiService GetServerLog", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}/log" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - machineTypeValue := "machineType" - path = strings.Replace(path, "{"+"machineType"+"}", url.PathEscape(ParameterValueToString(machineTypeValue, "machineType")), -1) + serverIdValue := "serverId" + path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := MachineType{} + data := GetServerLog200Response{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -1807,9 +3477,9 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - machineType := "machineType" + serverId := "serverId" - resp, reqErr := apiClient.GetMachineType(context.Background(), projectId, machineType).Execute() + resp, reqErr := apiClient.GetServerLog(context.Background(), projectId, serverId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1819,16 +3489,73 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetNetwork", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/networks/{networkId}" + t.Run("Test DefaultApiService GetSnapshot", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/snapshots/{snapshotId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + snapshotIdValue := "snapshotId" + path = strings.Replace(path, "{"+"snapshotId"+"}", url.PathEscape(ParameterValueToString(snapshotIdValue, "snapshotId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := Snapshot{} + 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" + snapshotId := "snapshotId" + + resp, reqErr := apiClient.GetSnapshot(context.Background(), projectId, snapshotId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetVirtualIP", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) networkIdValue := "networkId" path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + virtualIpIdValue := "virtualIpId" + path = strings.Replace(path, "{"+"virtualIpId"+"}", url.PathEscape(ParameterValueToString(virtualIpIdValue, "virtualIpId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := Network{} + data := VirtualIp{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -1863,8 +3590,9 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { projectId := "projectId" networkId := "networkId" + virtualIpId := "virtualIpId" - resp, reqErr := apiClient.GetNetwork(context.Background(), projectId, networkId).Execute() + resp, reqErr := apiClient.GetVirtualIP(context.Background(), projectId, networkId, virtualIpId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1874,16 +3602,71 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetNetworkArea", func(t *testing.T) { - path := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}" - organizationIdValue := "organizationId" - path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - areaIdValue := "areaId" - path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + t.Run("Test DefaultApiService GetVolume", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/volumes/{volumeId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + volumeIdValue := "volumeId" + path = strings.Replace(path, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := Volume{} + 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" + volumeId := "volumeId" + + resp, reqErr := apiClient.GetVolume(context.Background(), projectId, volumeId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetVolumePerformanceClass", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + volumePerformanceClassValue := "volumePerformanceClass" + path = strings.Replace(path, "{"+"volumePerformanceClass"+"}", url.PathEscape(ParameterValueToString(volumePerformanceClassValue, "volumePerformanceClass")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := NetworkArea{} + data := VolumePerformanceClass{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -1916,10 +3699,10 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := "organizationId" - areaId := "areaId" + projectId := "projectId" + volumePerformanceClass := "volumePerformanceClass" - resp, reqErr := apiClient.GetNetworkArea(context.Background(), organizationId, areaId).Execute() + resp, reqErr := apiClient.GetVolumePerformanceClass(context.Background(), projectId, volumePerformanceClass).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1929,18 +3712,14 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetNic", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + t.Run("Test DefaultApiService ListAffinityGroups", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/affinity-groups" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - networkIdValue := "networkId" - path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) - nicIdValue := "nicId" - path = strings.Replace(path, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := NIC{} + data := AffinityGroupListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -1974,10 +3753,8 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - networkId := "networkId" - nicId := "nicId" - resp, reqErr := apiClient.GetNic(context.Background(), projectId, networkId, nicId).Execute() + resp, reqErr := apiClient.ListAffinityGroups(context.Background(), projectId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -1987,16 +3764,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetOrganizationRequest", func(t *testing.T) { - path := "/v1alpha1/organizations/{organizationId}/requests/{requestId}" - organizationIdValue := "organizationId" - path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - requestIdValue := "requestId" - path = strings.Replace(path, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(requestIdValue, "requestId")), -1) + t.Run("Test DefaultApiService ListAttachedVolumes", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := "serverId" + path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := Request{} + data := VolumeAttachmentListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -2029,10 +3806,10 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := "organizationId" - requestId := "requestId" + projectId := "projectId" + serverId := "serverId" - resp, reqErr := apiClient.GetOrganizationRequest(context.Background(), organizationId, requestId).Execute() + resp, reqErr := apiClient.ListAttachedVolumes(context.Background(), projectId, serverId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2042,14 +3819,12 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetProjectDetails", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + 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 := Project{} + data := AvailabilityZoneListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -2082,9 +3857,7 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - - resp, reqErr := apiClient.GetProjectDetails(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListAvailabilityZones(context.Background()).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2094,16 +3867,14 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetProjectRequest", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/requests/{requestId}" + t.Run("Test DefaultApiService ListBackups", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/backups" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - requestIdValue := "requestId" - path = strings.Replace(path, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(requestIdValue, "requestId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := Request{} + data := BackupListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -2137,9 +3908,8 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - requestId := "requestId" - resp, reqErr := apiClient.GetProjectRequest(context.Background(), projectId, requestId).Execute() + resp, reqErr := apiClient.ListBackups(context.Background(), projectId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2149,16 +3919,14 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetPublicIP", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/public-ips/{publicIpId}" + t.Run("Test DefaultApiService ListImages", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/images" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - publicIpIdValue := "publicIpId" - path = strings.Replace(path, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := PublicIp{} + data := ImageListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -2192,9 +3960,8 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - publicIpId := "publicIpId" - resp, reqErr := apiClient.GetPublicIP(context.Background(), projectId, publicIpId).Execute() + resp, reqErr := apiClient.ListImages(context.Background(), projectId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2204,16 +3971,12 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetSecurityGroup", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - securityGroupIdValue := "securityGroupId" - path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) + t.Run("Test DefaultApiService ListKeyPairs", func(t *testing.T) { + path := "/v1alpha1/keypairs" testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := SecurityGroup{} + data := KeyPairListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -2246,10 +4009,7 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - securityGroupId := "securityGroupId" - - resp, reqErr := apiClient.GetSecurityGroup(context.Background(), projectId, securityGroupId).Execute() + resp, reqErr := apiClient.ListKeyPairs(context.Background()).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2259,18 +4019,14 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetSecurityGroupRule", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + t.Run("Test DefaultApiService ListMachineTypes", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/machine-types" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - securityGroupIdValue := "securityGroupId" - path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) - securityGroupRuleIdValue := "securityGroupRuleId" - path = strings.Replace(path, "{"+"securityGroupRuleId"+"}", url.PathEscape(ParameterValueToString(securityGroupRuleIdValue, "securityGroupRuleId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := SecurityGroupRule{} + data := MachineTypeListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -2304,10 +4060,8 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - securityGroupId := "securityGroupId" - securityGroupRuleId := "securityGroupRuleId" - resp, reqErr := apiClient.GetSecurityGroupRule(context.Background(), projectId, securityGroupId, securityGroupRuleId).Execute() + resp, reqErr := apiClient.ListMachineTypes(context.Background(), projectId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2317,16 +4071,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetServer", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers/{serverId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + t.Run("Test DefaultApiService ListNetworkAreaProjects", func(t *testing.T) { + path := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/projects" + organizationIdValue := "organizationId" + path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := "areaId" + path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := Server{} + data := ProjectListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -2359,10 +4113,10 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + organizationId := "organizationId" + areaId := "areaId" - resp, reqErr := apiClient.GetServer(context.Background(), projectId, serverId).Execute() + resp, reqErr := apiClient.ListNetworkAreaProjects(context.Background(), organizationId, areaId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2372,16 +4126,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetServerConsole", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers/{serverId}/console" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + t.Run("Test DefaultApiService ListNetworkAreaRanges", func(t *testing.T) { + path := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/network-ranges" + organizationIdValue := "organizationId" + path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := "areaId" + path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := ServerConsoleUrl{} + data := NetworkRangeListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -2414,10 +4168,10 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + organizationId := "organizationId" + areaId := "areaId" - resp, reqErr := apiClient.GetServerConsole(context.Background(), projectId, serverId).Execute() + resp, reqErr := apiClient.ListNetworkAreaRanges(context.Background(), organizationId, areaId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2427,16 +4181,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetServerLog", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers/{serverId}/log" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + t.Run("Test DefaultApiService ListNetworkAreaRoutes", func(t *testing.T) { + path := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/routes" + organizationIdValue := "organizationId" + path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := "areaId" + path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := GetServerLog200Response{} + data := RouteListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -2469,10 +4223,10 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + organizationId := "organizationId" + areaId := "areaId" - resp, reqErr := apiClient.GetServerLog(context.Background(), projectId, serverId).Execute() + resp, reqErr := apiClient.ListNetworkAreaRoutes(context.Background(), organizationId, areaId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2482,18 +4236,14 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetVirtualIP", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - networkIdValue := "networkId" - path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) - virtualIpIdValue := "virtualIpId" - path = strings.Replace(path, "{"+"virtualIpId"+"}", url.PathEscape(ParameterValueToString(virtualIpIdValue, "virtualIpId")), -1) + t.Run("Test DefaultApiService ListNetworkAreas", func(t *testing.T) { + path := "/v1alpha1/organizations/{organizationId}/network-areas" + organizationIdValue := "organizationId" + path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := VirtualIp{} + data := NetworkAreaListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -2526,11 +4276,9 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - networkId := "networkId" - virtualIpId := "virtualIpId" + organizationId := "organizationId" - resp, reqErr := apiClient.GetVirtualIP(context.Background(), projectId, networkId, virtualIpId).Execute() + resp, reqErr := apiClient.ListNetworkAreas(context.Background(), organizationId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2540,16 +4288,14 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetVolume", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/volumes/{volumeId}" + t.Run("Test DefaultApiService ListNetworks", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/networks" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - volumeIdValue := "volumeId" - path = strings.Replace(path, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := Volume{} + data := NetworkListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -2583,9 +4329,8 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - volumeId := "volumeId" - resp, reqErr := apiClient.GetVolume(context.Background(), projectId, volumeId).Execute() + resp, reqErr := apiClient.ListNetworks(context.Background(), projectId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2595,16 +4340,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService GetVolumePerformanceClass", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}" + t.Run("Test DefaultApiService ListNics", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/networks/{networkId}/nics" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - volumePerformanceClassValue := "volumePerformanceClass" - path = strings.Replace(path, "{"+"volumePerformanceClass"+"}", url.PathEscape(ParameterValueToString(volumePerformanceClassValue, "volumePerformanceClass")), -1) + networkIdValue := "networkId" + path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := VolumePerformanceClass{} + data := NICListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -2638,9 +4383,9 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - volumePerformanceClass := "volumePerformanceClass" + networkId := "networkId" - resp, reqErr := apiClient.GetVolumePerformanceClass(context.Background(), projectId, volumePerformanceClass).Execute() + resp, reqErr := apiClient.ListNics(context.Background(), projectId, networkId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2650,16 +4395,14 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListAttachedVolumes", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments" + t.Run("Test DefaultApiService ListProjectNICs", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/nics" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := VolumeAttachmentListResponse{} + data := NICListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -2693,9 +4436,8 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - serverId := "serverId" - resp, reqErr := apiClient.ListAttachedVolumes(context.Background(), projectId, serverId).Execute() + resp, reqErr := apiClient.ListProjectNICs(context.Background(), projectId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2705,12 +4447,12 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListAvailabilityZones", func(t *testing.T) { - path := "/v1alpha1/availability-zones" + t.Run("Test DefaultApiService ListPublicIPRanges", func(t *testing.T) { + path := "/v1alpha1/networks/public-ip-ranges" testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := AvailabilityZoneListResponse{} + data := PublicNetworkListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -2743,7 +4485,7 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - resp, reqErr := apiClient.ListAvailabilityZones(context.Background()).Execute() + resp, reqErr := apiClient.ListPublicIPRanges(context.Background()).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2753,14 +4495,14 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListImages", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/images" + t.Run("Test DefaultApiService ListPublicIPs", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/public-ips" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := ImageListResponse{} + data := PublicIpListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -2795,7 +4537,7 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { projectId := "projectId" - resp, reqErr := apiClient.ListImages(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListPublicIPs(context.Background(), projectId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2805,12 +4547,14 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListKeyPairs", func(t *testing.T) { - path := "/v1alpha1/keypairs" + t.Run("Test DefaultApiService ListQuotas", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/quotas" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := KeyPairListResponse{} + data := QuotaListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -2843,7 +4587,9 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - resp, reqErr := apiClient.ListKeyPairs(context.Background()).Execute() + projectId := "projectId" + + resp, reqErr := apiClient.ListQuotas(context.Background(), projectId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2853,14 +4599,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListMachineTypes", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/machine-types" + t.Run("Test DefaultApiService ListSecurityGroupRules", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + securityGroupIdValue := "securityGroupId" + path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := MachineTypeListResponse{} + data := SecurityGroupRuleListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -2894,8 +4642,9 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" + securityGroupId := "securityGroupId" - resp, reqErr := apiClient.ListMachineTypes(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListSecurityGroupRules(context.Background(), projectId, securityGroupId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2905,16 +4654,14 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListNetworkAreaProjects", func(t *testing.T) { - path := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/projects" - organizationIdValue := "organizationId" - path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - areaIdValue := "areaId" - path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + t.Run("Test DefaultApiService ListSecurityGroups", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/security-groups" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := ProjectListResponse{} + data := SecurityGroupListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -2947,10 +4694,9 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := "organizationId" - areaId := "areaId" + projectId := "projectId" - resp, reqErr := apiClient.ListNetworkAreaProjects(context.Background(), organizationId, areaId).Execute() + resp, reqErr := apiClient.ListSecurityGroups(context.Background(), projectId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -2960,14 +4706,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListNetworkAreas", func(t *testing.T) { - path := "/v1alpha1/organizations/{organizationId}/network-areas" - organizationIdValue := "organizationId" - path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + t.Run("Test DefaultApiService ListServerNics", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}/nics" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := "serverId" + path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := NetworkAreaListResponse{} + data := NICListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -3000,9 +4748,10 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := "organizationId" + projectId := "projectId" + serverId := "serverId" - resp, reqErr := apiClient.ListNetworkAreas(context.Background(), organizationId).Execute() + resp, reqErr := apiClient.ListServerNics(context.Background(), projectId, serverId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3012,14 +4761,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListNetworks", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/networks" + t.Run("Test DefaultApiService ListServerServiceAccounts", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}/service-accounts" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := "serverId" + path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := NetworkListResponse{} + data := ServiceAccountMailListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -3053,8 +4804,9 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" + serverId := "serverId" - resp, reqErr := apiClient.ListNetworks(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListServerServiceAccounts(context.Background(), projectId, serverId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3064,16 +4816,14 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListNics", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/networks/{networkId}/nics" + t.Run("Test DefaultApiService ListServers", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - networkIdValue := "networkId" - path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := NICListResponse{} + data := ServerListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -3107,9 +4857,8 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - networkId := "networkId" - resp, reqErr := apiClient.ListNics(context.Background(), projectId, networkId).Execute() + resp, reqErr := apiClient.ListServers(context.Background(), projectId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3119,12 +4868,14 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListPublicIPRanges", func(t *testing.T) { - path := "/v1alpha1/networks/public-ip-ranges" + t.Run("Test DefaultApiService ListSnapshots", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/snapshots" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := PublicNetworkListResponse{} + data := SnapshotListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -3157,7 +4908,9 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - resp, reqErr := apiClient.ListPublicIPRanges(context.Background()).Execute() + projectId := "projectId" + + resp, reqErr := apiClient.ListSnapshots(context.Background(), projectId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3167,14 +4920,16 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListPublicIPs", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/public-ips" + t.Run("Test DefaultApiService ListVirtualIPs", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + networkIdValue := "networkId" + path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := PublicIpListResponse{} + data := VirtualIpListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -3208,8 +4963,9 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" + networkId := "networkId" - resp, reqErr := apiClient.ListPublicIPs(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListVirtualIPs(context.Background(), projectId, networkId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3219,16 +4975,14 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListSecurityGroupRules", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/security-groups/{securityGroupId}/rules" + t.Run("Test DefaultApiService ListVolumePerformanceClasses", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/volume-performance-classes" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - securityGroupIdValue := "securityGroupId" - path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := SecurityGroupRuleListResponse{} + data := VolumePerformanceClassListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -3262,9 +5016,8 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - securityGroupId := "securityGroupId" - resp, reqErr := apiClient.ListSecurityGroupRules(context.Background(), projectId, securityGroupId).Execute() + resp, reqErr := apiClient.ListVolumePerformanceClasses(context.Background(), projectId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3274,14 +5027,14 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListSecurityGroups", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/security-groups" + t.Run("Test DefaultApiService ListVolumes", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/volumes" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := SecurityGroupListResponse{} + data := VolumeListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -3316,7 +5069,7 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { projectId := "projectId" - resp, reqErr := apiClient.ListSecurityGroups(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListVolumes(context.Background(), projectId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3326,18 +5079,15 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListServerNics", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers/{serverId}/nics" + t.Run("Test DefaultApiService PartialUpdateNetwork", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/networks/{networkId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + networkIdValue := "networkId" + path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := NICListResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -3369,28 +5119,26 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - serverId := "serverId" + networkId := "networkId" + partialUpdateNetworkPayload := PartialUpdateNetworkPayload{} - resp, reqErr := apiClient.ListServerNics(context.Background(), projectId, serverId).Execute() + reqErr := apiClient.PartialUpdateNetwork(context.Background(), projectId, networkId).PartialUpdateNetworkPayload(partialUpdateNetworkPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { - t.Fatalf("response not present") - } }) - t.Run("Test DefaultApiService ListServerServiceAccounts", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers/{serverId}/service-accounts" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + t.Run("Test DefaultApiService PartialUpdateNetworkArea", func(t *testing.T) { + path := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}" + organizationIdValue := "organizationId" + path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := "areaId" + path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := ServiceAccountMailListResponse{} + data := NetworkArea{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -3423,10 +5171,11 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + organizationId := "organizationId" + areaId := "areaId" + partialUpdateNetworkAreaPayload := PartialUpdateNetworkAreaPayload{} - resp, reqErr := apiClient.ListServerServiceAccounts(context.Background(), projectId, serverId).Execute() + resp, reqErr := apiClient.PartialUpdateNetworkArea(context.Background(), organizationId, areaId).PartialUpdateNetworkAreaPayload(partialUpdateNetworkAreaPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3436,16 +5185,15 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListServers", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers" + t.Run("Test DefaultApiService RebootServer", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}/reboot" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := "serverId" + path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := ServerListResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -3477,27 +5225,27 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" + serverId := "serverId" - resp, reqErr := apiClient.ListServers(context.Background(), projectId).Execute() + reqErr := apiClient.RebootServer(context.Background(), projectId, serverId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { - t.Fatalf("response not present") - } }) - t.Run("Test DefaultApiService ListVirtualIPs", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips" + t.Run("Test DefaultApiService RemoveMemberFromVirtualIP", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}/remove-member" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) networkIdValue := "networkId" path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + virtualIpIdValue := "virtualIpId" + path = strings.Replace(path, "{"+"virtualIpId"+"}", url.PathEscape(ParameterValueToString(virtualIpIdValue, "virtualIpId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := VirtualIpListResponse{} + data := VirtualIp{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -3532,8 +5280,10 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { projectId := "projectId" networkId := "networkId" + virtualIpId := "virtualIpId" + removeMemberFromVirtualIPPayload := RemoveMemberFromVirtualIPPayload{} - resp, reqErr := apiClient.ListVirtualIPs(context.Background(), projectId, networkId).Execute() + resp, reqErr := apiClient.RemoveMemberFromVirtualIP(context.Background(), projectId, networkId, virtualIpId).RemoveMemberFromVirtualIPPayload(removeMemberFromVirtualIPPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -3543,16 +5293,17 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService ListVolumePerformanceClasses", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/volume-performance-classes" + t.Run("Test DefaultApiService RemoveNetworkFromServer", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}/networks/{networkId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := "serverId" + path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + networkIdValue := "networkId" + path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := VolumePerformanceClassListResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -3584,27 +5335,27 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" + serverId := "serverId" + networkId := "networkId" - resp, reqErr := apiClient.ListVolumePerformanceClasses(context.Background(), projectId).Execute() + reqErr := apiClient.RemoveNetworkFromServer(context.Background(), projectId, serverId, networkId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { - t.Fatalf("response not present") - } }) - t.Run("Test DefaultApiService ListVolumes", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/volumes" + t.Run("Test DefaultApiService RemoveNicFromServer", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}/nics/{nicId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := "serverId" + path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + nicIdValue := "nicId" + path = strings.Replace(path, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := VolumeListResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -3636,23 +5387,24 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" + serverId := "serverId" + nicId := "nicId" - resp, reqErr := apiClient.ListVolumes(context.Background(), projectId).Execute() + reqErr := apiClient.RemoveNicFromServer(context.Background(), projectId, serverId, nicId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { - t.Fatalf("response not present") - } }) - t.Run("Test DefaultApiService RebootServer", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers/{serverId}/reboot" + t.Run("Test DefaultApiService RemovePublicIpFromServer", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := "serverId" path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + publicIpIdValue := "publicIpId" + path = strings.Replace(path, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { @@ -3688,28 +5440,26 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { projectId := "projectId" serverId := "serverId" + publicIpId := "publicIpId" - reqErr := apiClient.RebootServer(context.Background(), projectId, serverId).Execute() + reqErr := apiClient.RemovePublicIpFromServer(context.Background(), projectId, serverId, publicIpId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } }) - t.Run("Test DefaultApiService RemoveMemberFromVirtualIP", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}/remove-member" + t.Run("Test DefaultApiService RemoveSecurityGroupFromServer", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - networkIdValue := "networkId" - path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) - virtualIpIdValue := "virtualIpId" - path = strings.Replace(path, "{"+"virtualIpId"+"}", url.PathEscape(ParameterValueToString(virtualIpIdValue, "virtualIpId")), -1) + serverIdValue := "serverId" + path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + securityGroupIdValue := "securityGroupId" + path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := VirtualIp{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -3741,31 +5491,30 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - networkId := "networkId" - virtualIpId := "virtualIpId" - removeMemberFromVirtualIPPayload := RemoveMemberFromVirtualIPPayload{} + serverId := "serverId" + securityGroupId := "securityGroupId" - resp, reqErr := apiClient.RemoveMemberFromVirtualIP(context.Background(), projectId, networkId, virtualIpId).RemoveMemberFromVirtualIPPayload(removeMemberFromVirtualIPPayload).Execute() + reqErr := apiClient.RemoveSecurityGroupFromServer(context.Background(), projectId, serverId, securityGroupId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { - t.Fatalf("response not present") - } }) - t.Run("Test DefaultApiService RemoveNetworkFromServer", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers/{serverId}/networks/{networkId}" + t.Run("Test DefaultApiService RemoveServiceAccountFromServer", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := "serverId" path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - networkIdValue := "networkId" - path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + serviceAccountMailValue := "serviceAccountMail" + path = strings.Replace(path, "{"+"serviceAccountMail"+"}", url.PathEscape(ParameterValueToString(serviceAccountMailValue, "serviceAccountMail")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := ServiceAccountMailListResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -3798,23 +5547,26 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { projectId := "projectId" serverId := "serverId" - networkId := "networkId" + serviceAccountMail := "serviceAccountMail" - reqErr := apiClient.RemoveNetworkFromServer(context.Background(), projectId, serverId, networkId).Execute() + resp, reqErr := apiClient.RemoveServiceAccountFromServer(context.Background(), projectId, serverId, serviceAccountMail).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } + if resp == nil { + t.Fatalf("response not present") + } }) - t.Run("Test DefaultApiService RemoveNicFromServer", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers/{serverId}/nics/{nicId}" + t.Run("Test DefaultApiService RemoveVolumeFromServer", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := "serverId" path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - nicIdValue := "nicId" - path = strings.Replace(path, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -1) + volumeIdValue := "volumeId" + path = strings.Replace(path, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { @@ -3850,23 +5602,21 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { projectId := "projectId" serverId := "serverId" - nicId := "nicId" + volumeId := "volumeId" - reqErr := apiClient.RemoveNicFromServer(context.Background(), projectId, serverId, nicId).Execute() + reqErr := apiClient.RemoveVolumeFromServer(context.Background(), projectId, serverId, volumeId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } }) - t.Run("Test DefaultApiService RemovePublicIpFromServer", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}" + t.Run("Test DefaultApiService RescueServer", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}/rescue" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := "serverId" path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - publicIpIdValue := "publicIpId" - path = strings.Replace(path, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { @@ -3902,23 +5652,21 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { projectId := "projectId" serverId := "serverId" - publicIpId := "publicIpId" + rescueServerPayload := RescueServerPayload{} - reqErr := apiClient.RemovePublicIpFromServer(context.Background(), projectId, serverId, publicIpId).Execute() + reqErr := apiClient.RescueServer(context.Background(), projectId, serverId).RescueServerPayload(rescueServerPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } }) - t.Run("Test DefaultApiService RemoveSecurityGroupFromServer", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}" + t.Run("Test DefaultApiService ResizeServer", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}/resize" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := "serverId" path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - securityGroupIdValue := "securityGroupId" - path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { @@ -3954,29 +5702,24 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { projectId := "projectId" serverId := "serverId" - securityGroupId := "securityGroupId" + resizeServerPayload := ResizeServerPayload{} - reqErr := apiClient.RemoveSecurityGroupFromServer(context.Background(), projectId, serverId, securityGroupId).Execute() + reqErr := apiClient.ResizeServer(context.Background(), projectId, serverId).ResizeServerPayload(resizeServerPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } }) - t.Run("Test DefaultApiService RemoveServiceAccountFromServer", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}" + t.Run("Test DefaultApiService ResizeVolume", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/volumes/{volumeId}/resize" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - serviceAccountMailValue := "serviceAccountMail" - path = strings.Replace(path, "{"+"serviceAccountMail"+"}", url.PathEscape(ParameterValueToString(serviceAccountMailValue, "serviceAccountMail")), -1) + volumeIdValue := "volumeId" + path = strings.Replace(path, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := ServiceAccountMailListResponse{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -4008,27 +5751,21 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - serverId := "serverId" - serviceAccountMail := "serviceAccountMail" + volumeId := "volumeId" - resp, reqErr := apiClient.RemoveServiceAccountFromServer(context.Background(), projectId, serverId, serviceAccountMail).Execute() + reqErr := apiClient.ResizeVolume(context.Background(), projectId, volumeId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { - t.Fatalf("response not present") - } }) - t.Run("Test DefaultApiService RemoveVolumeFromServer", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + t.Run("Test DefaultApiService RestoreBackup", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/backups/{backupId}/restore" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - volumeIdValue := "volumeId" - path = strings.Replace(path, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) + backupIdValue := "backupId" + path = strings.Replace(path, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { @@ -4063,25 +5800,27 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - serverId := "serverId" - volumeId := "volumeId" + backupId := "backupId" - reqErr := apiClient.RemoveVolumeFromServer(context.Background(), projectId, serverId, volumeId).Execute() + reqErr := apiClient.RestoreBackup(context.Background(), projectId, backupId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } }) - t.Run("Test DefaultApiService RescueServer", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers/{serverId}/rescue" + 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) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -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() @@ -4113,18 +5852,21 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - serverId := "serverId" - rescueServerPayload := RescueServerPayload{} + imageId := "imageId" + setImageSharePayload := SetImageSharePayload{} - reqErr := apiClient.RescueServer(context.Background(), projectId, serverId).RescueServerPayload(rescueServerPayload).Execute() + 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 ResizeServer", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers/{serverId}/resize" + t.Run("Test DefaultApiService StartServer", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}/start" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := "serverId" @@ -4164,21 +5906,20 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { projectId := "projectId" serverId := "serverId" - resizeServerPayload := ResizeServerPayload{} - reqErr := apiClient.ResizeServer(context.Background(), projectId, serverId).ResizeServerPayload(resizeServerPayload).Execute() + reqErr := apiClient.StartServer(context.Background(), projectId, serverId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } }) - t.Run("Test DefaultApiService ResizeVolume", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/volumes/{volumeId}/resize" + t.Run("Test DefaultApiService StopServer", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}/stop" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - volumeIdValue := "volumeId" - path = strings.Replace(path, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) + serverIdValue := "serverId" + path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { @@ -4213,27 +5954,24 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - volumeId := "volumeId" + serverId := "serverId" - reqErr := apiClient.ResizeVolume(context.Background(), projectId, volumeId).Execute() + reqErr := apiClient.StopServer(context.Background(), projectId, serverId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } }) - t.Run("Test DefaultApiService SetImageShare", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/images/{imageId}/share" + t.Run("Test DefaultApiService UnrescueServer", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}/unrescue" 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) + serverIdValue := "serverId" + path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { - data := ImageShare{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -4265,28 +6003,29 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - imageId := "imageId" - setImageSharePayload := SetImageSharePayload{} + serverId := "serverId" - resp, reqErr := apiClient.SetImageShare(context.Background(), projectId, imageId).SetImageSharePayload(setImageSharePayload).Execute() + reqErr := apiClient.UnrescueServer(context.Background(), projectId, serverId).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" + t.Run("Test DefaultApiService UpdateAttachedVolume", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serverIdValue := "serverId" path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + volumeIdValue := "volumeId" + path = strings.Replace(path, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := VolumeAttachment{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -4319,23 +6058,31 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { projectId := "projectId" serverId := "serverId" + volumeId := "volumeId" + updateAttachedVolumePayload := UpdateAttachedVolumePayload{} - reqErr := apiClient.StartServer(context.Background(), projectId, serverId).Execute() + resp, reqErr := apiClient.UpdateAttachedVolume(context.Background(), projectId, serverId, volumeId).UpdateAttachedVolumePayload(updateAttachedVolumePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } + if resp == nil { + t.Fatalf("response not present") + } }) - t.Run("Test DefaultApiService StopServer", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers/{serverId}/stop" + t.Run("Test DefaultApiService UpdateBackup", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/backups/{backupId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + backupIdValue := "backupId" + path = strings.Replace(path, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := Backup{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -4367,24 +6114,31 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - serverId := "serverId" + backupId := "backupId" + updateBackupPayload := UpdateBackupPayload{} - reqErr := apiClient.StopServer(context.Background(), projectId, serverId).Execute() + resp, reqErr := apiClient.UpdateBackup(context.Background(), projectId, backupId).UpdateBackupPayload(updateBackupPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } + if resp == nil { + t.Fatalf("response not present") + } }) - t.Run("Test DefaultApiService UnrescueServer", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers/{serverId}/unrescue" + t.Run("Test DefaultApiService UpdateImage", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/images/{imageId}" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + 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 := Image{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -4416,27 +6170,29 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - serverId := "serverId" + imageId := "imageId" + updateImagePayload := UpdateImagePayload{} - reqErr := apiClient.UnrescueServer(context.Background(), projectId, serverId).Execute() + resp, reqErr := apiClient.UpdateImage(context.Background(), projectId, imageId).UpdateImagePayload(updateImagePayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } + if resp == nil { + t.Fatalf("response not present") + } }) - t.Run("Test DefaultApiService UpdateAttachedVolume", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + t.Run("Test DefaultApiService UpdateImageScopeLocal", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/images/{imageId}/publish" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - volumeIdValue := "volumeId" - path = strings.Replace(path, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -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 := VolumeAttachment{} + data := Image{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) }) @@ -4470,11 +6226,9 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } projectId := "projectId" - serverId := "serverId" - volumeId := "volumeId" - updateAttachedVolumePayload := UpdateAttachedVolumePayload{} + imageId := "imageId" - resp, reqErr := apiClient.UpdateAttachedVolume(context.Background(), projectId, serverId, volumeId).UpdateAttachedVolumePayload(updateAttachedVolumePayload).Execute() + resp, reqErr := apiClient.UpdateImageScopeLocal(context.Background(), projectId, imageId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -4484,8 +6238,8 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) - t.Run("Test DefaultApiService UpdateImage", func(t *testing.T) { - path := "/v1alpha1/projects/{projectId}/images/{imageId}" + t.Run("Test DefaultApiService UpdateImageScopePublic", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/images/{imageId}/publish" projectIdValue := "projectId" path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) imageIdValue := "imageId" @@ -4528,9 +6282,8 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { projectId := "projectId" imageId := "imageId" - updateImagePayload := UpdateImagePayload{} - resp, reqErr := apiClient.UpdateImage(context.Background(), projectId, imageId).UpdateImagePayload(updateImagePayload).Execute() + resp, reqErr := apiClient.UpdateImageScopePublic(context.Background(), projectId, imageId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -4876,6 +6629,62 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) + t.Run("Test DefaultApiService UpdateSnapshot", func(t *testing.T) { + path := "/v1alpha1/projects/{projectId}/snapshots/{snapshotId}" + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + snapshotIdValue := "snapshotId" + path = strings.Replace(path, "{"+"snapshotId"+"}", url.PathEscape(ParameterValueToString(snapshotIdValue, "snapshotId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := Snapshot{} + 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" + snapshotId := "snapshotId" + updateSnapshotPayload := UpdateSnapshotPayload{} + + resp, reqErr := apiClient.UpdateSnapshot(context.Background(), projectId, snapshotId).UpdateSnapshotPayload(updateSnapshotPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + t.Run("Test DefaultApiService UpdateVirtualIP", func(t *testing.T) { path := "/v1alpha1/projects/{projectId}/networks/{networkId}/virtual-ips/{virtualIpId}" projectIdValue := "projectId" @@ -4985,4 +6794,63 @@ func Test_iaasalpha_DefaultApiService(t *testing.T) { } }) + t.Run("Test DefaultApiService V1alpha1UpdateRouteOfArea", func(t *testing.T) { + path := "/v1alpha1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" + organizationIdValue := "organizationId" + path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := "areaId" + path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + routeIdValue := "routeId" + path = strings.Replace(path, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(routeIdValue, "routeId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := Route{} + 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) + } + + organizationId := "organizationId" + areaId := "areaId" + routeId := "routeId" + v1alpha1UpdateRouteOfAreaPayload := V1alpha1UpdateRouteOfAreaPayload{} + + resp, reqErr := apiClient.V1alpha1UpdateRouteOfArea(context.Background(), organizationId, areaId, routeId).V1alpha1UpdateRouteOfAreaPayload(v1alpha1UpdateRouteOfAreaPayload).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + } diff --git a/services/iaasalpha/model_affinity_group.go b/services/iaasalpha/model_affinity_group.go new file mode 100644 index 00000000..b17eade9 --- /dev/null +++ b/services/iaasalpha/model_affinity_group.go @@ -0,0 +1,214 @@ +/* +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 AffinityGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AffinityGroup{} + +// AffinityGroup Definition of an affinity group. +type AffinityGroup struct { + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty"` + // The servers that are part of the affinity group. + Members *[]string `json:"members,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + // REQUIRED + Name *string `json:"name"` + // The affinity group policy. + // REQUIRED + Policy *string `json:"policy"` +} + +type _AffinityGroup AffinityGroup + +// NewAffinityGroup instantiates a new AffinityGroup 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 NewAffinityGroup(name *string, policy *string) *AffinityGroup { + this := AffinityGroup{} + this.Name = name + this.Policy = policy + return &this +} + +// NewAffinityGroupWithDefaults instantiates a new AffinityGroup 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 NewAffinityGroupWithDefaults() *AffinityGroup { + this := AffinityGroup{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *AffinityGroup) GetId() *string { + if o == nil || IsNil(o.Id) { + var ret *string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AffinityGroup) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *AffinityGroup) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *AffinityGroup) SetId(v *string) { + o.Id = v +} + +// GetMembers returns the Members field value if set, zero value otherwise. +func (o *AffinityGroup) GetMembers() *[]string { + if o == nil || IsNil(o.Members) { + var ret *[]string + return ret + } + return o.Members +} + +// GetMembersOk returns a tuple with the Members field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AffinityGroup) GetMembersOk() (*[]string, bool) { + if o == nil || IsNil(o.Members) { + return nil, false + } + return o.Members, true +} + +// HasMembers returns a boolean if a field has been set. +func (o *AffinityGroup) HasMembers() bool { + if o != nil && !IsNil(o.Members) { + return true + } + + return false +} + +// SetMembers gets a reference to the given []string and assigns it to the Members field. +func (o *AffinityGroup) SetMembers(v *[]string) { + o.Members = v +} + +// GetName returns the Name field value +func (o *AffinityGroup) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AffinityGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *AffinityGroup) SetName(v *string) { + o.Name = v +} + +// GetPolicy returns the Policy field value +func (o *AffinityGroup) GetPolicy() *string { + if o == nil || IsNil(o.Policy) { + var ret *string + return ret + } + + return o.Policy +} + +// GetPolicyOk returns a tuple with the Policy field value +// and a boolean to check if the value has been set. +func (o *AffinityGroup) GetPolicyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Policy, true +} + +// SetPolicy sets field value +func (o *AffinityGroup) SetPolicy(v *string) { + o.Policy = v +} + +func (o AffinityGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Members) { + toSerialize["members"] = o.Members + } + toSerialize["name"] = o.Name + toSerialize["policy"] = o.Policy + return toSerialize, nil +} + +type NullableAffinityGroup struct { + value *AffinityGroup + isSet bool +} + +func (v NullableAffinityGroup) Get() *AffinityGroup { + return v.value +} + +func (v *NullableAffinityGroup) Set(val *AffinityGroup) { + v.value = val + v.isSet = true +} + +func (v NullableAffinityGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableAffinityGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAffinityGroup(val *AffinityGroup) *NullableAffinityGroup { + return &NullableAffinityGroup{value: val, isSet: true} +} + +func (v NullableAffinityGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAffinityGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_affinity_group_list_response.go b/services/iaasalpha/model_affinity_group_list_response.go new file mode 100644 index 00000000..de40c1f5 --- /dev/null +++ b/services/iaasalpha/model_affinity_group_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 AffinityGroupListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AffinityGroupListResponse{} + +// AffinityGroupListResponse Response object for affinity group list request. +type AffinityGroupListResponse struct { + // A list of affinity groups. + // REQUIRED + Items *[]AffinityGroup `json:"items"` +} + +type _AffinityGroupListResponse AffinityGroupListResponse + +// NewAffinityGroupListResponse instantiates a new AffinityGroupListResponse 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 NewAffinityGroupListResponse(items *[]AffinityGroup) *AffinityGroupListResponse { + this := AffinityGroupListResponse{} + this.Items = items + return &this +} + +// NewAffinityGroupListResponseWithDefaults instantiates a new AffinityGroupListResponse 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 NewAffinityGroupListResponseWithDefaults() *AffinityGroupListResponse { + this := AffinityGroupListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *AffinityGroupListResponse) GetItems() *[]AffinityGroup { + if o == nil || IsNil(o.Items) { + var ret *[]AffinityGroup + 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 *AffinityGroupListResponse) GetItemsOk() (*[]AffinityGroup, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *AffinityGroupListResponse) SetItems(v *[]AffinityGroup) { + o.Items = v +} + +func (o AffinityGroupListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +type NullableAffinityGroupListResponse struct { + value *AffinityGroupListResponse + isSet bool +} + +func (v NullableAffinityGroupListResponse) Get() *AffinityGroupListResponse { + return v.value +} + +func (v *NullableAffinityGroupListResponse) Set(val *AffinityGroupListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAffinityGroupListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAffinityGroupListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAffinityGroupListResponse(val *AffinityGroupListResponse) *NullableAffinityGroupListResponse { + return &NullableAffinityGroupListResponse{value: val, isSet: true} +} + +func (v NullableAffinityGroupListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAffinityGroupListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_backup.go b/services/iaasalpha/model_backup.go new file mode 100644 index 00000000..40206267 --- /dev/null +++ b/services/iaasalpha/model_backup.go @@ -0,0 +1,451 @@ +/* +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 Backup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Backup{} + +// Backup Object that represents a backup. +type Backup struct { + // Object that represents an availability zone. + AvailabilityZone *string `json:"availabilityZone,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,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. + Name *string `json:"name,omitempty"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + // Universally Unique Identifier (UUID). + SnapshotId *string `json:"snapshotId,omitempty"` + // The status of a backup object. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // Universally Unique Identifier (UUID). + VolumeId *string `json:"volumeId,omitempty"` +} + +// NewBackup instantiates a new Backup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackup() *Backup { + this := Backup{} + return &this +} + +// NewBackupWithDefaults instantiates a new Backup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupWithDefaults() *Backup { + this := Backup{} + return &this +} + +// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +func (o *Backup) GetAvailabilityZone() *string { + if o == nil || IsNil(o.AvailabilityZone) { + var ret *string + return ret + } + return o.AvailabilityZone +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetAvailabilityZoneOk() (*string, bool) { + if o == nil || IsNil(o.AvailabilityZone) { + return nil, false + } + return o.AvailabilityZone, true +} + +// HasAvailabilityZone returns a boolean if a field has been set. +func (o *Backup) HasAvailabilityZone() bool { + if o != nil && !IsNil(o.AvailabilityZone) { + return true + } + + return false +} + +// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +func (o *Backup) SetAvailabilityZone(v *string) { + o.AvailabilityZone = v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Backup) 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 *Backup) 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 *Backup) HasCreatedAt() bool { + if o != nil && !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 *Backup) SetCreatedAt(v *time.Time) { + o.CreatedAt = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Backup) GetId() *string { + if o == nil || IsNil(o.Id) { + var ret *string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Backup) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Backup) SetId(v *string) { + o.Id = v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Backup) GetLabels() *map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret *map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetLabelsOk() (*map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return &map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Backup) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Backup) SetLabels(v *map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Backup) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Backup) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Backup) SetName(v *string) { + o.Name = v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Backup) GetSize() *int64 { + if o == nil || IsNil(o.Size) { + var ret *int64 + return ret + } + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Backup) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *Backup) SetSize(v *int64) { + o.Size = v +} + +// GetSnapshotId returns the SnapshotId field value if set, zero value otherwise. +func (o *Backup) GetSnapshotId() *string { + if o == nil || IsNil(o.SnapshotId) { + var ret *string + return ret + } + return o.SnapshotId +} + +// GetSnapshotIdOk returns a tuple with the SnapshotId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetSnapshotIdOk() (*string, bool) { + if o == nil || IsNil(o.SnapshotId) { + return nil, false + } + return o.SnapshotId, true +} + +// HasSnapshotId returns a boolean if a field has been set. +func (o *Backup) HasSnapshotId() bool { + if o != nil && !IsNil(o.SnapshotId) { + return true + } + + return false +} + +// SetSnapshotId gets a reference to the given string and assigns it to the SnapshotId field. +func (o *Backup) SetSnapshotId(v *string) { + o.SnapshotId = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Backup) GetStatus() *string { + if o == nil || IsNil(o.Status) { + var ret *string + return ret + } + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Backup) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Backup) SetStatus(v *string) { + o.Status = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Backup) 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 *Backup) 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 *Backup) HasUpdatedAt() bool { + if o != nil && !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 *Backup) SetUpdatedAt(v *time.Time) { + o.UpdatedAt = v +} + +// GetVolumeId returns the VolumeId field value if set, zero value otherwise. +func (o *Backup) GetVolumeId() *string { + if o == nil || IsNil(o.VolumeId) { + var ret *string + return ret + } + return o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetVolumeIdOk() (*string, bool) { + if o == nil || IsNil(o.VolumeId) { + return nil, false + } + return o.VolumeId, true +} + +// HasVolumeId returns a boolean if a field has been set. +func (o *Backup) HasVolumeId() bool { + if o != nil && !IsNil(o.VolumeId) { + return true + } + + return false +} + +// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +func (o *Backup) SetVolumeId(v *string) { + o.VolumeId = v +} + +func (o Backup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AvailabilityZone) { + toSerialize["availabilityZone"] = o.AvailabilityZone + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.SnapshotId) { + toSerialize["snapshotId"] = o.SnapshotId + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.VolumeId) { + toSerialize["volumeId"] = o.VolumeId + } + return toSerialize, nil +} + +type NullableBackup struct { + value *Backup + isSet bool +} + +func (v NullableBackup) Get() *Backup { + return v.value +} + +func (v *NullableBackup) Set(val *Backup) { + v.value = val + v.isSet = true +} + +func (v NullableBackup) IsSet() bool { + return v.isSet +} + +func (v *NullableBackup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackup(val *Backup) *NullableBackup { + return &NullableBackup{value: val, isSet: true} +} + +func (v NullableBackup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_backup_list_response.go b/services/iaasalpha/model_backup_list_response.go new file mode 100644 index 00000000..d9646770 --- /dev/null +++ b/services/iaasalpha/model_backup_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 BackupListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupListResponse{} + +// BackupListResponse Backup list response. +type BackupListResponse struct { + // A list containing backup objects. + // REQUIRED + Items *[]Backup `json:"items"` +} + +type _BackupListResponse BackupListResponse + +// NewBackupListResponse instantiates a new BackupListResponse 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 NewBackupListResponse(items *[]Backup) *BackupListResponse { + this := BackupListResponse{} + this.Items = items + return &this +} + +// NewBackupListResponseWithDefaults instantiates a new BackupListResponse 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 NewBackupListResponseWithDefaults() *BackupListResponse { + this := BackupListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *BackupListResponse) GetItems() *[]Backup { + if o == nil || IsNil(o.Items) { + var ret *[]Backup + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *BackupListResponse) GetItemsOk() (*[]Backup, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *BackupListResponse) SetItems(v *[]Backup) { + o.Items = v +} + +func (o BackupListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +type NullableBackupListResponse struct { + value *BackupListResponse + isSet bool +} + +func (v NullableBackupListResponse) Get() *BackupListResponse { + return v.value +} + +func (v *NullableBackupListResponse) Set(val *BackupListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBackupListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupListResponse(val *BackupListResponse) *NullableBackupListResponse { + return &NullableBackupListResponse{value: val, isSet: true} +} + +func (v NullableBackupListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_backup_source.go b/services/iaasalpha/model_backup_source.go new file mode 100644 index 00000000..e236d903 --- /dev/null +++ b/services/iaasalpha/model_backup_source.go @@ -0,0 +1,140 @@ +/* +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 BackupSource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupSource{} + +// BackupSource The source object of a backup. +type BackupSource struct { + // Universally Unique Identifier (UUID). + // REQUIRED + Id *string `json:"id"` + // The source types of a backup. + // REQUIRED + Type *string `json:"type"` +} + +type _BackupSource BackupSource + +// NewBackupSource instantiates a new BackupSource 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 NewBackupSource(id *string, type_ *string) *BackupSource { + this := BackupSource{} + this.Id = id + this.Type = type_ + return &this +} + +// NewBackupSourceWithDefaults instantiates a new BackupSource 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 NewBackupSourceWithDefaults() *BackupSource { + this := BackupSource{} + return &this +} + +// GetId returns the Id field value +func (o *BackupSource) GetId() *string { + if o == nil || IsNil(o.Id) { + var ret *string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *BackupSource) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Id, true +} + +// SetId sets field value +func (o *BackupSource) SetId(v *string) { + o.Id = v +} + +// GetType returns the Type field value +func (o *BackupSource) GetType() *string { + if o == nil || IsNil(o.Type) { + var ret *string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *BackupSource) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Type, true +} + +// SetType sets field value +func (o *BackupSource) SetType(v *string) { + o.Type = v +} + +func (o BackupSource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableBackupSource struct { + value *BackupSource + isSet bool +} + +func (v NullableBackupSource) Get() *BackupSource { + return v.value +} + +func (v *NullableBackupSource) Set(val *BackupSource) { + v.value = val + v.isSet = true +} + +func (v NullableBackupSource) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupSource(val *BackupSource) *NullableBackupSource { + return &NullableBackupSource{value: val, isSet: true} +} + +func (v NullableBackupSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_create_affinity_group_payload.go b/services/iaasalpha/model_create_affinity_group_payload.go new file mode 100644 index 00000000..211a23cf --- /dev/null +++ b/services/iaasalpha/model_create_affinity_group_payload.go @@ -0,0 +1,214 @@ +/* +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 CreateAffinityGroupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateAffinityGroupPayload{} + +// CreateAffinityGroupPayload Definition of an affinity group. +type CreateAffinityGroupPayload struct { + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty"` + // The servers that are part of the affinity group. + Members *[]string `json:"members,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + // REQUIRED + Name *string `json:"name"` + // The affinity group policy. + // REQUIRED + Policy *string `json:"policy"` +} + +type _CreateAffinityGroupPayload CreateAffinityGroupPayload + +// NewCreateAffinityGroupPayload instantiates a new CreateAffinityGroupPayload 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 NewCreateAffinityGroupPayload(name *string, policy *string) *CreateAffinityGroupPayload { + this := CreateAffinityGroupPayload{} + this.Name = name + this.Policy = policy + return &this +} + +// NewCreateAffinityGroupPayloadWithDefaults instantiates a new CreateAffinityGroupPayload 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 NewCreateAffinityGroupPayloadWithDefaults() *CreateAffinityGroupPayload { + this := CreateAffinityGroupPayload{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateAffinityGroupPayload) GetId() *string { + if o == nil || IsNil(o.Id) { + var ret *string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAffinityGroupPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateAffinityGroupPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateAffinityGroupPayload) SetId(v *string) { + o.Id = v +} + +// GetMembers returns the Members field value if set, zero value otherwise. +func (o *CreateAffinityGroupPayload) GetMembers() *[]string { + if o == nil || IsNil(o.Members) { + var ret *[]string + return ret + } + return o.Members +} + +// GetMembersOk returns a tuple with the Members field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAffinityGroupPayload) GetMembersOk() (*[]string, bool) { + if o == nil || IsNil(o.Members) { + return nil, false + } + return o.Members, true +} + +// HasMembers returns a boolean if a field has been set. +func (o *CreateAffinityGroupPayload) HasMembers() bool { + if o != nil && !IsNil(o.Members) { + return true + } + + return false +} + +// SetMembers gets a reference to the given []string and assigns it to the Members field. +func (o *CreateAffinityGroupPayload) SetMembers(v *[]string) { + o.Members = v +} + +// GetName returns the Name field value +func (o *CreateAffinityGroupPayload) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateAffinityGroupPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *CreateAffinityGroupPayload) SetName(v *string) { + o.Name = v +} + +// GetPolicy returns the Policy field value +func (o *CreateAffinityGroupPayload) GetPolicy() *string { + if o == nil || IsNil(o.Policy) { + var ret *string + return ret + } + + return o.Policy +} + +// GetPolicyOk returns a tuple with the Policy field value +// and a boolean to check if the value has been set. +func (o *CreateAffinityGroupPayload) GetPolicyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Policy, true +} + +// SetPolicy sets field value +func (o *CreateAffinityGroupPayload) SetPolicy(v *string) { + o.Policy = v +} + +func (o CreateAffinityGroupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Members) { + toSerialize["members"] = o.Members + } + toSerialize["name"] = o.Name + toSerialize["policy"] = o.Policy + return toSerialize, nil +} + +type NullableCreateAffinityGroupPayload struct { + value *CreateAffinityGroupPayload + isSet bool +} + +func (v NullableCreateAffinityGroupPayload) Get() *CreateAffinityGroupPayload { + return v.value +} + +func (v *NullableCreateAffinityGroupPayload) Set(val *CreateAffinityGroupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateAffinityGroupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateAffinityGroupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateAffinityGroupPayload(val *CreateAffinityGroupPayload) *NullableCreateAffinityGroupPayload { + return &NullableCreateAffinityGroupPayload{value: val, isSet: true} +} + +func (v NullableCreateAffinityGroupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateAffinityGroupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_create_backup_payload.go b/services/iaasalpha/model_create_backup_payload.go new file mode 100644 index 00000000..596bede5 --- /dev/null +++ b/services/iaasalpha/model_create_backup_payload.go @@ -0,0 +1,184 @@ +/* +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 CreateBackupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateBackupPayload{} + +// CreateBackupPayload Object that represents a backup create request body. +type CreateBackupPayload struct { + // 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. + Name *string `json:"name,omitempty"` + // REQUIRED + Source *BackupSource `json:"source"` +} + +type _CreateBackupPayload CreateBackupPayload + +// NewCreateBackupPayload instantiates a new CreateBackupPayload 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 NewCreateBackupPayload(source *BackupSource) *CreateBackupPayload { + this := CreateBackupPayload{} + this.Source = source + return &this +} + +// NewCreateBackupPayloadWithDefaults instantiates a new CreateBackupPayload 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 NewCreateBackupPayloadWithDefaults() *CreateBackupPayload { + this := CreateBackupPayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateBackupPayload) GetLabels() *map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret *map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateBackupPayload) GetLabelsOk() (*map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return &map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateBackupPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateBackupPayload) SetLabels(v *map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateBackupPayload) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateBackupPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CreateBackupPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateBackupPayload) SetName(v *string) { + o.Name = v +} + +// GetSource returns the Source field value +func (o *CreateBackupPayload) GetSource() *BackupSource { + if o == nil || IsNil(o.Source) { + var ret *BackupSource + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *CreateBackupPayload) GetSourceOk() (*BackupSource, bool) { + if o == nil { + return nil, false + } + return o.Source, true +} + +// SetSource sets field value +func (o *CreateBackupPayload) SetSource(v *BackupSource) { + o.Source = v +} + +func (o CreateBackupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["source"] = o.Source + return toSerialize, nil +} + +type NullableCreateBackupPayload struct { + value *CreateBackupPayload + isSet bool +} + +func (v NullableCreateBackupPayload) Get() *CreateBackupPayload { + return v.value +} + +func (v *NullableCreateBackupPayload) Set(val *CreateBackupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateBackupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateBackupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateBackupPayload(val *CreateBackupPayload) *NullableCreateBackupPayload { + return &NullableCreateBackupPayload{value: val, isSet: true} +} + +func (v NullableCreateBackupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateBackupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_create_network_address_family.go b/services/iaasalpha/model_create_network_address_family.go new file mode 100644 index 00000000..8a42caf6 --- /dev/null +++ b/services/iaasalpha/model_create_network_address_family.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 CreateNetworkAddressFamily type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkAddressFamily{} + +// CreateNetworkAddressFamily The addressFamily object for a network create request. +type CreateNetworkAddressFamily struct { + Ipv4 *CreateNetworkIPv4Body `json:"ipv4,omitempty"` + Ipv6 *CreateNetworkIPv6Body `json:"ipv6,omitempty"` +} + +// NewCreateNetworkAddressFamily instantiates a new CreateNetworkAddressFamily 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 NewCreateNetworkAddressFamily() *CreateNetworkAddressFamily { + this := CreateNetworkAddressFamily{} + return &this +} + +// NewCreateNetworkAddressFamilyWithDefaults instantiates a new CreateNetworkAddressFamily 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 NewCreateNetworkAddressFamilyWithDefaults() *CreateNetworkAddressFamily { + this := CreateNetworkAddressFamily{} + return &this +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *CreateNetworkAddressFamily) GetIpv4() *CreateNetworkIPv4Body { + if o == nil || IsNil(o.Ipv4) { + var ret *CreateNetworkIPv4Body + return ret + } + return o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkAddressFamily) GetIpv4Ok() (*CreateNetworkIPv4Body, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *CreateNetworkAddressFamily) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given CreateNetworkIPv4Body and assigns it to the Ipv4 field. +func (o *CreateNetworkAddressFamily) SetIpv4(v *CreateNetworkIPv4Body) { + o.Ipv4 = v +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *CreateNetworkAddressFamily) GetIpv6() *CreateNetworkIPv6Body { + if o == nil || IsNil(o.Ipv6) { + var ret *CreateNetworkIPv6Body + return ret + } + return o.Ipv6 +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkAddressFamily) GetIpv6Ok() (*CreateNetworkIPv6Body, bool) { + if o == nil || IsNil(o.Ipv6) { + return nil, false + } + return o.Ipv6, true +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *CreateNetworkAddressFamily) HasIpv6() bool { + if o != nil && !IsNil(o.Ipv6) { + return true + } + + return false +} + +// SetIpv6 gets a reference to the given CreateNetworkIPv6Body and assigns it to the Ipv6 field. +func (o *CreateNetworkAddressFamily) SetIpv6(v *CreateNetworkIPv6Body) { + o.Ipv6 = v +} + +func (o CreateNetworkAddressFamily) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Ipv6) { + toSerialize["ipv6"] = o.Ipv6 + } + return toSerialize, nil +} + +type NullableCreateNetworkAddressFamily struct { + value *CreateNetworkAddressFamily + isSet bool +} + +func (v NullableCreateNetworkAddressFamily) Get() *CreateNetworkAddressFamily { + return v.value +} + +func (v *NullableCreateNetworkAddressFamily) Set(val *CreateNetworkAddressFamily) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkAddressFamily) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkAddressFamily) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkAddressFamily(val *CreateNetworkAddressFamily) *NullableCreateNetworkAddressFamily { + return &NullableCreateNetworkAddressFamily{value: val, isSet: true} +} + +func (v NullableCreateNetworkAddressFamily) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkAddressFamily) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_create_network_area_payload.go b/services/iaasalpha/model_create_network_area_payload.go new file mode 100644 index 00000000..f44292e7 --- /dev/null +++ b/services/iaasalpha/model_create_network_area_payload.go @@ -0,0 +1,176 @@ +/* +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 CreateNetworkAreaPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkAreaPayload{} + +// CreateNetworkAreaPayload struct for CreateNetworkAreaPayload +type CreateNetworkAreaPayload struct { + // REQUIRED + AddressFamily *CreateAreaAddressFamily `json:"addressFamily"` + // 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. + // REQUIRED + Name *string `json:"name"` +} + +type _CreateNetworkAreaPayload CreateNetworkAreaPayload + +// NewCreateNetworkAreaPayload instantiates a new CreateNetworkAreaPayload 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 NewCreateNetworkAreaPayload(addressFamily *CreateAreaAddressFamily, name *string) *CreateNetworkAreaPayload { + this := CreateNetworkAreaPayload{} + this.AddressFamily = addressFamily + this.Name = name + return &this +} + +// NewCreateNetworkAreaPayloadWithDefaults instantiates a new CreateNetworkAreaPayload 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 NewCreateNetworkAreaPayloadWithDefaults() *CreateNetworkAreaPayload { + this := CreateNetworkAreaPayload{} + return &this +} + +// GetAddressFamily returns the AddressFamily field value +func (o *CreateNetworkAreaPayload) GetAddressFamily() *CreateAreaAddressFamily { + if o == nil || IsNil(o.AddressFamily) { + var ret *CreateAreaAddressFamily + return ret + } + + return o.AddressFamily +} + +// GetAddressFamilyOk returns a tuple with the AddressFamily field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkAreaPayload) GetAddressFamilyOk() (*CreateAreaAddressFamily, bool) { + if o == nil { + return nil, false + } + return o.AddressFamily, true +} + +// SetAddressFamily sets field value +func (o *CreateNetworkAreaPayload) SetAddressFamily(v *CreateAreaAddressFamily) { + o.AddressFamily = v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateNetworkAreaPayload) GetLabels() *map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret *map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkAreaPayload) GetLabelsOk() (*map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return &map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateNetworkAreaPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateNetworkAreaPayload) SetLabels(v *map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *CreateNetworkAreaPayload) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkAreaPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *CreateNetworkAreaPayload) SetName(v *string) { + o.Name = v +} + +func (o CreateNetworkAreaPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["addressFamily"] = o.AddressFamily + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + return toSerialize, nil +} + +type NullableCreateNetworkAreaPayload struct { + value *CreateNetworkAreaPayload + isSet bool +} + +func (v NullableCreateNetworkAreaPayload) Get() *CreateNetworkAreaPayload { + return v.value +} + +func (v *NullableCreateNetworkAreaPayload) Set(val *CreateNetworkAreaPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkAreaPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkAreaPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkAreaPayload(val *CreateNetworkAreaPayload) *NullableCreateNetworkAreaPayload { + return &NullableCreateNetworkAreaPayload{value: val, isSet: true} +} + +func (v NullableCreateNetworkAreaPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkAreaPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_create_network_area_range_payload.go b/services/iaasalpha/model_create_network_area_range_payload.go new file mode 100644 index 00000000..f99e3b65 --- /dev/null +++ b/services/iaasalpha/model_create_network_area_range_payload.go @@ -0,0 +1,117 @@ +/* +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 CreateNetworkAreaRangePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkAreaRangePayload{} + +// CreateNetworkAreaRangePayload struct for CreateNetworkAreaRangePayload +type CreateNetworkAreaRangePayload struct { + // A list of network ranges. + Ipv4 *[]NetworkRange `json:"ipv4,omitempty"` +} + +// NewCreateNetworkAreaRangePayload instantiates a new CreateNetworkAreaRangePayload 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 NewCreateNetworkAreaRangePayload() *CreateNetworkAreaRangePayload { + this := CreateNetworkAreaRangePayload{} + return &this +} + +// NewCreateNetworkAreaRangePayloadWithDefaults instantiates a new CreateNetworkAreaRangePayload 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 NewCreateNetworkAreaRangePayloadWithDefaults() *CreateNetworkAreaRangePayload { + this := CreateNetworkAreaRangePayload{} + return &this +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *CreateNetworkAreaRangePayload) GetIpv4() *[]NetworkRange { + if o == nil || IsNil(o.Ipv4) { + var ret *[]NetworkRange + return ret + } + return o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkAreaRangePayload) GetIpv4Ok() (*[]NetworkRange, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *CreateNetworkAreaRangePayload) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given []NetworkRange and assigns it to the Ipv4 field. +func (o *CreateNetworkAreaRangePayload) SetIpv4(v *[]NetworkRange) { + o.Ipv4 = v +} + +func (o CreateNetworkAreaRangePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + return toSerialize, nil +} + +type NullableCreateNetworkAreaRangePayload struct { + value *CreateNetworkAreaRangePayload + isSet bool +} + +func (v NullableCreateNetworkAreaRangePayload) Get() *CreateNetworkAreaRangePayload { + return v.value +} + +func (v *NullableCreateNetworkAreaRangePayload) Set(val *CreateNetworkAreaRangePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkAreaRangePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkAreaRangePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkAreaRangePayload(val *CreateNetworkAreaRangePayload) *NullableCreateNetworkAreaRangePayload { + return &NullableCreateNetworkAreaRangePayload{value: val, isSet: true} +} + +func (v NullableCreateNetworkAreaRangePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkAreaRangePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_create_network_area_route_payload.go b/services/iaasalpha/model_create_network_area_route_payload.go new file mode 100644 index 00000000..2fcba24d --- /dev/null +++ b/services/iaasalpha/model_create_network_area_route_payload.go @@ -0,0 +1,117 @@ +/* +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 CreateNetworkAreaRoutePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkAreaRoutePayload{} + +// CreateNetworkAreaRoutePayload struct for CreateNetworkAreaRoutePayload +type CreateNetworkAreaRoutePayload struct { + // A list of routes. + Ipv4 *[]Route `json:"ipv4,omitempty"` +} + +// NewCreateNetworkAreaRoutePayload instantiates a new CreateNetworkAreaRoutePayload 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 NewCreateNetworkAreaRoutePayload() *CreateNetworkAreaRoutePayload { + this := CreateNetworkAreaRoutePayload{} + return &this +} + +// NewCreateNetworkAreaRoutePayloadWithDefaults instantiates a new CreateNetworkAreaRoutePayload 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 NewCreateNetworkAreaRoutePayloadWithDefaults() *CreateNetworkAreaRoutePayload { + this := CreateNetworkAreaRoutePayload{} + return &this +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *CreateNetworkAreaRoutePayload) GetIpv4() *[]Route { + if o == nil || IsNil(o.Ipv4) { + var ret *[]Route + return ret + } + return o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkAreaRoutePayload) GetIpv4Ok() (*[]Route, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *CreateNetworkAreaRoutePayload) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given []Route and assigns it to the Ipv4 field. +func (o *CreateNetworkAreaRoutePayload) SetIpv4(v *[]Route) { + o.Ipv4 = v +} + +func (o CreateNetworkAreaRoutePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + return toSerialize, nil +} + +type NullableCreateNetworkAreaRoutePayload struct { + value *CreateNetworkAreaRoutePayload + isSet bool +} + +func (v NullableCreateNetworkAreaRoutePayload) Get() *CreateNetworkAreaRoutePayload { + return v.value +} + +func (v *NullableCreateNetworkAreaRoutePayload) Set(val *CreateNetworkAreaRoutePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkAreaRoutePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkAreaRoutePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkAreaRoutePayload(val *CreateNetworkAreaRoutePayload) *NullableCreateNetworkAreaRoutePayload { + return &NullableCreateNetworkAreaRoutePayload{value: val, isSet: true} +} + +func (v NullableCreateNetworkAreaRoutePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkAreaRoutePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_create_network_ipv4_body.go b/services/iaasalpha/model_create_network_ipv4_body.go new file mode 100644 index 00000000..ea09ad3b --- /dev/null +++ b/services/iaasalpha/model_create_network_ipv4_body.go @@ -0,0 +1,247 @@ +/* +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 CreateNetworkIPv4Body type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkIPv4Body{} + +// CreateNetworkIPv4Body The config object for an IPv4 network. +type CreateNetworkIPv4Body struct { + // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway *NullableString `json:"gateway,omitempty"` + // A list containing DNS Servers/Nameservers for IPv4. + Nameservers *[]string `json:"nameservers,omitempty"` + // Classless Inter-Domain Routing (CIDR). + Prefix *string `json:"prefix,omitempty"` + PrefixLength *int64 `json:"prefixLength,omitempty"` +} + +// NewCreateNetworkIPv4Body instantiates a new CreateNetworkIPv4Body 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 NewCreateNetworkIPv4Body() *CreateNetworkIPv4Body { + this := CreateNetworkIPv4Body{} + return &this +} + +// NewCreateNetworkIPv4BodyWithDefaults instantiates a new CreateNetworkIPv4Body 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 NewCreateNetworkIPv4BodyWithDefaults() *CreateNetworkIPv4Body { + this := CreateNetworkIPv4Body{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateNetworkIPv4Body) GetGateway() *string { + if o == nil || IsNil(o.Gateway) || IsNil(o.Gateway.Get()) { + var ret *string + return ret + } + return o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateNetworkIPv4Body) GetGatewayOk() (*string, bool) { + if o == nil || IsNil(o.Gateway) { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *CreateNetworkIPv4Body) HasGateway() bool { + if o != nil && !IsNil(o.Gateway) && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given string and assigns it to the Gateway field. +func (o *CreateNetworkIPv4Body) 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 *CreateNetworkIPv4Body) 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 *CreateNetworkIPv4Body) UnsetGateway() { + if IsNil(o.Gateway) { + o.Gateway = new(NullableString) + } + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *CreateNetworkIPv4Body) GetNameservers() *[]string { + if o == nil || IsNil(o.Nameservers) { + var ret *[]string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv4Body) GetNameserversOk() (*[]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *CreateNetworkIPv4Body) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *CreateNetworkIPv4Body) SetNameservers(v *[]string) { + o.Nameservers = v +} + +// GetPrefix returns the Prefix field value if set, zero value otherwise. +func (o *CreateNetworkIPv4Body) GetPrefix() *string { + if o == nil || IsNil(o.Prefix) { + var ret *string + return ret + } + return o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv4Body) GetPrefixOk() (*string, bool) { + if o == nil || IsNil(o.Prefix) { + return nil, false + } + return o.Prefix, true +} + +// HasPrefix returns a boolean if a field has been set. +func (o *CreateNetworkIPv4Body) HasPrefix() bool { + if o != nil && !IsNil(o.Prefix) { + return true + } + + return false +} + +// SetPrefix gets a reference to the given string and assigns it to the Prefix field. +func (o *CreateNetworkIPv4Body) SetPrefix(v *string) { + o.Prefix = v +} + +// GetPrefixLength returns the PrefixLength field value if set, zero value otherwise. +func (o *CreateNetworkIPv4Body) GetPrefixLength() *int64 { + if o == nil || IsNil(o.PrefixLength) { + var ret *int64 + return ret + } + return o.PrefixLength +} + +// GetPrefixLengthOk returns a tuple with the PrefixLength field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv4Body) GetPrefixLengthOk() (*int64, bool) { + if o == nil || IsNil(o.PrefixLength) { + return nil, false + } + return o.PrefixLength, true +} + +// HasPrefixLength returns a boolean if a field has been set. +func (o *CreateNetworkIPv4Body) HasPrefixLength() bool { + if o != nil && !IsNil(o.PrefixLength) { + return true + } + + return false +} + +// SetPrefixLength gets a reference to the given int64 and assigns it to the PrefixLength field. +func (o *CreateNetworkIPv4Body) SetPrefixLength(v *int64) { + o.PrefixLength = v +} + +func (o CreateNetworkIPv4Body) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + if !IsNil(o.Prefix) { + toSerialize["prefix"] = o.Prefix + } + if !IsNil(o.PrefixLength) { + toSerialize["prefixLength"] = o.PrefixLength + } + return toSerialize, nil +} + +type NullableCreateNetworkIPv4Body struct { + value *CreateNetworkIPv4Body + isSet bool +} + +func (v NullableCreateNetworkIPv4Body) Get() *CreateNetworkIPv4Body { + return v.value +} + +func (v *NullableCreateNetworkIPv4Body) Set(val *CreateNetworkIPv4Body) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv4Body) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv4Body) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv4Body(val *CreateNetworkIPv4Body) *NullableCreateNetworkIPv4Body { + return &NullableCreateNetworkIPv4Body{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv4Body) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv4Body) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_create_network_ipv6_body.go b/services/iaasalpha/model_create_network_ipv6_body.go new file mode 100644 index 00000000..0a0a7d93 --- /dev/null +++ b/services/iaasalpha/model_create_network_ipv6_body.go @@ -0,0 +1,247 @@ +/* +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 CreateNetworkIPv6Body type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkIPv6Body{} + +// CreateNetworkIPv6Body The config object for an IPv6 network. +type CreateNetworkIPv6Body struct { + // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway *NullableString `json:"gateway,omitempty"` + // A list containing DNS Servers/Nameservers for IPv6. + Nameservers *[]string `json:"nameservers,omitempty"` + // Classless Inter-Domain Routing (CIDR) for IPv6. + Prefix *string `json:"prefix,omitempty"` + PrefixLength *int64 `json:"prefixLength,omitempty"` +} + +// NewCreateNetworkIPv6Body instantiates a new CreateNetworkIPv6Body 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 NewCreateNetworkIPv6Body() *CreateNetworkIPv6Body { + this := CreateNetworkIPv6Body{} + return &this +} + +// NewCreateNetworkIPv6BodyWithDefaults instantiates a new CreateNetworkIPv6Body 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 NewCreateNetworkIPv6BodyWithDefaults() *CreateNetworkIPv6Body { + this := CreateNetworkIPv6Body{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateNetworkIPv6Body) GetGateway() *string { + if o == nil || IsNil(o.Gateway) || IsNil(o.Gateway.Get()) { + var ret *string + return ret + } + return o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateNetworkIPv6Body) GetGatewayOk() (*string, bool) { + if o == nil || IsNil(o.Gateway) { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *CreateNetworkIPv6Body) HasGateway() bool { + if o != nil && !IsNil(o.Gateway) && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given string and assigns it to the Gateway field. +func (o *CreateNetworkIPv6Body) 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 *CreateNetworkIPv6Body) 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 *CreateNetworkIPv6Body) UnsetGateway() { + if IsNil(o.Gateway) { + o.Gateway = new(NullableString) + } + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *CreateNetworkIPv6Body) GetNameservers() *[]string { + if o == nil || IsNil(o.Nameservers) { + var ret *[]string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv6Body) GetNameserversOk() (*[]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *CreateNetworkIPv6Body) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *CreateNetworkIPv6Body) SetNameservers(v *[]string) { + o.Nameservers = v +} + +// GetPrefix returns the Prefix field value if set, zero value otherwise. +func (o *CreateNetworkIPv6Body) GetPrefix() *string { + if o == nil || IsNil(o.Prefix) { + var ret *string + return ret + } + return o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv6Body) GetPrefixOk() (*string, bool) { + if o == nil || IsNil(o.Prefix) { + return nil, false + } + return o.Prefix, true +} + +// HasPrefix returns a boolean if a field has been set. +func (o *CreateNetworkIPv6Body) HasPrefix() bool { + if o != nil && !IsNil(o.Prefix) { + return true + } + + return false +} + +// SetPrefix gets a reference to the given string and assigns it to the Prefix field. +func (o *CreateNetworkIPv6Body) SetPrefix(v *string) { + o.Prefix = v +} + +// GetPrefixLength returns the PrefixLength field value if set, zero value otherwise. +func (o *CreateNetworkIPv6Body) GetPrefixLength() *int64 { + if o == nil || IsNil(o.PrefixLength) { + var ret *int64 + return ret + } + return o.PrefixLength +} + +// GetPrefixLengthOk returns a tuple with the PrefixLength field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv6Body) GetPrefixLengthOk() (*int64, bool) { + if o == nil || IsNil(o.PrefixLength) { + return nil, false + } + return o.PrefixLength, true +} + +// HasPrefixLength returns a boolean if a field has been set. +func (o *CreateNetworkIPv6Body) HasPrefixLength() bool { + if o != nil && !IsNil(o.PrefixLength) { + return true + } + + return false +} + +// SetPrefixLength gets a reference to the given int64 and assigns it to the PrefixLength field. +func (o *CreateNetworkIPv6Body) SetPrefixLength(v *int64) { + o.PrefixLength = v +} + +func (o CreateNetworkIPv6Body) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + if !IsNil(o.Prefix) { + toSerialize["prefix"] = o.Prefix + } + if !IsNil(o.PrefixLength) { + toSerialize["prefixLength"] = o.PrefixLength + } + return toSerialize, nil +} + +type NullableCreateNetworkIPv6Body struct { + value *CreateNetworkIPv6Body + isSet bool +} + +func (v NullableCreateNetworkIPv6Body) Get() *CreateNetworkIPv6Body { + return v.value +} + +func (v *NullableCreateNetworkIPv6Body) Set(val *CreateNetworkIPv6Body) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv6Body) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv6Body) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv6Body(val *CreateNetworkIPv6Body) *NullableCreateNetworkIPv6Body { + return &NullableCreateNetworkIPv6Body{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv6Body) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv6Body) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_create_network_payload.go b/services/iaasalpha/model_create_network_payload.go new file mode 100644 index 00000000..4c59902c --- /dev/null +++ b/services/iaasalpha/model_create_network_payload.go @@ -0,0 +1,221 @@ +/* +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 CreateNetworkPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkPayload{} + +// CreateNetworkPayload Object that represents the request body for a network create. +type CreateNetworkPayload struct { + AddressFamily *CreateNetworkAddressFamily `json:"addressFamily,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. + // REQUIRED + Name *string `json:"name"` + // Shows if the network is routed and therefore accessible from other networks. + Routed *bool `json:"routed,omitempty"` +} + +type _CreateNetworkPayload CreateNetworkPayload + +// NewCreateNetworkPayload instantiates a new CreateNetworkPayload 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 NewCreateNetworkPayload(name *string) *CreateNetworkPayload { + this := CreateNetworkPayload{} + this.Name = name + return &this +} + +// NewCreateNetworkPayloadWithDefaults instantiates a new CreateNetworkPayload 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 NewCreateNetworkPayloadWithDefaults() *CreateNetworkPayload { + this := CreateNetworkPayload{} + return &this +} + +// GetAddressFamily returns the AddressFamily field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetAddressFamily() *CreateNetworkAddressFamily { + if o == nil || IsNil(o.AddressFamily) { + var ret *CreateNetworkAddressFamily + return ret + } + return o.AddressFamily +} + +// GetAddressFamilyOk returns a tuple with the AddressFamily field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetAddressFamilyOk() (*CreateNetworkAddressFamily, bool) { + if o == nil || IsNil(o.AddressFamily) { + return nil, false + } + return o.AddressFamily, true +} + +// HasAddressFamily returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasAddressFamily() bool { + if o != nil && !IsNil(o.AddressFamily) { + return true + } + + return false +} + +// SetAddressFamily gets a reference to the given CreateNetworkAddressFamily and assigns it to the AddressFamily field. +func (o *CreateNetworkPayload) SetAddressFamily(v *CreateNetworkAddressFamily) { + o.AddressFamily = v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetLabels() *map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret *map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetLabelsOk() (*map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return &map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateNetworkPayload) SetLabels(v *map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *CreateNetworkPayload) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *CreateNetworkPayload) SetName(v *string) { + o.Name = v +} + +// GetRouted returns the Routed field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetRouted() *bool { + if o == nil || IsNil(o.Routed) { + var ret *bool + return ret + } + return o.Routed +} + +// GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetRoutedOk() (*bool, bool) { + if o == nil || IsNil(o.Routed) { + return nil, false + } + return o.Routed, true +} + +// HasRouted returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasRouted() bool { + if o != nil && !IsNil(o.Routed) { + return true + } + + return false +} + +// SetRouted gets a reference to the given bool and assigns it to the Routed field. +func (o *CreateNetworkPayload) SetRouted(v *bool) { + o.Routed = v +} + +func (o CreateNetworkPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AddressFamily) { + toSerialize["addressFamily"] = o.AddressFamily + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.Routed) { + toSerialize["routed"] = o.Routed + } + return toSerialize, nil +} + +type NullableCreateNetworkPayload struct { + value *CreateNetworkPayload + isSet bool +} + +func (v NullableCreateNetworkPayload) Get() *CreateNetworkPayload { + return v.value +} + +func (v *NullableCreateNetworkPayload) Set(val *CreateNetworkPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkPayload(val *CreateNetworkPayload) *NullableCreateNetworkPayload { + return &NullableCreateNetworkPayload{value: val, isSet: true} +} + +func (v NullableCreateNetworkPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_create_snapshot_payload.go b/services/iaasalpha/model_create_snapshot_payload.go new file mode 100644 index 00000000..b1d97900 --- /dev/null +++ b/services/iaasalpha/model_create_snapshot_payload.go @@ -0,0 +1,371 @@ +/* +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 CreateSnapshotPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateSnapshotPayload{} + +// CreateSnapshotPayload Object that represents a snapshot. +type CreateSnapshotPayload struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,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. + Name *string `json:"name,omitempty"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + // The status of a snapshot object. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // Universally Unique Identifier (UUID). + // REQUIRED + VolumeId *string `json:"volumeId"` +} + +type _CreateSnapshotPayload CreateSnapshotPayload + +// NewCreateSnapshotPayload instantiates a new CreateSnapshotPayload 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 NewCreateSnapshotPayload(volumeId *string) *CreateSnapshotPayload { + this := CreateSnapshotPayload{} + this.VolumeId = volumeId + return &this +} + +// NewCreateSnapshotPayloadWithDefaults instantiates a new CreateSnapshotPayload 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 NewCreateSnapshotPayloadWithDefaults() *CreateSnapshotPayload { + this := CreateSnapshotPayload{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateSnapshotPayload) 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 *CreateSnapshotPayload) 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 *CreateSnapshotPayload) HasCreatedAt() bool { + if o != nil && !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 *CreateSnapshotPayload) SetCreatedAt(v *time.Time) { + o.CreatedAt = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateSnapshotPayload) GetId() *string { + if o == nil || IsNil(o.Id) { + var ret *string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSnapshotPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateSnapshotPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateSnapshotPayload) SetId(v *string) { + o.Id = v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateSnapshotPayload) GetLabels() *map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret *map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSnapshotPayload) GetLabelsOk() (*map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return &map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateSnapshotPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateSnapshotPayload) SetLabels(v *map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateSnapshotPayload) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSnapshotPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CreateSnapshotPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateSnapshotPayload) SetName(v *string) { + o.Name = v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *CreateSnapshotPayload) GetSize() *int64 { + if o == nil || IsNil(o.Size) { + var ret *int64 + return ret + } + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSnapshotPayload) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *CreateSnapshotPayload) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *CreateSnapshotPayload) SetSize(v *int64) { + o.Size = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateSnapshotPayload) GetStatus() *string { + if o == nil || IsNil(o.Status) { + var ret *string + return ret + } + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSnapshotPayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CreateSnapshotPayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *CreateSnapshotPayload) SetStatus(v *string) { + o.Status = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *CreateSnapshotPayload) 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 *CreateSnapshotPayload) 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 *CreateSnapshotPayload) HasUpdatedAt() bool { + if o != nil && !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 *CreateSnapshotPayload) SetUpdatedAt(v *time.Time) { + o.UpdatedAt = v +} + +// GetVolumeId returns the VolumeId field value +func (o *CreateSnapshotPayload) GetVolumeId() *string { + if o == nil || IsNil(o.VolumeId) { + var ret *string + return ret + } + + return o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value +// and a boolean to check if the value has been set. +func (o *CreateSnapshotPayload) GetVolumeIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.VolumeId, true +} + +// SetVolumeId sets field value +func (o *CreateSnapshotPayload) SetVolumeId(v *string) { + o.VolumeId = v +} + +func (o CreateSnapshotPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + toSerialize["volumeId"] = o.VolumeId + return toSerialize, nil +} + +type NullableCreateSnapshotPayload struct { + value *CreateSnapshotPayload + isSet bool +} + +func (v NullableCreateSnapshotPayload) Get() *CreateSnapshotPayload { + return v.value +} + +func (v *NullableCreateSnapshotPayload) Set(val *CreateSnapshotPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateSnapshotPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateSnapshotPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateSnapshotPayload(val *CreateSnapshotPayload) *NullableCreateSnapshotPayload { + return &NullableCreateSnapshotPayload{value: val, isSet: true} +} + +func (v NullableCreateSnapshotPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateSnapshotPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_network_range_list_response.go b/services/iaasalpha/model_network_range_list_response.go new file mode 100644 index 00000000..4bece4ee --- /dev/null +++ b/services/iaasalpha/model_network_range_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 NetworkRangeListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkRangeListResponse{} + +// NetworkRangeListResponse Network Range list response. +type NetworkRangeListResponse struct { + // A list of network ranges. + // REQUIRED + Items *[]NetworkRange `json:"items"` +} + +type _NetworkRangeListResponse NetworkRangeListResponse + +// NewNetworkRangeListResponse instantiates a new NetworkRangeListResponse 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 NewNetworkRangeListResponse(items *[]NetworkRange) *NetworkRangeListResponse { + this := NetworkRangeListResponse{} + this.Items = items + return &this +} + +// NewNetworkRangeListResponseWithDefaults instantiates a new NetworkRangeListResponse 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 NewNetworkRangeListResponseWithDefaults() *NetworkRangeListResponse { + this := NetworkRangeListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *NetworkRangeListResponse) GetItems() *[]NetworkRange { + if o == nil || IsNil(o.Items) { + var ret *[]NetworkRange + 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 *NetworkRangeListResponse) GetItemsOk() (*[]NetworkRange, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *NetworkRangeListResponse) SetItems(v *[]NetworkRange) { + o.Items = v +} + +func (o NetworkRangeListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +type NullableNetworkRangeListResponse struct { + value *NetworkRangeListResponse + isSet bool +} + +func (v NullableNetworkRangeListResponse) Get() *NetworkRangeListResponse { + return v.value +} + +func (v *NullableNetworkRangeListResponse) Set(val *NetworkRangeListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkRangeListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkRangeListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkRangeListResponse(val *NetworkRangeListResponse) *NullableNetworkRangeListResponse { + return &NullableNetworkRangeListResponse{value: val, isSet: true} +} + +func (v NullableNetworkRangeListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkRangeListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_partial_update_network_area_payload.go b/services/iaasalpha/model_partial_update_network_area_payload.go new file mode 100644 index 00000000..1159860c --- /dev/null +++ b/services/iaasalpha/model_partial_update_network_area_payload.go @@ -0,0 +1,190 @@ +/* +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 PartialUpdateNetworkAreaPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateNetworkAreaPayload{} + +// PartialUpdateNetworkAreaPayload struct for PartialUpdateNetworkAreaPayload +type PartialUpdateNetworkAreaPayload struct { + AddressFamily *UpdateAreaAddressFamily `json:"addressFamily,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. + Name *string `json:"name,omitempty"` +} + +// NewPartialUpdateNetworkAreaPayload instantiates a new PartialUpdateNetworkAreaPayload 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 NewPartialUpdateNetworkAreaPayload() *PartialUpdateNetworkAreaPayload { + this := PartialUpdateNetworkAreaPayload{} + return &this +} + +// NewPartialUpdateNetworkAreaPayloadWithDefaults instantiates a new PartialUpdateNetworkAreaPayload 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 NewPartialUpdateNetworkAreaPayloadWithDefaults() *PartialUpdateNetworkAreaPayload { + this := PartialUpdateNetworkAreaPayload{} + return &this +} + +// GetAddressFamily returns the AddressFamily field value if set, zero value otherwise. +func (o *PartialUpdateNetworkAreaPayload) GetAddressFamily() *UpdateAreaAddressFamily { + if o == nil || IsNil(o.AddressFamily) { + var ret *UpdateAreaAddressFamily + return ret + } + return o.AddressFamily +} + +// GetAddressFamilyOk returns a tuple with the AddressFamily field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkAreaPayload) GetAddressFamilyOk() (*UpdateAreaAddressFamily, bool) { + if o == nil || IsNil(o.AddressFamily) { + return nil, false + } + return o.AddressFamily, true +} + +// HasAddressFamily returns a boolean if a field has been set. +func (o *PartialUpdateNetworkAreaPayload) HasAddressFamily() bool { + if o != nil && !IsNil(o.AddressFamily) { + return true + } + + return false +} + +// SetAddressFamily gets a reference to the given UpdateAreaAddressFamily and assigns it to the AddressFamily field. +func (o *PartialUpdateNetworkAreaPayload) SetAddressFamily(v *UpdateAreaAddressFamily) { + o.AddressFamily = v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *PartialUpdateNetworkAreaPayload) GetLabels() *map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret *map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkAreaPayload) GetLabelsOk() (*map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return &map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *PartialUpdateNetworkAreaPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *PartialUpdateNetworkAreaPayload) SetLabels(v *map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PartialUpdateNetworkAreaPayload) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkAreaPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PartialUpdateNetworkAreaPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PartialUpdateNetworkAreaPayload) SetName(v *string) { + o.Name = v +} + +func (o PartialUpdateNetworkAreaPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AddressFamily) { + toSerialize["addressFamily"] = o.AddressFamily + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullablePartialUpdateNetworkAreaPayload struct { + value *PartialUpdateNetworkAreaPayload + isSet bool +} + +func (v NullablePartialUpdateNetworkAreaPayload) Get() *PartialUpdateNetworkAreaPayload { + return v.value +} + +func (v *NullablePartialUpdateNetworkAreaPayload) Set(val *PartialUpdateNetworkAreaPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateNetworkAreaPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateNetworkAreaPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateNetworkAreaPayload(val *PartialUpdateNetworkAreaPayload) *NullablePartialUpdateNetworkAreaPayload { + return &NullablePartialUpdateNetworkAreaPayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateNetworkAreaPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateNetworkAreaPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_partial_update_network_payload.go b/services/iaasalpha/model_partial_update_network_payload.go new file mode 100644 index 00000000..d00c5dfc --- /dev/null +++ b/services/iaasalpha/model_partial_update_network_payload.go @@ -0,0 +1,227 @@ +/* +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 PartialUpdateNetworkPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateNetworkPayload{} + +// PartialUpdateNetworkPayload Object that represents the request body for a network update. +type PartialUpdateNetworkPayload struct { + AddressFamily *UpdateNetworkAddressFamily `json:"addressFamily,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. + Name *string `json:"name,omitempty"` + // Shows if the network is routed and therefore accessible from other networks. + Routed *bool `json:"routed,omitempty"` +} + +// NewPartialUpdateNetworkPayload instantiates a new PartialUpdateNetworkPayload 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 NewPartialUpdateNetworkPayload() *PartialUpdateNetworkPayload { + this := PartialUpdateNetworkPayload{} + return &this +} + +// NewPartialUpdateNetworkPayloadWithDefaults instantiates a new PartialUpdateNetworkPayload 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 NewPartialUpdateNetworkPayloadWithDefaults() *PartialUpdateNetworkPayload { + this := PartialUpdateNetworkPayload{} + return &this +} + +// GetAddressFamily returns the AddressFamily field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetAddressFamily() *UpdateNetworkAddressFamily { + if o == nil || IsNil(o.AddressFamily) { + var ret *UpdateNetworkAddressFamily + return ret + } + return o.AddressFamily +} + +// GetAddressFamilyOk returns a tuple with the AddressFamily field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetAddressFamilyOk() (*UpdateNetworkAddressFamily, bool) { + if o == nil || IsNil(o.AddressFamily) { + return nil, false + } + return o.AddressFamily, true +} + +// HasAddressFamily returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasAddressFamily() bool { + if o != nil && !IsNil(o.AddressFamily) { + return true + } + + return false +} + +// SetAddressFamily gets a reference to the given UpdateNetworkAddressFamily and assigns it to the AddressFamily field. +func (o *PartialUpdateNetworkPayload) SetAddressFamily(v *UpdateNetworkAddressFamily) { + o.AddressFamily = v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetLabels() *map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret *map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetLabelsOk() (*map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return &map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *PartialUpdateNetworkPayload) SetLabels(v *map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PartialUpdateNetworkPayload) SetName(v *string) { + o.Name = v +} + +// GetRouted returns the Routed field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetRouted() *bool { + if o == nil || IsNil(o.Routed) { + var ret *bool + return ret + } + return o.Routed +} + +// GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetRoutedOk() (*bool, bool) { + if o == nil || IsNil(o.Routed) { + return nil, false + } + return o.Routed, true +} + +// HasRouted returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasRouted() bool { + if o != nil && !IsNil(o.Routed) { + return true + } + + return false +} + +// SetRouted gets a reference to the given bool and assigns it to the Routed field. +func (o *PartialUpdateNetworkPayload) SetRouted(v *bool) { + o.Routed = v +} + +func (o PartialUpdateNetworkPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AddressFamily) { + toSerialize["addressFamily"] = o.AddressFamily + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Routed) { + toSerialize["routed"] = o.Routed + } + return toSerialize, nil +} + +type NullablePartialUpdateNetworkPayload struct { + value *PartialUpdateNetworkPayload + isSet bool +} + +func (v NullablePartialUpdateNetworkPayload) Get() *PartialUpdateNetworkPayload { + return v.value +} + +func (v *NullablePartialUpdateNetworkPayload) Set(val *PartialUpdateNetworkPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateNetworkPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateNetworkPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateNetworkPayload(val *PartialUpdateNetworkPayload) *NullablePartialUpdateNetworkPayload { + return &NullablePartialUpdateNetworkPayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateNetworkPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateNetworkPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_quota.go b/services/iaasalpha/model_quota.go new file mode 100644 index 00000000..ccfba4b6 --- /dev/null +++ b/services/iaasalpha/model_quota.go @@ -0,0 +1,138 @@ +/* +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 Quota type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Quota{} + +// Quota Object that represents a single resource quota. +type Quota struct { + // REQUIRED + Limit *int64 `json:"limit"` + // REQUIRED + Usage *int64 `json:"usage"` +} + +type _Quota Quota + +// NewQuota instantiates a new Quota 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 NewQuota(limit *int64, usage *int64) *Quota { + this := Quota{} + this.Limit = limit + this.Usage = usage + return &this +} + +// NewQuotaWithDefaults instantiates a new Quota 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 NewQuotaWithDefaults() *Quota { + this := Quota{} + return &this +} + +// GetLimit returns the Limit field value +func (o *Quota) GetLimit() *int64 { + if o == nil || IsNil(o.Limit) { + var ret *int64 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *Quota) GetLimitOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Limit, true +} + +// SetLimit sets field value +func (o *Quota) SetLimit(v *int64) { + o.Limit = v +} + +// GetUsage returns the Usage field value +func (o *Quota) GetUsage() *int64 { + if o == nil || IsNil(o.Usage) { + var ret *int64 + return ret + } + + return o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value +// and a boolean to check if the value has been set. +func (o *Quota) GetUsageOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Usage, true +} + +// SetUsage sets field value +func (o *Quota) SetUsage(v *int64) { + o.Usage = v +} + +func (o Quota) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["limit"] = o.Limit + toSerialize["usage"] = o.Usage + return toSerialize, nil +} + +type NullableQuota struct { + value *Quota + isSet bool +} + +func (v NullableQuota) Get() *Quota { + return v.value +} + +func (v *NullableQuota) Set(val *Quota) { + v.value = val + v.isSet = true +} + +func (v NullableQuota) IsSet() bool { + return v.isSet +} + +func (v *NullableQuota) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuota(val *Quota) *NullableQuota { + return &NullableQuota{value: val, isSet: true} +} + +func (v NullableQuota) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuota) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_quota_list.go b/services/iaasalpha/model_quota_list.go new file mode 100644 index 00000000..60568ab2 --- /dev/null +++ b/services/iaasalpha/model_quota_list.go @@ -0,0 +1,418 @@ +/* +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 QuotaList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuotaList{} + +// QuotaList Object that represents the quotas for a project. +type QuotaList struct { + // REQUIRED + BackupGigabytes *QuotaListBackupGigabytes `json:"backupGigabytes"` + // REQUIRED + Backups *QuotaListBackups `json:"backups"` + // REQUIRED + Gigabytes *QuotaListGigabytes `json:"gigabytes"` + // REQUIRED + Networks *QuotaListNetworks `json:"networks"` + // REQUIRED + Nics *QuotaListNics `json:"nics"` + // REQUIRED + PublicIps *QuotaListPublicIps `json:"publicIps"` + // REQUIRED + Ram *QuotaListRam `json:"ram"` + // REQUIRED + SecurityGroupRules *QuotaListSecurityGroupRules `json:"securityGroupRules"` + // REQUIRED + SecurityGroups *QuotaListSecurityGroups `json:"securityGroups"` + // REQUIRED + Snapshots *QuotaListSnapshots `json:"snapshots"` + // REQUIRED + Vcpu *QuotaListVcpu `json:"vcpu"` + // REQUIRED + Volumes *QuotaListVolumes `json:"volumes"` +} + +type _QuotaList QuotaList + +// NewQuotaList instantiates a new QuotaList 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 NewQuotaList(backupGigabytes *QuotaListBackupGigabytes, backups *QuotaListBackups, gigabytes *QuotaListGigabytes, networks *QuotaListNetworks, nics *QuotaListNics, publicIps *QuotaListPublicIps, ram *QuotaListRam, securityGroupRules *QuotaListSecurityGroupRules, securityGroups *QuotaListSecurityGroups, snapshots *QuotaListSnapshots, vcpu *QuotaListVcpu, volumes *QuotaListVolumes) *QuotaList { + this := QuotaList{} + this.BackupGigabytes = backupGigabytes + this.Backups = backups + this.Gigabytes = gigabytes + this.Networks = networks + this.Nics = nics + this.PublicIps = publicIps + this.Ram = ram + this.SecurityGroupRules = securityGroupRules + this.SecurityGroups = securityGroups + this.Snapshots = snapshots + this.Vcpu = vcpu + this.Volumes = volumes + return &this +} + +// NewQuotaListWithDefaults instantiates a new QuotaList 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 NewQuotaListWithDefaults() *QuotaList { + this := QuotaList{} + return &this +} + +// GetBackupGigabytes returns the BackupGigabytes field value +func (o *QuotaList) GetBackupGigabytes() *QuotaListBackupGigabytes { + if o == nil || IsNil(o.BackupGigabytes) { + var ret *QuotaListBackupGigabytes + return ret + } + + return o.BackupGigabytes +} + +// GetBackupGigabytesOk returns a tuple with the BackupGigabytes field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetBackupGigabytesOk() (*QuotaListBackupGigabytes, bool) { + if o == nil { + return nil, false + } + return o.BackupGigabytes, true +} + +// SetBackupGigabytes sets field value +func (o *QuotaList) SetBackupGigabytes(v *QuotaListBackupGigabytes) { + o.BackupGigabytes = v +} + +// GetBackups returns the Backups field value +func (o *QuotaList) GetBackups() *QuotaListBackups { + if o == nil || IsNil(o.Backups) { + var ret *QuotaListBackups + return ret + } + + return o.Backups +} + +// GetBackupsOk returns a tuple with the Backups field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetBackupsOk() (*QuotaListBackups, bool) { + if o == nil { + return nil, false + } + return o.Backups, true +} + +// SetBackups sets field value +func (o *QuotaList) SetBackups(v *QuotaListBackups) { + o.Backups = v +} + +// GetGigabytes returns the Gigabytes field value +func (o *QuotaList) GetGigabytes() *QuotaListGigabytes { + if o == nil || IsNil(o.Gigabytes) { + var ret *QuotaListGigabytes + return ret + } + + return o.Gigabytes +} + +// GetGigabytesOk returns a tuple with the Gigabytes field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetGigabytesOk() (*QuotaListGigabytes, bool) { + if o == nil { + return nil, false + } + return o.Gigabytes, true +} + +// SetGigabytes sets field value +func (o *QuotaList) SetGigabytes(v *QuotaListGigabytes) { + o.Gigabytes = v +} + +// GetNetworks returns the Networks field value +func (o *QuotaList) GetNetworks() *QuotaListNetworks { + if o == nil || IsNil(o.Networks) { + var ret *QuotaListNetworks + return ret + } + + return o.Networks +} + +// GetNetworksOk returns a tuple with the Networks field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetNetworksOk() (*QuotaListNetworks, bool) { + if o == nil { + return nil, false + } + return o.Networks, true +} + +// SetNetworks sets field value +func (o *QuotaList) SetNetworks(v *QuotaListNetworks) { + o.Networks = v +} + +// GetNics returns the Nics field value +func (o *QuotaList) GetNics() *QuotaListNics { + if o == nil || IsNil(o.Nics) { + var ret *QuotaListNics + return ret + } + + return o.Nics +} + +// GetNicsOk returns a tuple with the Nics field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetNicsOk() (*QuotaListNics, bool) { + if o == nil { + return nil, false + } + return o.Nics, true +} + +// SetNics sets field value +func (o *QuotaList) SetNics(v *QuotaListNics) { + o.Nics = v +} + +// GetPublicIps returns the PublicIps field value +func (o *QuotaList) GetPublicIps() *QuotaListPublicIps { + if o == nil || IsNil(o.PublicIps) { + var ret *QuotaListPublicIps + return ret + } + + return o.PublicIps +} + +// GetPublicIpsOk returns a tuple with the PublicIps field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetPublicIpsOk() (*QuotaListPublicIps, bool) { + if o == nil { + return nil, false + } + return o.PublicIps, true +} + +// SetPublicIps sets field value +func (o *QuotaList) SetPublicIps(v *QuotaListPublicIps) { + o.PublicIps = v +} + +// GetRam returns the Ram field value +func (o *QuotaList) GetRam() *QuotaListRam { + if o == nil || IsNil(o.Ram) { + var ret *QuotaListRam + return ret + } + + return o.Ram +} + +// GetRamOk returns a tuple with the Ram field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetRamOk() (*QuotaListRam, bool) { + if o == nil { + return nil, false + } + return o.Ram, true +} + +// SetRam sets field value +func (o *QuotaList) SetRam(v *QuotaListRam) { + o.Ram = v +} + +// GetSecurityGroupRules returns the SecurityGroupRules field value +func (o *QuotaList) GetSecurityGroupRules() *QuotaListSecurityGroupRules { + if o == nil || IsNil(o.SecurityGroupRules) { + var ret *QuotaListSecurityGroupRules + return ret + } + + return o.SecurityGroupRules +} + +// GetSecurityGroupRulesOk returns a tuple with the SecurityGroupRules field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetSecurityGroupRulesOk() (*QuotaListSecurityGroupRules, bool) { + if o == nil { + return nil, false + } + return o.SecurityGroupRules, true +} + +// SetSecurityGroupRules sets field value +func (o *QuotaList) SetSecurityGroupRules(v *QuotaListSecurityGroupRules) { + o.SecurityGroupRules = v +} + +// GetSecurityGroups returns the SecurityGroups field value +func (o *QuotaList) GetSecurityGroups() *QuotaListSecurityGroups { + if o == nil || IsNil(o.SecurityGroups) { + var ret *QuotaListSecurityGroups + return ret + } + + return o.SecurityGroups +} + +// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetSecurityGroupsOk() (*QuotaListSecurityGroups, bool) { + if o == nil { + return nil, false + } + return o.SecurityGroups, true +} + +// SetSecurityGroups sets field value +func (o *QuotaList) SetSecurityGroups(v *QuotaListSecurityGroups) { + o.SecurityGroups = v +} + +// GetSnapshots returns the Snapshots field value +func (o *QuotaList) GetSnapshots() *QuotaListSnapshots { + if o == nil || IsNil(o.Snapshots) { + var ret *QuotaListSnapshots + return ret + } + + return o.Snapshots +} + +// GetSnapshotsOk returns a tuple with the Snapshots field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetSnapshotsOk() (*QuotaListSnapshots, bool) { + if o == nil { + return nil, false + } + return o.Snapshots, true +} + +// SetSnapshots sets field value +func (o *QuotaList) SetSnapshots(v *QuotaListSnapshots) { + o.Snapshots = v +} + +// GetVcpu returns the Vcpu field value +func (o *QuotaList) GetVcpu() *QuotaListVcpu { + if o == nil || IsNil(o.Vcpu) { + var ret *QuotaListVcpu + return ret + } + + return o.Vcpu +} + +// GetVcpuOk returns a tuple with the Vcpu field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetVcpuOk() (*QuotaListVcpu, bool) { + if o == nil { + return nil, false + } + return o.Vcpu, true +} + +// SetVcpu sets field value +func (o *QuotaList) SetVcpu(v *QuotaListVcpu) { + o.Vcpu = v +} + +// GetVolumes returns the Volumes field value +func (o *QuotaList) GetVolumes() *QuotaListVolumes { + if o == nil || IsNil(o.Volumes) { + var ret *QuotaListVolumes + return ret + } + + return o.Volumes +} + +// GetVolumesOk returns a tuple with the Volumes field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetVolumesOk() (*QuotaListVolumes, bool) { + if o == nil { + return nil, false + } + return o.Volumes, true +} + +// SetVolumes sets field value +func (o *QuotaList) SetVolumes(v *QuotaListVolumes) { + o.Volumes = v +} + +func (o QuotaList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backupGigabytes"] = o.BackupGigabytes + toSerialize["backups"] = o.Backups + toSerialize["gigabytes"] = o.Gigabytes + toSerialize["networks"] = o.Networks + toSerialize["nics"] = o.Nics + toSerialize["publicIps"] = o.PublicIps + toSerialize["ram"] = o.Ram + toSerialize["securityGroupRules"] = o.SecurityGroupRules + toSerialize["securityGroups"] = o.SecurityGroups + toSerialize["snapshots"] = o.Snapshots + toSerialize["vcpu"] = o.Vcpu + toSerialize["volumes"] = o.Volumes + return toSerialize, nil +} + +type NullableQuotaList struct { + value *QuotaList + isSet bool +} + +func (v NullableQuotaList) Get() *QuotaList { + return v.value +} + +func (v *NullableQuotaList) Set(val *QuotaList) { + v.value = val + v.isSet = true +} + +func (v NullableQuotaList) IsSet() bool { + return v.isSet +} + +func (v *NullableQuotaList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuotaList(val *QuotaList) *NullableQuotaList { + return &NullableQuotaList{value: val, isSet: true} +} + +func (v NullableQuotaList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuotaList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_quota_list_backup_gigabytes.go b/services/iaasalpha/model_quota_list_backup_gigabytes.go new file mode 100644 index 00000000..a46694b8 --- /dev/null +++ b/services/iaasalpha/model_quota_list_backup_gigabytes.go @@ -0,0 +1,138 @@ +/* +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 QuotaListBackupGigabytes type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuotaListBackupGigabytes{} + +// QuotaListBackupGigabytes Total size in GiB of backups. +type QuotaListBackupGigabytes struct { + // REQUIRED + Limit *int64 `json:"limit"` + // REQUIRED + Usage *int64 `json:"usage"` +} + +type _QuotaListBackupGigabytes QuotaListBackupGigabytes + +// NewQuotaListBackupGigabytes instantiates a new QuotaListBackupGigabytes 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 NewQuotaListBackupGigabytes(limit *int64, usage *int64) *QuotaListBackupGigabytes { + this := QuotaListBackupGigabytes{} + this.Limit = limit + this.Usage = usage + return &this +} + +// NewQuotaListBackupGigabytesWithDefaults instantiates a new QuotaListBackupGigabytes 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 NewQuotaListBackupGigabytesWithDefaults() *QuotaListBackupGigabytes { + this := QuotaListBackupGigabytes{} + return &this +} + +// GetLimit returns the Limit field value +func (o *QuotaListBackupGigabytes) GetLimit() *int64 { + if o == nil || IsNil(o.Limit) { + var ret *int64 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *QuotaListBackupGigabytes) GetLimitOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Limit, true +} + +// SetLimit sets field value +func (o *QuotaListBackupGigabytes) SetLimit(v *int64) { + o.Limit = v +} + +// GetUsage returns the Usage field value +func (o *QuotaListBackupGigabytes) GetUsage() *int64 { + if o == nil || IsNil(o.Usage) { + var ret *int64 + return ret + } + + return o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value +// and a boolean to check if the value has been set. +func (o *QuotaListBackupGigabytes) GetUsageOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Usage, true +} + +// SetUsage sets field value +func (o *QuotaListBackupGigabytes) SetUsage(v *int64) { + o.Usage = v +} + +func (o QuotaListBackupGigabytes) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["limit"] = o.Limit + toSerialize["usage"] = o.Usage + return toSerialize, nil +} + +type NullableQuotaListBackupGigabytes struct { + value *QuotaListBackupGigabytes + isSet bool +} + +func (v NullableQuotaListBackupGigabytes) Get() *QuotaListBackupGigabytes { + return v.value +} + +func (v *NullableQuotaListBackupGigabytes) Set(val *QuotaListBackupGigabytes) { + v.value = val + v.isSet = true +} + +func (v NullableQuotaListBackupGigabytes) IsSet() bool { + return v.isSet +} + +func (v *NullableQuotaListBackupGigabytes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuotaListBackupGigabytes(val *QuotaListBackupGigabytes) *NullableQuotaListBackupGigabytes { + return &NullableQuotaListBackupGigabytes{value: val, isSet: true} +} + +func (v NullableQuotaListBackupGigabytes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuotaListBackupGigabytes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_quota_list_backups.go b/services/iaasalpha/model_quota_list_backups.go new file mode 100644 index 00000000..264b8fca --- /dev/null +++ b/services/iaasalpha/model_quota_list_backups.go @@ -0,0 +1,138 @@ +/* +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 QuotaListBackups type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuotaListBackups{} + +// QuotaListBackups Number of backups. +type QuotaListBackups struct { + // REQUIRED + Limit *int64 `json:"limit"` + // REQUIRED + Usage *int64 `json:"usage"` +} + +type _QuotaListBackups QuotaListBackups + +// NewQuotaListBackups instantiates a new QuotaListBackups 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 NewQuotaListBackups(limit *int64, usage *int64) *QuotaListBackups { + this := QuotaListBackups{} + this.Limit = limit + this.Usage = usage + return &this +} + +// NewQuotaListBackupsWithDefaults instantiates a new QuotaListBackups 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 NewQuotaListBackupsWithDefaults() *QuotaListBackups { + this := QuotaListBackups{} + return &this +} + +// GetLimit returns the Limit field value +func (o *QuotaListBackups) GetLimit() *int64 { + if o == nil || IsNil(o.Limit) { + var ret *int64 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *QuotaListBackups) GetLimitOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Limit, true +} + +// SetLimit sets field value +func (o *QuotaListBackups) SetLimit(v *int64) { + o.Limit = v +} + +// GetUsage returns the Usage field value +func (o *QuotaListBackups) GetUsage() *int64 { + if o == nil || IsNil(o.Usage) { + var ret *int64 + return ret + } + + return o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value +// and a boolean to check if the value has been set. +func (o *QuotaListBackups) GetUsageOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Usage, true +} + +// SetUsage sets field value +func (o *QuotaListBackups) SetUsage(v *int64) { + o.Usage = v +} + +func (o QuotaListBackups) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["limit"] = o.Limit + toSerialize["usage"] = o.Usage + return toSerialize, nil +} + +type NullableQuotaListBackups struct { + value *QuotaListBackups + isSet bool +} + +func (v NullableQuotaListBackups) Get() *QuotaListBackups { + return v.value +} + +func (v *NullableQuotaListBackups) Set(val *QuotaListBackups) { + v.value = val + v.isSet = true +} + +func (v NullableQuotaListBackups) IsSet() bool { + return v.isSet +} + +func (v *NullableQuotaListBackups) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuotaListBackups(val *QuotaListBackups) *NullableQuotaListBackups { + return &NullableQuotaListBackups{value: val, isSet: true} +} + +func (v NullableQuotaListBackups) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuotaListBackups) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_quota_list_gigabytes.go b/services/iaasalpha/model_quota_list_gigabytes.go new file mode 100644 index 00000000..35336de7 --- /dev/null +++ b/services/iaasalpha/model_quota_list_gigabytes.go @@ -0,0 +1,138 @@ +/* +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 QuotaListGigabytes type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuotaListGigabytes{} + +// QuotaListGigabytes Total size in GiB of volumes and snapshots. +type QuotaListGigabytes struct { + // REQUIRED + Limit *int64 `json:"limit"` + // REQUIRED + Usage *int64 `json:"usage"` +} + +type _QuotaListGigabytes QuotaListGigabytes + +// NewQuotaListGigabytes instantiates a new QuotaListGigabytes 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 NewQuotaListGigabytes(limit *int64, usage *int64) *QuotaListGigabytes { + this := QuotaListGigabytes{} + this.Limit = limit + this.Usage = usage + return &this +} + +// NewQuotaListGigabytesWithDefaults instantiates a new QuotaListGigabytes 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 NewQuotaListGigabytesWithDefaults() *QuotaListGigabytes { + this := QuotaListGigabytes{} + return &this +} + +// GetLimit returns the Limit field value +func (o *QuotaListGigabytes) GetLimit() *int64 { + if o == nil || IsNil(o.Limit) { + var ret *int64 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *QuotaListGigabytes) GetLimitOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Limit, true +} + +// SetLimit sets field value +func (o *QuotaListGigabytes) SetLimit(v *int64) { + o.Limit = v +} + +// GetUsage returns the Usage field value +func (o *QuotaListGigabytes) GetUsage() *int64 { + if o == nil || IsNil(o.Usage) { + var ret *int64 + return ret + } + + return o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value +// and a boolean to check if the value has been set. +func (o *QuotaListGigabytes) GetUsageOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Usage, true +} + +// SetUsage sets field value +func (o *QuotaListGigabytes) SetUsage(v *int64) { + o.Usage = v +} + +func (o QuotaListGigabytes) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["limit"] = o.Limit + toSerialize["usage"] = o.Usage + return toSerialize, nil +} + +type NullableQuotaListGigabytes struct { + value *QuotaListGigabytes + isSet bool +} + +func (v NullableQuotaListGigabytes) Get() *QuotaListGigabytes { + return v.value +} + +func (v *NullableQuotaListGigabytes) Set(val *QuotaListGigabytes) { + v.value = val + v.isSet = true +} + +func (v NullableQuotaListGigabytes) IsSet() bool { + return v.isSet +} + +func (v *NullableQuotaListGigabytes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuotaListGigabytes(val *QuotaListGigabytes) *NullableQuotaListGigabytes { + return &NullableQuotaListGigabytes{value: val, isSet: true} +} + +func (v NullableQuotaListGigabytes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuotaListGigabytes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_quota_list_networks.go b/services/iaasalpha/model_quota_list_networks.go new file mode 100644 index 00000000..56069656 --- /dev/null +++ b/services/iaasalpha/model_quota_list_networks.go @@ -0,0 +1,138 @@ +/* +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 QuotaListNetworks type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuotaListNetworks{} + +// QuotaListNetworks Number of networks. +type QuotaListNetworks struct { + // REQUIRED + Limit *int64 `json:"limit"` + // REQUIRED + Usage *int64 `json:"usage"` +} + +type _QuotaListNetworks QuotaListNetworks + +// NewQuotaListNetworks instantiates a new QuotaListNetworks 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 NewQuotaListNetworks(limit *int64, usage *int64) *QuotaListNetworks { + this := QuotaListNetworks{} + this.Limit = limit + this.Usage = usage + return &this +} + +// NewQuotaListNetworksWithDefaults instantiates a new QuotaListNetworks 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 NewQuotaListNetworksWithDefaults() *QuotaListNetworks { + this := QuotaListNetworks{} + return &this +} + +// GetLimit returns the Limit field value +func (o *QuotaListNetworks) GetLimit() *int64 { + if o == nil || IsNil(o.Limit) { + var ret *int64 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *QuotaListNetworks) GetLimitOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Limit, true +} + +// SetLimit sets field value +func (o *QuotaListNetworks) SetLimit(v *int64) { + o.Limit = v +} + +// GetUsage returns the Usage field value +func (o *QuotaListNetworks) GetUsage() *int64 { + if o == nil || IsNil(o.Usage) { + var ret *int64 + return ret + } + + return o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value +// and a boolean to check if the value has been set. +func (o *QuotaListNetworks) GetUsageOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Usage, true +} + +// SetUsage sets field value +func (o *QuotaListNetworks) SetUsage(v *int64) { + o.Usage = v +} + +func (o QuotaListNetworks) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["limit"] = o.Limit + toSerialize["usage"] = o.Usage + return toSerialize, nil +} + +type NullableQuotaListNetworks struct { + value *QuotaListNetworks + isSet bool +} + +func (v NullableQuotaListNetworks) Get() *QuotaListNetworks { + return v.value +} + +func (v *NullableQuotaListNetworks) Set(val *QuotaListNetworks) { + v.value = val + v.isSet = true +} + +func (v NullableQuotaListNetworks) IsSet() bool { + return v.isSet +} + +func (v *NullableQuotaListNetworks) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuotaListNetworks(val *QuotaListNetworks) *NullableQuotaListNetworks { + return &NullableQuotaListNetworks{value: val, isSet: true} +} + +func (v NullableQuotaListNetworks) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuotaListNetworks) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_quota_list_nics.go b/services/iaasalpha/model_quota_list_nics.go new file mode 100644 index 00000000..1cd398f0 --- /dev/null +++ b/services/iaasalpha/model_quota_list_nics.go @@ -0,0 +1,138 @@ +/* +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 QuotaListNics type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuotaListNics{} + +// QuotaListNics Number of network interfaces. +type QuotaListNics struct { + // REQUIRED + Limit *int64 `json:"limit"` + // REQUIRED + Usage *int64 `json:"usage"` +} + +type _QuotaListNics QuotaListNics + +// NewQuotaListNics instantiates a new QuotaListNics 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 NewQuotaListNics(limit *int64, usage *int64) *QuotaListNics { + this := QuotaListNics{} + this.Limit = limit + this.Usage = usage + return &this +} + +// NewQuotaListNicsWithDefaults instantiates a new QuotaListNics 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 NewQuotaListNicsWithDefaults() *QuotaListNics { + this := QuotaListNics{} + return &this +} + +// GetLimit returns the Limit field value +func (o *QuotaListNics) GetLimit() *int64 { + if o == nil || IsNil(o.Limit) { + var ret *int64 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *QuotaListNics) GetLimitOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Limit, true +} + +// SetLimit sets field value +func (o *QuotaListNics) SetLimit(v *int64) { + o.Limit = v +} + +// GetUsage returns the Usage field value +func (o *QuotaListNics) GetUsage() *int64 { + if o == nil || IsNil(o.Usage) { + var ret *int64 + return ret + } + + return o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value +// and a boolean to check if the value has been set. +func (o *QuotaListNics) GetUsageOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Usage, true +} + +// SetUsage sets field value +func (o *QuotaListNics) SetUsage(v *int64) { + o.Usage = v +} + +func (o QuotaListNics) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["limit"] = o.Limit + toSerialize["usage"] = o.Usage + return toSerialize, nil +} + +type NullableQuotaListNics struct { + value *QuotaListNics + isSet bool +} + +func (v NullableQuotaListNics) Get() *QuotaListNics { + return v.value +} + +func (v *NullableQuotaListNics) Set(val *QuotaListNics) { + v.value = val + v.isSet = true +} + +func (v NullableQuotaListNics) IsSet() bool { + return v.isSet +} + +func (v *NullableQuotaListNics) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuotaListNics(val *QuotaListNics) *NullableQuotaListNics { + return &NullableQuotaListNics{value: val, isSet: true} +} + +func (v NullableQuotaListNics) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuotaListNics) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_quota_list_public_ips.go b/services/iaasalpha/model_quota_list_public_ips.go new file mode 100644 index 00000000..c6637999 --- /dev/null +++ b/services/iaasalpha/model_quota_list_public_ips.go @@ -0,0 +1,138 @@ +/* +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 QuotaListPublicIps type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuotaListPublicIps{} + +// QuotaListPublicIps Number of public IP addresses. +type QuotaListPublicIps struct { + // REQUIRED + Limit *int64 `json:"limit"` + // REQUIRED + Usage *int64 `json:"usage"` +} + +type _QuotaListPublicIps QuotaListPublicIps + +// NewQuotaListPublicIps instantiates a new QuotaListPublicIps 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 NewQuotaListPublicIps(limit *int64, usage *int64) *QuotaListPublicIps { + this := QuotaListPublicIps{} + this.Limit = limit + this.Usage = usage + return &this +} + +// NewQuotaListPublicIpsWithDefaults instantiates a new QuotaListPublicIps 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 NewQuotaListPublicIpsWithDefaults() *QuotaListPublicIps { + this := QuotaListPublicIps{} + return &this +} + +// GetLimit returns the Limit field value +func (o *QuotaListPublicIps) GetLimit() *int64 { + if o == nil || IsNil(o.Limit) { + var ret *int64 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *QuotaListPublicIps) GetLimitOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Limit, true +} + +// SetLimit sets field value +func (o *QuotaListPublicIps) SetLimit(v *int64) { + o.Limit = v +} + +// GetUsage returns the Usage field value +func (o *QuotaListPublicIps) GetUsage() *int64 { + if o == nil || IsNil(o.Usage) { + var ret *int64 + return ret + } + + return o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value +// and a boolean to check if the value has been set. +func (o *QuotaListPublicIps) GetUsageOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Usage, true +} + +// SetUsage sets field value +func (o *QuotaListPublicIps) SetUsage(v *int64) { + o.Usage = v +} + +func (o QuotaListPublicIps) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["limit"] = o.Limit + toSerialize["usage"] = o.Usage + return toSerialize, nil +} + +type NullableQuotaListPublicIps struct { + value *QuotaListPublicIps + isSet bool +} + +func (v NullableQuotaListPublicIps) Get() *QuotaListPublicIps { + return v.value +} + +func (v *NullableQuotaListPublicIps) Set(val *QuotaListPublicIps) { + v.value = val + v.isSet = true +} + +func (v NullableQuotaListPublicIps) IsSet() bool { + return v.isSet +} + +func (v *NullableQuotaListPublicIps) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuotaListPublicIps(val *QuotaListPublicIps) *NullableQuotaListPublicIps { + return &NullableQuotaListPublicIps{value: val, isSet: true} +} + +func (v NullableQuotaListPublicIps) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuotaListPublicIps) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_quota_list_ram.go b/services/iaasalpha/model_quota_list_ram.go new file mode 100644 index 00000000..864df772 --- /dev/null +++ b/services/iaasalpha/model_quota_list_ram.go @@ -0,0 +1,138 @@ +/* +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 QuotaListRam type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuotaListRam{} + +// QuotaListRam Amount of server RAM in MiB. +type QuotaListRam struct { + // REQUIRED + Limit *int64 `json:"limit"` + // REQUIRED + Usage *int64 `json:"usage"` +} + +type _QuotaListRam QuotaListRam + +// NewQuotaListRam instantiates a new QuotaListRam 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 NewQuotaListRam(limit *int64, usage *int64) *QuotaListRam { + this := QuotaListRam{} + this.Limit = limit + this.Usage = usage + return &this +} + +// NewQuotaListRamWithDefaults instantiates a new QuotaListRam 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 NewQuotaListRamWithDefaults() *QuotaListRam { + this := QuotaListRam{} + return &this +} + +// GetLimit returns the Limit field value +func (o *QuotaListRam) GetLimit() *int64 { + if o == nil || IsNil(o.Limit) { + var ret *int64 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *QuotaListRam) GetLimitOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Limit, true +} + +// SetLimit sets field value +func (o *QuotaListRam) SetLimit(v *int64) { + o.Limit = v +} + +// GetUsage returns the Usage field value +func (o *QuotaListRam) GetUsage() *int64 { + if o == nil || IsNil(o.Usage) { + var ret *int64 + return ret + } + + return o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value +// and a boolean to check if the value has been set. +func (o *QuotaListRam) GetUsageOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Usage, true +} + +// SetUsage sets field value +func (o *QuotaListRam) SetUsage(v *int64) { + o.Usage = v +} + +func (o QuotaListRam) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["limit"] = o.Limit + toSerialize["usage"] = o.Usage + return toSerialize, nil +} + +type NullableQuotaListRam struct { + value *QuotaListRam + isSet bool +} + +func (v NullableQuotaListRam) Get() *QuotaListRam { + return v.value +} + +func (v *NullableQuotaListRam) Set(val *QuotaListRam) { + v.value = val + v.isSet = true +} + +func (v NullableQuotaListRam) IsSet() bool { + return v.isSet +} + +func (v *NullableQuotaListRam) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuotaListRam(val *QuotaListRam) *NullableQuotaListRam { + return &NullableQuotaListRam{value: val, isSet: true} +} + +func (v NullableQuotaListRam) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuotaListRam) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_quota_list_response.go b/services/iaasalpha/model_quota_list_response.go new file mode 100644 index 00000000..f4987976 --- /dev/null +++ b/services/iaasalpha/model_quota_list_response.go @@ -0,0 +1,110 @@ +/* +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 QuotaListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuotaListResponse{} + +// QuotaListResponse Quotas list response. +type QuotaListResponse struct { + // REQUIRED + Quotas *QuotaList `json:"quotas"` +} + +type _QuotaListResponse QuotaListResponse + +// NewQuotaListResponse instantiates a new QuotaListResponse 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 NewQuotaListResponse(quotas *QuotaList) *QuotaListResponse { + this := QuotaListResponse{} + this.Quotas = quotas + return &this +} + +// NewQuotaListResponseWithDefaults instantiates a new QuotaListResponse 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 NewQuotaListResponseWithDefaults() *QuotaListResponse { + this := QuotaListResponse{} + return &this +} + +// GetQuotas returns the Quotas field value +func (o *QuotaListResponse) GetQuotas() *QuotaList { + if o == nil || IsNil(o.Quotas) { + var ret *QuotaList + return ret + } + + return o.Quotas +} + +// GetQuotasOk returns a tuple with the Quotas field value +// and a boolean to check if the value has been set. +func (o *QuotaListResponse) GetQuotasOk() (*QuotaList, bool) { + if o == nil { + return nil, false + } + return o.Quotas, true +} + +// SetQuotas sets field value +func (o *QuotaListResponse) SetQuotas(v *QuotaList) { + o.Quotas = v +} + +func (o QuotaListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["quotas"] = o.Quotas + return toSerialize, nil +} + +type NullableQuotaListResponse struct { + value *QuotaListResponse + isSet bool +} + +func (v NullableQuotaListResponse) Get() *QuotaListResponse { + return v.value +} + +func (v *NullableQuotaListResponse) Set(val *QuotaListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableQuotaListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableQuotaListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuotaListResponse(val *QuotaListResponse) *NullableQuotaListResponse { + return &NullableQuotaListResponse{value: val, isSet: true} +} + +func (v NullableQuotaListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuotaListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_quota_list_security_group_rules.go b/services/iaasalpha/model_quota_list_security_group_rules.go new file mode 100644 index 00000000..9cb2cfe1 --- /dev/null +++ b/services/iaasalpha/model_quota_list_security_group_rules.go @@ -0,0 +1,138 @@ +/* +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 QuotaListSecurityGroupRules type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuotaListSecurityGroupRules{} + +// QuotaListSecurityGroupRules Number of security group rules. +type QuotaListSecurityGroupRules struct { + // REQUIRED + Limit *int64 `json:"limit"` + // REQUIRED + Usage *int64 `json:"usage"` +} + +type _QuotaListSecurityGroupRules QuotaListSecurityGroupRules + +// NewQuotaListSecurityGroupRules instantiates a new QuotaListSecurityGroupRules 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 NewQuotaListSecurityGroupRules(limit *int64, usage *int64) *QuotaListSecurityGroupRules { + this := QuotaListSecurityGroupRules{} + this.Limit = limit + this.Usage = usage + return &this +} + +// NewQuotaListSecurityGroupRulesWithDefaults instantiates a new QuotaListSecurityGroupRules 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 NewQuotaListSecurityGroupRulesWithDefaults() *QuotaListSecurityGroupRules { + this := QuotaListSecurityGroupRules{} + return &this +} + +// GetLimit returns the Limit field value +func (o *QuotaListSecurityGroupRules) GetLimit() *int64 { + if o == nil || IsNil(o.Limit) { + var ret *int64 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *QuotaListSecurityGroupRules) GetLimitOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Limit, true +} + +// SetLimit sets field value +func (o *QuotaListSecurityGroupRules) SetLimit(v *int64) { + o.Limit = v +} + +// GetUsage returns the Usage field value +func (o *QuotaListSecurityGroupRules) GetUsage() *int64 { + if o == nil || IsNil(o.Usage) { + var ret *int64 + return ret + } + + return o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value +// and a boolean to check if the value has been set. +func (o *QuotaListSecurityGroupRules) GetUsageOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Usage, true +} + +// SetUsage sets field value +func (o *QuotaListSecurityGroupRules) SetUsage(v *int64) { + o.Usage = v +} + +func (o QuotaListSecurityGroupRules) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["limit"] = o.Limit + toSerialize["usage"] = o.Usage + return toSerialize, nil +} + +type NullableQuotaListSecurityGroupRules struct { + value *QuotaListSecurityGroupRules + isSet bool +} + +func (v NullableQuotaListSecurityGroupRules) Get() *QuotaListSecurityGroupRules { + return v.value +} + +func (v *NullableQuotaListSecurityGroupRules) Set(val *QuotaListSecurityGroupRules) { + v.value = val + v.isSet = true +} + +func (v NullableQuotaListSecurityGroupRules) IsSet() bool { + return v.isSet +} + +func (v *NullableQuotaListSecurityGroupRules) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuotaListSecurityGroupRules(val *QuotaListSecurityGroupRules) *NullableQuotaListSecurityGroupRules { + return &NullableQuotaListSecurityGroupRules{value: val, isSet: true} +} + +func (v NullableQuotaListSecurityGroupRules) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuotaListSecurityGroupRules) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_quota_list_security_groups.go b/services/iaasalpha/model_quota_list_security_groups.go new file mode 100644 index 00000000..0acc620e --- /dev/null +++ b/services/iaasalpha/model_quota_list_security_groups.go @@ -0,0 +1,138 @@ +/* +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 QuotaListSecurityGroups type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuotaListSecurityGroups{} + +// QuotaListSecurityGroups Number of security groups. +type QuotaListSecurityGroups struct { + // REQUIRED + Limit *int64 `json:"limit"` + // REQUIRED + Usage *int64 `json:"usage"` +} + +type _QuotaListSecurityGroups QuotaListSecurityGroups + +// NewQuotaListSecurityGroups instantiates a new QuotaListSecurityGroups 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 NewQuotaListSecurityGroups(limit *int64, usage *int64) *QuotaListSecurityGroups { + this := QuotaListSecurityGroups{} + this.Limit = limit + this.Usage = usage + return &this +} + +// NewQuotaListSecurityGroupsWithDefaults instantiates a new QuotaListSecurityGroups 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 NewQuotaListSecurityGroupsWithDefaults() *QuotaListSecurityGroups { + this := QuotaListSecurityGroups{} + return &this +} + +// GetLimit returns the Limit field value +func (o *QuotaListSecurityGroups) GetLimit() *int64 { + if o == nil || IsNil(o.Limit) { + var ret *int64 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *QuotaListSecurityGroups) GetLimitOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Limit, true +} + +// SetLimit sets field value +func (o *QuotaListSecurityGroups) SetLimit(v *int64) { + o.Limit = v +} + +// GetUsage returns the Usage field value +func (o *QuotaListSecurityGroups) GetUsage() *int64 { + if o == nil || IsNil(o.Usage) { + var ret *int64 + return ret + } + + return o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value +// and a boolean to check if the value has been set. +func (o *QuotaListSecurityGroups) GetUsageOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Usage, true +} + +// SetUsage sets field value +func (o *QuotaListSecurityGroups) SetUsage(v *int64) { + o.Usage = v +} + +func (o QuotaListSecurityGroups) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["limit"] = o.Limit + toSerialize["usage"] = o.Usage + return toSerialize, nil +} + +type NullableQuotaListSecurityGroups struct { + value *QuotaListSecurityGroups + isSet bool +} + +func (v NullableQuotaListSecurityGroups) Get() *QuotaListSecurityGroups { + return v.value +} + +func (v *NullableQuotaListSecurityGroups) Set(val *QuotaListSecurityGroups) { + v.value = val + v.isSet = true +} + +func (v NullableQuotaListSecurityGroups) IsSet() bool { + return v.isSet +} + +func (v *NullableQuotaListSecurityGroups) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuotaListSecurityGroups(val *QuotaListSecurityGroups) *NullableQuotaListSecurityGroups { + return &NullableQuotaListSecurityGroups{value: val, isSet: true} +} + +func (v NullableQuotaListSecurityGroups) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuotaListSecurityGroups) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_quota_list_snapshots.go b/services/iaasalpha/model_quota_list_snapshots.go new file mode 100644 index 00000000..96591fc6 --- /dev/null +++ b/services/iaasalpha/model_quota_list_snapshots.go @@ -0,0 +1,138 @@ +/* +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 QuotaListSnapshots type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuotaListSnapshots{} + +// QuotaListSnapshots Number of snapshots. +type QuotaListSnapshots struct { + // REQUIRED + Limit *int64 `json:"limit"` + // REQUIRED + Usage *int64 `json:"usage"` +} + +type _QuotaListSnapshots QuotaListSnapshots + +// NewQuotaListSnapshots instantiates a new QuotaListSnapshots 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 NewQuotaListSnapshots(limit *int64, usage *int64) *QuotaListSnapshots { + this := QuotaListSnapshots{} + this.Limit = limit + this.Usage = usage + return &this +} + +// NewQuotaListSnapshotsWithDefaults instantiates a new QuotaListSnapshots 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 NewQuotaListSnapshotsWithDefaults() *QuotaListSnapshots { + this := QuotaListSnapshots{} + return &this +} + +// GetLimit returns the Limit field value +func (o *QuotaListSnapshots) GetLimit() *int64 { + if o == nil || IsNil(o.Limit) { + var ret *int64 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *QuotaListSnapshots) GetLimitOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Limit, true +} + +// SetLimit sets field value +func (o *QuotaListSnapshots) SetLimit(v *int64) { + o.Limit = v +} + +// GetUsage returns the Usage field value +func (o *QuotaListSnapshots) GetUsage() *int64 { + if o == nil || IsNil(o.Usage) { + var ret *int64 + return ret + } + + return o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value +// and a boolean to check if the value has been set. +func (o *QuotaListSnapshots) GetUsageOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Usage, true +} + +// SetUsage sets field value +func (o *QuotaListSnapshots) SetUsage(v *int64) { + o.Usage = v +} + +func (o QuotaListSnapshots) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["limit"] = o.Limit + toSerialize["usage"] = o.Usage + return toSerialize, nil +} + +type NullableQuotaListSnapshots struct { + value *QuotaListSnapshots + isSet bool +} + +func (v NullableQuotaListSnapshots) Get() *QuotaListSnapshots { + return v.value +} + +func (v *NullableQuotaListSnapshots) Set(val *QuotaListSnapshots) { + v.value = val + v.isSet = true +} + +func (v NullableQuotaListSnapshots) IsSet() bool { + return v.isSet +} + +func (v *NullableQuotaListSnapshots) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuotaListSnapshots(val *QuotaListSnapshots) *NullableQuotaListSnapshots { + return &NullableQuotaListSnapshots{value: val, isSet: true} +} + +func (v NullableQuotaListSnapshots) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuotaListSnapshots) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_quota_list_vcpu.go b/services/iaasalpha/model_quota_list_vcpu.go new file mode 100644 index 00000000..8c34c37c --- /dev/null +++ b/services/iaasalpha/model_quota_list_vcpu.go @@ -0,0 +1,138 @@ +/* +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 QuotaListVcpu type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuotaListVcpu{} + +// QuotaListVcpu Number of server cores. +type QuotaListVcpu struct { + // REQUIRED + Limit *int64 `json:"limit"` + // REQUIRED + Usage *int64 `json:"usage"` +} + +type _QuotaListVcpu QuotaListVcpu + +// NewQuotaListVcpu instantiates a new QuotaListVcpu 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 NewQuotaListVcpu(limit *int64, usage *int64) *QuotaListVcpu { + this := QuotaListVcpu{} + this.Limit = limit + this.Usage = usage + return &this +} + +// NewQuotaListVcpuWithDefaults instantiates a new QuotaListVcpu 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 NewQuotaListVcpuWithDefaults() *QuotaListVcpu { + this := QuotaListVcpu{} + return &this +} + +// GetLimit returns the Limit field value +func (o *QuotaListVcpu) GetLimit() *int64 { + if o == nil || IsNil(o.Limit) { + var ret *int64 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *QuotaListVcpu) GetLimitOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Limit, true +} + +// SetLimit sets field value +func (o *QuotaListVcpu) SetLimit(v *int64) { + o.Limit = v +} + +// GetUsage returns the Usage field value +func (o *QuotaListVcpu) GetUsage() *int64 { + if o == nil || IsNil(o.Usage) { + var ret *int64 + return ret + } + + return o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value +// and a boolean to check if the value has been set. +func (o *QuotaListVcpu) GetUsageOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Usage, true +} + +// SetUsage sets field value +func (o *QuotaListVcpu) SetUsage(v *int64) { + o.Usage = v +} + +func (o QuotaListVcpu) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["limit"] = o.Limit + toSerialize["usage"] = o.Usage + return toSerialize, nil +} + +type NullableQuotaListVcpu struct { + value *QuotaListVcpu + isSet bool +} + +func (v NullableQuotaListVcpu) Get() *QuotaListVcpu { + return v.value +} + +func (v *NullableQuotaListVcpu) Set(val *QuotaListVcpu) { + v.value = val + v.isSet = true +} + +func (v NullableQuotaListVcpu) IsSet() bool { + return v.isSet +} + +func (v *NullableQuotaListVcpu) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuotaListVcpu(val *QuotaListVcpu) *NullableQuotaListVcpu { + return &NullableQuotaListVcpu{value: val, isSet: true} +} + +func (v NullableQuotaListVcpu) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuotaListVcpu) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_quota_list_volumes.go b/services/iaasalpha/model_quota_list_volumes.go new file mode 100644 index 00000000..06cd5059 --- /dev/null +++ b/services/iaasalpha/model_quota_list_volumes.go @@ -0,0 +1,138 @@ +/* +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 QuotaListVolumes type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuotaListVolumes{} + +// QuotaListVolumes Number of volumes. +type QuotaListVolumes struct { + // REQUIRED + Limit *int64 `json:"limit"` + // REQUIRED + Usage *int64 `json:"usage"` +} + +type _QuotaListVolumes QuotaListVolumes + +// NewQuotaListVolumes instantiates a new QuotaListVolumes 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 NewQuotaListVolumes(limit *int64, usage *int64) *QuotaListVolumes { + this := QuotaListVolumes{} + this.Limit = limit + this.Usage = usage + return &this +} + +// NewQuotaListVolumesWithDefaults instantiates a new QuotaListVolumes 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 NewQuotaListVolumesWithDefaults() *QuotaListVolumes { + this := QuotaListVolumes{} + return &this +} + +// GetLimit returns the Limit field value +func (o *QuotaListVolumes) GetLimit() *int64 { + if o == nil || IsNil(o.Limit) { + var ret *int64 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *QuotaListVolumes) GetLimitOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Limit, true +} + +// SetLimit sets field value +func (o *QuotaListVolumes) SetLimit(v *int64) { + o.Limit = v +} + +// GetUsage returns the Usage field value +func (o *QuotaListVolumes) GetUsage() *int64 { + if o == nil || IsNil(o.Usage) { + var ret *int64 + return ret + } + + return o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value +// and a boolean to check if the value has been set. +func (o *QuotaListVolumes) GetUsageOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Usage, true +} + +// SetUsage sets field value +func (o *QuotaListVolumes) SetUsage(v *int64) { + o.Usage = v +} + +func (o QuotaListVolumes) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["limit"] = o.Limit + toSerialize["usage"] = o.Usage + return toSerialize, nil +} + +type NullableQuotaListVolumes struct { + value *QuotaListVolumes + isSet bool +} + +func (v NullableQuotaListVolumes) Get() *QuotaListVolumes { + return v.value +} + +func (v *NullableQuotaListVolumes) Set(val *QuotaListVolumes) { + v.value = val + v.isSet = true +} + +func (v NullableQuotaListVolumes) IsSet() bool { + return v.isSet +} + +func (v *NullableQuotaListVolumes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuotaListVolumes(val *QuotaListVolumes) *NullableQuotaListVolumes { + return &NullableQuotaListVolumes{value: val, isSet: true} +} + +func (v NullableQuotaListVolumes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuotaListVolumes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_route_list_response.go b/services/iaasalpha/model_route_list_response.go new file mode 100644 index 00000000..aaba6cc5 --- /dev/null +++ b/services/iaasalpha/model_route_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 RouteListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RouteListResponse{} + +// RouteListResponse Route list response. +type RouteListResponse struct { + // A list of routes. + // REQUIRED + Items *[]Route `json:"items"` +} + +type _RouteListResponse RouteListResponse + +// NewRouteListResponse instantiates a new RouteListResponse 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 NewRouteListResponse(items *[]Route) *RouteListResponse { + this := RouteListResponse{} + this.Items = items + return &this +} + +// NewRouteListResponseWithDefaults instantiates a new RouteListResponse 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 NewRouteListResponseWithDefaults() *RouteListResponse { + this := RouteListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *RouteListResponse) GetItems() *[]Route { + if o == nil || IsNil(o.Items) { + var ret *[]Route + 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 *RouteListResponse) GetItemsOk() (*[]Route, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *RouteListResponse) SetItems(v *[]Route) { + o.Items = v +} + +func (o RouteListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +type NullableRouteListResponse struct { + value *RouteListResponse + isSet bool +} + +func (v NullableRouteListResponse) Get() *RouteListResponse { + return v.value +} + +func (v *NullableRouteListResponse) Set(val *RouteListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRouteListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRouteListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRouteListResponse(val *RouteListResponse) *NullableRouteListResponse { + return &NullableRouteListResponse{value: val, isSet: true} +} + +func (v NullableRouteListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRouteListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_snapshot.go b/services/iaasalpha/model_snapshot.go new file mode 100644 index 00000000..0a0f9569 --- /dev/null +++ b/services/iaasalpha/model_snapshot.go @@ -0,0 +1,371 @@ +/* +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 Snapshot type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Snapshot{} + +// Snapshot Object that represents a snapshot. +type Snapshot struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,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. + Name *string `json:"name,omitempty"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + // The status of a snapshot object. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // Universally Unique Identifier (UUID). + // REQUIRED + VolumeId *string `json:"volumeId"` +} + +type _Snapshot Snapshot + +// NewSnapshot instantiates a new Snapshot 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 NewSnapshot(volumeId *string) *Snapshot { + this := Snapshot{} + this.VolumeId = volumeId + return &this +} + +// NewSnapshotWithDefaults instantiates a new Snapshot 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 NewSnapshotWithDefaults() *Snapshot { + this := Snapshot{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Snapshot) 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 *Snapshot) 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 *Snapshot) HasCreatedAt() bool { + if o != nil && !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 *Snapshot) SetCreatedAt(v *time.Time) { + o.CreatedAt = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Snapshot) GetId() *string { + if o == nil || IsNil(o.Id) { + var ret *string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Snapshot) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Snapshot) SetId(v *string) { + o.Id = v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Snapshot) GetLabels() *map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret *map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetLabelsOk() (*map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return &map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Snapshot) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Snapshot) SetLabels(v *map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Snapshot) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Snapshot) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Snapshot) SetName(v *string) { + o.Name = v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Snapshot) GetSize() *int64 { + if o == nil || IsNil(o.Size) { + var ret *int64 + return ret + } + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Snapshot) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *Snapshot) SetSize(v *int64) { + o.Size = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Snapshot) GetStatus() *string { + if o == nil || IsNil(o.Status) { + var ret *string + return ret + } + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Snapshot) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Snapshot) SetStatus(v *string) { + o.Status = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Snapshot) 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 *Snapshot) 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 *Snapshot) HasUpdatedAt() bool { + if o != nil && !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 *Snapshot) SetUpdatedAt(v *time.Time) { + o.UpdatedAt = v +} + +// GetVolumeId returns the VolumeId field value +func (o *Snapshot) GetVolumeId() *string { + if o == nil || IsNil(o.VolumeId) { + var ret *string + return ret + } + + return o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value +// and a boolean to check if the value has been set. +func (o *Snapshot) GetVolumeIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.VolumeId, true +} + +// SetVolumeId sets field value +func (o *Snapshot) SetVolumeId(v *string) { + o.VolumeId = v +} + +func (o Snapshot) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + toSerialize["volumeId"] = o.VolumeId + return toSerialize, nil +} + +type NullableSnapshot struct { + value *Snapshot + isSet bool +} + +func (v NullableSnapshot) Get() *Snapshot { + return v.value +} + +func (v *NullableSnapshot) Set(val *Snapshot) { + v.value = val + v.isSet = true +} + +func (v NullableSnapshot) IsSet() bool { + return v.isSet +} + +func (v *NullableSnapshot) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSnapshot(val *Snapshot) *NullableSnapshot { + return &NullableSnapshot{value: val, isSet: true} +} + +func (v NullableSnapshot) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSnapshot) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_snapshot_list_response.go b/services/iaasalpha/model_snapshot_list_response.go new file mode 100644 index 00000000..87129fe2 --- /dev/null +++ b/services/iaasalpha/model_snapshot_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 SnapshotListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SnapshotListResponse{} + +// SnapshotListResponse Snapshot list response. +type SnapshotListResponse struct { + // A list containing snapshot objects. + // REQUIRED + Items *[]Snapshot `json:"items"` +} + +type _SnapshotListResponse SnapshotListResponse + +// NewSnapshotListResponse instantiates a new SnapshotListResponse 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 NewSnapshotListResponse(items *[]Snapshot) *SnapshotListResponse { + this := SnapshotListResponse{} + this.Items = items + return &this +} + +// NewSnapshotListResponseWithDefaults instantiates a new SnapshotListResponse 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 NewSnapshotListResponseWithDefaults() *SnapshotListResponse { + this := SnapshotListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *SnapshotListResponse) GetItems() *[]Snapshot { + if o == nil || IsNil(o.Items) { + var ret *[]Snapshot + 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 *SnapshotListResponse) GetItemsOk() (*[]Snapshot, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *SnapshotListResponse) SetItems(v *[]Snapshot) { + o.Items = v +} + +func (o SnapshotListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +type NullableSnapshotListResponse struct { + value *SnapshotListResponse + isSet bool +} + +func (v NullableSnapshotListResponse) Get() *SnapshotListResponse { + return v.value +} + +func (v *NullableSnapshotListResponse) Set(val *SnapshotListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSnapshotListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSnapshotListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSnapshotListResponse(val *SnapshotListResponse) *NullableSnapshotListResponse { + return &NullableSnapshotListResponse{value: val, isSet: true} +} + +func (v NullableSnapshotListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSnapshotListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_update_backup_payload.go b/services/iaasalpha/model_update_backup_payload.go new file mode 100644 index 00000000..ad09b2c3 --- /dev/null +++ b/services/iaasalpha/model_update_backup_payload.go @@ -0,0 +1,451 @@ +/* +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 UpdateBackupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateBackupPayload{} + +// UpdateBackupPayload Object that represents a backup. +type UpdateBackupPayload struct { + // Object that represents an availability zone. + AvailabilityZone *string `json:"availabilityZone,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,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. + Name *string `json:"name,omitempty"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + // Universally Unique Identifier (UUID). + SnapshotId *string `json:"snapshotId,omitempty"` + // The status of a backup object. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // Universally Unique Identifier (UUID). + VolumeId *string `json:"volumeId,omitempty"` +} + +// NewUpdateBackupPayload instantiates a new UpdateBackupPayload 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 NewUpdateBackupPayload() *UpdateBackupPayload { + this := UpdateBackupPayload{} + return &this +} + +// NewUpdateBackupPayloadWithDefaults instantiates a new UpdateBackupPayload 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 NewUpdateBackupPayloadWithDefaults() *UpdateBackupPayload { + this := UpdateBackupPayload{} + return &this +} + +// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetAvailabilityZone() *string { + if o == nil || IsNil(o.AvailabilityZone) { + var ret *string + return ret + } + return o.AvailabilityZone +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetAvailabilityZoneOk() (*string, bool) { + if o == nil || IsNil(o.AvailabilityZone) { + return nil, false + } + return o.AvailabilityZone, true +} + +// HasAvailabilityZone returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasAvailabilityZone() bool { + if o != nil && !IsNil(o.AvailabilityZone) { + return true + } + + return false +} + +// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +func (o *UpdateBackupPayload) SetAvailabilityZone(v *string) { + o.AvailabilityZone = v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *UpdateBackupPayload) 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 *UpdateBackupPayload) 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 *UpdateBackupPayload) HasCreatedAt() bool { + if o != nil && !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 *UpdateBackupPayload) SetCreatedAt(v *time.Time) { + o.CreatedAt = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetId() *string { + if o == nil || IsNil(o.Id) { + var ret *string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *UpdateBackupPayload) SetId(v *string) { + o.Id = v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetLabels() *map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret *map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetLabelsOk() (*map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return &map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateBackupPayload) SetLabels(v *map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateBackupPayload) SetName(v *string) { + o.Name = v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetSize() *int64 { + if o == nil || IsNil(o.Size) { + var ret *int64 + return ret + } + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *UpdateBackupPayload) SetSize(v *int64) { + o.Size = v +} + +// GetSnapshotId returns the SnapshotId field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetSnapshotId() *string { + if o == nil || IsNil(o.SnapshotId) { + var ret *string + return ret + } + return o.SnapshotId +} + +// GetSnapshotIdOk returns a tuple with the SnapshotId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetSnapshotIdOk() (*string, bool) { + if o == nil || IsNil(o.SnapshotId) { + return nil, false + } + return o.SnapshotId, true +} + +// HasSnapshotId returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasSnapshotId() bool { + if o != nil && !IsNil(o.SnapshotId) { + return true + } + + return false +} + +// SetSnapshotId gets a reference to the given string and assigns it to the SnapshotId field. +func (o *UpdateBackupPayload) SetSnapshotId(v *string) { + o.SnapshotId = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetStatus() *string { + if o == nil || IsNil(o.Status) { + var ret *string + return ret + } + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *UpdateBackupPayload) SetStatus(v *string) { + o.Status = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *UpdateBackupPayload) 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 *UpdateBackupPayload) 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 *UpdateBackupPayload) HasUpdatedAt() bool { + if o != nil && !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 *UpdateBackupPayload) SetUpdatedAt(v *time.Time) { + o.UpdatedAt = v +} + +// GetVolumeId returns the VolumeId field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetVolumeId() *string { + if o == nil || IsNil(o.VolumeId) { + var ret *string + return ret + } + return o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetVolumeIdOk() (*string, bool) { + if o == nil || IsNil(o.VolumeId) { + return nil, false + } + return o.VolumeId, true +} + +// HasVolumeId returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasVolumeId() bool { + if o != nil && !IsNil(o.VolumeId) { + return true + } + + return false +} + +// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +func (o *UpdateBackupPayload) SetVolumeId(v *string) { + o.VolumeId = v +} + +func (o UpdateBackupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AvailabilityZone) { + toSerialize["availabilityZone"] = o.AvailabilityZone + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.SnapshotId) { + toSerialize["snapshotId"] = o.SnapshotId + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.VolumeId) { + toSerialize["volumeId"] = o.VolumeId + } + return toSerialize, nil +} + +type NullableUpdateBackupPayload struct { + value *UpdateBackupPayload + isSet bool +} + +func (v NullableUpdateBackupPayload) Get() *UpdateBackupPayload { + return v.value +} + +func (v *NullableUpdateBackupPayload) Set(val *UpdateBackupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateBackupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateBackupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateBackupPayload(val *UpdateBackupPayload) *NullableUpdateBackupPayload { + return &NullableUpdateBackupPayload{value: val, isSet: true} +} + +func (v NullableUpdateBackupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateBackupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_update_network_address_family.go b/services/iaasalpha/model_update_network_address_family.go new file mode 100644 index 00000000..d11b03c9 --- /dev/null +++ b/services/iaasalpha/model_update_network_address_family.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 UpdateNetworkAddressFamily type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateNetworkAddressFamily{} + +// UpdateNetworkAddressFamily The addressFamily object for a network update request. +type UpdateNetworkAddressFamily struct { + Ipv4 *UpdateNetworkIPv4Body `json:"ipv4,omitempty"` + Ipv6 *UpdateNetworkIPv6Body `json:"ipv6,omitempty"` +} + +// NewUpdateNetworkAddressFamily instantiates a new UpdateNetworkAddressFamily 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 NewUpdateNetworkAddressFamily() *UpdateNetworkAddressFamily { + this := UpdateNetworkAddressFamily{} + return &this +} + +// NewUpdateNetworkAddressFamilyWithDefaults instantiates a new UpdateNetworkAddressFamily 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 NewUpdateNetworkAddressFamilyWithDefaults() *UpdateNetworkAddressFamily { + this := UpdateNetworkAddressFamily{} + return &this +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *UpdateNetworkAddressFamily) GetIpv4() *UpdateNetworkIPv4Body { + if o == nil || IsNil(o.Ipv4) { + var ret *UpdateNetworkIPv4Body + return ret + } + return o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNetworkAddressFamily) GetIpv4Ok() (*UpdateNetworkIPv4Body, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *UpdateNetworkAddressFamily) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given UpdateNetworkIPv4Body and assigns it to the Ipv4 field. +func (o *UpdateNetworkAddressFamily) SetIpv4(v *UpdateNetworkIPv4Body) { + o.Ipv4 = v +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *UpdateNetworkAddressFamily) GetIpv6() *UpdateNetworkIPv6Body { + if o == nil || IsNil(o.Ipv6) { + var ret *UpdateNetworkIPv6Body + return ret + } + return o.Ipv6 +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNetworkAddressFamily) GetIpv6Ok() (*UpdateNetworkIPv6Body, bool) { + if o == nil || IsNil(o.Ipv6) { + return nil, false + } + return o.Ipv6, true +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *UpdateNetworkAddressFamily) HasIpv6() bool { + if o != nil && !IsNil(o.Ipv6) { + return true + } + + return false +} + +// SetIpv6 gets a reference to the given UpdateNetworkIPv6Body and assigns it to the Ipv6 field. +func (o *UpdateNetworkAddressFamily) SetIpv6(v *UpdateNetworkIPv6Body) { + o.Ipv6 = v +} + +func (o UpdateNetworkAddressFamily) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Ipv6) { + toSerialize["ipv6"] = o.Ipv6 + } + return toSerialize, nil +} + +type NullableUpdateNetworkAddressFamily struct { + value *UpdateNetworkAddressFamily + isSet bool +} + +func (v NullableUpdateNetworkAddressFamily) Get() *UpdateNetworkAddressFamily { + return v.value +} + +func (v *NullableUpdateNetworkAddressFamily) Set(val *UpdateNetworkAddressFamily) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateNetworkAddressFamily) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateNetworkAddressFamily) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateNetworkAddressFamily(val *UpdateNetworkAddressFamily) *NullableUpdateNetworkAddressFamily { + return &NullableUpdateNetworkAddressFamily{value: val, isSet: true} +} + +func (v NullableUpdateNetworkAddressFamily) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateNetworkAddressFamily) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_update_network_ipv4_body.go b/services/iaasalpha/model_update_network_ipv4_body.go new file mode 100644 index 00000000..6180f462 --- /dev/null +++ b/services/iaasalpha/model_update_network_ipv4_body.go @@ -0,0 +1,174 @@ +/* +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 UpdateNetworkIPv4Body type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateNetworkIPv4Body{} + +// UpdateNetworkIPv4Body The config object for a IPv4 network update. +type UpdateNetworkIPv4Body struct { + // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway *NullableString `json:"gateway,omitempty"` + // A list containing DNS Servers/Nameservers for IPv4. + Nameservers *[]string `json:"nameservers,omitempty"` +} + +// NewUpdateNetworkIPv4Body instantiates a new UpdateNetworkIPv4Body 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 NewUpdateNetworkIPv4Body() *UpdateNetworkIPv4Body { + this := UpdateNetworkIPv4Body{} + return &this +} + +// NewUpdateNetworkIPv4BodyWithDefaults instantiates a new UpdateNetworkIPv4Body 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 NewUpdateNetworkIPv4BodyWithDefaults() *UpdateNetworkIPv4Body { + this := UpdateNetworkIPv4Body{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateNetworkIPv4Body) GetGateway() *string { + if o == nil || IsNil(o.Gateway) || IsNil(o.Gateway.Get()) { + var ret *string + return ret + } + return o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateNetworkIPv4Body) GetGatewayOk() (*string, bool) { + if o == nil || IsNil(o.Gateway) { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *UpdateNetworkIPv4Body) HasGateway() bool { + if o != nil && !IsNil(o.Gateway) && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given string and assigns it to the Gateway field. +func (o *UpdateNetworkIPv4Body) 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 *UpdateNetworkIPv4Body) 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 *UpdateNetworkIPv4Body) UnsetGateway() { + if IsNil(o.Gateway) { + o.Gateway = new(NullableString) + } + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *UpdateNetworkIPv4Body) GetNameservers() *[]string { + if o == nil || IsNil(o.Nameservers) { + var ret *[]string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNetworkIPv4Body) GetNameserversOk() (*[]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *UpdateNetworkIPv4Body) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *UpdateNetworkIPv4Body) SetNameservers(v *[]string) { + o.Nameservers = v +} + +func (o UpdateNetworkIPv4Body) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + return toSerialize, nil +} + +type NullableUpdateNetworkIPv4Body struct { + value *UpdateNetworkIPv4Body + isSet bool +} + +func (v NullableUpdateNetworkIPv4Body) Get() *UpdateNetworkIPv4Body { + return v.value +} + +func (v *NullableUpdateNetworkIPv4Body) Set(val *UpdateNetworkIPv4Body) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateNetworkIPv4Body) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateNetworkIPv4Body) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateNetworkIPv4Body(val *UpdateNetworkIPv4Body) *NullableUpdateNetworkIPv4Body { + return &NullableUpdateNetworkIPv4Body{value: val, isSet: true} +} + +func (v NullableUpdateNetworkIPv4Body) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateNetworkIPv4Body) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_update_network_ipv6_body.go b/services/iaasalpha/model_update_network_ipv6_body.go new file mode 100644 index 00000000..0d51ecb2 --- /dev/null +++ b/services/iaasalpha/model_update_network_ipv6_body.go @@ -0,0 +1,174 @@ +/* +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 UpdateNetworkIPv6Body type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateNetworkIPv6Body{} + +// UpdateNetworkIPv6Body The config object for a IPv6 network update. +type UpdateNetworkIPv6Body struct { + // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway *NullableString `json:"gateway,omitempty"` + // A list containing DNS Servers/Nameservers for IPv6. + Nameservers *[]string `json:"nameservers,omitempty"` +} + +// NewUpdateNetworkIPv6Body instantiates a new UpdateNetworkIPv6Body 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 NewUpdateNetworkIPv6Body() *UpdateNetworkIPv6Body { + this := UpdateNetworkIPv6Body{} + return &this +} + +// NewUpdateNetworkIPv6BodyWithDefaults instantiates a new UpdateNetworkIPv6Body 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 NewUpdateNetworkIPv6BodyWithDefaults() *UpdateNetworkIPv6Body { + this := UpdateNetworkIPv6Body{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateNetworkIPv6Body) GetGateway() *string { + if o == nil || IsNil(o.Gateway) || IsNil(o.Gateway.Get()) { + var ret *string + return ret + } + return o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateNetworkIPv6Body) GetGatewayOk() (*string, bool) { + if o == nil || IsNil(o.Gateway) { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *UpdateNetworkIPv6Body) HasGateway() bool { + if o != nil && !IsNil(o.Gateway) && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given string and assigns it to the Gateway field. +func (o *UpdateNetworkIPv6Body) 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 *UpdateNetworkIPv6Body) 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 *UpdateNetworkIPv6Body) UnsetGateway() { + if IsNil(o.Gateway) { + o.Gateway = new(NullableString) + } + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *UpdateNetworkIPv6Body) GetNameservers() *[]string { + if o == nil || IsNil(o.Nameservers) { + var ret *[]string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNetworkIPv6Body) GetNameserversOk() (*[]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *UpdateNetworkIPv6Body) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *UpdateNetworkIPv6Body) SetNameservers(v *[]string) { + o.Nameservers = v +} + +func (o UpdateNetworkIPv6Body) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + return toSerialize, nil +} + +type NullableUpdateNetworkIPv6Body struct { + value *UpdateNetworkIPv6Body + isSet bool +} + +func (v NullableUpdateNetworkIPv6Body) Get() *UpdateNetworkIPv6Body { + return v.value +} + +func (v *NullableUpdateNetworkIPv6Body) Set(val *UpdateNetworkIPv6Body) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateNetworkIPv6Body) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateNetworkIPv6Body) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateNetworkIPv6Body(val *UpdateNetworkIPv6Body) *NullableUpdateNetworkIPv6Body { + return &NullableUpdateNetworkIPv6Body{value: val, isSet: true} +} + +func (v NullableUpdateNetworkIPv6Body) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateNetworkIPv6Body) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_update_snapshot_payload.go b/services/iaasalpha/model_update_snapshot_payload.go new file mode 100644 index 00000000..477538ba --- /dev/null +++ b/services/iaasalpha/model_update_snapshot_payload.go @@ -0,0 +1,154 @@ +/* +IaaS-API + +This API allows you to create and modify IaaS resources. + +API version: 1alpha1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package iaasalpha + +import ( + "encoding/json" +) + +// checks if the UpdateSnapshotPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateSnapshotPayload{} + +// UpdateSnapshotPayload Object that represents an update request body of a snapshot. +type UpdateSnapshotPayload struct { + // 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. + Name *string `json:"name,omitempty"` +} + +// NewUpdateSnapshotPayload instantiates a new UpdateSnapshotPayload 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 NewUpdateSnapshotPayload() *UpdateSnapshotPayload { + this := UpdateSnapshotPayload{} + return &this +} + +// NewUpdateSnapshotPayloadWithDefaults instantiates a new UpdateSnapshotPayload 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 NewUpdateSnapshotPayloadWithDefaults() *UpdateSnapshotPayload { + this := UpdateSnapshotPayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateSnapshotPayload) GetLabels() *map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret *map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateSnapshotPayload) GetLabelsOk() (*map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return &map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateSnapshotPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateSnapshotPayload) SetLabels(v *map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateSnapshotPayload) GetName() *string { + if o == nil || IsNil(o.Name) { + var ret *string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateSnapshotPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateSnapshotPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateSnapshotPayload) SetName(v *string) { + o.Name = v +} + +func (o UpdateSnapshotPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableUpdateSnapshotPayload struct { + value *UpdateSnapshotPayload + isSet bool +} + +func (v NullableUpdateSnapshotPayload) Get() *UpdateSnapshotPayload { + return v.value +} + +func (v *NullableUpdateSnapshotPayload) Set(val *UpdateSnapshotPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateSnapshotPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateSnapshotPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateSnapshotPayload(val *UpdateSnapshotPayload) *NullableUpdateSnapshotPayload { + return &NullableUpdateSnapshotPayload{value: val, isSet: true} +} + +func (v NullableUpdateSnapshotPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateSnapshotPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaasalpha/model_v1alpha1_update_route_of_area_payload.go b/services/iaasalpha/model_v1alpha1_update_route_of_area_payload.go new file mode 100644 index 00000000..96aadb5a --- /dev/null +++ b/services/iaasalpha/model_v1alpha1_update_route_of_area_payload.go @@ -0,0 +1,117 @@ +/* +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 V1alpha1UpdateRouteOfAreaPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &V1alpha1UpdateRouteOfAreaPayload{} + +// V1alpha1UpdateRouteOfAreaPayload Object that represents the request body for a route update. +type V1alpha1UpdateRouteOfAreaPayload struct { + // Object that represents the labels of an object. + Labels *map[string]interface{} `json:"labels,omitempty"` +} + +// NewV1alpha1UpdateRouteOfAreaPayload instantiates a new V1alpha1UpdateRouteOfAreaPayload 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 NewV1alpha1UpdateRouteOfAreaPayload() *V1alpha1UpdateRouteOfAreaPayload { + this := V1alpha1UpdateRouteOfAreaPayload{} + return &this +} + +// NewV1alpha1UpdateRouteOfAreaPayloadWithDefaults instantiates a new V1alpha1UpdateRouteOfAreaPayload 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 NewV1alpha1UpdateRouteOfAreaPayloadWithDefaults() *V1alpha1UpdateRouteOfAreaPayload { + this := V1alpha1UpdateRouteOfAreaPayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *V1alpha1UpdateRouteOfAreaPayload) GetLabels() *map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret *map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V1alpha1UpdateRouteOfAreaPayload) GetLabelsOk() (*map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return &map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *V1alpha1UpdateRouteOfAreaPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *V1alpha1UpdateRouteOfAreaPayload) SetLabels(v *map[string]interface{}) { + o.Labels = v +} + +func (o V1alpha1UpdateRouteOfAreaPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + return toSerialize, nil +} + +type NullableV1alpha1UpdateRouteOfAreaPayload struct { + value *V1alpha1UpdateRouteOfAreaPayload + isSet bool +} + +func (v NullableV1alpha1UpdateRouteOfAreaPayload) Get() *V1alpha1UpdateRouteOfAreaPayload { + return v.value +} + +func (v *NullableV1alpha1UpdateRouteOfAreaPayload) Set(val *V1alpha1UpdateRouteOfAreaPayload) { + v.value = val + v.isSet = true +} + +func (v NullableV1alpha1UpdateRouteOfAreaPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableV1alpha1UpdateRouteOfAreaPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV1alpha1UpdateRouteOfAreaPayload(val *V1alpha1UpdateRouteOfAreaPayload) *NullableV1alpha1UpdateRouteOfAreaPayload { + return &NullableV1alpha1UpdateRouteOfAreaPayload{value: val, isSet: true} +} + +func (v NullableV1alpha1UpdateRouteOfAreaPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV1alpha1UpdateRouteOfAreaPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +}