diff --git a/services/logme/api_default.go b/services/logme/api_default.go index 4bc445a28..75330c085 100644 --- a/services/logme/api_default.go +++ b/services/logme/api_default.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -31,417 +31,452 @@ type DefaultApi interface { CreateBackup create a backup @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiCreateBackupRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateBackup(ctx context.Context, instanceId string, projectId string) ApiCreateBackupRequest + CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest /* CreateBackupExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return []CreateBackupResponseItem // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateBackupExecute(ctx context.Context, instanceId string, projectId string) ([]CreateBackupResponseItem, error) + CreateBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string) ([]CreateBackupResponseItem, error) /* CreateCredentials create new credentials Create new service credentials @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiCreateCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateCredentials(ctx context.Context, projectId string, instanceId string) ApiCreateCredentialsRequest + CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest /* CreateCredentialsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return CredentialsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*CredentialsResponse, error) + CreateCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CredentialsResponse, error) /* CreateInstance provision Provision a service instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiCreateInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest + CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest /* CreateInstanceExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return CreateInstanceResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - CreateInstanceExecute(ctx context.Context, projectId string) (*CreateInstanceResponse, error) + CreateInstanceExecute(ctx context.Context, projectId string, regionId string) (*CreateInstanceResponse, error) /* DeleteCredentials delete credentials by id Delete a service credentials. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Id of the credentials being deleted @return ApiDeleteCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest + DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest /* DeleteCredentialsExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) error + DeleteCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) error /* DeleteInstance delete service instance Deprovision a service instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId Id of instance being deleted + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiDeleteInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest + DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest /* DeleteInstanceExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DeleteInstanceExecute(ctx context.Context, projectId string, instanceId string) error + DeleteInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error /* DownloadBackup download backup @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param backupId Backup id - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id @return ApiDownloadBackupRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DownloadBackup(ctx context.Context, backupId int32, instanceId string, projectId string) ApiDownloadBackupRequest + DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest /* DownloadBackupExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param backupId Backup id - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id @return *os.File // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - DownloadBackupExecute(ctx context.Context, backupId int32, instanceId string, projectId string) (*os.File, error) + DownloadBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*os.File, error) /* GetCredentials get credentials by id get a service credentials by credentials id @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Credentials id of credentials to fetch @return ApiGetCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiGetCredentialsRequest + GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest /* GetCredentialsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Credentials id of credentials to fetch @return CredentialsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) (*CredentialsResponse, error) + GetCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) (*CredentialsResponse, error) /* GetInstance get a service instance get a service instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiGetInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest + GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest /* GetInstanceExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return Instance // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetInstanceExecute(ctx context.Context, projectId string, instanceId string) (*Instance, error) + GetInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*Instance, error) /* GetMetrics get latest metrics for cpu load, memory and disk usage @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiGetMetricsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetMetrics(ctx context.Context, instanceId string, projectId string) ApiGetMetricsRequest + GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest /* GetMetricsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return GetMetricsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - GetMetricsExecute(ctx context.Context, instanceId string, projectId string) (*GetMetricsResponse, error) + GetMetricsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*GetMetricsResponse, error) /* ListBackups get latest backup information for provided instanceId @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListBackupsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListBackups(ctx context.Context, instanceId string, projectId string) ApiListBackupsRequest + ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest /* ListBackupsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ListBackupsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListBackupsExecute(ctx context.Context, instanceId string, projectId string) (*ListBackupsResponse, error) + ListBackupsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListBackupsResponse, error) /* ListCredentials get list of credentials ids get list all credentials ids for instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiListCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListCredentials(ctx context.Context, projectId string, instanceId string) ApiListCredentialsRequest + ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest /* ListCredentialsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ListCredentialsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*ListCredentialsResponse, error) + ListCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListCredentialsResponse, error) /* ListInstances get service instances list Get a list of available instances @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListInstancesRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest + ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest /* ListInstancesExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ListInstancesResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListInstancesExecute(ctx context.Context, projectId string) (*ListInstancesResponse, error) + ListInstancesExecute(ctx context.Context, projectId string, regionId string) (*ListInstancesResponse, error) /* ListOfferings get the service offerings Get the service offerings that the service broker offers. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListOfferingsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListOfferings(ctx context.Context, projectId string) ApiListOfferingsRequest + ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest /* ListOfferingsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ListOfferingsResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListOfferingsExecute(ctx context.Context, projectId string) (*ListOfferingsResponse, error) + ListOfferingsExecute(ctx context.Context, projectId string, regionId string) (*ListOfferingsResponse, error) /* ListRestores get latest restore information for provided instanceId @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListRestoresRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListRestores(ctx context.Context, instanceId string, projectId string) ApiListRestoresRequest + ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest /* ListRestoresExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ListRestoresResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListRestoresExecute(ctx context.Context, instanceId string, projectId string) (*ListRestoresResponse, error) + ListRestoresExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListRestoresResponse, error) /* PartialUpdateInstance update a service instance Update a service instance. This could be a sgw acl update or a plan upgrade. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId id of the instance being updated + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiPartialUpdateInstanceRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - PartialUpdateInstance(ctx context.Context, projectId string, instanceId string) ApiPartialUpdateInstanceRequest + PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest /* PartialUpdateInstanceExecute executes the request // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - PartialUpdateInstanceExecute(ctx context.Context, projectId string, instanceId string) error + PartialUpdateInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error /* TriggerRecreate trigger a recreate @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRecreateRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRecreate(ctx context.Context, instanceId string, projectId string) ApiTriggerRecreateRequest + TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest /* TriggerRecreateExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return CreateInstanceResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRecreateExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) + TriggerRecreateExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) /* TriggerRestart trigger a restart @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRestartRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestart(ctx context.Context, instanceId string, projectId string) ApiTriggerRestartRequest + TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest /* TriggerRestartExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return CreateInstanceResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestartExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) + TriggerRestartExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) /* TriggerRestore trigger a restore @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @param backupId Backup id @return ApiTriggerRestoreRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestore(ctx context.Context, instanceId string, projectId string, backupId int32) ApiTriggerRestoreRequest + TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest /* TriggerRestoreExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @param backupId Backup id @return TriggerRestoreResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - TriggerRestoreExecute(ctx context.Context, instanceId string, projectId string, backupId int32) (*TriggerRestoreResponse, error) + TriggerRestoreExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*TriggerRestoreResponse, error) /* UpdateBackupsConfig backups configuration update Update the configuration for backups for your instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiUpdateBackupsConfigRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - UpdateBackupsConfig(ctx context.Context, instanceId string, projectId string) ApiUpdateBackupsConfigRequest + UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest /* UpdateBackupsConfigExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return UpdateBackupsConfigResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - UpdateBackupsConfigExecute(ctx context.Context, instanceId string, projectId string) (*UpdateBackupsConfigResponse, error) + UpdateBackupsConfigExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*UpdateBackupsConfigResponse, error) } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -452,6 +487,9 @@ type ApiCreateBackupRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateCredentialsRequest interface { + // Parameters for requested credentials + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*CredentialsResponse, error) } @@ -575,8 +613,9 @@ type DefaultApiService service type CreateBackupRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -597,9 +636,10 @@ func (r CreateBackupRequest) Execute() ([]CreateBackupResponseItem, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -654,6 +694,28 @@ func (r CreateBackupRequest) Execute() ([]CreateBackupResponseItem, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = 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 = 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 = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -696,36 +758,48 @@ CreateBackup: create a backup Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiCreateBackupRequest */ -func (a *APIClient) CreateBackup(ctx context.Context, instanceId string, projectId string) ApiCreateBackupRequest { +func (a *APIClient) CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest { return CreateBackupRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) CreateBackupExecute(ctx context.Context, instanceId string, projectId string) ([]CreateBackupResponseItem, error) { +func (a *APIClient) CreateBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string) ([]CreateBackupResponseItem, error) { r := CreateBackupRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateCredentialsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - instanceId string + ctx context.Context + apiService *DefaultApiService + projectId string + regionId string + instanceId string + createCredentialsPayload *CreateCredentialsPayload +} + +// Parameters for requested credentials +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r CreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { + r.createCredentialsPayload = &createCredentialsPayload + return r } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -746,8 +820,9 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -755,7 +830,7 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -771,6 +846,8 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createCredentialsPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -812,6 +889,17 @@ func (r CreateCredentialsRequest) Execute() (*CredentialsResponse, error) { } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = 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 } @@ -835,25 +923,28 @@ CreateCredentials: create new credentials Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiCreateCredentialsRequest */ -func (a *APIClient) CreateCredentials(ctx context.Context, projectId string, instanceId string) ApiCreateCredentialsRequest { +func (a *APIClient) CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest { return CreateCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) CreateCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*CredentialsResponse, error) { +func (a *APIClient) CreateCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CredentialsResponse, error) { r := CreateCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -864,6 +955,7 @@ type CreateInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string createInstancePayload *CreateInstancePayload } @@ -892,8 +984,9 @@ func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -964,6 +1057,17 @@ func (r CreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 409 { var v Error err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -996,23 +1100,26 @@ CreateInstance: provision Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiCreateInstanceRequest */ -func (a *APIClient) CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest { +func (a *APIClient) CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest { return CreateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) CreateInstanceExecute(ctx context.Context, projectId string) (*CreateInstanceResponse, error) { +func (a *APIClient) CreateInstanceExecute(ctx context.Context, projectId string, regionId string) (*CreateInstanceResponse, error) { r := CreateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } return r.Execute() } @@ -1022,6 +1129,7 @@ type DeleteCredentialsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string credentialsId string } @@ -1043,8 +1151,9 @@ func (r DeleteCredentialsRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(ParameterValueToString(r.credentialsId, "credentialsId")), -1) @@ -1101,6 +1210,28 @@ func (r DeleteCredentialsRequest) Execute() error { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = 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 = 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 = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1123,27 +1254,30 @@ DeleteCredentials: delete credentials by id Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Id of the credentials being deleted @return ApiDeleteCredentialsRequest */ -func (a *APIClient) DeleteCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { +func (a *APIClient) DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { return DeleteCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DeleteCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) error { +func (a *APIClient) DeleteCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) error { r := DeleteCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } @@ -1155,6 +1289,7 @@ type DeleteInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string } @@ -1175,8 +1310,9 @@ func (r DeleteInstanceRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -1243,6 +1379,17 @@ func (r DeleteInstanceRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = 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 = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1265,25 +1412,28 @@ DeleteInstance: delete service instance Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId Id of instance being deleted + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiDeleteInstanceRequest */ -func (a *APIClient) DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest { +func (a *APIClient) DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest { return DeleteInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, instanceId string) error { +func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error { r := DeleteInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -1293,9 +1443,10 @@ func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, type DownloadBackupRequest struct { ctx context.Context apiService *DefaultApiService - backupId int32 - instanceId string projectId string + regionId string + instanceId string + backupId int32 } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1316,10 +1467,11 @@ func (r DownloadBackupRequest) Execute() (*os.File, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups/{backupId}/download" - localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/download" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1374,6 +1526,39 @@ func (r DownloadBackupRequest) Execute() (*os.File, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = 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 = 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 = 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 = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1405,29 +1590,32 @@ DownloadBackup: download backup Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param backupId Backup id - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id @return ApiDownloadBackupRequest */ -func (a *APIClient) DownloadBackup(ctx context.Context, backupId int32, instanceId string, projectId string) ApiDownloadBackupRequest { +func (a *APIClient) DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest { return DownloadBackupRequest{ apiService: a.defaultApi, ctx: ctx, - backupId: backupId, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DownloadBackupExecute(ctx context.Context, backupId int32, instanceId string, projectId string) (*os.File, error) { +func (a *APIClient) DownloadBackupExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*os.File, error) { r := DownloadBackupRequest{ apiService: a.defaultApi, ctx: ctx, - backupId: backupId, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, } return r.Execute() } @@ -1437,6 +1625,7 @@ type GetCredentialsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string credentialsId string } @@ -1459,8 +1648,9 @@ func (r GetCredentialsRequest) Execute() (*CredentialsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(ParameterValueToString(r.credentialsId, "credentialsId")), -1) @@ -1517,6 +1707,28 @@ func (r GetCredentialsRequest) Execute() (*CredentialsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = 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 = 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 = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1549,27 +1761,30 @@ GetCredentials: get credentials by id Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @param credentialsId Credentials id of credentials to fetch @return ApiGetCredentialsRequest */ -func (a *APIClient) GetCredentials(ctx context.Context, projectId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { +func (a *APIClient) GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { return GetCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetCredentialsExecute(ctx context.Context, projectId string, instanceId string, credentialsId string) (*CredentialsResponse, error) { +func (a *APIClient) GetCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) (*CredentialsResponse, error) { r := GetCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, credentialsId: credentialsId, } @@ -1581,6 +1796,7 @@ type GetInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string } @@ -1602,8 +1818,9 @@ func (r GetInstanceRequest) Execute() (*Instance, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -1659,6 +1876,28 @@ func (r GetInstanceRequest) Execute() (*Instance, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = 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 = 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 = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1702,25 +1941,28 @@ GetInstance: get a service instance Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiGetInstanceRequest */ -func (a *APIClient) GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest { +func (a *APIClient) GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest { return GetInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, instanceId string) (*Instance, error) { +func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*Instance, error) { r := GetInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -1730,8 +1972,9 @@ func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, in type GetMetricsRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1752,9 +1995,10 @@ func (r GetMetricsRequest) Execute() (*GetMetricsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/metrics" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/metrics" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1809,6 +2053,28 @@ func (r GetMetricsRequest) Execute() (*GetMetricsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = 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 = 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 = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1840,26 +2106,29 @@ GetMetrics: get latest metrics for cpu load, memory and disk usage Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiGetMetricsRequest */ -func (a *APIClient) GetMetrics(ctx context.Context, instanceId string, projectId string) ApiGetMetricsRequest { +func (a *APIClient) GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest { return GetMetricsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetMetricsExecute(ctx context.Context, instanceId string, projectId string) (*GetMetricsResponse, error) { +func (a *APIClient) GetMetricsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*GetMetricsResponse, error) { r := GetMetricsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -1868,8 +2137,9 @@ func (a *APIClient) GetMetricsExecute(ctx context.Context, instanceId string, pr type ListBackupsRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1890,9 +2160,10 @@ func (r ListBackupsRequest) Execute() (*ListBackupsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1947,6 +2218,28 @@ func (r ListBackupsRequest) Execute() (*ListBackupsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = 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 = 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 = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1978,26 +2271,29 @@ ListBackups: get latest backup information for provided instanceId Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListBackupsRequest */ -func (a *APIClient) ListBackups(ctx context.Context, instanceId string, projectId string) ApiListBackupsRequest { +func (a *APIClient) ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest { return ListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListBackupsExecute(ctx context.Context, instanceId string, projectId string) (*ListBackupsResponse, error) { +func (a *APIClient) ListBackupsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListBackupsResponse, error) { r := ListBackupsRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2007,6 +2303,7 @@ type ListCredentialsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string } @@ -2028,8 +2325,9 @@ func (r ListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/credentials" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -2085,6 +2383,28 @@ func (r ListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = 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 = 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 = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2117,25 +2437,28 @@ ListCredentials: get list of credentials ids Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @param instanceId Instance id @return ApiListCredentialsRequest */ -func (a *APIClient) ListCredentials(ctx context.Context, projectId string, instanceId string) ApiListCredentialsRequest { +func (a *APIClient) ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest { return ListCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListCredentialsExecute(ctx context.Context, projectId string, instanceId string) (*ListCredentialsResponse, error) { +func (a *APIClient) ListCredentialsExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListCredentialsResponse, error) { r := ListCredentialsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -2146,6 +2469,7 @@ type ListInstancesRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2166,8 +2490,9 @@ func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2222,6 +2547,28 @@ func (r ListInstancesRequest) Execute() (*ListInstancesResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = 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 = 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 = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2254,23 +2601,26 @@ ListInstances: get service instances list Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId + @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListInstancesRequest */ -func (a *APIClient) ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest { +func (a *APIClient) ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest { return ListInstancesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string) (*ListInstancesResponse, error) { +func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string, regionId string) (*ListInstancesResponse, error) { r := ListInstancesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } return r.Execute() } @@ -2280,6 +2630,7 @@ type ListOfferingsRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2300,8 +2651,9 @@ func (r ListOfferingsRequest) Execute() (*ListOfferingsResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/offerings" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/offerings" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2356,6 +2708,38 @@ func (r ListOfferingsRequest) Execute() (*ListOfferingsResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = 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 = 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 = 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 } @@ -2379,22 +2763,25 @@ Deprecated: Will be removed after 2026-09-30. Move to the packages generated for @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project id on which user has permissions + @param regionId region in which the project resides @return ApiListOfferingsRequest */ -func (a *APIClient) ListOfferings(ctx context.Context, projectId string) ApiListOfferingsRequest { +func (a *APIClient) ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest { return ListOfferingsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListOfferingsExecute(ctx context.Context, projectId string) (*ListOfferingsResponse, error) { +func (a *APIClient) ListOfferingsExecute(ctx context.Context, projectId string, regionId string) (*ListOfferingsResponse, error) { r := ListOfferingsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, } return r.Execute() } @@ -2403,8 +2790,9 @@ func (a *APIClient) ListOfferingsExecute(ctx context.Context, projectId string) type ListRestoresRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2425,9 +2813,10 @@ func (r ListRestoresRequest) Execute() (*ListRestoresResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/restores" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restores" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2482,6 +2871,28 @@ func (r ListRestoresRequest) Execute() (*ListRestoresResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = 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 = 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 = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2513,26 +2924,29 @@ ListRestores: get latest restore information for provided instanceId Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiListRestoresRequest */ -func (a *APIClient) ListRestores(ctx context.Context, instanceId string, projectId string) ApiListRestoresRequest { +func (a *APIClient) ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest { return ListRestoresRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListRestoresExecute(ctx context.Context, instanceId string, projectId string) (*ListRestoresResponse, error) { +func (a *APIClient) ListRestoresExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*ListRestoresResponse, error) { r := ListRestoresRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2542,6 +2956,7 @@ type PartialUpdateInstanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + regionId string instanceId string partialUpdateInstancePayload *PartialUpdateInstancePayload } @@ -2570,8 +2985,9 @@ func (r PartialUpdateInstanceRequest) Execute() error { return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) @@ -2643,6 +3059,17 @@ func (r PartialUpdateInstanceRequest) Execute() error { newErr.Model = v return newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = 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 = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2665,25 +3092,28 @@ PartialUpdateInstance: update a service instance Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId - @param instanceId id of the instance being updated + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiPartialUpdateInstanceRequest */ -func (a *APIClient) PartialUpdateInstance(ctx context.Context, projectId string, instanceId string) ApiPartialUpdateInstanceRequest { +func (a *APIClient) PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest { return PartialUpdateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) PartialUpdateInstanceExecute(ctx context.Context, projectId string, instanceId string) error { +func (a *APIClient) PartialUpdateInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error { r := PartialUpdateInstanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + regionId: regionId, instanceId: instanceId, } return r.Execute() @@ -2693,8 +3123,9 @@ func (a *APIClient) PartialUpdateInstanceExecute(ctx context.Context, projectId type TriggerRecreateRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2715,9 +3146,10 @@ func (r TriggerRecreateRequest) Execute() (*CreateInstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/recreate" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/recreate" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2772,6 +3204,28 @@ func (r TriggerRecreateRequest) Execute() (*CreateInstanceResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = 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 = 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 = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2814,26 +3268,29 @@ TriggerRecreate: trigger a recreate Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRecreateRequest */ -func (a *APIClient) TriggerRecreate(ctx context.Context, instanceId string, projectId string) ApiTriggerRecreateRequest { +func (a *APIClient) TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest { return TriggerRecreateRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) TriggerRecreateExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) { +func (a *APIClient) TriggerRecreateExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) { r := TriggerRecreateRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2842,8 +3299,9 @@ func (a *APIClient) TriggerRecreateExecute(ctx context.Context, instanceId strin type TriggerRestartRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -2864,9 +3322,10 @@ func (r TriggerRestartRequest) Execute() (*CreateInstanceResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/restart" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restart" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2921,6 +3380,28 @@ func (r TriggerRestartRequest) Execute() (*CreateInstanceResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = 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 = 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 = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2963,26 +3444,29 @@ TriggerRestart: trigger a restart Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiTriggerRestartRequest */ -func (a *APIClient) TriggerRestart(ctx context.Context, instanceId string, projectId string) ApiTriggerRestartRequest { +func (a *APIClient) TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest { return TriggerRestartRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) TriggerRestartExecute(ctx context.Context, instanceId string, projectId string) (*CreateInstanceResponse, error) { +func (a *APIClient) TriggerRestartExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*CreateInstanceResponse, error) { r := TriggerRestartRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } @@ -2991,8 +3475,9 @@ func (a *APIClient) TriggerRestartExecute(ctx context.Context, instanceId string type TriggerRestoreRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string backupId int32 } @@ -3014,9 +3499,10 @@ func (r TriggerRestoreRequest) Execute() (*TriggerRestoreResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups/{backupId}/restore" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/restore" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(r.backupId, "backupId")), -1) localVarHeaderParams := make(map[string]string) @@ -3072,6 +3558,28 @@ func (r TriggerRestoreRequest) Execute() (*TriggerRestoreResponse, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = 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 = 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 = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -3114,28 +3622,31 @@ TriggerRestore: trigger a restore Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @param backupId Backup id @return ApiTriggerRestoreRequest */ -func (a *APIClient) TriggerRestore(ctx context.Context, instanceId string, projectId string, backupId int32) ApiTriggerRestoreRequest { +func (a *APIClient) TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest { return TriggerRestoreRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, backupId: backupId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) TriggerRestoreExecute(ctx context.Context, instanceId string, projectId string, backupId int32) (*TriggerRestoreResponse, error) { +func (a *APIClient) TriggerRestoreExecute(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) (*TriggerRestoreResponse, error) { r := TriggerRestoreRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, backupId: backupId, } return r.Execute() @@ -3145,8 +3656,9 @@ func (a *APIClient) TriggerRestoreExecute(ctx context.Context, instanceId string type UpdateBackupsConfigRequest struct { ctx context.Context apiService *DefaultApiService - instanceId string projectId string + regionId string + instanceId string updateBackupsConfigPayload *UpdateBackupsConfigPayload } @@ -3175,9 +3687,10 @@ func (r UpdateBackupsConfigRequest) Execute() (*UpdateBackupsConfigResponse, err return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups-config" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups-config" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3237,6 +3750,28 @@ func (r UpdateBackupsConfigRequest) Execute() (*UpdateBackupsConfigResponse, err Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = 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 = 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 = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -3280,26 +3815,29 @@ UpdateBackupsConfig: backups configuration update Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance id @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id @return ApiUpdateBackupsConfigRequest */ -func (a *APIClient) UpdateBackupsConfig(ctx context.Context, instanceId string, projectId string) ApiUpdateBackupsConfigRequest { +func (a *APIClient) UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest { return UpdateBackupsConfigRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) UpdateBackupsConfigExecute(ctx context.Context, instanceId string, projectId string) (*UpdateBackupsConfigResponse, error) { +func (a *APIClient) UpdateBackupsConfigExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*UpdateBackupsConfigResponse, error) { r := UpdateBackupsConfigRequest{ apiService: a.defaultApi, ctx: ctx, - instanceId: instanceId, projectId: projectId, + regionId: regionId, + instanceId: instanceId, } return r.Execute() } diff --git a/services/logme/client.go b/services/logme/client.go index 2ff0c3e54..931fc8fcf 100644 --- a/services/logme/client.go +++ b/services/logme/client.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -43,7 +43,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the STACKIT LogMe API API v1.1.0 +// APIClient manages communication with the STACKIT LogMe API API v2.1.0 // In most cases there should be only one, shared, APIClient. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type APIClient struct { diff --git a/services/logme/configuration.go b/services/logme/configuration.go index 7c34df0e6..805016815 100644 --- a/services/logme/configuration.go +++ b/services/logme/configuration.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -24,15 +24,12 @@ func NewConfiguration() *config.Configuration { Debug: false, Servers: config.ServerConfigurations{ { - URL: "https://logme.api.{region}stackit.cloud", + URL: "https://logme.api.stackit.cloud", Description: "No description provided", Variables: map[string]config.ServerVariable{ "region": { Description: "No description provided", - DefaultValue: "eu01.", - EnumValues: []string{ - "eu01.", - }, + DefaultValue: "global", }, }, }, diff --git a/services/logme/model_backup.go b/services/logme/model_backup.go index c3aacab63..03bdb1dbd 100644 --- a/services/logme/model_backup.go +++ b/services/logme/model_backup.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -186,8 +186,10 @@ type Backup struct { Downloadable BackupgetDownloadableAttributeType `json:"downloadable,omitempty"` // REQUIRED FinishedAt BackupGetFinishedAtAttributeType `json:"finished_at" required:"true"` + // Can be cast to int32 without loss of precision. // REQUIRED - Id BackupGetIdAttributeType `json:"id" required:"true"` + Id BackupGetIdAttributeType `json:"id" required:"true"` + // Can be cast to int32 without loss of precision. Size BackupGetSizeAttributeType `json:"size,omitempty"` // REQUIRED Status BackupGetStatusAttributeType `json:"status" required:"true"` diff --git a/services/logme/model_backup_test.go b/services/logme/model_backup_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_backup_test.go +++ b/services/logme/model_backup_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_create_backup_response_item.go b/services/logme/model_create_backup_response_item.go index 99685db65..0fe13b921 100644 --- a/services/logme/model_create_backup_response_item.go +++ b/services/logme/model_create_backup_response_item.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -75,6 +75,7 @@ type CreateBackupResponseItemGetMessageRetType = string // CreateBackupResponseItem struct for CreateBackupResponseItem // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupResponseItem struct { + // Can be cast to int32 without loss of precision. // REQUIRED Id CreateBackupResponseItemGetIdAttributeType `json:"id" required:"true"` // REQUIRED diff --git a/services/logme/model_create_backup_response_item_test.go b/services/logme/model_create_backup_response_item_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_create_backup_response_item_test.go +++ b/services/logme/model_create_backup_response_item_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_create_credentials_payload.go b/services/logme/model_create_credentials_payload.go new file mode 100644 index 000000000..e268578a7 --- /dev/null +++ b/services/logme/model_create_credentials_payload.go @@ -0,0 +1,151 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package logme + +import ( + "encoding/json" +) + +// checks if the CreateCredentialsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCredentialsPayload{} + +/* + types and functions for parameters +*/ + +// isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayloadGetParametersAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayloadGetParametersArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayloadGetParametersRetType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateCredentialsPayloadGetParametersAttributeTypeOk(arg CreateCredentialsPayloadGetParametersAttributeType) (ret CreateCredentialsPayloadGetParametersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCreateCredentialsPayloadGetParametersAttributeType(arg *CreateCredentialsPayloadGetParametersAttributeType, val CreateCredentialsPayloadGetParametersRetType) { + *arg = &val +} + +// CreateCredentialsPayload struct for CreateCredentialsPayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateCredentialsPayload struct { + Parameters CreateCredentialsPayloadGetParametersAttributeType `json:"parameters,omitempty"` +} + +// NewCreateCredentialsPayload instantiates a new CreateCredentialsPayload 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewCreateCredentialsPayload() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// NewCreateCredentialsPayloadWithDefaults instantiates a new CreateCredentialsPayload 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewCreateCredentialsPayloadWithDefaults() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) GetParameters() (res CreateCredentialsPayloadGetParametersRetType) { + res, _ = o.GetParametersOk() + return +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) GetParametersOk() (ret CreateCredentialsPayloadGetParametersRetType, ok bool) { + return getCreateCredentialsPayloadGetParametersAttributeTypeOk(o.Parameters) +} + +// HasParameters returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) HasParameters() bool { + _, ok := o.GetParametersOk() + return ok +} + +// SetParameters gets a reference to the given map[string]interface{} and assigns it to the Parameters field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateCredentialsPayload) SetParameters(v CreateCredentialsPayloadGetParametersRetType) { + setCreateCredentialsPayloadGetParametersAttributeType(&o.Parameters, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o CreateCredentialsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateCredentialsPayloadGetParametersAttributeTypeOk(o.Parameters); ok { + toSerialize["Parameters"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableCreateCredentialsPayload struct { + value *CreateCredentialsPayload + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateCredentialsPayload) Get() *CreateCredentialsPayload { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateCredentialsPayload) Set(val *CreateCredentialsPayload) { + v.value = val + v.isSet = true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateCredentialsPayload) IsSet() bool { + return v.isSet +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateCredentialsPayload) Unset() { + v.value = nil + v.isSet = false +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewNullableCreateCredentialsPayload(val *CreateCredentialsPayload) *NullableCreateCredentialsPayload { + return &NullableCreateCredentialsPayload{value: val, isSet: true} +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateCredentialsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateCredentialsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/model_create_credentials_payload_test.go b/services/logme/model_create_credentials_payload_test.go new file mode 100644 index 000000000..8cc84223f --- /dev/null +++ b/services/logme/model_create_credentials_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package logme diff --git a/services/logme/model_create_instance_payload.go b/services/logme/model_create_instance_payload.go index 61712f833..41d447de0 100644 --- a/services/logme/model_create_instance_payload.go +++ b/services/logme/model_create_instance_payload.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_create_instance_payload_test.go b/services/logme/model_create_instance_payload_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_create_instance_payload_test.go +++ b/services/logme/model_create_instance_payload_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_create_instance_response.go b/services/logme/model_create_instance_response.go index 5e6b86d08..54b357b4c 100644 --- a/services/logme/model_create_instance_response.go +++ b/services/logme/model_create_instance_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_create_instance_response_test.go b/services/logme/model_create_instance_response_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_create_instance_response_test.go +++ b/services/logme/model_create_instance_response_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_credentials.go b/services/logme/model_credentials.go index a73ae8aba..775735aa9 100644 --- a/services/logme/model_credentials.go +++ b/services/logme/model_credentials.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_credentials_list_item.go b/services/logme/model_credentials_list_item.go index d8fd23be9..fcba62cdb 100644 --- a/services/logme/model_credentials_list_item.go +++ b/services/logme/model_credentials_list_item.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_credentials_list_item_test.go b/services/logme/model_credentials_list_item_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_credentials_list_item_test.go +++ b/services/logme/model_credentials_list_item_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_credentials_response.go b/services/logme/model_credentials_response.go index 917db8474..aafc72de8 100644 --- a/services/logme/model_credentials_response.go +++ b/services/logme/model_credentials_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_credentials_response_test.go b/services/logme/model_credentials_response_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_credentials_response_test.go +++ b/services/logme/model_credentials_response_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_credentials_test.go b/services/logme/model_credentials_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_credentials_test.go +++ b/services/logme/model_credentials_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_error.go b/services/logme/model_error.go index 591483079..dd6096578 100644 --- a/services/logme/model_error.go +++ b/services/logme/model_error.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_error_test.go b/services/logme/model_error_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_error_test.go +++ b/services/logme/model_error_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_get_metrics_response.go b/services/logme/model_get_metrics_response.go index a765295a6..2e6ba7e5c 100644 --- a/services/logme/model_get_metrics_response.go +++ b/services/logme/model_get_metrics_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_get_metrics_response_test.go b/services/logme/model_get_metrics_response_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_get_metrics_response_test.go +++ b/services/logme/model_get_metrics_response_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_instance.go b/services/logme/model_instance.go index 73e99e584..d838965c0 100644 --- a/services/logme/model_instance.go +++ b/services/logme/model_instance.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_instance_last_operation.go b/services/logme/model_instance_last_operation.go index 06bd06124..29cb7968d 100644 --- a/services/logme/model_instance_last_operation.go +++ b/services/logme/model_instance_last_operation.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_instance_last_operation_test.go b/services/logme/model_instance_last_operation_test.go index 0ce42e6a2..1b136433c 100644 --- a/services/logme/model_instance_last_operation_test.go +++ b/services/logme/model_instance_last_operation_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_instance_parameters.go b/services/logme/model_instance_parameters.go index 55b1a5406..6b35a9100 100644 --- a/services/logme/model_instance_parameters.go +++ b/services/logme/model_instance_parameters.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -645,12 +645,17 @@ type InstanceParameters struct { EnableMonitoring InstanceParametersgetEnableMonitoringAttributeType `json:"enable_monitoring,omitempty"` // Can be cast to int32 without loss of precision. FluentdTcp InstanceParametersGetFluentdTcpAttributeType `json:"fluentd-tcp,omitempty"` + // Deprecated: This property is deprecated and will be removed in a future release. // Can be cast to int32 without loss of precision. - FluentdTls InstanceParametersGetFluentdTlsAttributeType `json:"fluentd-tls,omitempty"` - FluentdTlsCiphers InstanceParametersGetFluentdTlsCiphersAttributeType `json:"fluentd-tls-ciphers,omitempty"` + FluentdTls InstanceParametersGetFluentdTlsAttributeType `json:"fluentd-tls,omitempty"` + // Deprecated: This property is deprecated and will be removed in a future release. + FluentdTlsCiphers InstanceParametersGetFluentdTlsCiphersAttributeType `json:"fluentd-tls-ciphers,omitempty"` + // Deprecated: This property is deprecated and will be removed in a future release. FluentdTlsMaxVersion InstanceParametersGetFluentdTlsMaxVersionAttributeType `json:"fluentd-tls-max-version,omitempty"` + // Deprecated: This property is deprecated and will be removed in a future release. FluentdTlsMinVersion InstanceParametersGetFluentdTlsMinVersionAttributeType `json:"fluentd-tls-min-version,omitempty"` - FluentdTlsVersion InstanceParametersGetFluentdTlsVersionAttributeType `json:"fluentd-tls-version,omitempty"` + // Deprecated: This property is deprecated and will be removed in a future release. + FluentdTlsVersion InstanceParametersGetFluentdTlsVersionAttributeType `json:"fluentd-tls-version,omitempty"` // Can be cast to int32 without loss of precision. FluentdUdp InstanceParametersGetFluentdUdpAttributeType `json:"fluentd-udp,omitempty"` // If you want to monitor your service with Graphite, you can set the custom parameter graphite. It expects the host and port where the Graphite metrics should be sent to. @@ -674,9 +679,11 @@ type InstanceParameters struct { // Can be cast to int32 without loss of precision. MetricsFrequency InstanceParametersGetMetricsFrequencyAttributeType `json:"metrics_frequency,omitempty"` // Depending on your graphite provider, you might need to prefix the metrics with a certain value, like an API key for example. - MetricsPrefix InstanceParametersGetMetricsPrefixAttributeType `json:"metrics_prefix,omitempty"` - MonitoringInstanceId InstanceParametersGetMonitoringInstanceIdAttributeType `json:"monitoring_instance_id,omitempty"` - OpensearchTlsCiphers InstanceParametersGetOpensearchTlsCiphersAttributeType `json:"opensearch-tls-ciphers,omitempty"` + MetricsPrefix InstanceParametersGetMetricsPrefixAttributeType `json:"metrics_prefix,omitempty"` + MonitoringInstanceId InstanceParametersGetMonitoringInstanceIdAttributeType `json:"monitoring_instance_id,omitempty"` + // Deprecated: This property is deprecated and will be removed in a future release. + OpensearchTlsCiphers InstanceParametersGetOpensearchTlsCiphersAttributeType `json:"opensearch-tls-ciphers,omitempty"` + // Deprecated: This property is deprecated and will be removed in a future release. OpensearchTlsProtocols InstanceParametersGetOpensearchTlsProtocolsAttributeType `json:"opensearch-tls-protocols,omitempty"` // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. SgwAcl InstanceParametersGetSgwAclAttributeType `json:"sgw_acl,omitempty"` diff --git a/services/logme/model_instance_parameters_groks_inner.go b/services/logme/model_instance_parameters_groks_inner.go index 96cc54e27..490ed0b97 100644 --- a/services/logme/model_instance_parameters_groks_inner.go +++ b/services/logme/model_instance_parameters_groks_inner.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_instance_parameters_groks_inner_test.go b/services/logme/model_instance_parameters_groks_inner_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_instance_parameters_groks_inner_test.go +++ b/services/logme/model_instance_parameters_groks_inner_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_instance_parameters_test.go b/services/logme/model_instance_parameters_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_instance_parameters_test.go +++ b/services/logme/model_instance_parameters_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_instance_schema.go b/services/logme/model_instance_schema.go index 20945c34a..1ea5b5951 100644 --- a/services/logme/model_instance_schema.go +++ b/services/logme/model_instance_schema.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_instance_schema_test.go b/services/logme/model_instance_schema_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_instance_schema_test.go +++ b/services/logme/model_instance_schema_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_instance_test.go b/services/logme/model_instance_test.go index c0e7585e9..0eec05301 100644 --- a/services/logme/model_instance_test.go +++ b/services/logme/model_instance_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_list_backups_response.go b/services/logme/model_list_backups_response.go index dd9fc3f7c..e8cbba255 100644 --- a/services/logme/model_list_backups_response.go +++ b/services/logme/model_list_backups_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_list_backups_response_test.go b/services/logme/model_list_backups_response_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_list_backups_response_test.go +++ b/services/logme/model_list_backups_response_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_list_credentials_response.go b/services/logme/model_list_credentials_response.go index be321e165..1dc74087e 100644 --- a/services/logme/model_list_credentials_response.go +++ b/services/logme/model_list_credentials_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_list_credentials_response_test.go b/services/logme/model_list_credentials_response_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_list_credentials_response_test.go +++ b/services/logme/model_list_credentials_response_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_list_instances_response.go b/services/logme/model_list_instances_response.go index 7e6900c97..1a1d83837 100644 --- a/services/logme/model_list_instances_response.go +++ b/services/logme/model_list_instances_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_list_instances_response_test.go b/services/logme/model_list_instances_response_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_list_instances_response_test.go +++ b/services/logme/model_list_instances_response_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_list_offerings_response.go b/services/logme/model_list_offerings_response.go index 0597cee4f..5f0086716 100644 --- a/services/logme/model_list_offerings_response.go +++ b/services/logme/model_list_offerings_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_list_offerings_response_test.go b/services/logme/model_list_offerings_response_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_list_offerings_response_test.go +++ b/services/logme/model_list_offerings_response_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_list_restores_response.go b/services/logme/model_list_restores_response.go index 673c3661c..61888b25f 100644 --- a/services/logme/model_list_restores_response.go +++ b/services/logme/model_list_restores_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_list_restores_response_test.go b/services/logme/model_list_restores_response_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_list_restores_response_test.go +++ b/services/logme/model_list_restores_response_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_offering.go b/services/logme/model_offering.go index eb19aabee..4345d1f40 100644 --- a/services/logme/model_offering.go +++ b/services/logme/model_offering.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -304,6 +304,7 @@ type Offering struct { Name OfferingGetNameAttributeType `json:"name" required:"true"` // REQUIRED Plans OfferingGetPlansAttributeType `json:"plans" required:"true"` + // Can be cast to int32 without loss of precision. // REQUIRED QuotaCount OfferingGetQuotaCountAttributeType `json:"quotaCount" required:"true"` Schema OfferingGetSchemaAttributeType `json:"schema,omitempty"` diff --git a/services/logme/model_offering_test.go b/services/logme/model_offering_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_offering_test.go +++ b/services/logme/model_offering_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_partial_update_instance_payload.go b/services/logme/model_partial_update_instance_payload.go index 9882eab63..4d37b29e7 100644 --- a/services/logme/model_partial_update_instance_payload.go +++ b/services/logme/model_partial_update_instance_payload.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_partial_update_instance_payload_test.go b/services/logme/model_partial_update_instance_payload_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_partial_update_instance_payload_test.go +++ b/services/logme/model_partial_update_instance_payload_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_plan.go b/services/logme/model_plan.go index 232d6174e..239ac2ec4 100644 --- a/services/logme/model_plan.go +++ b/services/logme/model_plan.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_plan_test.go b/services/logme/model_plan_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_plan_test.go +++ b/services/logme/model_plan_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_raw_credentials.go b/services/logme/model_raw_credentials.go index b3c539c18..680445abd 100644 --- a/services/logme/model_raw_credentials.go +++ b/services/logme/model_raw_credentials.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_raw_credentials_test.go b/services/logme/model_raw_credentials_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_raw_credentials_test.go +++ b/services/logme/model_raw_credentials_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_restore.go b/services/logme/model_restore.go index 9b1c1fd24..dcb23d9b3 100644 --- a/services/logme/model_restore.go +++ b/services/logme/model_restore.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -156,10 +156,12 @@ type RestoreGetTriggeredAtRetType = string // Restore struct for Restore // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Restore struct { + // Can be cast to int32 without loss of precision. // REQUIRED BackupId RestoreGetBackupIdAttributeType `json:"backup_id" required:"true"` // REQUIRED FinishedAt RestoreGetFinishedAtAttributeType `json:"finished_at" required:"true"` + // Can be cast to int32 without loss of precision. // REQUIRED Id RestoreGetIdAttributeType `json:"id" required:"true"` // REQUIRED diff --git a/services/logme/model_restore_test.go b/services/logme/model_restore_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_restore_test.go +++ b/services/logme/model_restore_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_schema.go b/services/logme/model_schema.go index 1c317e149..82fae31eb 100644 --- a/services/logme/model_schema.go +++ b/services/logme/model_schema.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_schema_test.go b/services/logme/model_schema_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_schema_test.go +++ b/services/logme/model_schema_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_trigger_restore_response.go b/services/logme/model_trigger_restore_response.go index c0dc1e46d..af41e3def 100644 --- a/services/logme/model_trigger_restore_response.go +++ b/services/logme/model_trigger_restore_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -48,6 +48,7 @@ func setTriggerRestoreResponseGetIdAttributeType(arg *TriggerRestoreResponseGetI // TriggerRestoreResponse struct for TriggerRestoreResponse // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type TriggerRestoreResponse struct { + // Can be cast to int32 without loss of precision. // REQUIRED Id TriggerRestoreResponseGetIdAttributeType `json:"id" required:"true"` } diff --git a/services/logme/model_trigger_restore_response_test.go b/services/logme/model_trigger_restore_response_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_trigger_restore_response_test.go +++ b/services/logme/model_trigger_restore_response_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_update_backups_config_payload.go b/services/logme/model_update_backups_config_payload.go index 211111803..dbaad932d 100644 --- a/services/logme/model_update_backups_config_payload.go +++ b/services/logme/model_update_backups_config_payload.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_update_backups_config_payload_test.go b/services/logme/model_update_backups_config_payload_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_update_backups_config_payload_test.go +++ b/services/logme/model_update_backups_config_payload_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_update_backups_config_response.go b/services/logme/model_update_backups_config_response.go index 51dcc459a..8a779c083 100644 --- a/services/logme/model_update_backups_config_response.go +++ b/services/logme/model_update_backups_config_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/model_update_backups_config_response_test.go b/services/logme/model_update_backups_config_response_test.go index 9a92c8a8e..8cc84223f 100644 --- a/services/logme/model_update_backups_config_response_test.go +++ b/services/logme/model_update_backups_config_response_test.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/oas_commit b/services/logme/oas_commit index c08a6770d..293cbe3e4 100644 --- a/services/logme/oas_commit +++ b/services/logme/oas_commit @@ -1 +1 @@ -4407196dbbef4e53e6798809e856725cbc84ae05 +409f48dd7287ddea0ee1fdea89f994a906e150de diff --git a/services/logme/utils.go b/services/logme/utils.go index f92a95b36..c18b39605 100644 --- a/services/logme/utils.go +++ b/services/logme/utils.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 2.1.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/api_default.go b/services/logme/v1api/api_default.go index 10b40366b..c422924b1 100644 --- a/services/logme/v1api/api_default.go +++ b/services/logme/v1api/api_default.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -453,10 +453,17 @@ func (a *DefaultAPIService) CreateBackupExecute(r ApiCreateBackupRequest) ([]Cre } type ApiCreateCredentialsRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - instanceId string + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + createCredentialsPayload *CreateCredentialsPayload +} + +// Parameters for requested credentials +func (r ApiCreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { + r.createCredentialsPayload = &createCredentialsPayload + return r } func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { @@ -507,7 +514,7 @@ func (a *DefaultAPIService) CreateCredentialsExecute(r ApiCreateCredentialsReque localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -523,6 +530,8 @@ func (a *DefaultAPIService) CreateCredentialsExecute(r ApiCreateCredentialsReque if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.createCredentialsPayload req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err diff --git a/services/logme/v1api/api_default_mock.go b/services/logme/v1api/api_default_mock.go index efa82edf5..3980424fc 100644 --- a/services/logme/v1api/api_default_mock.go +++ b/services/logme/v1api/api_default_mock.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/client.go b/services/logme/v1api/client.go index b96af5730..4f276ed24 100644 --- a/services/logme/v1api/client.go +++ b/services/logme/v1api/client.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -42,7 +42,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the STACKIT LogMe API API v1.1.0 +// APIClient manages communication with the STACKIT LogMe API API v1.2.0 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *config.Configuration diff --git a/services/logme/v1api/configuration.go b/services/logme/v1api/configuration.go index 810454e9b..5e27af4c2 100644 --- a/services/logme/v1api/configuration.go +++ b/services/logme/v1api/configuration.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_backup.go b/services/logme/v1api/model_backup.go index c23e4121b..79fb75563 100644 --- a/services/logme/v1api/model_backup.go +++ b/services/logme/v1api/model_backup.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_create_backup_response_item.go b/services/logme/v1api/model_create_backup_response_item.go index 607c05450..1cf5006bb 100644 --- a/services/logme/v1api/model_create_backup_response_item.go +++ b/services/logme/v1api/model_create_backup_response_item.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_create_credentials_payload.go b/services/logme/v1api/model_create_credentials_payload.go new file mode 100644 index 000000000..5260fd627 --- /dev/null +++ b/services/logme/v1api/model_create_credentials_payload.go @@ -0,0 +1,153 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 1.2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreateCredentialsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCredentialsPayload{} + +// CreateCredentialsPayload struct for CreateCredentialsPayload +type CreateCredentialsPayload struct { + Parameters map[string]interface{} `json:"parameters,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateCredentialsPayload CreateCredentialsPayload + +// NewCreateCredentialsPayload instantiates a new CreateCredentialsPayload 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 NewCreateCredentialsPayload() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// NewCreateCredentialsPayloadWithDefaults instantiates a new CreateCredentialsPayload 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 NewCreateCredentialsPayloadWithDefaults() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *CreateCredentialsPayload) GetParameters() map[string]interface{} { + if o == nil || IsNil(o.Parameters) { + var ret map[string]interface{} + return ret + } + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCredentialsPayload) GetParametersOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Parameters) { + return map[string]interface{}{}, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *CreateCredentialsPayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given map[string]interface{} and assigns it to the Parameters field. +func (o *CreateCredentialsPayload) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +func (o CreateCredentialsPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateCredentialsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateCredentialsPayload) UnmarshalJSON(data []byte) (err error) { + varCreateCredentialsPayload := _CreateCredentialsPayload{} + + err = json.Unmarshal(data, &varCreateCredentialsPayload) + + if err != nil { + return err + } + + *o = CreateCredentialsPayload(varCreateCredentialsPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "parameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateCredentialsPayload struct { + value *CreateCredentialsPayload + isSet bool +} + +func (v NullableCreateCredentialsPayload) Get() *CreateCredentialsPayload { + return v.value +} + +func (v *NullableCreateCredentialsPayload) Set(val *CreateCredentialsPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCredentialsPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCredentialsPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCredentialsPayload(val *CreateCredentialsPayload) *NullableCreateCredentialsPayload { + return &NullableCreateCredentialsPayload{value: val, isSet: true} +} + +func (v NullableCreateCredentialsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCredentialsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v1api/model_create_instance_payload.go b/services/logme/v1api/model_create_instance_payload.go index f12c285e3..b20eefa3c 100644 --- a/services/logme/v1api/model_create_instance_payload.go +++ b/services/logme/v1api/model_create_instance_payload.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_create_instance_response.go b/services/logme/v1api/model_create_instance_response.go index c44dbc62e..6a72ac99f 100644 --- a/services/logme/v1api/model_create_instance_response.go +++ b/services/logme/v1api/model_create_instance_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_credentials.go b/services/logme/v1api/model_credentials.go index b793188e5..4cd6fe5d5 100644 --- a/services/logme/v1api/model_credentials.go +++ b/services/logme/v1api/model_credentials.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_credentials_list_item.go b/services/logme/v1api/model_credentials_list_item.go index 5cfa0ebca..58fb5ab8d 100644 --- a/services/logme/v1api/model_credentials_list_item.go +++ b/services/logme/v1api/model_credentials_list_item.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_credentials_response.go b/services/logme/v1api/model_credentials_response.go index 626ce4ea5..fdeec4f42 100644 --- a/services/logme/v1api/model_credentials_response.go +++ b/services/logme/v1api/model_credentials_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_error.go b/services/logme/v1api/model_error.go index aaae49204..b41ecea54 100644 --- a/services/logme/v1api/model_error.go +++ b/services/logme/v1api/model_error.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_get_metrics_response.go b/services/logme/v1api/model_get_metrics_response.go index 2912e2402..ab6f29a45 100644 --- a/services/logme/v1api/model_get_metrics_response.go +++ b/services/logme/v1api/model_get_metrics_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_instance.go b/services/logme/v1api/model_instance.go index d46b5dfe7..e8afdd759 100644 --- a/services/logme/v1api/model_instance.go +++ b/services/logme/v1api/model_instance.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_instance_last_operation.go b/services/logme/v1api/model_instance_last_operation.go index f8a574b2b..d2f684f35 100644 --- a/services/logme/v1api/model_instance_last_operation.go +++ b/services/logme/v1api/model_instance_last_operation.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_instance_parameters.go b/services/logme/v1api/model_instance_parameters.go index 6970965ff..d83eb74b4 100644 --- a/services/logme/v1api/model_instance_parameters.go +++ b/services/logme/v1api/model_instance_parameters.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,14 +19,24 @@ var _ MappedNullable = &InstanceParameters{} // InstanceParameters struct for InstanceParameters type InstanceParameters struct { - EnableMonitoring *bool `json:"enable_monitoring,omitempty"` - FluentdTcp *int32 `json:"fluentd-tcp,omitempty"` - FluentdTls *int32 `json:"fluentd-tls,omitempty"` - FluentdTlsCiphers *string `json:"fluentd-tls-ciphers,omitempty"` + EnableMonitoring *bool `json:"enable_monitoring,omitempty"` + FluentdTcp *int32 `json:"fluentd-tcp,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + FluentdTls *int32 `json:"fluentd-tls,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + FluentdTlsCiphers *string `json:"fluentd-tls-ciphers,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated FluentdTlsMaxVersion *string `json:"fluentd-tls-max-version,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated FluentdTlsMinVersion *string `json:"fluentd-tls-min-version,omitempty"` - FluentdTlsVersion *string `json:"fluentd-tls-version,omitempty"` - FluentdUdp *int32 `json:"fluentd-udp,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + FluentdTlsVersion *string `json:"fluentd-tls-version,omitempty"` + FluentdUdp *int32 `json:"fluentd-udp,omitempty"` // If you want to monitor your service with Graphite, you can set the custom parameter graphite. It expects the host and port where the Graphite metrics should be sent to. Graphite *string `json:"graphite,omitempty"` Groks []InstanceParametersGroksInner `json:"groks,omitempty"` @@ -43,9 +53,13 @@ type InstanceParameters struct { // Frequency of metrics being emitted in seconds MetricsFrequency *int32 `json:"metrics_frequency,omitempty"` // Depending on your graphite provider, you might need to prefix the metrics with a certain value, like an API key for example. - MetricsPrefix *string `json:"metrics_prefix,omitempty"` - MonitoringInstanceId *string `json:"monitoring_instance_id,omitempty"` - OpensearchTlsCiphers []string `json:"opensearch-tls-ciphers,omitempty"` + MetricsPrefix *string `json:"metrics_prefix,omitempty"` + MonitoringInstanceId *string `json:"monitoring_instance_id,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + OpensearchTlsCiphers []string `json:"opensearch-tls-ciphers,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated OpensearchTlsProtocols []string `json:"opensearch-tls-protocols,omitempty"` // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. SgwAcl *string `json:"sgw_acl,omitempty"` @@ -177,6 +191,7 @@ func (o *InstanceParameters) SetFluentdTcp(v int32) { } // GetFluentdTls returns the FluentdTls field value if set, zero value otherwise. +// Deprecated func (o *InstanceParameters) GetFluentdTls() int32 { if o == nil || IsNil(o.FluentdTls) { var ret int32 @@ -187,6 +202,7 @@ func (o *InstanceParameters) GetFluentdTls() int32 { // GetFluentdTlsOk returns a tuple with the FluentdTls field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *InstanceParameters) GetFluentdTlsOk() (*int32, bool) { if o == nil || IsNil(o.FluentdTls) { return nil, false @@ -204,11 +220,13 @@ func (o *InstanceParameters) HasFluentdTls() bool { } // SetFluentdTls gets a reference to the given int32 and assigns it to the FluentdTls field. +// Deprecated func (o *InstanceParameters) SetFluentdTls(v int32) { o.FluentdTls = &v } // GetFluentdTlsCiphers returns the FluentdTlsCiphers field value if set, zero value otherwise. +// Deprecated func (o *InstanceParameters) GetFluentdTlsCiphers() string { if o == nil || IsNil(o.FluentdTlsCiphers) { var ret string @@ -219,6 +237,7 @@ func (o *InstanceParameters) GetFluentdTlsCiphers() string { // GetFluentdTlsCiphersOk returns a tuple with the FluentdTlsCiphers field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *InstanceParameters) GetFluentdTlsCiphersOk() (*string, bool) { if o == nil || IsNil(o.FluentdTlsCiphers) { return nil, false @@ -236,11 +255,13 @@ func (o *InstanceParameters) HasFluentdTlsCiphers() bool { } // SetFluentdTlsCiphers gets a reference to the given string and assigns it to the FluentdTlsCiphers field. +// Deprecated func (o *InstanceParameters) SetFluentdTlsCiphers(v string) { o.FluentdTlsCiphers = &v } // GetFluentdTlsMaxVersion returns the FluentdTlsMaxVersion field value if set, zero value otherwise. +// Deprecated func (o *InstanceParameters) GetFluentdTlsMaxVersion() string { if o == nil || IsNil(o.FluentdTlsMaxVersion) { var ret string @@ -251,6 +272,7 @@ func (o *InstanceParameters) GetFluentdTlsMaxVersion() string { // GetFluentdTlsMaxVersionOk returns a tuple with the FluentdTlsMaxVersion field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *InstanceParameters) GetFluentdTlsMaxVersionOk() (*string, bool) { if o == nil || IsNil(o.FluentdTlsMaxVersion) { return nil, false @@ -268,11 +290,13 @@ func (o *InstanceParameters) HasFluentdTlsMaxVersion() bool { } // SetFluentdTlsMaxVersion gets a reference to the given string and assigns it to the FluentdTlsMaxVersion field. +// Deprecated func (o *InstanceParameters) SetFluentdTlsMaxVersion(v string) { o.FluentdTlsMaxVersion = &v } // GetFluentdTlsMinVersion returns the FluentdTlsMinVersion field value if set, zero value otherwise. +// Deprecated func (o *InstanceParameters) GetFluentdTlsMinVersion() string { if o == nil || IsNil(o.FluentdTlsMinVersion) { var ret string @@ -283,6 +307,7 @@ func (o *InstanceParameters) GetFluentdTlsMinVersion() string { // GetFluentdTlsMinVersionOk returns a tuple with the FluentdTlsMinVersion field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *InstanceParameters) GetFluentdTlsMinVersionOk() (*string, bool) { if o == nil || IsNil(o.FluentdTlsMinVersion) { return nil, false @@ -300,11 +325,13 @@ func (o *InstanceParameters) HasFluentdTlsMinVersion() bool { } // SetFluentdTlsMinVersion gets a reference to the given string and assigns it to the FluentdTlsMinVersion field. +// Deprecated func (o *InstanceParameters) SetFluentdTlsMinVersion(v string) { o.FluentdTlsMinVersion = &v } // GetFluentdTlsVersion returns the FluentdTlsVersion field value if set, zero value otherwise. +// Deprecated func (o *InstanceParameters) GetFluentdTlsVersion() string { if o == nil || IsNil(o.FluentdTlsVersion) { var ret string @@ -315,6 +342,7 @@ func (o *InstanceParameters) GetFluentdTlsVersion() string { // GetFluentdTlsVersionOk returns a tuple with the FluentdTlsVersion field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *InstanceParameters) GetFluentdTlsVersionOk() (*string, bool) { if o == nil || IsNil(o.FluentdTlsVersion) { return nil, false @@ -332,6 +360,7 @@ func (o *InstanceParameters) HasFluentdTlsVersion() bool { } // SetFluentdTlsVersion gets a reference to the given string and assigns it to the FluentdTlsVersion field. +// Deprecated func (o *InstanceParameters) SetFluentdTlsVersion(v string) { o.FluentdTlsVersion = &v } @@ -721,6 +750,7 @@ func (o *InstanceParameters) SetMonitoringInstanceId(v string) { } // GetOpensearchTlsCiphers returns the OpensearchTlsCiphers field value if set, zero value otherwise. +// Deprecated func (o *InstanceParameters) GetOpensearchTlsCiphers() []string { if o == nil || IsNil(o.OpensearchTlsCiphers) { var ret []string @@ -731,6 +761,7 @@ func (o *InstanceParameters) GetOpensearchTlsCiphers() []string { // GetOpensearchTlsCiphersOk returns a tuple with the OpensearchTlsCiphers field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *InstanceParameters) GetOpensearchTlsCiphersOk() ([]string, bool) { if o == nil || IsNil(o.OpensearchTlsCiphers) { return nil, false @@ -748,11 +779,13 @@ func (o *InstanceParameters) HasOpensearchTlsCiphers() bool { } // SetOpensearchTlsCiphers gets a reference to the given []string and assigns it to the OpensearchTlsCiphers field. +// Deprecated func (o *InstanceParameters) SetOpensearchTlsCiphers(v []string) { o.OpensearchTlsCiphers = v } // GetOpensearchTlsProtocols returns the OpensearchTlsProtocols field value if set, zero value otherwise. +// Deprecated func (o *InstanceParameters) GetOpensearchTlsProtocols() []string { if o == nil || IsNil(o.OpensearchTlsProtocols) { var ret []string @@ -763,6 +796,7 @@ func (o *InstanceParameters) GetOpensearchTlsProtocols() []string { // GetOpensearchTlsProtocolsOk returns a tuple with the OpensearchTlsProtocols field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *InstanceParameters) GetOpensearchTlsProtocolsOk() ([]string, bool) { if o == nil || IsNil(o.OpensearchTlsProtocols) { return nil, false @@ -780,6 +814,7 @@ func (o *InstanceParameters) HasOpensearchTlsProtocols() bool { } // SetOpensearchTlsProtocols gets a reference to the given []string and assigns it to the OpensearchTlsProtocols field. +// Deprecated func (o *InstanceParameters) SetOpensearchTlsProtocols(v []string) { o.OpensearchTlsProtocols = v } diff --git a/services/logme/v1api/model_instance_parameters_groks_inner.go b/services/logme/v1api/model_instance_parameters_groks_inner.go index ebd57ae73..8109d0b0c 100644 --- a/services/logme/v1api/model_instance_parameters_groks_inner.go +++ b/services/logme/v1api/model_instance_parameters_groks_inner.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_instance_schema.go b/services/logme/v1api/model_instance_schema.go index fa8ed2dc0..b53fa6c5a 100644 --- a/services/logme/v1api/model_instance_schema.go +++ b/services/logme/v1api/model_instance_schema.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_list_backups_response.go b/services/logme/v1api/model_list_backups_response.go index 79cb6f65b..7d611bb21 100644 --- a/services/logme/v1api/model_list_backups_response.go +++ b/services/logme/v1api/model_list_backups_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_list_credentials_response.go b/services/logme/v1api/model_list_credentials_response.go index 3d8480c51..acc60665d 100644 --- a/services/logme/v1api/model_list_credentials_response.go +++ b/services/logme/v1api/model_list_credentials_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_list_instances_response.go b/services/logme/v1api/model_list_instances_response.go index 8da663c4a..ac16e5bd0 100644 --- a/services/logme/v1api/model_list_instances_response.go +++ b/services/logme/v1api/model_list_instances_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_list_offerings_response.go b/services/logme/v1api/model_list_offerings_response.go index cc17d2ab6..5a6055660 100644 --- a/services/logme/v1api/model_list_offerings_response.go +++ b/services/logme/v1api/model_list_offerings_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_list_restores_response.go b/services/logme/v1api/model_list_restores_response.go index c46866fe8..c20484aac 100644 --- a/services/logme/v1api/model_list_restores_response.go +++ b/services/logme/v1api/model_list_restores_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_offering.go b/services/logme/v1api/model_offering.go index 6b6753ac6..7f0451413 100644 --- a/services/logme/v1api/model_offering.go +++ b/services/logme/v1api/model_offering.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_partial_update_instance_payload.go b/services/logme/v1api/model_partial_update_instance_payload.go index 4be8ecea4..86256146a 100644 --- a/services/logme/v1api/model_partial_update_instance_payload.go +++ b/services/logme/v1api/model_partial_update_instance_payload.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_plan.go b/services/logme/v1api/model_plan.go index 7a8bbc416..a8e76b5f7 100644 --- a/services/logme/v1api/model_plan.go +++ b/services/logme/v1api/model_plan.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_raw_credentials.go b/services/logme/v1api/model_raw_credentials.go index cb1a468b1..5c9ce5352 100644 --- a/services/logme/v1api/model_raw_credentials.go +++ b/services/logme/v1api/model_raw_credentials.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_restore.go b/services/logme/v1api/model_restore.go index 5db9fd906..023d5508f 100644 --- a/services/logme/v1api/model_restore.go +++ b/services/logme/v1api/model_restore.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_schema.go b/services/logme/v1api/model_schema.go index 3e78e7b6c..351fd1495 100644 --- a/services/logme/v1api/model_schema.go +++ b/services/logme/v1api/model_schema.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_trigger_restore_response.go b/services/logme/v1api/model_trigger_restore_response.go index 26c7d3096..65892e9cc 100644 --- a/services/logme/v1api/model_trigger_restore_response.go +++ b/services/logme/v1api/model_trigger_restore_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_update_backups_config_payload.go b/services/logme/v1api/model_update_backups_config_payload.go index 9e27e1332..ddca6d14b 100644 --- a/services/logme/v1api/model_update_backups_config_payload.go +++ b/services/logme/v1api/model_update_backups_config_payload.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/model_update_backups_config_response.go b/services/logme/v1api/model_update_backups_config_response.go index 2660d765c..2c60ee860 100644 --- a/services/logme/v1api/model_update_backups_config_response.go +++ b/services/logme/v1api/model_update_backups_config_response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/response.go b/services/logme/v1api/response.go index 0ce0024d3..7e808fccf 100644 --- a/services/logme/v1api/response.go +++ b/services/logme/v1api/response.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v1api/utils.go b/services/logme/v1api/utils.go index 13ded495b..4ab007378 100644 --- a/services/logme/v1api/utils.go +++ b/services/logme/v1api/utils.go @@ -3,7 +3,7 @@ STACKIT LogMe API The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. -API version: 1.1.0 +API version: 1.2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/logme/v2api/api_default.go b/services/logme/v2api/api_default.go new file mode 100644 index 000000000..2685b9ede --- /dev/null +++ b/services/logme/v2api/api_default.go @@ -0,0 +1,3339 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "os" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +type DefaultAPI interface { + + /* + CreateBackup create a backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateBackupRequest + */ + CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest + + // CreateBackupExecute executes the request + // @return []CreateBackupResponseItem + CreateBackupExecute(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) + + /* + CreateCredentials create new credentials + + Create new service credentials + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateCredentialsRequest + */ + CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest + + // CreateCredentialsExecute executes the request + // @return CredentialsResponse + CreateCredentialsExecute(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) + + /* + CreateInstance provision + + Provision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiCreateInstanceRequest + */ + CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest + + // CreateInstanceExecute executes the request + // @return CreateInstanceResponse + CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) + + /* + DeleteCredentials delete credentials by id + + Delete a service credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Id of the credentials being deleted + @return ApiDeleteCredentialsRequest + */ + DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest + + // DeleteCredentialsExecute executes the request + DeleteCredentialsExecute(r ApiDeleteCredentialsRequest) error + + /* + DeleteInstance delete service instance + + Deprovision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiDeleteInstanceRequest + */ + DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest + + // DeleteInstanceExecute executes the request + DeleteInstanceExecute(r ApiDeleteInstanceRequest) error + + /* + DownloadBackup download backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiDownloadBackupRequest + */ + DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest + + // DownloadBackupExecute executes the request + // @return *os.File + DownloadBackupExecute(r ApiDownloadBackupRequest) (*os.File, error) + + /* + GetCredentials get credentials by id + + get a service credentials by credentials id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Credentials id of credentials to fetch + @return ApiGetCredentialsRequest + */ + GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest + + // GetCredentialsExecute executes the request + // @return CredentialsResponse + GetCredentialsExecute(r ApiGetCredentialsRequest) (*CredentialsResponse, error) + + /* + GetInstance get a service instance + + get a service instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetInstanceRequest + */ + GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest + + // GetInstanceExecute executes the request + // @return Instance + GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) + + /* + GetMetrics get latest metrics for cpu load, memory and disk usage + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetMetricsRequest + */ + GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest + + // GetMetricsExecute executes the request + // @return GetMetricsResponse + GetMetricsExecute(r ApiGetMetricsRequest) (*GetMetricsResponse, error) + + /* + ListBackups get latest backup information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListBackupsRequest + */ + ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest + + // ListBackupsExecute executes the request + // @return ListBackupsResponse + ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) + + /* + ListCredentials get list of credentials ids + + get list all credentials ids for instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListCredentialsRequest + */ + ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest + + // ListCredentialsExecute executes the request + // @return ListCredentialsResponse + ListCredentialsExecute(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) + + /* + ListInstances get service instances list + + Get a list of available instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListInstancesRequest + */ + ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest + + // ListInstancesExecute executes the request + // @return ListInstancesResponse + ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) + + /* + ListOfferings get the service offerings + + Get the service offerings that the service broker offers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListOfferingsRequest + */ + ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest + + // ListOfferingsExecute executes the request + // @return ListOfferingsResponse + ListOfferingsExecute(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) + + /* + ListRestores get latest restore information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListRestoresRequest + */ + ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest + + // ListRestoresExecute executes the request + // @return ListRestoresResponse + ListRestoresExecute(r ApiListRestoresRequest) (*ListRestoresResponse, error) + + /* + PartialUpdateInstance update a service instance + + Update a service instance. This could be a sgw acl update or a plan upgrade. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiPartialUpdateInstanceRequest + */ + PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest + + // PartialUpdateInstanceExecute executes the request + PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error + + /* + TriggerRecreate trigger a recreate + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRecreateRequest + */ + TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest + + // TriggerRecreateExecute executes the request + // @return CreateInstanceResponse + TriggerRecreateExecute(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) + + /* + TriggerRestart trigger a restart + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRestartRequest + */ + TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest + + // TriggerRestartExecute executes the request + // @return CreateInstanceResponse + TriggerRestartExecute(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) + + /* + TriggerRestore trigger a restore + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiTriggerRestoreRequest + */ + TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest + + // TriggerRestoreExecute executes the request + // @return TriggerRestoreResponse + TriggerRestoreExecute(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) + + /* + UpdateBackupsConfig backups configuration update + + Update the configuration for backups for your instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiUpdateBackupsConfigRequest + */ + UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest + + // UpdateBackupsConfigExecute executes the request + // @return UpdateBackupsConfigResponse + UpdateBackupsConfigExecute(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiCreateBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiCreateBackupRequest) Execute() ([]CreateBackupResponseItem, error) { + return r.ApiService.CreateBackupExecute(r) +} + +/* +CreateBackup create a backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateBackupRequest +*/ +func (a *DefaultAPIService) CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return []CreateBackupResponseItem +func (a *DefaultAPIService) CreateBackupExecute(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []CreateBackupResponseItem + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"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{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + 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 == 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 +} + +type ApiCreateCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + createCredentialsPayload *CreateCredentialsPayload +} + +// Parameters for requested credentials +func (r ApiCreateCredentialsRequest) CreateCredentialsPayload(createCredentialsPayload CreateCredentialsPayload) ApiCreateCredentialsRequest { + r.createCredentialsPayload = &createCredentialsPayload + return r +} + +func (r ApiCreateCredentialsRequest) Execute() (*CredentialsResponse, error) { + return r.ApiService.CreateCredentialsExecute(r) +} + +/* +CreateCredentials create new credentials + +Create new service credentials + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiCreateCredentialsRequest +*/ +func (a *DefaultAPIService) CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest { + return ApiCreateCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CredentialsResponse +func (a *DefaultAPIService) CreateCredentialsExecute(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CredentialsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createCredentialsPayload + 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{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + 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 + } + + 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 +} + +type ApiCreateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + createInstancePayload *CreateInstancePayload +} + +// Parameters for the requested service instance provision +func (r ApiCreateInstanceRequest) CreateInstancePayload(createInstancePayload CreateInstancePayload) ApiCreateInstanceRequest { + r.createInstancePayload = &createInstancePayload + return r +} + +func (r ApiCreateInstanceRequest) Execute() (*CreateInstanceResponse, error) { + return r.ApiService.CreateInstanceExecute(r) +} + +/* +CreateInstance provision + +Provision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiCreateInstanceRequest +*/ +func (a *DefaultAPIService) CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest { + return ApiCreateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// Execute executes the request +// +// @return CreateInstanceResponse +func (a *DefaultAPIService) CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createInstancePayload == nil { + return localVarReturnValue, reportError("createInstancePayload 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.createInstancePayload + 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{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + 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 == 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 + } + + 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 +} + +type ApiDeleteCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + credentialsId string +} + +func (r ApiDeleteCredentialsRequest) Execute() error { + return r.ApiService.DeleteCredentialsExecute(r) +} + +/* +DeleteCredentials delete credentials by id + +Delete a service credentials. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Id of the credentials being deleted + @return ApiDeleteCredentialsRequest +*/ +func (a *DefaultAPIService) DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { + return ApiDeleteCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteCredentialsExecute(r ApiDeleteCredentialsRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteCredentials") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(parameterValueToString(r.credentialsId, "credentialsId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"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{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + 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 == 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 + } + + return nil +} + +type ApiDeleteInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiDeleteInstanceRequest) Execute() error { + return r.ApiService.DeleteInstanceExecute(r) +} + +/* +DeleteInstance delete service instance + +Deprovision a service instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiDeleteInstanceRequest +*/ +func (a *DefaultAPIService) DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest { + return ApiDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteInstanceExecute(r ApiDeleteInstanceRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteInstance") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"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{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + 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 == 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 + } + + return nil +} + +type ApiDownloadBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + backupId int32 +} + +func (r ApiDownloadBackupRequest) Execute() (*os.File, error) { + return r.ApiService.DownloadBackupExecute(r) +} + +/* +DownloadBackup download backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiDownloadBackupRequest +*/ +func (a *DefaultAPIService) DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest { + return ApiDownloadBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return *os.File +func (a *DefaultAPIService) DownloadBackupExecute(r ApiDownloadBackupRequest) (*os.File, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *os.File + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DownloadBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/download" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/octet-stream", "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{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + 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 == 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 +} + +type ApiGetCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + credentialsId string +} + +func (r ApiGetCredentialsRequest) Execute() (*CredentialsResponse, error) { + return r.ApiService.GetCredentialsExecute(r) +} + +/* +GetCredentials get credentials by id + +get a service credentials by credentials id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param credentialsId Credentials id of credentials to fetch + @return ApiGetCredentialsRequest +*/ +func (a *DefaultAPIService) GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { + return ApiGetCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// Execute executes the request +// +// @return CredentialsResponse +func (a *DefaultAPIService) GetCredentialsExecute(r ApiGetCredentialsRequest) (*CredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CredentialsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"credentialsId"+"}", url.PathEscape(parameterValueToString(r.credentialsId, "credentialsId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"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{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + 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 == 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 + } + + 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 +} + +type ApiGetInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiGetInstanceRequest) Execute() (*Instance, error) { + return r.ApiService.GetInstanceExecute(r) +} + +/* +GetInstance get a service instance + +get a service instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetInstanceRequest +*/ +func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return Instance +func (a *DefaultAPIService) GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Instance + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"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{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + 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 == 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 == 410 { + 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 +} + +type ApiGetMetricsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiGetMetricsRequest) Execute() (*GetMetricsResponse, error) { + return r.ApiService.GetMetricsExecute(r) +} + +/* +GetMetrics get latest metrics for cpu load, memory and disk usage + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiGetMetricsRequest +*/ +func (a *DefaultAPIService) GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest { + return ApiGetMetricsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return GetMetricsResponse +func (a *DefaultAPIService) GetMetricsExecute(r ApiGetMetricsRequest) (*GetMetricsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetMetricsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetMetrics") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/metrics" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"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{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + 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 == 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 + } + + 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 +} + +type ApiListBackupsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiListBackupsRequest) Execute() (*ListBackupsResponse, error) { + return r.ApiService.ListBackupsExecute(r) +} + +/* +ListBackups get latest backup information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListBackupsRequest +*/ +func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListBackupsResponse +func (a *DefaultAPIService) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListBackupsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListBackups") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"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{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + 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 == 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 + } + + 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 +} + +type ApiListCredentialsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiListCredentialsRequest) Execute() (*ListCredentialsResponse, error) { + return r.ApiService.ListCredentialsExecute(r) +} + +/* +ListCredentials get list of credentials ids + +get list all credentials ids for instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListCredentialsRequest +*/ +func (a *DefaultAPIService) ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest { + return ApiListCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListCredentialsResponse +func (a *DefaultAPIService) ListCredentialsExecute(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListCredentialsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListCredentials") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"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{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + 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 == 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 + } + + 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 +} + +type ApiListInstancesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string +} + +func (r ApiListInstancesRequest) Execute() (*ListInstancesResponse, error) { + return r.ApiService.ListInstancesExecute(r) +} + +/* +ListInstances get service instances list + +Get a list of available instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListInstancesRequest +*/ +func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest { + return ApiListInstancesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// Execute executes the request +// +// @return ListInstancesResponse +func (a *DefaultAPIService) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListInstancesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListInstances") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"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{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + 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 == 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 + } + + 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 +} + +type ApiListOfferingsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string +} + +func (r ApiListOfferingsRequest) Execute() (*ListOfferingsResponse, error) { + return r.ApiService.ListOfferingsExecute(r) +} + +/* +ListOfferings get the service offerings + +Get the service offerings that the service broker offers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @return ApiListOfferingsRequest +*/ +func (a *DefaultAPIService) ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest { + return ApiListOfferingsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// Execute executes the request +// +// @return ListOfferingsResponse +func (a *DefaultAPIService) ListOfferingsExecute(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOfferingsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListOfferings") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/offerings" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"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{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + 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 == 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 + } + + 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 +} + +type ApiListRestoresRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiListRestoresRequest) Execute() (*ListRestoresResponse, error) { + return r.ApiService.ListRestoresExecute(r) +} + +/* +ListRestores get latest restore information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiListRestoresRequest +*/ +func (a *DefaultAPIService) ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest { + return ApiListRestoresRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return ListRestoresResponse +func (a *DefaultAPIService) ListRestoresExecute(r ApiListRestoresRequest) (*ListRestoresResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListRestoresResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRestores") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restores" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"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{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + 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 == 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 + } + + 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 +} + +type ApiPartialUpdateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + partialUpdateInstancePayload *PartialUpdateInstancePayload +} + +// Parameters for the requested update operation on service instance - sgw acl update, plan upgrade +func (r ApiPartialUpdateInstanceRequest) PartialUpdateInstancePayload(partialUpdateInstancePayload PartialUpdateInstancePayload) ApiPartialUpdateInstanceRequest { + r.partialUpdateInstancePayload = &partialUpdateInstancePayload + return r +} + +func (r ApiPartialUpdateInstanceRequest) Execute() error { + return r.ApiService.PartialUpdateInstanceExecute(r) +} + +/* +PartialUpdateInstance update a service instance + +Update a service instance. This could be a sgw acl update or a plan upgrade. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiPartialUpdateInstanceRequest +*/ +func (a *DefaultAPIService) PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest { + return ApiPartialUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateInstance") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.partialUpdateInstancePayload == nil { + return reportError("partialUpdateInstancePayload 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.partialUpdateInstancePayload + 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{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + 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 == 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 + } + + return nil +} + +type ApiTriggerRecreateRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiTriggerRecreateRequest) Execute() (*CreateInstanceResponse, error) { + return r.ApiService.TriggerRecreateExecute(r) +} + +/* +TriggerRecreate trigger a recreate + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRecreateRequest +*/ +func (a *DefaultAPIService) TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest { + return ApiTriggerRecreateRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CreateInstanceResponse +func (a *DefaultAPIService) TriggerRecreateExecute(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerRecreate") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/recreate" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"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{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + 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 == 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 +} + +type ApiTriggerRestartRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string +} + +func (r ApiTriggerRestartRequest) Execute() (*CreateInstanceResponse, error) { + return r.ApiService.TriggerRestartExecute(r) +} + +/* +TriggerRestart trigger a restart + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiTriggerRestartRequest +*/ +func (a *DefaultAPIService) TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest { + return ApiTriggerRestartRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return CreateInstanceResponse +func (a *DefaultAPIService) TriggerRestartExecute(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateInstanceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerRestart") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restart" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"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{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + 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 == 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 +} + +type ApiTriggerRestoreRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + backupId int32 +} + +func (r ApiTriggerRestoreRequest) Execute() (*TriggerRestoreResponse, error) { + return r.ApiService.TriggerRestoreExecute(r) +} + +/* +TriggerRestore trigger a restore + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @param backupId Backup id + @return ApiTriggerRestoreRequest +*/ +func (a *DefaultAPIService) TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest { + return ApiTriggerRestoreRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return TriggerRestoreResponse +func (a *DefaultAPIService) TriggerRestoreExecute(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TriggerRestoreResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.TriggerRestore") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/restore" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"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{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + 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 == 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 +} + +type ApiUpdateBackupsConfigRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + instanceId string + updateBackupsConfigPayload *UpdateBackupsConfigPayload +} + +// Parameters for the requested backup configuration update +func (r ApiUpdateBackupsConfigRequest) UpdateBackupsConfigPayload(updateBackupsConfigPayload UpdateBackupsConfigPayload) ApiUpdateBackupsConfigRequest { + r.updateBackupsConfigPayload = &updateBackupsConfigPayload + return r +} + +func (r ApiUpdateBackupsConfigRequest) Execute() (*UpdateBackupsConfigResponse, error) { + return r.ApiService.UpdateBackupsConfigExecute(r) +} + +/* +UpdateBackupsConfig backups configuration update + +Update the configuration for backups for your instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project id on which user has permissions + @param regionId region in which the project resides + @param instanceId Instance id + @return ApiUpdateBackupsConfigRequest +*/ +func (a *DefaultAPIService) UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest { + return ApiUpdateBackupsConfigRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return UpdateBackupsConfigResponse +func (a *DefaultAPIService) UpdateBackupsConfigExecute(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateBackupsConfigResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateBackupsConfig") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups-config" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateBackupsConfigPayload == nil { + return localVarReturnValue, reportError("updateBackupsConfigPayload 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.updateBackupsConfigPayload + 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{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + 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 == 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 +} diff --git a/services/logme/v2api/api_default_mock.go b/services/logme/v2api/api_default_mock.go new file mode 100644 index 000000000..19281499a --- /dev/null +++ b/services/logme/v2api/api_default_mock.go @@ -0,0 +1,440 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "context" + "os" +) + +// assert the implementation matches the interface +var _ DefaultAPI = &DefaultAPIServiceMock{} + +// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. +// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. +type DefaultAPIServiceMock struct { + // CreateBackupExecuteMock can be populated to implement the behavior of the CreateBackupExecute function of this mock + CreateBackupExecuteMock *func(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) + // CreateCredentialsExecuteMock can be populated to implement the behavior of the CreateCredentialsExecute function of this mock + CreateCredentialsExecuteMock *func(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) + // CreateInstanceExecuteMock can be populated to implement the behavior of the CreateInstanceExecute function of this mock + CreateInstanceExecuteMock *func(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) + // DeleteCredentialsExecuteMock can be populated to implement the behavior of the DeleteCredentialsExecute function of this mock + DeleteCredentialsExecuteMock *func(r ApiDeleteCredentialsRequest) error + // DeleteInstanceExecuteMock can be populated to implement the behavior of the DeleteInstanceExecute function of this mock + DeleteInstanceExecuteMock *func(r ApiDeleteInstanceRequest) error + // DownloadBackupExecuteMock can be populated to implement the behavior of the DownloadBackupExecute function of this mock + DownloadBackupExecuteMock *func(r ApiDownloadBackupRequest) (*os.File, error) + // GetCredentialsExecuteMock can be populated to implement the behavior of the GetCredentialsExecute function of this mock + GetCredentialsExecuteMock *func(r ApiGetCredentialsRequest) (*CredentialsResponse, error) + // GetInstanceExecuteMock can be populated to implement the behavior of the GetInstanceExecute function of this mock + GetInstanceExecuteMock *func(r ApiGetInstanceRequest) (*Instance, error) + // GetMetricsExecuteMock can be populated to implement the behavior of the GetMetricsExecute function of this mock + GetMetricsExecuteMock *func(r ApiGetMetricsRequest) (*GetMetricsResponse, error) + // ListBackupsExecuteMock can be populated to implement the behavior of the ListBackupsExecute function of this mock + ListBackupsExecuteMock *func(r ApiListBackupsRequest) (*ListBackupsResponse, error) + // ListCredentialsExecuteMock can be populated to implement the behavior of the ListCredentialsExecute function of this mock + ListCredentialsExecuteMock *func(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) + // ListInstancesExecuteMock can be populated to implement the behavior of the ListInstancesExecute function of this mock + ListInstancesExecuteMock *func(r ApiListInstancesRequest) (*ListInstancesResponse, error) + // ListOfferingsExecuteMock can be populated to implement the behavior of the ListOfferingsExecute function of this mock + ListOfferingsExecuteMock *func(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) + // ListRestoresExecuteMock can be populated to implement the behavior of the ListRestoresExecute function of this mock + ListRestoresExecuteMock *func(r ApiListRestoresRequest) (*ListRestoresResponse, error) + // PartialUpdateInstanceExecuteMock can be populated to implement the behavior of the PartialUpdateInstanceExecute function of this mock + PartialUpdateInstanceExecuteMock *func(r ApiPartialUpdateInstanceRequest) error + // TriggerRecreateExecuteMock can be populated to implement the behavior of the TriggerRecreateExecute function of this mock + TriggerRecreateExecuteMock *func(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) + // TriggerRestartExecuteMock can be populated to implement the behavior of the TriggerRestartExecute function of this mock + TriggerRestartExecuteMock *func(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) + // TriggerRestoreExecuteMock can be populated to implement the behavior of the TriggerRestoreExecute function of this mock + TriggerRestoreExecuteMock *func(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) + // UpdateBackupsConfigExecuteMock can be populated to implement the behavior of the UpdateBackupsConfigExecute function of this mock + UpdateBackupsConfigExecuteMock *func(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) +} + +func (a DefaultAPIServiceMock) CreateBackup(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// CreateBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateBackupExecute(r ApiCreateBackupRequest) ([]CreateBackupResponseItem, error) { + if a.CreateBackupExecuteMock == nil { + var localVarReturnValue []CreateBackupResponseItem + return localVarReturnValue, nil + } + + return (*a.CreateBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateCredentialsRequest { + return ApiCreateCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// CreateCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateCredentialsExecute(r ApiCreateCredentialsRequest) (*CredentialsResponse, error) { + if a.CreateCredentialsExecuteMock == nil { + var localVarReturnValue *CredentialsResponse + return localVarReturnValue, nil + } + + return (*a.CreateCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest { + return ApiCreateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// CreateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateInstanceExecute(r ApiCreateInstanceRequest) (*CreateInstanceResponse, error) { + if a.CreateInstanceExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.CreateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiDeleteCredentialsRequest { + return ApiDeleteCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// DeleteCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteCredentialsExecute(r ApiDeleteCredentialsRequest) error { + if a.DeleteCredentialsExecuteMock == nil { + return nil + } + + return (*a.DeleteCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest { + return ApiDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// DeleteInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteInstanceExecute(r ApiDeleteInstanceRequest) error { + if a.DeleteInstanceExecuteMock == nil { + return nil + } + + return (*a.DeleteInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DownloadBackup(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiDownloadBackupRequest { + return ApiDownloadBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// DownloadBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DownloadBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DownloadBackupExecute(r ApiDownloadBackupRequest) (*os.File, error) { + if a.DownloadBackupExecuteMock == nil { + var localVarReturnValue *os.File + return localVarReturnValue, nil + } + + return (*a.DownloadBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetCredentials(ctx context.Context, projectId string, regionId string, instanceId string, credentialsId string) ApiGetCredentialsRequest { + return ApiGetCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + credentialsId: credentialsId, + } +} + +// GetCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetCredentialsExecute(r ApiGetCredentialsRequest) (*CredentialsResponse, error) { + if a.GetCredentialsExecuteMock == nil { + var localVarReturnValue *CredentialsResponse + return localVarReturnValue, nil + } + + return (*a.GetCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// GetInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) { + if a.GetInstanceExecuteMock == nil { + var localVarReturnValue *Instance + return localVarReturnValue, nil + } + + return (*a.GetInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetMetrics(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetMetricsRequest { + return ApiGetMetricsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// GetMetricsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetMetricsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetMetricsExecute(r ApiGetMetricsRequest) (*GetMetricsResponse, error) { + if a.GetMetricsExecuteMock == nil { + var localVarReturnValue *GetMetricsResponse + return localVarReturnValue, nil + } + + return (*a.GetMetricsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, regionId string, instanceId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// ListBackupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListBackupsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListBackupsExecute(r ApiListBackupsRequest) (*ListBackupsResponse, error) { + if a.ListBackupsExecuteMock == nil { + var localVarReturnValue *ListBackupsResponse + return localVarReturnValue, nil + } + + return (*a.ListBackupsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListCredentials(ctx context.Context, projectId string, regionId string, instanceId string) ApiListCredentialsRequest { + return ApiListCredentialsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// ListCredentialsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListCredentialsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListCredentialsExecute(r ApiListCredentialsRequest) (*ListCredentialsResponse, error) { + if a.ListCredentialsExecuteMock == nil { + var localVarReturnValue *ListCredentialsResponse + return localVarReturnValue, nil + } + + return (*a.ListCredentialsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest { + return ApiListInstancesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// ListInstancesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListInstancesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstancesResponse, error) { + if a.ListInstancesExecuteMock == nil { + var localVarReturnValue *ListInstancesResponse + return localVarReturnValue, nil + } + + return (*a.ListInstancesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListOfferings(ctx context.Context, projectId string, regionId string) ApiListOfferingsRequest { + return ApiListOfferingsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + } +} + +// ListOfferingsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListOfferingsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListOfferingsExecute(r ApiListOfferingsRequest) (*ListOfferingsResponse, error) { + if a.ListOfferingsExecuteMock == nil { + var localVarReturnValue *ListOfferingsResponse + return localVarReturnValue, nil + } + + return (*a.ListOfferingsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListRestores(ctx context.Context, projectId string, regionId string, instanceId string) ApiListRestoresRequest { + return ApiListRestoresRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// ListRestoresExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListRestoresExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListRestoresExecute(r ApiListRestoresRequest) (*ListRestoresResponse, error) { + if a.ListRestoresExecuteMock == nil { + var localVarReturnValue *ListRestoresResponse + return localVarReturnValue, nil + } + + return (*a.ListRestoresExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PartialUpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiPartialUpdateInstanceRequest { + return ApiPartialUpdateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// PartialUpdateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateInstanceExecute(r ApiPartialUpdateInstanceRequest) error { + if a.PartialUpdateInstanceExecuteMock == nil { + return nil + } + + return (*a.PartialUpdateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerRecreate(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRecreateRequest { + return ApiTriggerRecreateRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// TriggerRecreateExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRecreateExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerRecreateExecute(r ApiTriggerRecreateRequest) (*CreateInstanceResponse, error) { + if a.TriggerRecreateExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.TriggerRecreateExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerRestart(ctx context.Context, projectId string, regionId string, instanceId string) ApiTriggerRestartRequest { + return ApiTriggerRestartRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// TriggerRestartExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRestartExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerRestartExecute(r ApiTriggerRestartRequest) (*CreateInstanceResponse, error) { + if a.TriggerRestartExecuteMock == nil { + var localVarReturnValue *CreateInstanceResponse + return localVarReturnValue, nil + } + + return (*a.TriggerRestartExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) TriggerRestore(ctx context.Context, projectId string, regionId string, instanceId string, backupId int32) ApiTriggerRestoreRequest { + return ApiTriggerRestoreRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + backupId: backupId, + } +} + +// TriggerRestoreExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the TriggerRestoreExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) TriggerRestoreExecute(r ApiTriggerRestoreRequest) (*TriggerRestoreResponse, error) { + if a.TriggerRestoreExecuteMock == nil { + var localVarReturnValue *TriggerRestoreResponse + return localVarReturnValue, nil + } + + return (*a.TriggerRestoreExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateBackupsConfig(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateBackupsConfigRequest { + return ApiUpdateBackupsConfigRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + instanceId: instanceId, + } +} + +// UpdateBackupsConfigExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateBackupsConfigExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateBackupsConfigExecute(r ApiUpdateBackupsConfigRequest) (*UpdateBackupsConfigResponse, error) { + if a.UpdateBackupsConfigExecuteMock == nil { + var localVarReturnValue *UpdateBackupsConfigResponse + return localVarReturnValue, nil + } + + return (*a.UpdateBackupsConfigExecuteMock)(r) +} diff --git a/services/logme/v2api/client.go b/services/logme/v2api/client.go new file mode 100644 index 000000000..640a4c52a --- /dev/null +++ b/services/logme/v2api/client.go @@ -0,0 +1,658 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the STACKIT LogMe API API v2.1.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultAPI DefaultAPI +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultAPI = (*DefaultAPIService)(&c.common) + + return c, nil +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *config.Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/services/logme/v2api/configuration.go b/services/logme/v2api/configuration.go new file mode 100644 index 000000000..0f3683908 --- /dev/null +++ b/services/logme/v2api/configuration.go @@ -0,0 +1,37 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "stackit-sdk-go/logme", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://logme.api.stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "global", + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/logme/v2api/model_backup.go b/services/logme/v2api/model_backup.go new file mode 100644 index 000000000..49f359ff1 --- /dev/null +++ b/services/logme/v2api/model_backup.go @@ -0,0 +1,335 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Backup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Backup{} + +// Backup struct for Backup +type Backup struct { + Downloadable *bool `json:"downloadable,omitempty"` + FinishedAt string `json:"finished_at"` + Id int32 `json:"id"` + Size *int32 `json:"size,omitempty"` + Status string `json:"status"` + TriggeredAt *string `json:"triggered_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Backup Backup + +// 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(finishedAt string, id int32, status string) *Backup { + this := Backup{} + this.FinishedAt = finishedAt + this.Id = id + this.Status = status + 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 +} + +// GetDownloadable returns the Downloadable field value if set, zero value otherwise. +func (o *Backup) GetDownloadable() bool { + if o == nil || IsNil(o.Downloadable) { + var ret bool + return ret + } + return *o.Downloadable +} + +// GetDownloadableOk returns a tuple with the Downloadable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetDownloadableOk() (*bool, bool) { + if o == nil || IsNil(o.Downloadable) { + return nil, false + } + return o.Downloadable, true +} + +// HasDownloadable returns a boolean if a field has been set. +func (o *Backup) HasDownloadable() bool { + if o != nil && !IsNil(o.Downloadable) { + return true + } + + return false +} + +// SetDownloadable gets a reference to the given bool and assigns it to the Downloadable field. +func (o *Backup) SetDownloadable(v bool) { + o.Downloadable = &v +} + +// GetFinishedAt returns the FinishedAt field value +func (o *Backup) GetFinishedAt() string { + if o == nil { + var ret string + return ret + } + + return o.FinishedAt +} + +// GetFinishedAtOk returns a tuple with the FinishedAt field value +// and a boolean to check if the value has been set. +func (o *Backup) GetFinishedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FinishedAt, true +} + +// SetFinishedAt sets field value +func (o *Backup) SetFinishedAt(v string) { + o.FinishedAt = v +} + +// GetId returns the Id field value +func (o *Backup) GetId() int32 { + if o == nil { + var ret int32 + 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 *Backup) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Backup) SetId(v int32) { + o.Id = v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Backup) GetSize() int32 { + if o == nil || IsNil(o.Size) { + var ret int32 + 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() (*int32, 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 int32 and assigns it to the Size field. +func (o *Backup) SetSize(v int32) { + o.Size = &v +} + +// GetStatus returns the Status field value +func (o *Backup) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Backup) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Backup) SetStatus(v string) { + o.Status = v +} + +// GetTriggeredAt returns the TriggeredAt field value if set, zero value otherwise. +func (o *Backup) GetTriggeredAt() string { + if o == nil || IsNil(o.TriggeredAt) { + var ret string + return ret + } + return *o.TriggeredAt +} + +// GetTriggeredAtOk returns a tuple with the TriggeredAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetTriggeredAtOk() (*string, bool) { + if o == nil || IsNil(o.TriggeredAt) { + return nil, false + } + return o.TriggeredAt, true +} + +// HasTriggeredAt returns a boolean if a field has been set. +func (o *Backup) HasTriggeredAt() bool { + if o != nil && !IsNil(o.TriggeredAt) { + return true + } + + return false +} + +// SetTriggeredAt gets a reference to the given string and assigns it to the TriggeredAt field. +func (o *Backup) SetTriggeredAt(v string) { + o.TriggeredAt = &v +} + +func (o Backup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Backup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Downloadable) { + toSerialize["downloadable"] = o.Downloadable + } + toSerialize["finished_at"] = o.FinishedAt + toSerialize["id"] = o.Id + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + toSerialize["status"] = o.Status + if !IsNil(o.TriggeredAt) { + toSerialize["triggered_at"] = o.TriggeredAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Backup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "finished_at", + "id", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackup := _Backup{} + + err = json.Unmarshal(data, &varBackup) + + if err != nil { + return err + } + + *o = Backup(varBackup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "downloadable") + delete(additionalProperties, "finished_at") + delete(additionalProperties, "id") + delete(additionalProperties, "size") + delete(additionalProperties, "status") + delete(additionalProperties, "triggered_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +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/logme/v2api/model_create_backup_response_item.go b/services/logme/v2api/model_create_backup_response_item.go new file mode 100644 index 000000000..014a6c6f5 --- /dev/null +++ b/services/logme/v2api/model_create_backup_response_item.go @@ -0,0 +1,195 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateBackupResponseItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateBackupResponseItem{} + +// CreateBackupResponseItem struct for CreateBackupResponseItem +type CreateBackupResponseItem struct { + Id int32 `json:"id"` + Message string `json:"message"` + AdditionalProperties map[string]interface{} +} + +type _CreateBackupResponseItem CreateBackupResponseItem + +// NewCreateBackupResponseItem instantiates a new CreateBackupResponseItem 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 NewCreateBackupResponseItem(id int32, message string) *CreateBackupResponseItem { + this := CreateBackupResponseItem{} + this.Id = id + this.Message = message + return &this +} + +// NewCreateBackupResponseItemWithDefaults instantiates a new CreateBackupResponseItem 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 NewCreateBackupResponseItemWithDefaults() *CreateBackupResponseItem { + this := CreateBackupResponseItem{} + return &this +} + +// GetId returns the Id field value +func (o *CreateBackupResponseItem) GetId() int32 { + if o == nil { + var ret int32 + 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 *CreateBackupResponseItem) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CreateBackupResponseItem) SetId(v int32) { + o.Id = v +} + +// GetMessage returns the Message field value +func (o *CreateBackupResponseItem) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *CreateBackupResponseItem) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *CreateBackupResponseItem) SetMessage(v string) { + o.Message = v +} + +func (o CreateBackupResponseItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateBackupResponseItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["message"] = o.Message + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateBackupResponseItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "message", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateBackupResponseItem := _CreateBackupResponseItem{} + + err = json.Unmarshal(data, &varCreateBackupResponseItem) + + if err != nil { + return err + } + + *o = CreateBackupResponseItem(varCreateBackupResponseItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateBackupResponseItem struct { + value *CreateBackupResponseItem + isSet bool +} + +func (v NullableCreateBackupResponseItem) Get() *CreateBackupResponseItem { + return v.value +} + +func (v *NullableCreateBackupResponseItem) Set(val *CreateBackupResponseItem) { + v.value = val + v.isSet = true +} + +func (v NullableCreateBackupResponseItem) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateBackupResponseItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateBackupResponseItem(val *CreateBackupResponseItem) *NullableCreateBackupResponseItem { + return &NullableCreateBackupResponseItem{value: val, isSet: true} +} + +func (v NullableCreateBackupResponseItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateBackupResponseItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_create_credentials_payload.go b/services/logme/v2api/model_create_credentials_payload.go new file mode 100644 index 000000000..bcf174339 --- /dev/null +++ b/services/logme/v2api/model_create_credentials_payload.go @@ -0,0 +1,153 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the CreateCredentialsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCredentialsPayload{} + +// CreateCredentialsPayload struct for CreateCredentialsPayload +type CreateCredentialsPayload struct { + Parameters map[string]interface{} `json:"parameters,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateCredentialsPayload CreateCredentialsPayload + +// NewCreateCredentialsPayload instantiates a new CreateCredentialsPayload 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 NewCreateCredentialsPayload() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// NewCreateCredentialsPayloadWithDefaults instantiates a new CreateCredentialsPayload 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 NewCreateCredentialsPayloadWithDefaults() *CreateCredentialsPayload { + this := CreateCredentialsPayload{} + return &this +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *CreateCredentialsPayload) GetParameters() map[string]interface{} { + if o == nil || IsNil(o.Parameters) { + var ret map[string]interface{} + return ret + } + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCredentialsPayload) GetParametersOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Parameters) { + return map[string]interface{}{}, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *CreateCredentialsPayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given map[string]interface{} and assigns it to the Parameters field. +func (o *CreateCredentialsPayload) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +func (o CreateCredentialsPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateCredentialsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateCredentialsPayload) UnmarshalJSON(data []byte) (err error) { + varCreateCredentialsPayload := _CreateCredentialsPayload{} + + err = json.Unmarshal(data, &varCreateCredentialsPayload) + + if err != nil { + return err + } + + *o = CreateCredentialsPayload(varCreateCredentialsPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "parameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateCredentialsPayload struct { + value *CreateCredentialsPayload + isSet bool +} + +func (v NullableCreateCredentialsPayload) Get() *CreateCredentialsPayload { + return v.value +} + +func (v *NullableCreateCredentialsPayload) Set(val *CreateCredentialsPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCredentialsPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCredentialsPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCredentialsPayload(val *CreateCredentialsPayload) *NullableCreateCredentialsPayload { + return &NullableCreateCredentialsPayload{value: val, isSet: true} +} + +func (v NullableCreateCredentialsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCredentialsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_create_instance_payload.go b/services/logme/v2api/model_create_instance_payload.go new file mode 100644 index 000000000..376f7e955 --- /dev/null +++ b/services/logme/v2api/model_create_instance_payload.go @@ -0,0 +1,232 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstancePayload{} + +// CreateInstancePayload struct for CreateInstancePayload +type CreateInstancePayload struct { + InstanceName string `json:"instanceName"` + Parameters *InstanceParameters `json:"parameters,omitempty"` + PlanId string `json:"planId"` + AdditionalProperties map[string]interface{} +} + +type _CreateInstancePayload CreateInstancePayload + +// NewCreateInstancePayload instantiates a new CreateInstancePayload 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 NewCreateInstancePayload(instanceName string, planId string) *CreateInstancePayload { + this := CreateInstancePayload{} + this.InstanceName = instanceName + this.PlanId = planId + return &this +} + +// NewCreateInstancePayloadWithDefaults instantiates a new CreateInstancePayload 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 NewCreateInstancePayloadWithDefaults() *CreateInstancePayload { + this := CreateInstancePayload{} + return &this +} + +// GetInstanceName returns the InstanceName field value +func (o *CreateInstancePayload) GetInstanceName() string { + if o == nil { + var ret string + return ret + } + + return o.InstanceName +} + +// GetInstanceNameOk returns a tuple with the InstanceName field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetInstanceNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InstanceName, true +} + +// SetInstanceName sets field value +func (o *CreateInstancePayload) SetInstanceName(v string) { + o.InstanceName = v +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *CreateInstancePayload) GetParameters() InstanceParameters { + if o == nil || IsNil(o.Parameters) { + var ret InstanceParameters + return ret + } + return *o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetParametersOk() (*InstanceParameters, bool) { + if o == nil || IsNil(o.Parameters) { + return nil, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *CreateInstancePayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given InstanceParameters and assigns it to the Parameters field. +func (o *CreateInstancePayload) SetParameters(v InstanceParameters) { + o.Parameters = &v +} + +// GetPlanId returns the PlanId field value +func (o *CreateInstancePayload) GetPlanId() string { + if o == nil { + var ret string + return ret + } + + return o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetPlanIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PlanId, true +} + +// SetPlanId sets field value +func (o *CreateInstancePayload) SetPlanId(v string) { + o.PlanId = v +} + +func (o CreateInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceName"] = o.InstanceName + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + toSerialize["planId"] = o.PlanId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateInstancePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceName", + "planId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateInstancePayload := _CreateInstancePayload{} + + err = json.Unmarshal(data, &varCreateInstancePayload) + + if err != nil { + return err + } + + *o = CreateInstancePayload(varCreateInstancePayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceName") + delete(additionalProperties, "parameters") + delete(additionalProperties, "planId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateInstancePayload struct { + value *CreateInstancePayload + isSet bool +} + +func (v NullableCreateInstancePayload) Get() *CreateInstancePayload { + return v.value +} + +func (v *NullableCreateInstancePayload) Set(val *CreateInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstancePayload(val *CreateInstancePayload) *NullableCreateInstancePayload { + return &NullableCreateInstancePayload{value: val, isSet: true} +} + +func (v NullableCreateInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_create_instance_response.go b/services/logme/v2api/model_create_instance_response.go new file mode 100644 index 000000000..af5ee249e --- /dev/null +++ b/services/logme/v2api/model_create_instance_response.go @@ -0,0 +1,166 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateInstanceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstanceResponse{} + +// CreateInstanceResponse struct for CreateInstanceResponse +type CreateInstanceResponse struct { + InstanceId string `json:"instanceId"` + AdditionalProperties map[string]interface{} +} + +type _CreateInstanceResponse CreateInstanceResponse + +// NewCreateInstanceResponse instantiates a new CreateInstanceResponse 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 NewCreateInstanceResponse(instanceId string) *CreateInstanceResponse { + this := CreateInstanceResponse{} + this.InstanceId = instanceId + return &this +} + +// NewCreateInstanceResponseWithDefaults instantiates a new CreateInstanceResponse 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 NewCreateInstanceResponseWithDefaults() *CreateInstanceResponse { + this := CreateInstanceResponse{} + return &this +} + +// GetInstanceId returns the InstanceId field value +func (o *CreateInstanceResponse) GetInstanceId() string { + if o == nil { + var ret string + return ret + } + + return o.InstanceId +} + +// GetInstanceIdOk returns a tuple with the InstanceId field value +// and a boolean to check if the value has been set. +func (o *CreateInstanceResponse) GetInstanceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InstanceId, true +} + +// SetInstanceId sets field value +func (o *CreateInstanceResponse) SetInstanceId(v string) { + o.InstanceId = v +} + +func (o CreateInstanceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstanceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceId"] = o.InstanceId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateInstanceResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateInstanceResponse := _CreateInstanceResponse{} + + err = json.Unmarshal(data, &varCreateInstanceResponse) + + if err != nil { + return err + } + + *o = CreateInstanceResponse(varCreateInstanceResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateInstanceResponse struct { + value *CreateInstanceResponse + isSet bool +} + +func (v NullableCreateInstanceResponse) Get() *CreateInstanceResponse { + return v.value +} + +func (v *NullableCreateInstanceResponse) Set(val *CreateInstanceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstanceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstanceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstanceResponse(val *CreateInstanceResponse) *NullableCreateInstanceResponse { + return &NullableCreateInstanceResponse{value: val, isSet: true} +} + +func (v NullableCreateInstanceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstanceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_credentials.go b/services/logme/v2api/model_credentials.go new file mode 100644 index 000000000..b8ef553e8 --- /dev/null +++ b/services/logme/v2api/model_credentials.go @@ -0,0 +1,335 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Credentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Credentials{} + +// Credentials struct for Credentials +type Credentials struct { + Host string `json:"host"` + Password string `json:"password"` + Port *int32 `json:"port,omitempty"` + SyslogDrainUrl *string `json:"syslog_drain_url,omitempty"` + Uri *string `json:"uri,omitempty"` + Username string `json:"username"` + AdditionalProperties map[string]interface{} +} + +type _Credentials Credentials + +// NewCredentials instantiates a new Credentials 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 NewCredentials(host string, password string, username string) *Credentials { + this := Credentials{} + this.Host = host + this.Password = password + this.Username = username + return &this +} + +// NewCredentialsWithDefaults instantiates a new Credentials 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 NewCredentialsWithDefaults() *Credentials { + this := Credentials{} + return &this +} + +// GetHost returns the Host field value +func (o *Credentials) GetHost() string { + if o == nil { + var ret string + return ret + } + + return o.Host +} + +// GetHostOk returns a tuple with the Host field value +// and a boolean to check if the value has been set. +func (o *Credentials) GetHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Host, true +} + +// SetHost sets field value +func (o *Credentials) SetHost(v string) { + o.Host = v +} + +// GetPassword returns the Password field value +func (o *Credentials) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *Credentials) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *Credentials) SetPassword(v string) { + o.Password = v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *Credentials) GetPort() int32 { + if o == nil || IsNil(o.Port) { + var ret int32 + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetPortOk() (*int32, bool) { + if o == nil || IsNil(o.Port) { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *Credentials) HasPort() bool { + if o != nil && !IsNil(o.Port) { + return true + } + + return false +} + +// SetPort gets a reference to the given int32 and assigns it to the Port field. +func (o *Credentials) SetPort(v int32) { + o.Port = &v +} + +// GetSyslogDrainUrl returns the SyslogDrainUrl field value if set, zero value otherwise. +func (o *Credentials) GetSyslogDrainUrl() string { + if o == nil || IsNil(o.SyslogDrainUrl) { + var ret string + return ret + } + return *o.SyslogDrainUrl +} + +// GetSyslogDrainUrlOk returns a tuple with the SyslogDrainUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetSyslogDrainUrlOk() (*string, bool) { + if o == nil || IsNil(o.SyslogDrainUrl) { + return nil, false + } + return o.SyslogDrainUrl, true +} + +// HasSyslogDrainUrl returns a boolean if a field has been set. +func (o *Credentials) HasSyslogDrainUrl() bool { + if o != nil && !IsNil(o.SyslogDrainUrl) { + return true + } + + return false +} + +// SetSyslogDrainUrl gets a reference to the given string and assigns it to the SyslogDrainUrl field. +func (o *Credentials) SetSyslogDrainUrl(v string) { + o.SyslogDrainUrl = &v +} + +// GetUri returns the Uri field value if set, zero value otherwise. +func (o *Credentials) GetUri() string { + if o == nil || IsNil(o.Uri) { + var ret string + return ret + } + return *o.Uri +} + +// GetUriOk returns a tuple with the Uri field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Credentials) GetUriOk() (*string, bool) { + if o == nil || IsNil(o.Uri) { + return nil, false + } + return o.Uri, true +} + +// HasUri returns a boolean if a field has been set. +func (o *Credentials) HasUri() bool { + if o != nil && !IsNil(o.Uri) { + return true + } + + return false +} + +// SetUri gets a reference to the given string and assigns it to the Uri field. +func (o *Credentials) SetUri(v string) { + o.Uri = &v +} + +// GetUsername returns the Username field value +func (o *Credentials) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *Credentials) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *Credentials) SetUsername(v string) { + o.Username = v +} + +func (o Credentials) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Credentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["host"] = o.Host + toSerialize["password"] = o.Password + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + if !IsNil(o.SyslogDrainUrl) { + toSerialize["syslog_drain_url"] = o.SyslogDrainUrl + } + if !IsNil(o.Uri) { + toSerialize["uri"] = o.Uri + } + toSerialize["username"] = o.Username + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Credentials) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "host", + "password", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCredentials := _Credentials{} + + err = json.Unmarshal(data, &varCredentials) + + if err != nil { + return err + } + + *o = Credentials(varCredentials) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "host") + delete(additionalProperties, "password") + delete(additionalProperties, "port") + delete(additionalProperties, "syslog_drain_url") + delete(additionalProperties, "uri") + delete(additionalProperties, "username") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCredentials struct { + value *Credentials + isSet bool +} + +func (v NullableCredentials) Get() *Credentials { + return v.value +} + +func (v *NullableCredentials) Set(val *Credentials) { + v.value = val + v.isSet = true +} + +func (v NullableCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentials(val *Credentials) *NullableCredentials { + return &NullableCredentials{value: val, isSet: true} +} + +func (v NullableCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_credentials_list_item.go b/services/logme/v2api/model_credentials_list_item.go new file mode 100644 index 000000000..3abb49449 --- /dev/null +++ b/services/logme/v2api/model_credentials_list_item.go @@ -0,0 +1,166 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CredentialsListItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CredentialsListItem{} + +// CredentialsListItem struct for CredentialsListItem +type CredentialsListItem struct { + Id string `json:"id"` + AdditionalProperties map[string]interface{} +} + +type _CredentialsListItem CredentialsListItem + +// NewCredentialsListItem instantiates a new CredentialsListItem 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 NewCredentialsListItem(id string) *CredentialsListItem { + this := CredentialsListItem{} + this.Id = id + return &this +} + +// NewCredentialsListItemWithDefaults instantiates a new CredentialsListItem 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 NewCredentialsListItemWithDefaults() *CredentialsListItem { + this := CredentialsListItem{} + return &this +} + +// GetId returns the Id field value +func (o *CredentialsListItem) GetId() string { + if o == nil { + 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 *CredentialsListItem) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CredentialsListItem) SetId(v string) { + o.Id = v +} + +func (o CredentialsListItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CredentialsListItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CredentialsListItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCredentialsListItem := _CredentialsListItem{} + + err = json.Unmarshal(data, &varCredentialsListItem) + + if err != nil { + return err + } + + *o = CredentialsListItem(varCredentialsListItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCredentialsListItem struct { + value *CredentialsListItem + isSet bool +} + +func (v NullableCredentialsListItem) Get() *CredentialsListItem { + return v.value +} + +func (v *NullableCredentialsListItem) Set(val *CredentialsListItem) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialsListItem) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialsListItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialsListItem(val *CredentialsListItem) *NullableCredentialsListItem { + return &NullableCredentialsListItem{value: val, isSet: true} +} + +func (v NullableCredentialsListItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialsListItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_credentials_response.go b/services/logme/v2api/model_credentials_response.go new file mode 100644 index 000000000..11aa710e3 --- /dev/null +++ b/services/logme/v2api/model_credentials_response.go @@ -0,0 +1,232 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CredentialsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CredentialsResponse{} + +// CredentialsResponse struct for CredentialsResponse +type CredentialsResponse struct { + Id string `json:"id"` + Raw *RawCredentials `json:"raw,omitempty"` + Uri string `json:"uri"` + AdditionalProperties map[string]interface{} +} + +type _CredentialsResponse CredentialsResponse + +// NewCredentialsResponse instantiates a new CredentialsResponse 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 NewCredentialsResponse(id string, uri string) *CredentialsResponse { + this := CredentialsResponse{} + this.Id = id + this.Uri = uri + return &this +} + +// NewCredentialsResponseWithDefaults instantiates a new CredentialsResponse 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 NewCredentialsResponseWithDefaults() *CredentialsResponse { + this := CredentialsResponse{} + return &this +} + +// GetId returns the Id field value +func (o *CredentialsResponse) GetId() string { + if o == nil { + 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 *CredentialsResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CredentialsResponse) SetId(v string) { + o.Id = v +} + +// GetRaw returns the Raw field value if set, zero value otherwise. +func (o *CredentialsResponse) GetRaw() RawCredentials { + if o == nil || IsNil(o.Raw) { + var ret RawCredentials + return ret + } + return *o.Raw +} + +// GetRawOk returns a tuple with the Raw field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetRawOk() (*RawCredentials, bool) { + if o == nil || IsNil(o.Raw) { + return nil, false + } + return o.Raw, true +} + +// HasRaw returns a boolean if a field has been set. +func (o *CredentialsResponse) HasRaw() bool { + if o != nil && !IsNil(o.Raw) { + return true + } + + return false +} + +// SetRaw gets a reference to the given RawCredentials and assigns it to the Raw field. +func (o *CredentialsResponse) SetRaw(v RawCredentials) { + o.Raw = &v +} + +// GetUri returns the Uri field value +func (o *CredentialsResponse) GetUri() string { + if o == nil { + var ret string + return ret + } + + return o.Uri +} + +// GetUriOk returns a tuple with the Uri field value +// and a boolean to check if the value has been set. +func (o *CredentialsResponse) GetUriOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Uri, true +} + +// SetUri sets field value +func (o *CredentialsResponse) SetUri(v string) { + o.Uri = v +} + +func (o CredentialsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CredentialsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if !IsNil(o.Raw) { + toSerialize["raw"] = o.Raw + } + toSerialize["uri"] = o.Uri + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CredentialsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "uri", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCredentialsResponse := _CredentialsResponse{} + + err = json.Unmarshal(data, &varCredentialsResponse) + + if err != nil { + return err + } + + *o = CredentialsResponse(varCredentialsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "raw") + delete(additionalProperties, "uri") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCredentialsResponse struct { + value *CredentialsResponse + isSet bool +} + +func (v NullableCredentialsResponse) Get() *CredentialsResponse { + return v.value +} + +func (v *NullableCredentialsResponse) Set(val *CredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialsResponse(val *CredentialsResponse) *NullableCredentialsResponse { + return &NullableCredentialsResponse{value: val, isSet: true} +} + +func (v NullableCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_error.go b/services/logme/v2api/model_error.go new file mode 100644 index 000000000..c03943e94 --- /dev/null +++ b/services/logme/v2api/model_error.go @@ -0,0 +1,195 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Error{} + +// Error struct for Error +type Error struct { + Description string `json:"description"` + Error string `json:"error"` + AdditionalProperties map[string]interface{} +} + +type _Error Error + +// NewError instantiates a new Error 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 NewError(description string, error_ string) *Error { + this := Error{} + this.Description = description + this.Error = error_ + return &this +} + +// NewErrorWithDefaults instantiates a new Error 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 NewErrorWithDefaults() *Error { + this := Error{} + return &this +} + +// GetDescription returns the Description field value +func (o *Error) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Error) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *Error) SetDescription(v string) { + o.Description = v +} + +// GetError returns the Error field value +func (o *Error) GetError() string { + if o == nil { + var ret string + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *Error) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *Error) SetError(v string) { + o.Error = v +} + +func (o Error) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Error) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["error"] = o.Error + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Error) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "error", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varError := _Error{} + + err = json.Unmarshal(data, &varError) + + if err != nil { + return err + } + + *o = Error(varError) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "error") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableError struct { + value *Error + isSet bool +} + +func (v NullableError) Get() *Error { + return v.value +} + +func (v *NullableError) Set(val *Error) { + v.value = val + v.isSet = true +} + +func (v NullableError) IsSet() bool { + return v.isSet +} + +func (v *NullableError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableError(val *Error) *NullableError { + return &NullableError{value: val, isSet: true} +} + +func (v NullableError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_get_metrics_response.go b/services/logme/v2api/model_get_metrics_response.go new file mode 100644 index 000000000..ffeea837a --- /dev/null +++ b/services/logme/v2api/model_get_metrics_response.go @@ -0,0 +1,857 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GetMetricsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetMetricsResponse{} + +// GetMetricsResponse struct for GetMetricsResponse +type GetMetricsResponse struct { + CpuIdleTime *int64 `json:"cpuIdleTime,omitempty"` + CpuLoadPercent float32 `json:"cpuLoadPercent"` + CpuSystemTime *int64 `json:"cpuSystemTime,omitempty"` + CpuUserTime *int64 `json:"cpuUserTime,omitempty"` + DiskEphemeralTotal int64 `json:"diskEphemeralTotal"` + DiskEphemeralUsed int64 `json:"diskEphemeralUsed"` + DiskPersistentTotal int64 `json:"diskPersistentTotal"` + DiskPersistentUsed int64 `json:"diskPersistentUsed"` + Load1 float32 `json:"load1"` + Load15 float32 `json:"load15"` + Load5 float32 `json:"load5"` + MemoryTotal int64 `json:"memoryTotal"` + MemoryUsed int64 `json:"memoryUsed"` + OpensearchDashboardURL string `json:"opensearchDashboardURL"` + ParachuteDiskEphemeralActivated bool `json:"parachuteDiskEphemeralActivated"` + ParachuteDiskEphemeralTotal int64 `json:"parachuteDiskEphemeralTotal"` + ParachuteDiskEphemeralUsed int64 `json:"parachuteDiskEphemeralUsed"` + ParachuteDiskEphemeralUsedPercent int64 `json:"parachuteDiskEphemeralUsedPercent"` + ParachuteDiskEphemeralUsedThreshold int64 `json:"parachuteDiskEphemeralUsedThreshold"` + ParachuteDiskPersistentActivated bool `json:"parachuteDiskPersistentActivated"` + ParachuteDiskPersistentTotal int64 `json:"parachuteDiskPersistentTotal"` + ParachuteDiskPersistentUsed int64 `json:"parachuteDiskPersistentUsed"` + ParachuteDiskPersistentUsedPercent int64 `json:"parachuteDiskPersistentUsedPercent"` + ParachuteDiskPersistentUsedThreshold int64 `json:"parachuteDiskPersistentUsedThreshold"` + AdditionalProperties map[string]interface{} +} + +type _GetMetricsResponse GetMetricsResponse + +// NewGetMetricsResponse instantiates a new GetMetricsResponse 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 NewGetMetricsResponse(cpuLoadPercent float32, diskEphemeralTotal int64, diskEphemeralUsed int64, diskPersistentTotal int64, diskPersistentUsed int64, load1 float32, load15 float32, load5 float32, memoryTotal int64, memoryUsed int64, opensearchDashboardURL string, parachuteDiskEphemeralActivated bool, parachuteDiskEphemeralTotal int64, parachuteDiskEphemeralUsed int64, parachuteDiskEphemeralUsedPercent int64, parachuteDiskEphemeralUsedThreshold int64, parachuteDiskPersistentActivated bool, parachuteDiskPersistentTotal int64, parachuteDiskPersistentUsed int64, parachuteDiskPersistentUsedPercent int64, parachuteDiskPersistentUsedThreshold int64) *GetMetricsResponse { + this := GetMetricsResponse{} + this.CpuLoadPercent = cpuLoadPercent + this.DiskEphemeralTotal = diskEphemeralTotal + this.DiskEphemeralUsed = diskEphemeralUsed + this.DiskPersistentTotal = diskPersistentTotal + this.DiskPersistentUsed = diskPersistentUsed + this.Load1 = load1 + this.Load15 = load15 + this.Load5 = load5 + this.MemoryTotal = memoryTotal + this.MemoryUsed = memoryUsed + this.OpensearchDashboardURL = opensearchDashboardURL + this.ParachuteDiskEphemeralActivated = parachuteDiskEphemeralActivated + this.ParachuteDiskEphemeralTotal = parachuteDiskEphemeralTotal + this.ParachuteDiskEphemeralUsed = parachuteDiskEphemeralUsed + this.ParachuteDiskEphemeralUsedPercent = parachuteDiskEphemeralUsedPercent + this.ParachuteDiskEphemeralUsedThreshold = parachuteDiskEphemeralUsedThreshold + this.ParachuteDiskPersistentActivated = parachuteDiskPersistentActivated + this.ParachuteDiskPersistentTotal = parachuteDiskPersistentTotal + this.ParachuteDiskPersistentUsed = parachuteDiskPersistentUsed + this.ParachuteDiskPersistentUsedPercent = parachuteDiskPersistentUsedPercent + this.ParachuteDiskPersistentUsedThreshold = parachuteDiskPersistentUsedThreshold + return &this +} + +// NewGetMetricsResponseWithDefaults instantiates a new GetMetricsResponse 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 NewGetMetricsResponseWithDefaults() *GetMetricsResponse { + this := GetMetricsResponse{} + return &this +} + +// GetCpuIdleTime returns the CpuIdleTime field value if set, zero value otherwise. +func (o *GetMetricsResponse) GetCpuIdleTime() int64 { + if o == nil || IsNil(o.CpuIdleTime) { + var ret int64 + return ret + } + return *o.CpuIdleTime +} + +// GetCpuIdleTimeOk returns a tuple with the CpuIdleTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuIdleTimeOk() (*int64, bool) { + if o == nil || IsNil(o.CpuIdleTime) { + return nil, false + } + return o.CpuIdleTime, true +} + +// HasCpuIdleTime returns a boolean if a field has been set. +func (o *GetMetricsResponse) HasCpuIdleTime() bool { + if o != nil && !IsNil(o.CpuIdleTime) { + return true + } + + return false +} + +// SetCpuIdleTime gets a reference to the given int64 and assigns it to the CpuIdleTime field. +func (o *GetMetricsResponse) SetCpuIdleTime(v int64) { + o.CpuIdleTime = &v +} + +// GetCpuLoadPercent returns the CpuLoadPercent field value +func (o *GetMetricsResponse) GetCpuLoadPercent() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.CpuLoadPercent +} + +// GetCpuLoadPercentOk returns a tuple with the CpuLoadPercent field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuLoadPercentOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.CpuLoadPercent, true +} + +// SetCpuLoadPercent sets field value +func (o *GetMetricsResponse) SetCpuLoadPercent(v float32) { + o.CpuLoadPercent = v +} + +// GetCpuSystemTime returns the CpuSystemTime field value if set, zero value otherwise. +func (o *GetMetricsResponse) GetCpuSystemTime() int64 { + if o == nil || IsNil(o.CpuSystemTime) { + var ret int64 + return ret + } + return *o.CpuSystemTime +} + +// GetCpuSystemTimeOk returns a tuple with the CpuSystemTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuSystemTimeOk() (*int64, bool) { + if o == nil || IsNil(o.CpuSystemTime) { + return nil, false + } + return o.CpuSystemTime, true +} + +// HasCpuSystemTime returns a boolean if a field has been set. +func (o *GetMetricsResponse) HasCpuSystemTime() bool { + if o != nil && !IsNil(o.CpuSystemTime) { + return true + } + + return false +} + +// SetCpuSystemTime gets a reference to the given int64 and assigns it to the CpuSystemTime field. +func (o *GetMetricsResponse) SetCpuSystemTime(v int64) { + o.CpuSystemTime = &v +} + +// GetCpuUserTime returns the CpuUserTime field value if set, zero value otherwise. +func (o *GetMetricsResponse) GetCpuUserTime() int64 { + if o == nil || IsNil(o.CpuUserTime) { + var ret int64 + return ret + } + return *o.CpuUserTime +} + +// GetCpuUserTimeOk returns a tuple with the CpuUserTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetCpuUserTimeOk() (*int64, bool) { + if o == nil || IsNil(o.CpuUserTime) { + return nil, false + } + return o.CpuUserTime, true +} + +// HasCpuUserTime returns a boolean if a field has been set. +func (o *GetMetricsResponse) HasCpuUserTime() bool { + if o != nil && !IsNil(o.CpuUserTime) { + return true + } + + return false +} + +// SetCpuUserTime gets a reference to the given int64 and assigns it to the CpuUserTime field. +func (o *GetMetricsResponse) SetCpuUserTime(v int64) { + o.CpuUserTime = &v +} + +// GetDiskEphemeralTotal returns the DiskEphemeralTotal field value +func (o *GetMetricsResponse) GetDiskEphemeralTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskEphemeralTotal +} + +// GetDiskEphemeralTotalOk returns a tuple with the DiskEphemeralTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskEphemeralTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskEphemeralTotal, true +} + +// SetDiskEphemeralTotal sets field value +func (o *GetMetricsResponse) SetDiskEphemeralTotal(v int64) { + o.DiskEphemeralTotal = v +} + +// GetDiskEphemeralUsed returns the DiskEphemeralUsed field value +func (o *GetMetricsResponse) GetDiskEphemeralUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskEphemeralUsed +} + +// GetDiskEphemeralUsedOk returns a tuple with the DiskEphemeralUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskEphemeralUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskEphemeralUsed, true +} + +// SetDiskEphemeralUsed sets field value +func (o *GetMetricsResponse) SetDiskEphemeralUsed(v int64) { + o.DiskEphemeralUsed = v +} + +// GetDiskPersistentTotal returns the DiskPersistentTotal field value +func (o *GetMetricsResponse) GetDiskPersistentTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskPersistentTotal +} + +// GetDiskPersistentTotalOk returns a tuple with the DiskPersistentTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskPersistentTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskPersistentTotal, true +} + +// SetDiskPersistentTotal sets field value +func (o *GetMetricsResponse) SetDiskPersistentTotal(v int64) { + o.DiskPersistentTotal = v +} + +// GetDiskPersistentUsed returns the DiskPersistentUsed field value +func (o *GetMetricsResponse) GetDiskPersistentUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DiskPersistentUsed +} + +// GetDiskPersistentUsedOk returns a tuple with the DiskPersistentUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetDiskPersistentUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DiskPersistentUsed, true +} + +// SetDiskPersistentUsed sets field value +func (o *GetMetricsResponse) SetDiskPersistentUsed(v int64) { + o.DiskPersistentUsed = v +} + +// GetLoad1 returns the Load1 field value +func (o *GetMetricsResponse) GetLoad1() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Load1 +} + +// GetLoad1Ok returns a tuple with the Load1 field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetLoad1Ok() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Load1, true +} + +// SetLoad1 sets field value +func (o *GetMetricsResponse) SetLoad1(v float32) { + o.Load1 = v +} + +// GetLoad15 returns the Load15 field value +func (o *GetMetricsResponse) GetLoad15() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Load15 +} + +// GetLoad15Ok returns a tuple with the Load15 field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetLoad15Ok() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Load15, true +} + +// SetLoad15 sets field value +func (o *GetMetricsResponse) SetLoad15(v float32) { + o.Load15 = v +} + +// GetLoad5 returns the Load5 field value +func (o *GetMetricsResponse) GetLoad5() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Load5 +} + +// GetLoad5Ok returns a tuple with the Load5 field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetLoad5Ok() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Load5, true +} + +// SetLoad5 sets field value +func (o *GetMetricsResponse) SetLoad5(v float32) { + o.Load5 = v +} + +// GetMemoryTotal returns the MemoryTotal field value +func (o *GetMetricsResponse) GetMemoryTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.MemoryTotal +} + +// GetMemoryTotalOk returns a tuple with the MemoryTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetMemoryTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.MemoryTotal, true +} + +// SetMemoryTotal sets field value +func (o *GetMetricsResponse) SetMemoryTotal(v int64) { + o.MemoryTotal = v +} + +// GetMemoryUsed returns the MemoryUsed field value +func (o *GetMetricsResponse) GetMemoryUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.MemoryUsed +} + +// GetMemoryUsedOk returns a tuple with the MemoryUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetMemoryUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.MemoryUsed, true +} + +// SetMemoryUsed sets field value +func (o *GetMetricsResponse) SetMemoryUsed(v int64) { + o.MemoryUsed = v +} + +// GetOpensearchDashboardURL returns the OpensearchDashboardURL field value +func (o *GetMetricsResponse) GetOpensearchDashboardURL() string { + if o == nil { + var ret string + return ret + } + + return o.OpensearchDashboardURL +} + +// GetOpensearchDashboardURLOk returns a tuple with the OpensearchDashboardURL field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetOpensearchDashboardURLOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OpensearchDashboardURL, true +} + +// SetOpensearchDashboardURL sets field value +func (o *GetMetricsResponse) SetOpensearchDashboardURL(v string) { + o.OpensearchDashboardURL = v +} + +// GetParachuteDiskEphemeralActivated returns the ParachuteDiskEphemeralActivated field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralActivated() bool { + if o == nil { + var ret bool + return ret + } + + return o.ParachuteDiskEphemeralActivated +} + +// GetParachuteDiskEphemeralActivatedOk returns a tuple with the ParachuteDiskEphemeralActivated field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralActivatedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralActivated, true +} + +// SetParachuteDiskEphemeralActivated sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralActivated(v bool) { + o.ParachuteDiskEphemeralActivated = v +} + +// GetParachuteDiskEphemeralTotal returns the ParachuteDiskEphemeralTotal field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralTotal +} + +// GetParachuteDiskEphemeralTotalOk returns a tuple with the ParachuteDiskEphemeralTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralTotal, true +} + +// SetParachuteDiskEphemeralTotal sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralTotal(v int64) { + o.ParachuteDiskEphemeralTotal = v +} + +// GetParachuteDiskEphemeralUsed returns the ParachuteDiskEphemeralUsed field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralUsed +} + +// GetParachuteDiskEphemeralUsedOk returns a tuple with the ParachuteDiskEphemeralUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralUsed, true +} + +// SetParachuteDiskEphemeralUsed sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralUsed(v int64) { + o.ParachuteDiskEphemeralUsed = v +} + +// GetParachuteDiskEphemeralUsedPercent returns the ParachuteDiskEphemeralUsedPercent field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedPercent() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralUsedPercent +} + +// GetParachuteDiskEphemeralUsedPercentOk returns a tuple with the ParachuteDiskEphemeralUsedPercent field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedPercentOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralUsedPercent, true +} + +// SetParachuteDiskEphemeralUsedPercent sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralUsedPercent(v int64) { + o.ParachuteDiskEphemeralUsedPercent = v +} + +// GetParachuteDiskEphemeralUsedThreshold returns the ParachuteDiskEphemeralUsedThreshold field value +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedThreshold() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskEphemeralUsedThreshold +} + +// GetParachuteDiskEphemeralUsedThresholdOk returns a tuple with the ParachuteDiskEphemeralUsedThreshold field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskEphemeralUsedThresholdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskEphemeralUsedThreshold, true +} + +// SetParachuteDiskEphemeralUsedThreshold sets field value +func (o *GetMetricsResponse) SetParachuteDiskEphemeralUsedThreshold(v int64) { + o.ParachuteDiskEphemeralUsedThreshold = v +} + +// GetParachuteDiskPersistentActivated returns the ParachuteDiskPersistentActivated field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentActivated() bool { + if o == nil { + var ret bool + return ret + } + + return o.ParachuteDiskPersistentActivated +} + +// GetParachuteDiskPersistentActivatedOk returns a tuple with the ParachuteDiskPersistentActivated field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentActivatedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentActivated, true +} + +// SetParachuteDiskPersistentActivated sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentActivated(v bool) { + o.ParachuteDiskPersistentActivated = v +} + +// GetParachuteDiskPersistentTotal returns the ParachuteDiskPersistentTotal field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentTotal +} + +// GetParachuteDiskPersistentTotalOk returns a tuple with the ParachuteDiskPersistentTotal field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentTotal, true +} + +// SetParachuteDiskPersistentTotal sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentTotal(v int64) { + o.ParachuteDiskPersistentTotal = v +} + +// GetParachuteDiskPersistentUsed returns the ParachuteDiskPersistentUsed field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentUsed +} + +// GetParachuteDiskPersistentUsedOk returns a tuple with the ParachuteDiskPersistentUsed field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentUsed, true +} + +// SetParachuteDiskPersistentUsed sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentUsed(v int64) { + o.ParachuteDiskPersistentUsed = v +} + +// GetParachuteDiskPersistentUsedPercent returns the ParachuteDiskPersistentUsedPercent field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedPercent() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentUsedPercent +} + +// GetParachuteDiskPersistentUsedPercentOk returns a tuple with the ParachuteDiskPersistentUsedPercent field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedPercentOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentUsedPercent, true +} + +// SetParachuteDiskPersistentUsedPercent sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentUsedPercent(v int64) { + o.ParachuteDiskPersistentUsedPercent = v +} + +// GetParachuteDiskPersistentUsedThreshold returns the ParachuteDiskPersistentUsedThreshold field value +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedThreshold() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ParachuteDiskPersistentUsedThreshold +} + +// GetParachuteDiskPersistentUsedThresholdOk returns a tuple with the ParachuteDiskPersistentUsedThreshold field value +// and a boolean to check if the value has been set. +func (o *GetMetricsResponse) GetParachuteDiskPersistentUsedThresholdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ParachuteDiskPersistentUsedThreshold, true +} + +// SetParachuteDiskPersistentUsedThreshold sets field value +func (o *GetMetricsResponse) SetParachuteDiskPersistentUsedThreshold(v int64) { + o.ParachuteDiskPersistentUsedThreshold = v +} + +func (o GetMetricsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetMetricsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CpuIdleTime) { + toSerialize["cpuIdleTime"] = o.CpuIdleTime + } + toSerialize["cpuLoadPercent"] = o.CpuLoadPercent + if !IsNil(o.CpuSystemTime) { + toSerialize["cpuSystemTime"] = o.CpuSystemTime + } + if !IsNil(o.CpuUserTime) { + toSerialize["cpuUserTime"] = o.CpuUserTime + } + toSerialize["diskEphemeralTotal"] = o.DiskEphemeralTotal + toSerialize["diskEphemeralUsed"] = o.DiskEphemeralUsed + toSerialize["diskPersistentTotal"] = o.DiskPersistentTotal + toSerialize["diskPersistentUsed"] = o.DiskPersistentUsed + toSerialize["load1"] = o.Load1 + toSerialize["load15"] = o.Load15 + toSerialize["load5"] = o.Load5 + toSerialize["memoryTotal"] = o.MemoryTotal + toSerialize["memoryUsed"] = o.MemoryUsed + toSerialize["opensearchDashboardURL"] = o.OpensearchDashboardURL + toSerialize["parachuteDiskEphemeralActivated"] = o.ParachuteDiskEphemeralActivated + toSerialize["parachuteDiskEphemeralTotal"] = o.ParachuteDiskEphemeralTotal + toSerialize["parachuteDiskEphemeralUsed"] = o.ParachuteDiskEphemeralUsed + toSerialize["parachuteDiskEphemeralUsedPercent"] = o.ParachuteDiskEphemeralUsedPercent + toSerialize["parachuteDiskEphemeralUsedThreshold"] = o.ParachuteDiskEphemeralUsedThreshold + toSerialize["parachuteDiskPersistentActivated"] = o.ParachuteDiskPersistentActivated + toSerialize["parachuteDiskPersistentTotal"] = o.ParachuteDiskPersistentTotal + toSerialize["parachuteDiskPersistentUsed"] = o.ParachuteDiskPersistentUsed + toSerialize["parachuteDiskPersistentUsedPercent"] = o.ParachuteDiskPersistentUsedPercent + toSerialize["parachuteDiskPersistentUsedThreshold"] = o.ParachuteDiskPersistentUsedThreshold + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetMetricsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cpuLoadPercent", + "diskEphemeralTotal", + "diskEphemeralUsed", + "diskPersistentTotal", + "diskPersistentUsed", + "load1", + "load15", + "load5", + "memoryTotal", + "memoryUsed", + "opensearchDashboardURL", + "parachuteDiskEphemeralActivated", + "parachuteDiskEphemeralTotal", + "parachuteDiskEphemeralUsed", + "parachuteDiskEphemeralUsedPercent", + "parachuteDiskEphemeralUsedThreshold", + "parachuteDiskPersistentActivated", + "parachuteDiskPersistentTotal", + "parachuteDiskPersistentUsed", + "parachuteDiskPersistentUsedPercent", + "parachuteDiskPersistentUsedThreshold", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetMetricsResponse := _GetMetricsResponse{} + + err = json.Unmarshal(data, &varGetMetricsResponse) + + if err != nil { + return err + } + + *o = GetMetricsResponse(varGetMetricsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cpuIdleTime") + delete(additionalProperties, "cpuLoadPercent") + delete(additionalProperties, "cpuSystemTime") + delete(additionalProperties, "cpuUserTime") + delete(additionalProperties, "diskEphemeralTotal") + delete(additionalProperties, "diskEphemeralUsed") + delete(additionalProperties, "diskPersistentTotal") + delete(additionalProperties, "diskPersistentUsed") + delete(additionalProperties, "load1") + delete(additionalProperties, "load15") + delete(additionalProperties, "load5") + delete(additionalProperties, "memoryTotal") + delete(additionalProperties, "memoryUsed") + delete(additionalProperties, "opensearchDashboardURL") + delete(additionalProperties, "parachuteDiskEphemeralActivated") + delete(additionalProperties, "parachuteDiskEphemeralTotal") + delete(additionalProperties, "parachuteDiskEphemeralUsed") + delete(additionalProperties, "parachuteDiskEphemeralUsedPercent") + delete(additionalProperties, "parachuteDiskEphemeralUsedThreshold") + delete(additionalProperties, "parachuteDiskPersistentActivated") + delete(additionalProperties, "parachuteDiskPersistentTotal") + delete(additionalProperties, "parachuteDiskPersistentUsed") + delete(additionalProperties, "parachuteDiskPersistentUsedPercent") + delete(additionalProperties, "parachuteDiskPersistentUsedThreshold") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetMetricsResponse struct { + value *GetMetricsResponse + isSet bool +} + +func (v NullableGetMetricsResponse) Get() *GetMetricsResponse { + return v.value +} + +func (v *NullableGetMetricsResponse) Set(val *GetMetricsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetMetricsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetMetricsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetMetricsResponse(val *GetMetricsResponse) *NullableGetMetricsResponse { + return &NullableGetMetricsResponse{value: val, isSet: true} +} + +func (v NullableGetMetricsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetMetricsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_instance.go b/services/logme/v2api/model_instance.go new file mode 100644 index 000000000..e954cbc83 --- /dev/null +++ b/services/logme/v2api/model_instance.go @@ -0,0 +1,563 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Instance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Instance{} + +// Instance struct for Instance +type Instance struct { + CfGuid string `json:"cfGuid"` + CfOrganizationGuid string `json:"cfOrganizationGuid"` + CfSpaceGuid string `json:"cfSpaceGuid"` + DashboardUrl string `json:"dashboardUrl"` + ImageUrl string `json:"imageUrl"` + InstanceId *string `json:"instanceId,omitempty"` + LastOperation InstanceLastOperation `json:"lastOperation"` + Name string `json:"name"` + // Deprecated + OfferingName string `json:"offeringName"` + OfferingVersion string `json:"offeringVersion"` + Parameters map[string]interface{} `json:"parameters"` + PlanId string `json:"planId"` + PlanName string `json:"planName"` + Status *string `json:"status,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Instance Instance + +// NewInstance instantiates a new Instance 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 NewInstance(cfGuid string, cfOrganizationGuid string, cfSpaceGuid string, dashboardUrl string, imageUrl string, lastOperation InstanceLastOperation, name string, offeringName string, offeringVersion string, parameters map[string]interface{}, planId string, planName string) *Instance { + this := Instance{} + this.CfGuid = cfGuid + this.CfOrganizationGuid = cfOrganizationGuid + this.CfSpaceGuid = cfSpaceGuid + this.DashboardUrl = dashboardUrl + this.ImageUrl = imageUrl + this.LastOperation = lastOperation + this.Name = name + this.OfferingName = offeringName + this.OfferingVersion = offeringVersion + this.Parameters = parameters + this.PlanId = planId + this.PlanName = planName + return &this +} + +// NewInstanceWithDefaults instantiates a new Instance 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 NewInstanceWithDefaults() *Instance { + this := Instance{} + return &this +} + +// GetCfGuid returns the CfGuid field value +func (o *Instance) GetCfGuid() string { + if o == nil { + var ret string + return ret + } + + return o.CfGuid +} + +// GetCfGuidOk returns a tuple with the CfGuid field value +// and a boolean to check if the value has been set. +func (o *Instance) GetCfGuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CfGuid, true +} + +// SetCfGuid sets field value +func (o *Instance) SetCfGuid(v string) { + o.CfGuid = v +} + +// GetCfOrganizationGuid returns the CfOrganizationGuid field value +func (o *Instance) GetCfOrganizationGuid() string { + if o == nil { + var ret string + return ret + } + + return o.CfOrganizationGuid +} + +// GetCfOrganizationGuidOk returns a tuple with the CfOrganizationGuid field value +// and a boolean to check if the value has been set. +func (o *Instance) GetCfOrganizationGuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CfOrganizationGuid, true +} + +// SetCfOrganizationGuid sets field value +func (o *Instance) SetCfOrganizationGuid(v string) { + o.CfOrganizationGuid = v +} + +// GetCfSpaceGuid returns the CfSpaceGuid field value +func (o *Instance) GetCfSpaceGuid() string { + if o == nil { + var ret string + return ret + } + + return o.CfSpaceGuid +} + +// GetCfSpaceGuidOk returns a tuple with the CfSpaceGuid field value +// and a boolean to check if the value has been set. +func (o *Instance) GetCfSpaceGuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CfSpaceGuid, true +} + +// SetCfSpaceGuid sets field value +func (o *Instance) SetCfSpaceGuid(v string) { + o.CfSpaceGuid = v +} + +// GetDashboardUrl returns the DashboardUrl field value +func (o *Instance) GetDashboardUrl() string { + if o == nil { + var ret string + return ret + } + + return o.DashboardUrl +} + +// GetDashboardUrlOk returns a tuple with the DashboardUrl field value +// and a boolean to check if the value has been set. +func (o *Instance) GetDashboardUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DashboardUrl, true +} + +// SetDashboardUrl sets field value +func (o *Instance) SetDashboardUrl(v string) { + o.DashboardUrl = v +} + +// GetImageUrl returns the ImageUrl field value +func (o *Instance) GetImageUrl() string { + if o == nil { + var ret string + return ret + } + + return o.ImageUrl +} + +// GetImageUrlOk returns a tuple with the ImageUrl field value +// and a boolean to check if the value has been set. +func (o *Instance) GetImageUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ImageUrl, true +} + +// SetImageUrl sets field value +func (o *Instance) SetImageUrl(v string) { + o.ImageUrl = v +} + +// GetInstanceId returns the InstanceId field value if set, zero value otherwise. +func (o *Instance) GetInstanceId() string { + if o == nil || IsNil(o.InstanceId) { + var ret string + return ret + } + return *o.InstanceId +} + +// GetInstanceIdOk returns a tuple with the InstanceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Instance) GetInstanceIdOk() (*string, bool) { + if o == nil || IsNil(o.InstanceId) { + return nil, false + } + return o.InstanceId, true +} + +// HasInstanceId returns a boolean if a field has been set. +func (o *Instance) HasInstanceId() bool { + if o != nil && !IsNil(o.InstanceId) { + return true + } + + return false +} + +// SetInstanceId gets a reference to the given string and assigns it to the InstanceId field. +func (o *Instance) SetInstanceId(v string) { + o.InstanceId = &v +} + +// GetLastOperation returns the LastOperation field value +func (o *Instance) GetLastOperation() InstanceLastOperation { + if o == nil { + var ret InstanceLastOperation + return ret + } + + return o.LastOperation +} + +// GetLastOperationOk returns a tuple with the LastOperation field value +// and a boolean to check if the value has been set. +func (o *Instance) GetLastOperationOk() (*InstanceLastOperation, bool) { + if o == nil { + return nil, false + } + return &o.LastOperation, true +} + +// SetLastOperation sets field value +func (o *Instance) SetLastOperation(v InstanceLastOperation) { + o.LastOperation = v +} + +// GetName returns the Name field value +func (o *Instance) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Instance) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Instance) SetName(v string) { + o.Name = v +} + +// GetOfferingName returns the OfferingName field value +// Deprecated +func (o *Instance) GetOfferingName() string { + if o == nil { + var ret string + return ret + } + + return o.OfferingName +} + +// GetOfferingNameOk returns a tuple with the OfferingName field value +// and a boolean to check if the value has been set. +// Deprecated +func (o *Instance) GetOfferingNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OfferingName, true +} + +// SetOfferingName sets field value +// Deprecated +func (o *Instance) SetOfferingName(v string) { + o.OfferingName = v +} + +// GetOfferingVersion returns the OfferingVersion field value +func (o *Instance) GetOfferingVersion() string { + if o == nil { + var ret string + return ret + } + + return o.OfferingVersion +} + +// GetOfferingVersionOk returns a tuple with the OfferingVersion field value +// and a boolean to check if the value has been set. +func (o *Instance) GetOfferingVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OfferingVersion, true +} + +// SetOfferingVersion sets field value +func (o *Instance) SetOfferingVersion(v string) { + o.OfferingVersion = v +} + +// GetParameters returns the Parameters field value +func (o *Instance) GetParameters() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value +// and a boolean to check if the value has been set. +func (o *Instance) GetParametersOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Parameters, true +} + +// SetParameters sets field value +func (o *Instance) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +// GetPlanId returns the PlanId field value +func (o *Instance) GetPlanId() string { + if o == nil { + var ret string + return ret + } + + return o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value +// and a boolean to check if the value has been set. +func (o *Instance) GetPlanIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PlanId, true +} + +// SetPlanId sets field value +func (o *Instance) SetPlanId(v string) { + o.PlanId = v +} + +// GetPlanName returns the PlanName field value +func (o *Instance) GetPlanName() string { + if o == nil { + var ret string + return ret + } + + return o.PlanName +} + +// GetPlanNameOk returns a tuple with the PlanName field value +// and a boolean to check if the value has been set. +func (o *Instance) GetPlanNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PlanName, true +} + +// SetPlanName sets field value +func (o *Instance) SetPlanName(v string) { + o.PlanName = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Instance) 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 *Instance) 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 *Instance) 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 *Instance) SetStatus(v string) { + o.Status = &v +} + +func (o Instance) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Instance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cfGuid"] = o.CfGuid + toSerialize["cfOrganizationGuid"] = o.CfOrganizationGuid + toSerialize["cfSpaceGuid"] = o.CfSpaceGuid + toSerialize["dashboardUrl"] = o.DashboardUrl + toSerialize["imageUrl"] = o.ImageUrl + if !IsNil(o.InstanceId) { + toSerialize["instanceId"] = o.InstanceId + } + toSerialize["lastOperation"] = o.LastOperation + toSerialize["name"] = o.Name + toSerialize["offeringName"] = o.OfferingName + toSerialize["offeringVersion"] = o.OfferingVersion + toSerialize["parameters"] = o.Parameters + toSerialize["planId"] = o.PlanId + toSerialize["planName"] = o.PlanName + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Instance) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cfGuid", + "cfOrganizationGuid", + "cfSpaceGuid", + "dashboardUrl", + "imageUrl", + "lastOperation", + "name", + "offeringName", + "offeringVersion", + "parameters", + "planId", + "planName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstance := _Instance{} + + err = json.Unmarshal(data, &varInstance) + + if err != nil { + return err + } + + *o = Instance(varInstance) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cfGuid") + delete(additionalProperties, "cfOrganizationGuid") + delete(additionalProperties, "cfSpaceGuid") + delete(additionalProperties, "dashboardUrl") + delete(additionalProperties, "imageUrl") + delete(additionalProperties, "instanceId") + delete(additionalProperties, "lastOperation") + delete(additionalProperties, "name") + delete(additionalProperties, "offeringName") + delete(additionalProperties, "offeringVersion") + delete(additionalProperties, "parameters") + delete(additionalProperties, "planId") + delete(additionalProperties, "planName") + delete(additionalProperties, "status") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstance struct { + value *Instance + isSet bool +} + +func (v NullableInstance) Get() *Instance { + return v.value +} + +func (v *NullableInstance) Set(val *Instance) { + v.value = val + v.isSet = true +} + +func (v NullableInstance) IsSet() bool { + return v.isSet +} + +func (v *NullableInstance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstance(val *Instance) *NullableInstance { + return &NullableInstance{value: val, isSet: true} +} + +func (v NullableInstance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_instance_last_operation.go b/services/logme/v2api/model_instance_last_operation.go new file mode 100644 index 000000000..7af9f47db --- /dev/null +++ b/services/logme/v2api/model_instance_last_operation.go @@ -0,0 +1,224 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InstanceLastOperation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceLastOperation{} + +// InstanceLastOperation struct for InstanceLastOperation +type InstanceLastOperation struct { + Description string `json:"description"` + State string `json:"state"` + Type string `json:"type"` + AdditionalProperties map[string]interface{} +} + +type _InstanceLastOperation InstanceLastOperation + +// NewInstanceLastOperation instantiates a new InstanceLastOperation 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 NewInstanceLastOperation(description string, state string, types string) *InstanceLastOperation { + this := InstanceLastOperation{} + this.Description = description + this.State = state + this.Type = types + return &this +} + +// NewInstanceLastOperationWithDefaults instantiates a new InstanceLastOperation 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 NewInstanceLastOperationWithDefaults() *InstanceLastOperation { + this := InstanceLastOperation{} + return &this +} + +// GetDescription returns the Description field value +func (o *InstanceLastOperation) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *InstanceLastOperation) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *InstanceLastOperation) SetDescription(v string) { + o.Description = v +} + +// GetState returns the State field value +func (o *InstanceLastOperation) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *InstanceLastOperation) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *InstanceLastOperation) SetState(v string) { + o.State = v +} + +// GetType returns the Type field value +func (o *InstanceLastOperation) GetType() string { + if o == nil { + 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 *InstanceLastOperation) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *InstanceLastOperation) SetType(v string) { + o.Type = v +} + +func (o InstanceLastOperation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceLastOperation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["state"] = o.State + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceLastOperation) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "state", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceLastOperation := _InstanceLastOperation{} + + err = json.Unmarshal(data, &varInstanceLastOperation) + + if err != nil { + return err + } + + *o = InstanceLastOperation(varInstanceLastOperation) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "state") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceLastOperation struct { + value *InstanceLastOperation + isSet bool +} + +func (v NullableInstanceLastOperation) Get() *InstanceLastOperation { + return v.value +} + +func (v *NullableInstanceLastOperation) Set(val *InstanceLastOperation) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceLastOperation) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceLastOperation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceLastOperation(val *InstanceLastOperation) *NullableInstanceLastOperation { + return &NullableInstanceLastOperation{value: val, isSet: true} +} + +func (v NullableInstanceLastOperation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceLastOperation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_instance_parameters.go b/services/logme/v2api/model_instance_parameters.go new file mode 100644 index 000000000..e7b1171dd --- /dev/null +++ b/services/logme/v2api/model_instance_parameters.go @@ -0,0 +1,1050 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the InstanceParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceParameters{} + +// InstanceParameters struct for InstanceParameters +type InstanceParameters struct { + EnableMonitoring *bool `json:"enable_monitoring,omitempty"` + FluentdTcp *int32 `json:"fluentd-tcp,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + FluentdTls *int32 `json:"fluentd-tls,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + FluentdTlsCiphers *string `json:"fluentd-tls-ciphers,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + FluentdTlsMaxVersion *string `json:"fluentd-tls-max-version,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + FluentdTlsMinVersion *string `json:"fluentd-tls-min-version,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + FluentdTlsVersion *string `json:"fluentd-tls-version,omitempty"` + FluentdUdp *int32 `json:"fluentd-udp,omitempty"` + // If you want to monitor your service with Graphite, you can set the custom parameter graphite. It expects the host and port where the Graphite metrics should be sent to. + Graphite *string `json:"graphite,omitempty"` + Groks []InstanceParametersGroksInner `json:"groks,omitempty"` + // Combination of an integer and a timerange when an index will be considered 'd' and can be deleted from OpenSearch. Possible values for the timerange are s, m, h and d. + IsmDeletionAfter *string `json:"ism_deletion_after,omitempty"` + IsmJitter *float32 `json:"ism_jitter,omitempty"` + IsmJobInterval *int32 `json:"ism_job_interval,omitempty"` + // Default: not set, 46% of available memory will be used. The amount of memory (in MB) allocated as heap by the JVM for OpenSearch. + JavaHeapspace *int32 `json:"java_heapspace,omitempty"` + // The amount of memory (in MB) used by the JVM to store metadata for OpenSearch. + JavaMaxmetaspace *int32 `json:"java_maxmetaspace,omitempty"` + // This component monitors ephemeral and persistent disk usage. If one of these disk usages reaches the default configured threshold of 80%, the a9s Parachute stops all processes on that node. + MaxDiskThreshold *int32 `json:"max_disk_threshold,omitempty"` + // Frequency of metrics being emitted in seconds + MetricsFrequency *int32 `json:"metrics_frequency,omitempty"` + // Depending on your graphite provider, you might need to prefix the metrics with a certain value, like an API key for example. + MetricsPrefix *string `json:"metrics_prefix,omitempty"` + MonitoringInstanceId *string `json:"monitoring_instance_id,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + OpensearchTlsCiphers []string `json:"opensearch-tls-ciphers,omitempty"` + // This property is deprecated and will be removed in a future release. + // Deprecated + OpensearchTlsProtocols []string `json:"opensearch-tls-protocols,omitempty"` + // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. + SgwAcl *string `json:"sgw_acl,omitempty"` + Syslog []string `json:"syslog,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InstanceParameters InstanceParameters + +// NewInstanceParameters instantiates a new InstanceParameters 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 NewInstanceParameters() *InstanceParameters { + this := InstanceParameters{} + var enableMonitoring bool = false + this.EnableMonitoring = &enableMonitoring + var fluentdTcp int32 = 0 + this.FluentdTcp = &fluentdTcp + var fluentdTls int32 = 6514 + this.FluentdTls = &fluentdTls + var fluentdUdp int32 = 514 + this.FluentdUdp = &fluentdUdp + var ismDeletionAfter string = "30d" + this.IsmDeletionAfter = &ismDeletionAfter + var ismJitter float32 = 0.6 + this.IsmJitter = &ismJitter + var ismJobInterval int32 = 5 + this.IsmJobInterval = &ismJobInterval + var javaMaxmetaspace int32 = 512 + this.JavaMaxmetaspace = &javaMaxmetaspace + var maxDiskThreshold int32 = 80 + this.MaxDiskThreshold = &maxDiskThreshold + var metricsFrequency int32 = 10 + this.MetricsFrequency = &metricsFrequency + return &this +} + +// NewInstanceParametersWithDefaults instantiates a new InstanceParameters 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 NewInstanceParametersWithDefaults() *InstanceParameters { + this := InstanceParameters{} + var enableMonitoring bool = false + this.EnableMonitoring = &enableMonitoring + var fluentdTcp int32 = 0 + this.FluentdTcp = &fluentdTcp + var fluentdTls int32 = 6514 + this.FluentdTls = &fluentdTls + var fluentdUdp int32 = 514 + this.FluentdUdp = &fluentdUdp + var ismDeletionAfter string = "30d" + this.IsmDeletionAfter = &ismDeletionAfter + var ismJitter float32 = 0.6 + this.IsmJitter = &ismJitter + var ismJobInterval int32 = 5 + this.IsmJobInterval = &ismJobInterval + var javaMaxmetaspace int32 = 512 + this.JavaMaxmetaspace = &javaMaxmetaspace + var maxDiskThreshold int32 = 80 + this.MaxDiskThreshold = &maxDiskThreshold + var metricsFrequency int32 = 10 + this.MetricsFrequency = &metricsFrequency + return &this +} + +// GetEnableMonitoring returns the EnableMonitoring field value if set, zero value otherwise. +func (o *InstanceParameters) GetEnableMonitoring() bool { + if o == nil || IsNil(o.EnableMonitoring) { + var ret bool + return ret + } + return *o.EnableMonitoring +} + +// GetEnableMonitoringOk returns a tuple with the EnableMonitoring field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetEnableMonitoringOk() (*bool, bool) { + if o == nil || IsNil(o.EnableMonitoring) { + return nil, false + } + return o.EnableMonitoring, true +} + +// HasEnableMonitoring returns a boolean if a field has been set. +func (o *InstanceParameters) HasEnableMonitoring() bool { + if o != nil && !IsNil(o.EnableMonitoring) { + return true + } + + return false +} + +// SetEnableMonitoring gets a reference to the given bool and assigns it to the EnableMonitoring field. +func (o *InstanceParameters) SetEnableMonitoring(v bool) { + o.EnableMonitoring = &v +} + +// GetFluentdTcp returns the FluentdTcp field value if set, zero value otherwise. +func (o *InstanceParameters) GetFluentdTcp() int32 { + if o == nil || IsNil(o.FluentdTcp) { + var ret int32 + return ret + } + return *o.FluentdTcp +} + +// GetFluentdTcpOk returns a tuple with the FluentdTcp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetFluentdTcpOk() (*int32, bool) { + if o == nil || IsNil(o.FluentdTcp) { + return nil, false + } + return o.FluentdTcp, true +} + +// HasFluentdTcp returns a boolean if a field has been set. +func (o *InstanceParameters) HasFluentdTcp() bool { + if o != nil && !IsNil(o.FluentdTcp) { + return true + } + + return false +} + +// SetFluentdTcp gets a reference to the given int32 and assigns it to the FluentdTcp field. +func (o *InstanceParameters) SetFluentdTcp(v int32) { + o.FluentdTcp = &v +} + +// GetFluentdTls returns the FluentdTls field value if set, zero value otherwise. +// Deprecated +func (o *InstanceParameters) GetFluentdTls() int32 { + if o == nil || IsNil(o.FluentdTls) { + var ret int32 + return ret + } + return *o.FluentdTls +} + +// GetFluentdTlsOk returns a tuple with the FluentdTls field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstanceParameters) GetFluentdTlsOk() (*int32, bool) { + if o == nil || IsNil(o.FluentdTls) { + return nil, false + } + return o.FluentdTls, true +} + +// HasFluentdTls returns a boolean if a field has been set. +func (o *InstanceParameters) HasFluentdTls() bool { + if o != nil && !IsNil(o.FluentdTls) { + return true + } + + return false +} + +// SetFluentdTls gets a reference to the given int32 and assigns it to the FluentdTls field. +// Deprecated +func (o *InstanceParameters) SetFluentdTls(v int32) { + o.FluentdTls = &v +} + +// GetFluentdTlsCiphers returns the FluentdTlsCiphers field value if set, zero value otherwise. +// Deprecated +func (o *InstanceParameters) GetFluentdTlsCiphers() string { + if o == nil || IsNil(o.FluentdTlsCiphers) { + var ret string + return ret + } + return *o.FluentdTlsCiphers +} + +// GetFluentdTlsCiphersOk returns a tuple with the FluentdTlsCiphers field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstanceParameters) GetFluentdTlsCiphersOk() (*string, bool) { + if o == nil || IsNil(o.FluentdTlsCiphers) { + return nil, false + } + return o.FluentdTlsCiphers, true +} + +// HasFluentdTlsCiphers returns a boolean if a field has been set. +func (o *InstanceParameters) HasFluentdTlsCiphers() bool { + if o != nil && !IsNil(o.FluentdTlsCiphers) { + return true + } + + return false +} + +// SetFluentdTlsCiphers gets a reference to the given string and assigns it to the FluentdTlsCiphers field. +// Deprecated +func (o *InstanceParameters) SetFluentdTlsCiphers(v string) { + o.FluentdTlsCiphers = &v +} + +// GetFluentdTlsMaxVersion returns the FluentdTlsMaxVersion field value if set, zero value otherwise. +// Deprecated +func (o *InstanceParameters) GetFluentdTlsMaxVersion() string { + if o == nil || IsNil(o.FluentdTlsMaxVersion) { + var ret string + return ret + } + return *o.FluentdTlsMaxVersion +} + +// GetFluentdTlsMaxVersionOk returns a tuple with the FluentdTlsMaxVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstanceParameters) GetFluentdTlsMaxVersionOk() (*string, bool) { + if o == nil || IsNil(o.FluentdTlsMaxVersion) { + return nil, false + } + return o.FluentdTlsMaxVersion, true +} + +// HasFluentdTlsMaxVersion returns a boolean if a field has been set. +func (o *InstanceParameters) HasFluentdTlsMaxVersion() bool { + if o != nil && !IsNil(o.FluentdTlsMaxVersion) { + return true + } + + return false +} + +// SetFluentdTlsMaxVersion gets a reference to the given string and assigns it to the FluentdTlsMaxVersion field. +// Deprecated +func (o *InstanceParameters) SetFluentdTlsMaxVersion(v string) { + o.FluentdTlsMaxVersion = &v +} + +// GetFluentdTlsMinVersion returns the FluentdTlsMinVersion field value if set, zero value otherwise. +// Deprecated +func (o *InstanceParameters) GetFluentdTlsMinVersion() string { + if o == nil || IsNil(o.FluentdTlsMinVersion) { + var ret string + return ret + } + return *o.FluentdTlsMinVersion +} + +// GetFluentdTlsMinVersionOk returns a tuple with the FluentdTlsMinVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstanceParameters) GetFluentdTlsMinVersionOk() (*string, bool) { + if o == nil || IsNil(o.FluentdTlsMinVersion) { + return nil, false + } + return o.FluentdTlsMinVersion, true +} + +// HasFluentdTlsMinVersion returns a boolean if a field has been set. +func (o *InstanceParameters) HasFluentdTlsMinVersion() bool { + if o != nil && !IsNil(o.FluentdTlsMinVersion) { + return true + } + + return false +} + +// SetFluentdTlsMinVersion gets a reference to the given string and assigns it to the FluentdTlsMinVersion field. +// Deprecated +func (o *InstanceParameters) SetFluentdTlsMinVersion(v string) { + o.FluentdTlsMinVersion = &v +} + +// GetFluentdTlsVersion returns the FluentdTlsVersion field value if set, zero value otherwise. +// Deprecated +func (o *InstanceParameters) GetFluentdTlsVersion() string { + if o == nil || IsNil(o.FluentdTlsVersion) { + var ret string + return ret + } + return *o.FluentdTlsVersion +} + +// GetFluentdTlsVersionOk returns a tuple with the FluentdTlsVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstanceParameters) GetFluentdTlsVersionOk() (*string, bool) { + if o == nil || IsNil(o.FluentdTlsVersion) { + return nil, false + } + return o.FluentdTlsVersion, true +} + +// HasFluentdTlsVersion returns a boolean if a field has been set. +func (o *InstanceParameters) HasFluentdTlsVersion() bool { + if o != nil && !IsNil(o.FluentdTlsVersion) { + return true + } + + return false +} + +// SetFluentdTlsVersion gets a reference to the given string and assigns it to the FluentdTlsVersion field. +// Deprecated +func (o *InstanceParameters) SetFluentdTlsVersion(v string) { + o.FluentdTlsVersion = &v +} + +// GetFluentdUdp returns the FluentdUdp field value if set, zero value otherwise. +func (o *InstanceParameters) GetFluentdUdp() int32 { + if o == nil || IsNil(o.FluentdUdp) { + var ret int32 + return ret + } + return *o.FluentdUdp +} + +// GetFluentdUdpOk returns a tuple with the FluentdUdp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetFluentdUdpOk() (*int32, bool) { + if o == nil || IsNil(o.FluentdUdp) { + return nil, false + } + return o.FluentdUdp, true +} + +// HasFluentdUdp returns a boolean if a field has been set. +func (o *InstanceParameters) HasFluentdUdp() bool { + if o != nil && !IsNil(o.FluentdUdp) { + return true + } + + return false +} + +// SetFluentdUdp gets a reference to the given int32 and assigns it to the FluentdUdp field. +func (o *InstanceParameters) SetFluentdUdp(v int32) { + o.FluentdUdp = &v +} + +// GetGraphite returns the Graphite field value if set, zero value otherwise. +func (o *InstanceParameters) GetGraphite() string { + if o == nil || IsNil(o.Graphite) { + var ret string + return ret + } + return *o.Graphite +} + +// GetGraphiteOk returns a tuple with the Graphite field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetGraphiteOk() (*string, bool) { + if o == nil || IsNil(o.Graphite) { + return nil, false + } + return o.Graphite, true +} + +// HasGraphite returns a boolean if a field has been set. +func (o *InstanceParameters) HasGraphite() bool { + if o != nil && !IsNil(o.Graphite) { + return true + } + + return false +} + +// SetGraphite gets a reference to the given string and assigns it to the Graphite field. +func (o *InstanceParameters) SetGraphite(v string) { + o.Graphite = &v +} + +// GetGroks returns the Groks field value if set, zero value otherwise. +func (o *InstanceParameters) GetGroks() []InstanceParametersGroksInner { + if o == nil || IsNil(o.Groks) { + var ret []InstanceParametersGroksInner + return ret + } + return o.Groks +} + +// GetGroksOk returns a tuple with the Groks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetGroksOk() ([]InstanceParametersGroksInner, bool) { + if o == nil || IsNil(o.Groks) { + return nil, false + } + return o.Groks, true +} + +// HasGroks returns a boolean if a field has been set. +func (o *InstanceParameters) HasGroks() bool { + if o != nil && !IsNil(o.Groks) { + return true + } + + return false +} + +// SetGroks gets a reference to the given []InstanceParametersGroksInner and assigns it to the Groks field. +func (o *InstanceParameters) SetGroks(v []InstanceParametersGroksInner) { + o.Groks = v +} + +// GetIsmDeletionAfter returns the IsmDeletionAfter field value if set, zero value otherwise. +func (o *InstanceParameters) GetIsmDeletionAfter() string { + if o == nil || IsNil(o.IsmDeletionAfter) { + var ret string + return ret + } + return *o.IsmDeletionAfter +} + +// GetIsmDeletionAfterOk returns a tuple with the IsmDeletionAfter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetIsmDeletionAfterOk() (*string, bool) { + if o == nil || IsNil(o.IsmDeletionAfter) { + return nil, false + } + return o.IsmDeletionAfter, true +} + +// HasIsmDeletionAfter returns a boolean if a field has been set. +func (o *InstanceParameters) HasIsmDeletionAfter() bool { + if o != nil && !IsNil(o.IsmDeletionAfter) { + return true + } + + return false +} + +// SetIsmDeletionAfter gets a reference to the given string and assigns it to the IsmDeletionAfter field. +func (o *InstanceParameters) SetIsmDeletionAfter(v string) { + o.IsmDeletionAfter = &v +} + +// GetIsmJitter returns the IsmJitter field value if set, zero value otherwise. +func (o *InstanceParameters) GetIsmJitter() float32 { + if o == nil || IsNil(o.IsmJitter) { + var ret float32 + return ret + } + return *o.IsmJitter +} + +// GetIsmJitterOk returns a tuple with the IsmJitter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetIsmJitterOk() (*float32, bool) { + if o == nil || IsNil(o.IsmJitter) { + return nil, false + } + return o.IsmJitter, true +} + +// HasIsmJitter returns a boolean if a field has been set. +func (o *InstanceParameters) HasIsmJitter() bool { + if o != nil && !IsNil(o.IsmJitter) { + return true + } + + return false +} + +// SetIsmJitter gets a reference to the given float32 and assigns it to the IsmJitter field. +func (o *InstanceParameters) SetIsmJitter(v float32) { + o.IsmJitter = &v +} + +// GetIsmJobInterval returns the IsmJobInterval field value if set, zero value otherwise. +func (o *InstanceParameters) GetIsmJobInterval() int32 { + if o == nil || IsNil(o.IsmJobInterval) { + var ret int32 + return ret + } + return *o.IsmJobInterval +} + +// GetIsmJobIntervalOk returns a tuple with the IsmJobInterval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetIsmJobIntervalOk() (*int32, bool) { + if o == nil || IsNil(o.IsmJobInterval) { + return nil, false + } + return o.IsmJobInterval, true +} + +// HasIsmJobInterval returns a boolean if a field has been set. +func (o *InstanceParameters) HasIsmJobInterval() bool { + if o != nil && !IsNil(o.IsmJobInterval) { + return true + } + + return false +} + +// SetIsmJobInterval gets a reference to the given int32 and assigns it to the IsmJobInterval field. +func (o *InstanceParameters) SetIsmJobInterval(v int32) { + o.IsmJobInterval = &v +} + +// GetJavaHeapspace returns the JavaHeapspace field value if set, zero value otherwise. +func (o *InstanceParameters) GetJavaHeapspace() int32 { + if o == nil || IsNil(o.JavaHeapspace) { + var ret int32 + return ret + } + return *o.JavaHeapspace +} + +// GetJavaHeapspaceOk returns a tuple with the JavaHeapspace field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetJavaHeapspaceOk() (*int32, bool) { + if o == nil || IsNil(o.JavaHeapspace) { + return nil, false + } + return o.JavaHeapspace, true +} + +// HasJavaHeapspace returns a boolean if a field has been set. +func (o *InstanceParameters) HasJavaHeapspace() bool { + if o != nil && !IsNil(o.JavaHeapspace) { + return true + } + + return false +} + +// SetJavaHeapspace gets a reference to the given int32 and assigns it to the JavaHeapspace field. +func (o *InstanceParameters) SetJavaHeapspace(v int32) { + o.JavaHeapspace = &v +} + +// GetJavaMaxmetaspace returns the JavaMaxmetaspace field value if set, zero value otherwise. +func (o *InstanceParameters) GetJavaMaxmetaspace() int32 { + if o == nil || IsNil(o.JavaMaxmetaspace) { + var ret int32 + return ret + } + return *o.JavaMaxmetaspace +} + +// GetJavaMaxmetaspaceOk returns a tuple with the JavaMaxmetaspace field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetJavaMaxmetaspaceOk() (*int32, bool) { + if o == nil || IsNil(o.JavaMaxmetaspace) { + return nil, false + } + return o.JavaMaxmetaspace, true +} + +// HasJavaMaxmetaspace returns a boolean if a field has been set. +func (o *InstanceParameters) HasJavaMaxmetaspace() bool { + if o != nil && !IsNil(o.JavaMaxmetaspace) { + return true + } + + return false +} + +// SetJavaMaxmetaspace gets a reference to the given int32 and assigns it to the JavaMaxmetaspace field. +func (o *InstanceParameters) SetJavaMaxmetaspace(v int32) { + o.JavaMaxmetaspace = &v +} + +// GetMaxDiskThreshold returns the MaxDiskThreshold field value if set, zero value otherwise. +func (o *InstanceParameters) GetMaxDiskThreshold() int32 { + if o == nil || IsNil(o.MaxDiskThreshold) { + var ret int32 + return ret + } + return *o.MaxDiskThreshold +} + +// GetMaxDiskThresholdOk returns a tuple with the MaxDiskThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMaxDiskThresholdOk() (*int32, bool) { + if o == nil || IsNil(o.MaxDiskThreshold) { + return nil, false + } + return o.MaxDiskThreshold, true +} + +// HasMaxDiskThreshold returns a boolean if a field has been set. +func (o *InstanceParameters) HasMaxDiskThreshold() bool { + if o != nil && !IsNil(o.MaxDiskThreshold) { + return true + } + + return false +} + +// SetMaxDiskThreshold gets a reference to the given int32 and assigns it to the MaxDiskThreshold field. +func (o *InstanceParameters) SetMaxDiskThreshold(v int32) { + o.MaxDiskThreshold = &v +} + +// GetMetricsFrequency returns the MetricsFrequency field value if set, zero value otherwise. +func (o *InstanceParameters) GetMetricsFrequency() int32 { + if o == nil || IsNil(o.MetricsFrequency) { + var ret int32 + return ret + } + return *o.MetricsFrequency +} + +// GetMetricsFrequencyOk returns a tuple with the MetricsFrequency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMetricsFrequencyOk() (*int32, bool) { + if o == nil || IsNil(o.MetricsFrequency) { + return nil, false + } + return o.MetricsFrequency, true +} + +// HasMetricsFrequency returns a boolean if a field has been set. +func (o *InstanceParameters) HasMetricsFrequency() bool { + if o != nil && !IsNil(o.MetricsFrequency) { + return true + } + + return false +} + +// SetMetricsFrequency gets a reference to the given int32 and assigns it to the MetricsFrequency field. +func (o *InstanceParameters) SetMetricsFrequency(v int32) { + o.MetricsFrequency = &v +} + +// GetMetricsPrefix returns the MetricsPrefix field value if set, zero value otherwise. +func (o *InstanceParameters) GetMetricsPrefix() string { + if o == nil || IsNil(o.MetricsPrefix) { + var ret string + return ret + } + return *o.MetricsPrefix +} + +// GetMetricsPrefixOk returns a tuple with the MetricsPrefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMetricsPrefixOk() (*string, bool) { + if o == nil || IsNil(o.MetricsPrefix) { + return nil, false + } + return o.MetricsPrefix, true +} + +// HasMetricsPrefix returns a boolean if a field has been set. +func (o *InstanceParameters) HasMetricsPrefix() bool { + if o != nil && !IsNil(o.MetricsPrefix) { + return true + } + + return false +} + +// SetMetricsPrefix gets a reference to the given string and assigns it to the MetricsPrefix field. +func (o *InstanceParameters) SetMetricsPrefix(v string) { + o.MetricsPrefix = &v +} + +// GetMonitoringInstanceId returns the MonitoringInstanceId field value if set, zero value otherwise. +func (o *InstanceParameters) GetMonitoringInstanceId() string { + if o == nil || IsNil(o.MonitoringInstanceId) { + var ret string + return ret + } + return *o.MonitoringInstanceId +} + +// GetMonitoringInstanceIdOk returns a tuple with the MonitoringInstanceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetMonitoringInstanceIdOk() (*string, bool) { + if o == nil || IsNil(o.MonitoringInstanceId) { + return nil, false + } + return o.MonitoringInstanceId, true +} + +// HasMonitoringInstanceId returns a boolean if a field has been set. +func (o *InstanceParameters) HasMonitoringInstanceId() bool { + if o != nil && !IsNil(o.MonitoringInstanceId) { + return true + } + + return false +} + +// SetMonitoringInstanceId gets a reference to the given string and assigns it to the MonitoringInstanceId field. +func (o *InstanceParameters) SetMonitoringInstanceId(v string) { + o.MonitoringInstanceId = &v +} + +// GetOpensearchTlsCiphers returns the OpensearchTlsCiphers field value if set, zero value otherwise. +// Deprecated +func (o *InstanceParameters) GetOpensearchTlsCiphers() []string { + if o == nil || IsNil(o.OpensearchTlsCiphers) { + var ret []string + return ret + } + return o.OpensearchTlsCiphers +} + +// GetOpensearchTlsCiphersOk returns a tuple with the OpensearchTlsCiphers field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstanceParameters) GetOpensearchTlsCiphersOk() ([]string, bool) { + if o == nil || IsNil(o.OpensearchTlsCiphers) { + return nil, false + } + return o.OpensearchTlsCiphers, true +} + +// HasOpensearchTlsCiphers returns a boolean if a field has been set. +func (o *InstanceParameters) HasOpensearchTlsCiphers() bool { + if o != nil && !IsNil(o.OpensearchTlsCiphers) { + return true + } + + return false +} + +// SetOpensearchTlsCiphers gets a reference to the given []string and assigns it to the OpensearchTlsCiphers field. +// Deprecated +func (o *InstanceParameters) SetOpensearchTlsCiphers(v []string) { + o.OpensearchTlsCiphers = v +} + +// GetOpensearchTlsProtocols returns the OpensearchTlsProtocols field value if set, zero value otherwise. +// Deprecated +func (o *InstanceParameters) GetOpensearchTlsProtocols() []string { + if o == nil || IsNil(o.OpensearchTlsProtocols) { + var ret []string + return ret + } + return o.OpensearchTlsProtocols +} + +// GetOpensearchTlsProtocolsOk returns a tuple with the OpensearchTlsProtocols field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstanceParameters) GetOpensearchTlsProtocolsOk() ([]string, bool) { + if o == nil || IsNil(o.OpensearchTlsProtocols) { + return nil, false + } + return o.OpensearchTlsProtocols, true +} + +// HasOpensearchTlsProtocols returns a boolean if a field has been set. +func (o *InstanceParameters) HasOpensearchTlsProtocols() bool { + if o != nil && !IsNil(o.OpensearchTlsProtocols) { + return true + } + + return false +} + +// SetOpensearchTlsProtocols gets a reference to the given []string and assigns it to the OpensearchTlsProtocols field. +// Deprecated +func (o *InstanceParameters) SetOpensearchTlsProtocols(v []string) { + o.OpensearchTlsProtocols = v +} + +// GetSgwAcl returns the SgwAcl field value if set, zero value otherwise. +func (o *InstanceParameters) GetSgwAcl() string { + if o == nil || IsNil(o.SgwAcl) { + var ret string + return ret + } + return *o.SgwAcl +} + +// GetSgwAclOk returns a tuple with the SgwAcl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetSgwAclOk() (*string, bool) { + if o == nil || IsNil(o.SgwAcl) { + return nil, false + } + return o.SgwAcl, true +} + +// HasSgwAcl returns a boolean if a field has been set. +func (o *InstanceParameters) HasSgwAcl() bool { + if o != nil && !IsNil(o.SgwAcl) { + return true + } + + return false +} + +// SetSgwAcl gets a reference to the given string and assigns it to the SgwAcl field. +func (o *InstanceParameters) SetSgwAcl(v string) { + o.SgwAcl = &v +} + +// GetSyslog returns the Syslog field value if set, zero value otherwise. +func (o *InstanceParameters) GetSyslog() []string { + if o == nil || IsNil(o.Syslog) { + var ret []string + return ret + } + return o.Syslog +} + +// GetSyslogOk returns a tuple with the Syslog field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParameters) GetSyslogOk() ([]string, bool) { + if o == nil || IsNil(o.Syslog) { + return nil, false + } + return o.Syslog, true +} + +// HasSyslog returns a boolean if a field has been set. +func (o *InstanceParameters) HasSyslog() bool { + if o != nil && !IsNil(o.Syslog) { + return true + } + + return false +} + +// SetSyslog gets a reference to the given []string and assigns it to the Syslog field. +func (o *InstanceParameters) SetSyslog(v []string) { + o.Syslog = v +} + +func (o InstanceParameters) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.EnableMonitoring) { + toSerialize["enable_monitoring"] = o.EnableMonitoring + } + if !IsNil(o.FluentdTcp) { + toSerialize["fluentd-tcp"] = o.FluentdTcp + } + if !IsNil(o.FluentdTls) { + toSerialize["fluentd-tls"] = o.FluentdTls + } + if !IsNil(o.FluentdTlsCiphers) { + toSerialize["fluentd-tls-ciphers"] = o.FluentdTlsCiphers + } + if !IsNil(o.FluentdTlsMaxVersion) { + toSerialize["fluentd-tls-max-version"] = o.FluentdTlsMaxVersion + } + if !IsNil(o.FluentdTlsMinVersion) { + toSerialize["fluentd-tls-min-version"] = o.FluentdTlsMinVersion + } + if !IsNil(o.FluentdTlsVersion) { + toSerialize["fluentd-tls-version"] = o.FluentdTlsVersion + } + if !IsNil(o.FluentdUdp) { + toSerialize["fluentd-udp"] = o.FluentdUdp + } + if !IsNil(o.Graphite) { + toSerialize["graphite"] = o.Graphite + } + if !IsNil(o.Groks) { + toSerialize["groks"] = o.Groks + } + if !IsNil(o.IsmDeletionAfter) { + toSerialize["ism_deletion_after"] = o.IsmDeletionAfter + } + if !IsNil(o.IsmJitter) { + toSerialize["ism_jitter"] = o.IsmJitter + } + if !IsNil(o.IsmJobInterval) { + toSerialize["ism_job_interval"] = o.IsmJobInterval + } + if !IsNil(o.JavaHeapspace) { + toSerialize["java_heapspace"] = o.JavaHeapspace + } + if !IsNil(o.JavaMaxmetaspace) { + toSerialize["java_maxmetaspace"] = o.JavaMaxmetaspace + } + if !IsNil(o.MaxDiskThreshold) { + toSerialize["max_disk_threshold"] = o.MaxDiskThreshold + } + if !IsNil(o.MetricsFrequency) { + toSerialize["metrics_frequency"] = o.MetricsFrequency + } + if !IsNil(o.MetricsPrefix) { + toSerialize["metrics_prefix"] = o.MetricsPrefix + } + if !IsNil(o.MonitoringInstanceId) { + toSerialize["monitoring_instance_id"] = o.MonitoringInstanceId + } + if !IsNil(o.OpensearchTlsCiphers) { + toSerialize["opensearch-tls-ciphers"] = o.OpensearchTlsCiphers + } + if !IsNil(o.OpensearchTlsProtocols) { + toSerialize["opensearch-tls-protocols"] = o.OpensearchTlsProtocols + } + if !IsNil(o.SgwAcl) { + toSerialize["sgw_acl"] = o.SgwAcl + } + if !IsNil(o.Syslog) { + toSerialize["syslog"] = o.Syslog + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceParameters) UnmarshalJSON(data []byte) (err error) { + varInstanceParameters := _InstanceParameters{} + + err = json.Unmarshal(data, &varInstanceParameters) + + if err != nil { + return err + } + + *o = InstanceParameters(varInstanceParameters) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "enable_monitoring") + delete(additionalProperties, "fluentd-tcp") + delete(additionalProperties, "fluentd-tls") + delete(additionalProperties, "fluentd-tls-ciphers") + delete(additionalProperties, "fluentd-tls-max-version") + delete(additionalProperties, "fluentd-tls-min-version") + delete(additionalProperties, "fluentd-tls-version") + delete(additionalProperties, "fluentd-udp") + delete(additionalProperties, "graphite") + delete(additionalProperties, "groks") + delete(additionalProperties, "ism_deletion_after") + delete(additionalProperties, "ism_jitter") + delete(additionalProperties, "ism_job_interval") + delete(additionalProperties, "java_heapspace") + delete(additionalProperties, "java_maxmetaspace") + delete(additionalProperties, "max_disk_threshold") + delete(additionalProperties, "metrics_frequency") + delete(additionalProperties, "metrics_prefix") + delete(additionalProperties, "monitoring_instance_id") + delete(additionalProperties, "opensearch-tls-ciphers") + delete(additionalProperties, "opensearch-tls-protocols") + delete(additionalProperties, "sgw_acl") + delete(additionalProperties, "syslog") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceParameters struct { + value *InstanceParameters + isSet bool +} + +func (v NullableInstanceParameters) Get() *InstanceParameters { + return v.value +} + +func (v *NullableInstanceParameters) Set(val *InstanceParameters) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParameters(val *InstanceParameters) *NullableInstanceParameters { + return &NullableInstanceParameters{value: val, isSet: true} +} + +func (v NullableInstanceParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_instance_parameters_groks_inner.go b/services/logme/v2api/model_instance_parameters_groks_inner.go new file mode 100644 index 000000000..f565961b4 --- /dev/null +++ b/services/logme/v2api/model_instance_parameters_groks_inner.go @@ -0,0 +1,153 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the InstanceParametersGroksInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceParametersGroksInner{} + +// InstanceParametersGroksInner struct for InstanceParametersGroksInner +type InstanceParametersGroksInner struct { + Pattern *string `json:"pattern,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InstanceParametersGroksInner InstanceParametersGroksInner + +// NewInstanceParametersGroksInner instantiates a new InstanceParametersGroksInner 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 NewInstanceParametersGroksInner() *InstanceParametersGroksInner { + this := InstanceParametersGroksInner{} + return &this +} + +// NewInstanceParametersGroksInnerWithDefaults instantiates a new InstanceParametersGroksInner 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 NewInstanceParametersGroksInnerWithDefaults() *InstanceParametersGroksInner { + this := InstanceParametersGroksInner{} + return &this +} + +// GetPattern returns the Pattern field value if set, zero value otherwise. +func (o *InstanceParametersGroksInner) GetPattern() string { + if o == nil || IsNil(o.Pattern) { + var ret string + return ret + } + return *o.Pattern +} + +// GetPatternOk returns a tuple with the Pattern field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstanceParametersGroksInner) GetPatternOk() (*string, bool) { + if o == nil || IsNil(o.Pattern) { + return nil, false + } + return o.Pattern, true +} + +// HasPattern returns a boolean if a field has been set. +func (o *InstanceParametersGroksInner) HasPattern() bool { + if o != nil && !IsNil(o.Pattern) { + return true + } + + return false +} + +// SetPattern gets a reference to the given string and assigns it to the Pattern field. +func (o *InstanceParametersGroksInner) SetPattern(v string) { + o.Pattern = &v +} + +func (o InstanceParametersGroksInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceParametersGroksInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Pattern) { + toSerialize["pattern"] = o.Pattern + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceParametersGroksInner) UnmarshalJSON(data []byte) (err error) { + varInstanceParametersGroksInner := _InstanceParametersGroksInner{} + + err = json.Unmarshal(data, &varInstanceParametersGroksInner) + + if err != nil { + return err + } + + *o = InstanceParametersGroksInner(varInstanceParametersGroksInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pattern") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceParametersGroksInner struct { + value *InstanceParametersGroksInner + isSet bool +} + +func (v NullableInstanceParametersGroksInner) Get() *InstanceParametersGroksInner { + return v.value +} + +func (v *NullableInstanceParametersGroksInner) Set(val *InstanceParametersGroksInner) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceParametersGroksInner) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceParametersGroksInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceParametersGroksInner(val *InstanceParametersGroksInner) *NullableInstanceParametersGroksInner { + return &NullableInstanceParametersGroksInner{value: val, isSet: true} +} + +func (v NullableInstanceParametersGroksInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceParametersGroksInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_instance_schema.go b/services/logme/v2api/model_instance_schema.go new file mode 100644 index 000000000..21fc6b95f --- /dev/null +++ b/services/logme/v2api/model_instance_schema.go @@ -0,0 +1,195 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InstanceSchema type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstanceSchema{} + +// InstanceSchema struct for InstanceSchema +type InstanceSchema struct { + Create Schema `json:"create"` + Update Schema `json:"update"` + AdditionalProperties map[string]interface{} +} + +type _InstanceSchema InstanceSchema + +// NewInstanceSchema instantiates a new InstanceSchema 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 NewInstanceSchema(create Schema, update Schema) *InstanceSchema { + this := InstanceSchema{} + this.Create = create + this.Update = update + return &this +} + +// NewInstanceSchemaWithDefaults instantiates a new InstanceSchema 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 NewInstanceSchemaWithDefaults() *InstanceSchema { + this := InstanceSchema{} + return &this +} + +// GetCreate returns the Create field value +func (o *InstanceSchema) GetCreate() Schema { + if o == nil { + var ret Schema + return ret + } + + return o.Create +} + +// GetCreateOk returns a tuple with the Create field value +// and a boolean to check if the value has been set. +func (o *InstanceSchema) GetCreateOk() (*Schema, bool) { + if o == nil { + return nil, false + } + return &o.Create, true +} + +// SetCreate sets field value +func (o *InstanceSchema) SetCreate(v Schema) { + o.Create = v +} + +// GetUpdate returns the Update field value +func (o *InstanceSchema) GetUpdate() Schema { + if o == nil { + var ret Schema + return ret + } + + return o.Update +} + +// GetUpdateOk returns a tuple with the Update field value +// and a boolean to check if the value has been set. +func (o *InstanceSchema) GetUpdateOk() (*Schema, bool) { + if o == nil { + return nil, false + } + return &o.Update, true +} + +// SetUpdate sets field value +func (o *InstanceSchema) SetUpdate(v Schema) { + o.Update = v +} + +func (o InstanceSchema) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstanceSchema) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["create"] = o.Create + toSerialize["update"] = o.Update + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstanceSchema) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "create", + "update", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstanceSchema := _InstanceSchema{} + + err = json.Unmarshal(data, &varInstanceSchema) + + if err != nil { + return err + } + + *o = InstanceSchema(varInstanceSchema) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "create") + delete(additionalProperties, "update") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstanceSchema struct { + value *InstanceSchema + isSet bool +} + +func (v NullableInstanceSchema) Get() *InstanceSchema { + return v.value +} + +func (v *NullableInstanceSchema) Set(val *InstanceSchema) { + v.value = val + v.isSet = true +} + +func (v NullableInstanceSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableInstanceSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstanceSchema(val *InstanceSchema) *NullableInstanceSchema { + return &NullableInstanceSchema{value: val, isSet: true} +} + +func (v NullableInstanceSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstanceSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_list_backups_response.go b/services/logme/v2api/model_list_backups_response.go new file mode 100644 index 000000000..2580b77c2 --- /dev/null +++ b/services/logme/v2api/model_list_backups_response.go @@ -0,0 +1,166 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListBackupsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListBackupsResponse{} + +// ListBackupsResponse struct for ListBackupsResponse +type ListBackupsResponse struct { + InstanceBackups []Backup `json:"instanceBackups"` + AdditionalProperties map[string]interface{} +} + +type _ListBackupsResponse ListBackupsResponse + +// NewListBackupsResponse instantiates a new ListBackupsResponse 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 NewListBackupsResponse(instanceBackups []Backup) *ListBackupsResponse { + this := ListBackupsResponse{} + this.InstanceBackups = instanceBackups + return &this +} + +// NewListBackupsResponseWithDefaults instantiates a new ListBackupsResponse 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 NewListBackupsResponseWithDefaults() *ListBackupsResponse { + this := ListBackupsResponse{} + return &this +} + +// GetInstanceBackups returns the InstanceBackups field value +func (o *ListBackupsResponse) GetInstanceBackups() []Backup { + if o == nil { + var ret []Backup + return ret + } + + return o.InstanceBackups +} + +// GetInstanceBackupsOk returns a tuple with the InstanceBackups field value +// and a boolean to check if the value has been set. +func (o *ListBackupsResponse) GetInstanceBackupsOk() ([]Backup, bool) { + if o == nil { + return nil, false + } + return o.InstanceBackups, true +} + +// SetInstanceBackups sets field value +func (o *ListBackupsResponse) SetInstanceBackups(v []Backup) { + o.InstanceBackups = v +} + +func (o ListBackupsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListBackupsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceBackups"] = o.InstanceBackups + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListBackupsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceBackups", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListBackupsResponse := _ListBackupsResponse{} + + err = json.Unmarshal(data, &varListBackupsResponse) + + if err != nil { + return err + } + + *o = ListBackupsResponse(varListBackupsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceBackups") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListBackupsResponse struct { + value *ListBackupsResponse + isSet bool +} + +func (v NullableListBackupsResponse) Get() *ListBackupsResponse { + return v.value +} + +func (v *NullableListBackupsResponse) Set(val *ListBackupsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListBackupsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListBackupsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListBackupsResponse(val *ListBackupsResponse) *NullableListBackupsResponse { + return &NullableListBackupsResponse{value: val, isSet: true} +} + +func (v NullableListBackupsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListBackupsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_list_credentials_response.go b/services/logme/v2api/model_list_credentials_response.go new file mode 100644 index 000000000..66fc3d442 --- /dev/null +++ b/services/logme/v2api/model_list_credentials_response.go @@ -0,0 +1,166 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListCredentialsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCredentialsResponse{} + +// ListCredentialsResponse struct for ListCredentialsResponse +type ListCredentialsResponse struct { + CredentialsList []CredentialsListItem `json:"credentialsList"` + AdditionalProperties map[string]interface{} +} + +type _ListCredentialsResponse ListCredentialsResponse + +// NewListCredentialsResponse instantiates a new ListCredentialsResponse 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 NewListCredentialsResponse(credentialsList []CredentialsListItem) *ListCredentialsResponse { + this := ListCredentialsResponse{} + this.CredentialsList = credentialsList + return &this +} + +// NewListCredentialsResponseWithDefaults instantiates a new ListCredentialsResponse 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 NewListCredentialsResponseWithDefaults() *ListCredentialsResponse { + this := ListCredentialsResponse{} + return &this +} + +// GetCredentialsList returns the CredentialsList field value +func (o *ListCredentialsResponse) GetCredentialsList() []CredentialsListItem { + if o == nil { + var ret []CredentialsListItem + return ret + } + + return o.CredentialsList +} + +// GetCredentialsListOk returns a tuple with the CredentialsList field value +// and a boolean to check if the value has been set. +func (o *ListCredentialsResponse) GetCredentialsListOk() ([]CredentialsListItem, bool) { + if o == nil { + return nil, false + } + return o.CredentialsList, true +} + +// SetCredentialsList sets field value +func (o *ListCredentialsResponse) SetCredentialsList(v []CredentialsListItem) { + o.CredentialsList = v +} + +func (o ListCredentialsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListCredentialsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["credentialsList"] = o.CredentialsList + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListCredentialsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "credentialsList", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListCredentialsResponse := _ListCredentialsResponse{} + + err = json.Unmarshal(data, &varListCredentialsResponse) + + if err != nil { + return err + } + + *o = ListCredentialsResponse(varListCredentialsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "credentialsList") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListCredentialsResponse struct { + value *ListCredentialsResponse + isSet bool +} + +func (v NullableListCredentialsResponse) Get() *ListCredentialsResponse { + return v.value +} + +func (v *NullableListCredentialsResponse) Set(val *ListCredentialsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListCredentialsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListCredentialsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCredentialsResponse(val *ListCredentialsResponse) *NullableListCredentialsResponse { + return &NullableListCredentialsResponse{value: val, isSet: true} +} + +func (v NullableListCredentialsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCredentialsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_list_instances_response.go b/services/logme/v2api/model_list_instances_response.go new file mode 100644 index 000000000..d4d9135d7 --- /dev/null +++ b/services/logme/v2api/model_list_instances_response.go @@ -0,0 +1,166 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListInstancesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListInstancesResponse{} + +// ListInstancesResponse struct for ListInstancesResponse +type ListInstancesResponse struct { + Instances []Instance `json:"instances"` + AdditionalProperties map[string]interface{} +} + +type _ListInstancesResponse ListInstancesResponse + +// NewListInstancesResponse instantiates a new ListInstancesResponse 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 NewListInstancesResponse(instances []Instance) *ListInstancesResponse { + this := ListInstancesResponse{} + this.Instances = instances + return &this +} + +// NewListInstancesResponseWithDefaults instantiates a new ListInstancesResponse 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 NewListInstancesResponseWithDefaults() *ListInstancesResponse { + this := ListInstancesResponse{} + return &this +} + +// GetInstances returns the Instances field value +func (o *ListInstancesResponse) GetInstances() []Instance { + if o == nil { + var ret []Instance + return ret + } + + return o.Instances +} + +// GetInstancesOk returns a tuple with the Instances field value +// and a boolean to check if the value has been set. +func (o *ListInstancesResponse) GetInstancesOk() ([]Instance, bool) { + if o == nil { + return nil, false + } + return o.Instances, true +} + +// SetInstances sets field value +func (o *ListInstancesResponse) SetInstances(v []Instance) { + o.Instances = v +} + +func (o ListInstancesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListInstancesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instances"] = o.Instances + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListInstancesResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instances", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListInstancesResponse := _ListInstancesResponse{} + + err = json.Unmarshal(data, &varListInstancesResponse) + + if err != nil { + return err + } + + *o = ListInstancesResponse(varListInstancesResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instances") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListInstancesResponse struct { + value *ListInstancesResponse + isSet bool +} + +func (v NullableListInstancesResponse) Get() *ListInstancesResponse { + return v.value +} + +func (v *NullableListInstancesResponse) Set(val *ListInstancesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListInstancesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListInstancesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListInstancesResponse(val *ListInstancesResponse) *NullableListInstancesResponse { + return &NullableListInstancesResponse{value: val, isSet: true} +} + +func (v NullableListInstancesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListInstancesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_list_offerings_response.go b/services/logme/v2api/model_list_offerings_response.go new file mode 100644 index 000000000..a285907d4 --- /dev/null +++ b/services/logme/v2api/model_list_offerings_response.go @@ -0,0 +1,166 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListOfferingsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOfferingsResponse{} + +// ListOfferingsResponse struct for ListOfferingsResponse +type ListOfferingsResponse struct { + Offerings []Offering `json:"offerings"` + AdditionalProperties map[string]interface{} +} + +type _ListOfferingsResponse ListOfferingsResponse + +// NewListOfferingsResponse instantiates a new ListOfferingsResponse 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 NewListOfferingsResponse(offerings []Offering) *ListOfferingsResponse { + this := ListOfferingsResponse{} + this.Offerings = offerings + return &this +} + +// NewListOfferingsResponseWithDefaults instantiates a new ListOfferingsResponse 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 NewListOfferingsResponseWithDefaults() *ListOfferingsResponse { + this := ListOfferingsResponse{} + return &this +} + +// GetOfferings returns the Offerings field value +func (o *ListOfferingsResponse) GetOfferings() []Offering { + if o == nil { + var ret []Offering + return ret + } + + return o.Offerings +} + +// GetOfferingsOk returns a tuple with the Offerings field value +// and a boolean to check if the value has been set. +func (o *ListOfferingsResponse) GetOfferingsOk() ([]Offering, bool) { + if o == nil { + return nil, false + } + return o.Offerings, true +} + +// SetOfferings sets field value +func (o *ListOfferingsResponse) SetOfferings(v []Offering) { + o.Offerings = v +} + +func (o ListOfferingsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOfferingsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["offerings"] = o.Offerings + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListOfferingsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "offerings", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListOfferingsResponse := _ListOfferingsResponse{} + + err = json.Unmarshal(data, &varListOfferingsResponse) + + if err != nil { + return err + } + + *o = ListOfferingsResponse(varListOfferingsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "offerings") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListOfferingsResponse struct { + value *ListOfferingsResponse + isSet bool +} + +func (v NullableListOfferingsResponse) Get() *ListOfferingsResponse { + return v.value +} + +func (v *NullableListOfferingsResponse) Set(val *ListOfferingsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListOfferingsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListOfferingsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOfferingsResponse(val *ListOfferingsResponse) *NullableListOfferingsResponse { + return &NullableListOfferingsResponse{value: val, isSet: true} +} + +func (v NullableListOfferingsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOfferingsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_list_restores_response.go b/services/logme/v2api/model_list_restores_response.go new file mode 100644 index 000000000..9b804926f --- /dev/null +++ b/services/logme/v2api/model_list_restores_response.go @@ -0,0 +1,166 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ListRestoresResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListRestoresResponse{} + +// ListRestoresResponse struct for ListRestoresResponse +type ListRestoresResponse struct { + InstanceRestores []Restore `json:"instanceRestores"` + AdditionalProperties map[string]interface{} +} + +type _ListRestoresResponse ListRestoresResponse + +// NewListRestoresResponse instantiates a new ListRestoresResponse 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 NewListRestoresResponse(instanceRestores []Restore) *ListRestoresResponse { + this := ListRestoresResponse{} + this.InstanceRestores = instanceRestores + return &this +} + +// NewListRestoresResponseWithDefaults instantiates a new ListRestoresResponse 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 NewListRestoresResponseWithDefaults() *ListRestoresResponse { + this := ListRestoresResponse{} + return &this +} + +// GetInstanceRestores returns the InstanceRestores field value +func (o *ListRestoresResponse) GetInstanceRestores() []Restore { + if o == nil { + var ret []Restore + return ret + } + + return o.InstanceRestores +} + +// GetInstanceRestoresOk returns a tuple with the InstanceRestores field value +// and a boolean to check if the value has been set. +func (o *ListRestoresResponse) GetInstanceRestoresOk() ([]Restore, bool) { + if o == nil { + return nil, false + } + return o.InstanceRestores, true +} + +// SetInstanceRestores sets field value +func (o *ListRestoresResponse) SetInstanceRestores(v []Restore) { + o.InstanceRestores = v +} + +func (o ListRestoresResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListRestoresResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceRestores"] = o.InstanceRestores + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListRestoresResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instanceRestores", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListRestoresResponse := _ListRestoresResponse{} + + err = json.Unmarshal(data, &varListRestoresResponse) + + if err != nil { + return err + } + + *o = ListRestoresResponse(varListRestoresResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceRestores") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListRestoresResponse struct { + value *ListRestoresResponse + isSet bool +} + +func (v NullableListRestoresResponse) Get() *ListRestoresResponse { + return v.value +} + +func (v *NullableListRestoresResponse) Set(val *ListRestoresResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListRestoresResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListRestoresResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListRestoresResponse(val *ListRestoresResponse) *NullableListRestoresResponse { + return &NullableListRestoresResponse{value: val, isSet: true} +} + +func (v NullableListRestoresResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListRestoresResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_offering.go b/services/logme/v2api/model_offering.go new file mode 100644 index 000000000..fe5a56f52 --- /dev/null +++ b/services/logme/v2api/model_offering.go @@ -0,0 +1,443 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Offering type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Offering{} + +// Offering struct for Offering +type Offering struct { + Description string `json:"description"` + DocumentationUrl string `json:"documentationUrl"` + ImageUrl string `json:"imageUrl"` + Latest bool `json:"latest"` + Lifecycle *string `json:"lifecycle,omitempty"` + Name string `json:"name"` + Plans []Plan `json:"plans"` + QuotaCount int32 `json:"quotaCount"` + Schema *InstanceSchema `json:"schema,omitempty"` + Version string `json:"version"` + AdditionalProperties map[string]interface{} +} + +type _Offering Offering + +// NewOffering instantiates a new Offering 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 NewOffering(description string, documentationUrl string, imageUrl string, latest bool, name string, plans []Plan, quotaCount int32, version string) *Offering { + this := Offering{} + this.Description = description + this.DocumentationUrl = documentationUrl + this.ImageUrl = imageUrl + this.Latest = latest + this.Name = name + this.Plans = plans + this.QuotaCount = quotaCount + this.Version = version + return &this +} + +// NewOfferingWithDefaults instantiates a new Offering 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 NewOfferingWithDefaults() *Offering { + this := Offering{} + return &this +} + +// GetDescription returns the Description field value +func (o *Offering) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Offering) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *Offering) SetDescription(v string) { + o.Description = v +} + +// GetDocumentationUrl returns the DocumentationUrl field value +func (o *Offering) GetDocumentationUrl() string { + if o == nil { + var ret string + return ret + } + + return o.DocumentationUrl +} + +// GetDocumentationUrlOk returns a tuple with the DocumentationUrl field value +// and a boolean to check if the value has been set. +func (o *Offering) GetDocumentationUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DocumentationUrl, true +} + +// SetDocumentationUrl sets field value +func (o *Offering) SetDocumentationUrl(v string) { + o.DocumentationUrl = v +} + +// GetImageUrl returns the ImageUrl field value +func (o *Offering) GetImageUrl() string { + if o == nil { + var ret string + return ret + } + + return o.ImageUrl +} + +// GetImageUrlOk returns a tuple with the ImageUrl field value +// and a boolean to check if the value has been set. +func (o *Offering) GetImageUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ImageUrl, true +} + +// SetImageUrl sets field value +func (o *Offering) SetImageUrl(v string) { + o.ImageUrl = v +} + +// GetLatest returns the Latest field value +func (o *Offering) GetLatest() bool { + if o == nil { + var ret bool + return ret + } + + return o.Latest +} + +// GetLatestOk returns a tuple with the Latest field value +// and a boolean to check if the value has been set. +func (o *Offering) GetLatestOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Latest, true +} + +// SetLatest sets field value +func (o *Offering) SetLatest(v bool) { + o.Latest = v +} + +// GetLifecycle returns the Lifecycle field value if set, zero value otherwise. +func (o *Offering) GetLifecycle() string { + if o == nil || IsNil(o.Lifecycle) { + var ret string + return ret + } + return *o.Lifecycle +} + +// GetLifecycleOk returns a tuple with the Lifecycle field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Offering) GetLifecycleOk() (*string, bool) { + if o == nil || IsNil(o.Lifecycle) { + return nil, false + } + return o.Lifecycle, true +} + +// HasLifecycle returns a boolean if a field has been set. +func (o *Offering) HasLifecycle() bool { + if o != nil && !IsNil(o.Lifecycle) { + return true + } + + return false +} + +// SetLifecycle gets a reference to the given string and assigns it to the Lifecycle field. +func (o *Offering) SetLifecycle(v string) { + o.Lifecycle = &v +} + +// GetName returns the Name field value +func (o *Offering) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Offering) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Offering) SetName(v string) { + o.Name = v +} + +// GetPlans returns the Plans field value +func (o *Offering) GetPlans() []Plan { + if o == nil { + var ret []Plan + return ret + } + + return o.Plans +} + +// GetPlansOk returns a tuple with the Plans field value +// and a boolean to check if the value has been set. +func (o *Offering) GetPlansOk() ([]Plan, bool) { + if o == nil { + return nil, false + } + return o.Plans, true +} + +// SetPlans sets field value +func (o *Offering) SetPlans(v []Plan) { + o.Plans = v +} + +// GetQuotaCount returns the QuotaCount field value +func (o *Offering) GetQuotaCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.QuotaCount +} + +// GetQuotaCountOk returns a tuple with the QuotaCount field value +// and a boolean to check if the value has been set. +func (o *Offering) GetQuotaCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.QuotaCount, true +} + +// SetQuotaCount sets field value +func (o *Offering) SetQuotaCount(v int32) { + o.QuotaCount = v +} + +// GetSchema returns the Schema field value if set, zero value otherwise. +func (o *Offering) GetSchema() InstanceSchema { + if o == nil || IsNil(o.Schema) { + var ret InstanceSchema + return ret + } + return *o.Schema +} + +// GetSchemaOk returns a tuple with the Schema field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Offering) GetSchemaOk() (*InstanceSchema, bool) { + if o == nil || IsNil(o.Schema) { + return nil, false + } + return o.Schema, true +} + +// HasSchema returns a boolean if a field has been set. +func (o *Offering) HasSchema() bool { + if o != nil && !IsNil(o.Schema) { + return true + } + + return false +} + +// SetSchema gets a reference to the given InstanceSchema and assigns it to the Schema field. +func (o *Offering) SetSchema(v InstanceSchema) { + o.Schema = &v +} + +// GetVersion returns the Version field value +func (o *Offering) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *Offering) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *Offering) SetVersion(v string) { + o.Version = v +} + +func (o Offering) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Offering) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["documentationUrl"] = o.DocumentationUrl + toSerialize["imageUrl"] = o.ImageUrl + toSerialize["latest"] = o.Latest + if !IsNil(o.Lifecycle) { + toSerialize["lifecycle"] = o.Lifecycle + } + toSerialize["name"] = o.Name + toSerialize["plans"] = o.Plans + toSerialize["quotaCount"] = o.QuotaCount + if !IsNil(o.Schema) { + toSerialize["schema"] = o.Schema + } + toSerialize["version"] = o.Version + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Offering) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "documentationUrl", + "imageUrl", + "latest", + "name", + "plans", + "quotaCount", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOffering := _Offering{} + + err = json.Unmarshal(data, &varOffering) + + if err != nil { + return err + } + + *o = Offering(varOffering) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "documentationUrl") + delete(additionalProperties, "imageUrl") + delete(additionalProperties, "latest") + delete(additionalProperties, "lifecycle") + delete(additionalProperties, "name") + delete(additionalProperties, "plans") + delete(additionalProperties, "quotaCount") + delete(additionalProperties, "schema") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOffering struct { + value *Offering + isSet bool +} + +func (v NullableOffering) Get() *Offering { + return v.value +} + +func (v *NullableOffering) Set(val *Offering) { + v.value = val + v.isSet = true +} + +func (v NullableOffering) IsSet() bool { + return v.isSet +} + +func (v *NullableOffering) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOffering(val *Offering) *NullableOffering { + return &NullableOffering{value: val, isSet: true} +} + +func (v NullableOffering) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOffering) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_partial_update_instance_payload.go b/services/logme/v2api/model_partial_update_instance_payload.go new file mode 100644 index 000000000..249356d14 --- /dev/null +++ b/services/logme/v2api/model_partial_update_instance_payload.go @@ -0,0 +1,227 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateInstancePayload{} + +// PartialUpdateInstancePayload struct for PartialUpdateInstancePayload +type PartialUpdateInstancePayload struct { + InstanceName *string `json:"instanceName,omitempty"` + Parameters *InstanceParameters `json:"parameters,omitempty"` + PlanId *string `json:"planId,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PartialUpdateInstancePayload PartialUpdateInstancePayload + +// NewPartialUpdateInstancePayload instantiates a new PartialUpdateInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateInstancePayload() *PartialUpdateInstancePayload { + this := PartialUpdateInstancePayload{} + return &this +} + +// NewPartialUpdateInstancePayloadWithDefaults instantiates a new PartialUpdateInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateInstancePayloadWithDefaults() *PartialUpdateInstancePayload { + this := PartialUpdateInstancePayload{} + return &this +} + +// GetInstanceName returns the InstanceName field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetInstanceName() string { + if o == nil || IsNil(o.InstanceName) { + var ret string + return ret + } + return *o.InstanceName +} + +// GetInstanceNameOk returns a tuple with the InstanceName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetInstanceNameOk() (*string, bool) { + if o == nil || IsNil(o.InstanceName) { + return nil, false + } + return o.InstanceName, true +} + +// HasInstanceName returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasInstanceName() bool { + if o != nil && !IsNil(o.InstanceName) { + return true + } + + return false +} + +// SetInstanceName gets a reference to the given string and assigns it to the InstanceName field. +func (o *PartialUpdateInstancePayload) SetInstanceName(v string) { + o.InstanceName = &v +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetParameters() InstanceParameters { + if o == nil || IsNil(o.Parameters) { + var ret InstanceParameters + return ret + } + return *o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetParametersOk() (*InstanceParameters, bool) { + if o == nil || IsNil(o.Parameters) { + return nil, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given InstanceParameters and assigns it to the Parameters field. +func (o *PartialUpdateInstancePayload) SetParameters(v InstanceParameters) { + o.Parameters = &v +} + +// GetPlanId returns the PlanId field value if set, zero value otherwise. +func (o *PartialUpdateInstancePayload) GetPlanId() string { + if o == nil || IsNil(o.PlanId) { + var ret string + return ret + } + return *o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateInstancePayload) GetPlanIdOk() (*string, bool) { + if o == nil || IsNil(o.PlanId) { + return nil, false + } + return o.PlanId, true +} + +// HasPlanId returns a boolean if a field has been set. +func (o *PartialUpdateInstancePayload) HasPlanId() bool { + if o != nil && !IsNil(o.PlanId) { + return true + } + + return false +} + +// SetPlanId gets a reference to the given string and assigns it to the PlanId field. +func (o *PartialUpdateInstancePayload) SetPlanId(v string) { + o.PlanId = &v +} + +func (o PartialUpdateInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.InstanceName) { + toSerialize["instanceName"] = o.InstanceName + } + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + if !IsNil(o.PlanId) { + toSerialize["planId"] = o.PlanId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PartialUpdateInstancePayload) UnmarshalJSON(data []byte) (err error) { + varPartialUpdateInstancePayload := _PartialUpdateInstancePayload{} + + err = json.Unmarshal(data, &varPartialUpdateInstancePayload) + + if err != nil { + return err + } + + *o = PartialUpdateInstancePayload(varPartialUpdateInstancePayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instanceName") + delete(additionalProperties, "parameters") + delete(additionalProperties, "planId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePartialUpdateInstancePayload struct { + value *PartialUpdateInstancePayload + isSet bool +} + +func (v NullablePartialUpdateInstancePayload) Get() *PartialUpdateInstancePayload { + return v.value +} + +func (v *NullablePartialUpdateInstancePayload) Set(val *PartialUpdateInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateInstancePayload(val *PartialUpdateInstancePayload) *NullablePartialUpdateInstancePayload { + return &NullablePartialUpdateInstancePayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_plan.go b/services/logme/v2api/model_plan.go new file mode 100644 index 000000000..6e1a73ffc --- /dev/null +++ b/services/logme/v2api/model_plan.go @@ -0,0 +1,282 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Plan type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Plan{} + +// Plan struct for Plan +type Plan struct { + Description string `json:"description"` + Free bool `json:"free"` + Id string `json:"id"` + Name string `json:"name"` + SkuName string `json:"skuName"` + AdditionalProperties map[string]interface{} +} + +type _Plan Plan + +// NewPlan instantiates a new Plan 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 NewPlan(description string, free bool, id string, name string, skuName string) *Plan { + this := Plan{} + this.Description = description + this.Free = free + this.Id = id + this.Name = name + this.SkuName = skuName + return &this +} + +// NewPlanWithDefaults instantiates a new Plan 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 NewPlanWithDefaults() *Plan { + this := Plan{} + return &this +} + +// GetDescription returns the Description field value +func (o *Plan) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Plan) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *Plan) SetDescription(v string) { + o.Description = v +} + +// GetFree returns the Free field value +func (o *Plan) GetFree() bool { + if o == nil { + var ret bool + return ret + } + + return o.Free +} + +// GetFreeOk returns a tuple with the Free field value +// and a boolean to check if the value has been set. +func (o *Plan) GetFreeOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Free, true +} + +// SetFree sets field value +func (o *Plan) SetFree(v bool) { + o.Free = v +} + +// GetId returns the Id field value +func (o *Plan) GetId() string { + if o == nil { + 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 *Plan) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Plan) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *Plan) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Plan) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Plan) SetName(v string) { + o.Name = v +} + +// GetSkuName returns the SkuName field value +func (o *Plan) GetSkuName() string { + if o == nil { + var ret string + return ret + } + + return o.SkuName +} + +// GetSkuNameOk returns a tuple with the SkuName field value +// and a boolean to check if the value has been set. +func (o *Plan) GetSkuNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SkuName, true +} + +// SetSkuName sets field value +func (o *Plan) SetSkuName(v string) { + o.SkuName = v +} + +func (o Plan) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Plan) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["free"] = o.Free + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["skuName"] = o.SkuName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Plan) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "free", + "id", + "name", + "skuName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPlan := _Plan{} + + err = json.Unmarshal(data, &varPlan) + + if err != nil { + return err + } + + *o = Plan(varPlan) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "free") + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "skuName") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlan struct { + value *Plan + isSet bool +} + +func (v NullablePlan) Get() *Plan { + return v.value +} + +func (v *NullablePlan) Set(val *Plan) { + v.value = val + v.isSet = true +} + +func (v NullablePlan) IsSet() bool { + return v.isSet +} + +func (v *NullablePlan) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlan(val *Plan) *NullablePlan { + return &NullablePlan{value: val, isSet: true} +} + +func (v NullablePlan) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlan) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_raw_credentials.go b/services/logme/v2api/model_raw_credentials.go new file mode 100644 index 000000000..fa6890bba --- /dev/null +++ b/services/logme/v2api/model_raw_credentials.go @@ -0,0 +1,166 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RawCredentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RawCredentials{} + +// RawCredentials struct for RawCredentials +type RawCredentials struct { + Credentials Credentials `json:"credentials"` + AdditionalProperties map[string]interface{} +} + +type _RawCredentials RawCredentials + +// NewRawCredentials instantiates a new RawCredentials 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 NewRawCredentials(credentials Credentials) *RawCredentials { + this := RawCredentials{} + this.Credentials = credentials + return &this +} + +// NewRawCredentialsWithDefaults instantiates a new RawCredentials 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 NewRawCredentialsWithDefaults() *RawCredentials { + this := RawCredentials{} + return &this +} + +// GetCredentials returns the Credentials field value +func (o *RawCredentials) GetCredentials() Credentials { + if o == nil { + var ret Credentials + return ret + } + + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value +// and a boolean to check if the value has been set. +func (o *RawCredentials) GetCredentialsOk() (*Credentials, bool) { + if o == nil { + return nil, false + } + return &o.Credentials, true +} + +// SetCredentials sets field value +func (o *RawCredentials) SetCredentials(v Credentials) { + o.Credentials = v +} + +func (o RawCredentials) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RawCredentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["credentials"] = o.Credentials + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RawCredentials) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "credentials", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRawCredentials := _RawCredentials{} + + err = json.Unmarshal(data, &varRawCredentials) + + if err != nil { + return err + } + + *o = RawCredentials(varRawCredentials) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "credentials") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRawCredentials struct { + value *RawCredentials + isSet bool +} + +func (v NullableRawCredentials) Get() *RawCredentials { + return v.value +} + +func (v *NullableRawCredentials) Set(val *RawCredentials) { + v.value = val + v.isSet = true +} + +func (v NullableRawCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableRawCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRawCredentials(val *RawCredentials) *NullableRawCredentials { + return &NullableRawCredentials{value: val, isSet: true} +} + +func (v NullableRawCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRawCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_restore.go b/services/logme/v2api/model_restore.go new file mode 100644 index 000000000..292fc085e --- /dev/null +++ b/services/logme/v2api/model_restore.go @@ -0,0 +1,290 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Restore type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Restore{} + +// Restore struct for Restore +type Restore struct { + BackupId int32 `json:"backup_id"` + FinishedAt string `json:"finished_at"` + Id int32 `json:"id"` + Status string `json:"status"` + TriggeredAt *string `json:"triggered_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Restore Restore + +// NewRestore instantiates a new Restore 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 NewRestore(backupId int32, finishedAt string, id int32, status string) *Restore { + this := Restore{} + this.BackupId = backupId + this.FinishedAt = finishedAt + this.Id = id + this.Status = status + return &this +} + +// NewRestoreWithDefaults instantiates a new Restore 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 NewRestoreWithDefaults() *Restore { + this := Restore{} + return &this +} + +// GetBackupId returns the BackupId field value +func (o *Restore) GetBackupId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BackupId +} + +// GetBackupIdOk returns a tuple with the BackupId field value +// and a boolean to check if the value has been set. +func (o *Restore) GetBackupIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BackupId, true +} + +// SetBackupId sets field value +func (o *Restore) SetBackupId(v int32) { + o.BackupId = v +} + +// GetFinishedAt returns the FinishedAt field value +func (o *Restore) GetFinishedAt() string { + if o == nil { + var ret string + return ret + } + + return o.FinishedAt +} + +// GetFinishedAtOk returns a tuple with the FinishedAt field value +// and a boolean to check if the value has been set. +func (o *Restore) GetFinishedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FinishedAt, true +} + +// SetFinishedAt sets field value +func (o *Restore) SetFinishedAt(v string) { + o.FinishedAt = v +} + +// GetId returns the Id field value +func (o *Restore) GetId() int32 { + if o == nil { + var ret int32 + 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 *Restore) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Restore) SetId(v int32) { + o.Id = v +} + +// GetStatus returns the Status field value +func (o *Restore) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Restore) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Restore) SetStatus(v string) { + o.Status = v +} + +// GetTriggeredAt returns the TriggeredAt field value if set, zero value otherwise. +func (o *Restore) GetTriggeredAt() string { + if o == nil || IsNil(o.TriggeredAt) { + var ret string + return ret + } + return *o.TriggeredAt +} + +// GetTriggeredAtOk returns a tuple with the TriggeredAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Restore) GetTriggeredAtOk() (*string, bool) { + if o == nil || IsNil(o.TriggeredAt) { + return nil, false + } + return o.TriggeredAt, true +} + +// HasTriggeredAt returns a boolean if a field has been set. +func (o *Restore) HasTriggeredAt() bool { + if o != nil && !IsNil(o.TriggeredAt) { + return true + } + + return false +} + +// SetTriggeredAt gets a reference to the given string and assigns it to the TriggeredAt field. +func (o *Restore) SetTriggeredAt(v string) { + o.TriggeredAt = &v +} + +func (o Restore) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Restore) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backup_id"] = o.BackupId + toSerialize["finished_at"] = o.FinishedAt + toSerialize["id"] = o.Id + toSerialize["status"] = o.Status + if !IsNil(o.TriggeredAt) { + toSerialize["triggered_at"] = o.TriggeredAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Restore) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backup_id", + "finished_at", + "id", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRestore := _Restore{} + + err = json.Unmarshal(data, &varRestore) + + if err != nil { + return err + } + + *o = Restore(varRestore) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "backup_id") + delete(additionalProperties, "finished_at") + delete(additionalProperties, "id") + delete(additionalProperties, "status") + delete(additionalProperties, "triggered_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRestore struct { + value *Restore + isSet bool +} + +func (v NullableRestore) Get() *Restore { + return v.value +} + +func (v *NullableRestore) Set(val *Restore) { + v.value = val + v.isSet = true +} + +func (v NullableRestore) IsSet() bool { + return v.isSet +} + +func (v *NullableRestore) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestore(val *Restore) *NullableRestore { + return &NullableRestore{value: val, isSet: true} +} + +func (v NullableRestore) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestore) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_schema.go b/services/logme/v2api/model_schema.go new file mode 100644 index 000000000..849ee64c5 --- /dev/null +++ b/services/logme/v2api/model_schema.go @@ -0,0 +1,166 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Schema type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Schema{} + +// Schema struct for Schema +type Schema struct { + Parameters map[string]interface{} `json:"parameters"` + AdditionalProperties map[string]interface{} +} + +type _Schema Schema + +// NewSchema instantiates a new Schema 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 NewSchema(parameters map[string]interface{}) *Schema { + this := Schema{} + this.Parameters = parameters + return &this +} + +// NewSchemaWithDefaults instantiates a new Schema 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 NewSchemaWithDefaults() *Schema { + this := Schema{} + return &this +} + +// GetParameters returns the Parameters field value +func (o *Schema) GetParameters() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value +// and a boolean to check if the value has been set. +func (o *Schema) GetParametersOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Parameters, true +} + +// SetParameters sets field value +func (o *Schema) SetParameters(v map[string]interface{}) { + o.Parameters = v +} + +func (o Schema) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Schema) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["parameters"] = o.Parameters + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Schema) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "parameters", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSchema := _Schema{} + + err = json.Unmarshal(data, &varSchema) + + if err != nil { + return err + } + + *o = Schema(varSchema) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "parameters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSchema struct { + value *Schema + isSet bool +} + +func (v NullableSchema) Get() *Schema { + return v.value +} + +func (v *NullableSchema) Set(val *Schema) { + v.value = val + v.isSet = true +} + +func (v NullableSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSchema(val *Schema) *NullableSchema { + return &NullableSchema{value: val, isSet: true} +} + +func (v NullableSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_trigger_restore_response.go b/services/logme/v2api/model_trigger_restore_response.go new file mode 100644 index 000000000..7d7ec1a09 --- /dev/null +++ b/services/logme/v2api/model_trigger_restore_response.go @@ -0,0 +1,166 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TriggerRestoreResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TriggerRestoreResponse{} + +// TriggerRestoreResponse struct for TriggerRestoreResponse +type TriggerRestoreResponse struct { + Id int32 `json:"id"` + AdditionalProperties map[string]interface{} +} + +type _TriggerRestoreResponse TriggerRestoreResponse + +// NewTriggerRestoreResponse instantiates a new TriggerRestoreResponse 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 NewTriggerRestoreResponse(id int32) *TriggerRestoreResponse { + this := TriggerRestoreResponse{} + this.Id = id + return &this +} + +// NewTriggerRestoreResponseWithDefaults instantiates a new TriggerRestoreResponse 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 NewTriggerRestoreResponseWithDefaults() *TriggerRestoreResponse { + this := TriggerRestoreResponse{} + return &this +} + +// GetId returns the Id field value +func (o *TriggerRestoreResponse) GetId() int32 { + if o == nil { + var ret int32 + 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 *TriggerRestoreResponse) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *TriggerRestoreResponse) SetId(v int32) { + o.Id = v +} + +func (o TriggerRestoreResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TriggerRestoreResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TriggerRestoreResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTriggerRestoreResponse := _TriggerRestoreResponse{} + + err = json.Unmarshal(data, &varTriggerRestoreResponse) + + if err != nil { + return err + } + + *o = TriggerRestoreResponse(varTriggerRestoreResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTriggerRestoreResponse struct { + value *TriggerRestoreResponse + isSet bool +} + +func (v NullableTriggerRestoreResponse) Get() *TriggerRestoreResponse { + return v.value +} + +func (v *NullableTriggerRestoreResponse) Set(val *TriggerRestoreResponse) { + v.value = val + v.isSet = true +} + +func (v NullableTriggerRestoreResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableTriggerRestoreResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTriggerRestoreResponse(val *TriggerRestoreResponse) *NullableTriggerRestoreResponse { + return &NullableTriggerRestoreResponse{value: val, isSet: true} +} + +func (v NullableTriggerRestoreResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTriggerRestoreResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_update_backups_config_payload.go b/services/logme/v2api/model_update_backups_config_payload.go new file mode 100644 index 000000000..6f2013e45 --- /dev/null +++ b/services/logme/v2api/model_update_backups_config_payload.go @@ -0,0 +1,153 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateBackupsConfigPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateBackupsConfigPayload{} + +// UpdateBackupsConfigPayload struct for UpdateBackupsConfigPayload +type UpdateBackupsConfigPayload struct { + EncryptionKey *string `json:"encryption_key,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UpdateBackupsConfigPayload UpdateBackupsConfigPayload + +// NewUpdateBackupsConfigPayload instantiates a new UpdateBackupsConfigPayload 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 NewUpdateBackupsConfigPayload() *UpdateBackupsConfigPayload { + this := UpdateBackupsConfigPayload{} + return &this +} + +// NewUpdateBackupsConfigPayloadWithDefaults instantiates a new UpdateBackupsConfigPayload 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 NewUpdateBackupsConfigPayloadWithDefaults() *UpdateBackupsConfigPayload { + this := UpdateBackupsConfigPayload{} + return &this +} + +// GetEncryptionKey returns the EncryptionKey field value if set, zero value otherwise. +func (o *UpdateBackupsConfigPayload) GetEncryptionKey() string { + if o == nil || IsNil(o.EncryptionKey) { + var ret string + return ret + } + return *o.EncryptionKey +} + +// GetEncryptionKeyOk returns a tuple with the EncryptionKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupsConfigPayload) GetEncryptionKeyOk() (*string, bool) { + if o == nil || IsNil(o.EncryptionKey) { + return nil, false + } + return o.EncryptionKey, true +} + +// HasEncryptionKey returns a boolean if a field has been set. +func (o *UpdateBackupsConfigPayload) HasEncryptionKey() bool { + if o != nil && !IsNil(o.EncryptionKey) { + return true + } + + return false +} + +// SetEncryptionKey gets a reference to the given string and assigns it to the EncryptionKey field. +func (o *UpdateBackupsConfigPayload) SetEncryptionKey(v string) { + o.EncryptionKey = &v +} + +func (o UpdateBackupsConfigPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateBackupsConfigPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.EncryptionKey) { + toSerialize["encryption_key"] = o.EncryptionKey + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateBackupsConfigPayload) UnmarshalJSON(data []byte) (err error) { + varUpdateBackupsConfigPayload := _UpdateBackupsConfigPayload{} + + err = json.Unmarshal(data, &varUpdateBackupsConfigPayload) + + if err != nil { + return err + } + + *o = UpdateBackupsConfigPayload(varUpdateBackupsConfigPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "encryption_key") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateBackupsConfigPayload struct { + value *UpdateBackupsConfigPayload + isSet bool +} + +func (v NullableUpdateBackupsConfigPayload) Get() *UpdateBackupsConfigPayload { + return v.value +} + +func (v *NullableUpdateBackupsConfigPayload) Set(val *UpdateBackupsConfigPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateBackupsConfigPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateBackupsConfigPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateBackupsConfigPayload(val *UpdateBackupsConfigPayload) *NullableUpdateBackupsConfigPayload { + return &NullableUpdateBackupsConfigPayload{value: val, isSet: true} +} + +func (v NullableUpdateBackupsConfigPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateBackupsConfigPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/model_update_backups_config_response.go b/services/logme/v2api/model_update_backups_config_response.go new file mode 100644 index 000000000..f1ffc9513 --- /dev/null +++ b/services/logme/v2api/model_update_backups_config_response.go @@ -0,0 +1,166 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateBackupsConfigResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateBackupsConfigResponse{} + +// UpdateBackupsConfigResponse struct for UpdateBackupsConfigResponse +type UpdateBackupsConfigResponse struct { + Message string `json:"message"` + AdditionalProperties map[string]interface{} +} + +type _UpdateBackupsConfigResponse UpdateBackupsConfigResponse + +// NewUpdateBackupsConfigResponse instantiates a new UpdateBackupsConfigResponse 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 NewUpdateBackupsConfigResponse(message string) *UpdateBackupsConfigResponse { + this := UpdateBackupsConfigResponse{} + this.Message = message + return &this +} + +// NewUpdateBackupsConfigResponseWithDefaults instantiates a new UpdateBackupsConfigResponse 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 NewUpdateBackupsConfigResponseWithDefaults() *UpdateBackupsConfigResponse { + this := UpdateBackupsConfigResponse{} + return &this +} + +// GetMessage returns the Message field value +func (o *UpdateBackupsConfigResponse) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *UpdateBackupsConfigResponse) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *UpdateBackupsConfigResponse) SetMessage(v string) { + o.Message = v +} + +func (o UpdateBackupsConfigResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateBackupsConfigResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateBackupsConfigResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "message", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateBackupsConfigResponse := _UpdateBackupsConfigResponse{} + + err = json.Unmarshal(data, &varUpdateBackupsConfigResponse) + + if err != nil { + return err + } + + *o = UpdateBackupsConfigResponse(varUpdateBackupsConfigResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateBackupsConfigResponse struct { + value *UpdateBackupsConfigResponse + isSet bool +} + +func (v NullableUpdateBackupsConfigResponse) Get() *UpdateBackupsConfigResponse { + return v.value +} + +func (v *NullableUpdateBackupsConfigResponse) Set(val *UpdateBackupsConfigResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateBackupsConfigResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateBackupsConfigResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateBackupsConfigResponse(val *UpdateBackupsConfigResponse) *NullableUpdateBackupsConfigResponse { + return &NullableUpdateBackupsConfigResponse{value: val, isSet: true} +} + +func (v NullableUpdateBackupsConfigResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateBackupsConfigResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/logme/v2api/response.go b/services/logme/v2api/response.go new file mode 100644 index 000000000..8aa724e42 --- /dev/null +++ b/services/logme/v2api/response.go @@ -0,0 +1,47 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/services/logme/v2api/utils.go b/services/logme/v2api/utils.go new file mode 100644 index 000000000..e9430bfc9 --- /dev/null +++ b/services/logme/v2api/utils.go @@ -0,0 +1,361 @@ +/* +STACKIT LogMe API + +The STACKIT LogMe API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. + +API version: 2.1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +}