From 865fa28378ea81818399cc319069a8ca374325ee Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Wed, 28 Oct 2026 16:52:06 +0000 Subject: [PATCH] Generate sca --- services/sca/oas_commit | 2 +- services/sca/v1betaapi/api_default.go | 2879 +++++++++++++++++ services/sca/v1betaapi/api_default_mock.go | 376 +++ services/sca/v1betaapi/client.go | 667 ++++ services/sca/v1betaapi/configuration.go | 40 + .../sca/v1betaapi/model_api_error_response.go | 192 ++ services/sca/v1betaapi/model_application.go | 567 ++++ .../model_application_access_control.go | 192 ++ .../model_application_auto_scaling.go | 265 ++ .../model_application_current_status.go | 121 + ...model_application_custom_rule_parameter.go | 197 ++ ..._application_custom_rule_secret_mapping.go | 197 ++ .../model_application_custom_scale_rule.go | 243 ++ .../v1betaapi/model_application_domains.go | 192 ++ .../sca/v1betaapi/model_application_event.go | 154 + .../model_application_http_scale_rule.go | 192 ++ .../v1betaapi/model_application_instance.go | 195 ++ .../model_application_instance_status.go | 115 + .../model_application_internal_network.go | 205 ++ .../sca/v1betaapi/model_application_log.go | 154 + .../model_application_manual_scaling.go | 167 + .../v1betaapi/model_application_network.go | 190 ++ .../model_application_public_network.go | 242 ++ .../v1betaapi/model_application_rule_type.go | 115 + .../v1betaapi/model_application_scale_rule.go | 272 ++ .../v1betaapi/model_application_scaling.go | 242 ++ .../model_application_scaling_type.go | 115 + .../sca/v1betaapi/model_application_status.go | 270 ++ .../v1betaapi/model_application_summary.go | 458 +++ services/sca/v1betaapi/model_container.go | 387 +++ .../sca/v1betaapi/model_container_env_var.go | 238 ++ .../v1betaapi/model_container_env_var_type.go | 115 + .../model_create_application_payload.go | 567 ++++ .../model_create_environment_payload.go | 357 ++ services/sca/v1betaapi/model_environment.go | 357 ++ .../model_environment_current_status.go | 115 + .../model_environment_registries_vault.go | 167 + .../v1betaapi/model_environment_registry.go | 395 +++ .../model_environment_registry_status.go | 154 + .../sca/v1betaapi/model_environment_secret.go | 357 ++ .../model_environment_secret_status.go | 154 + .../model_environment_secrets_vault.go | 167 + .../sca/v1betaapi/model_environment_status.go | 195 ++ .../model_get_application_events_response.go | 154 + .../model_get_application_logs_response.go | 154 + .../v1betaapi/model_get_overview_response.go | 191 ++ .../model_list_applications_response.go | 154 + .../model_list_environments_response.go | 154 + .../sca/v1betaapi/model_overview_summary.go | 192 ++ .../sca/v1betaapi/model_registry_consumer.go | 230 ++ .../sca/v1betaapi/model_secret_consumer.go | 230 ++ .../model_update_application_payload.go | 567 ++++ ...l_update_environment_registries_payload.go | 167 + ...odel_update_environment_secrets_payload.go | 167 + services/sca/v1betaapi/response.go | 47 + services/sca/v1betaapi/utils.go | 361 +++ 56 files changed, 15708 insertions(+), 1 deletion(-) create mode 100644 services/sca/v1betaapi/api_default.go create mode 100644 services/sca/v1betaapi/api_default_mock.go create mode 100644 services/sca/v1betaapi/client.go create mode 100644 services/sca/v1betaapi/configuration.go create mode 100644 services/sca/v1betaapi/model_api_error_response.go create mode 100644 services/sca/v1betaapi/model_application.go create mode 100644 services/sca/v1betaapi/model_application_access_control.go create mode 100644 services/sca/v1betaapi/model_application_auto_scaling.go create mode 100644 services/sca/v1betaapi/model_application_current_status.go create mode 100644 services/sca/v1betaapi/model_application_custom_rule_parameter.go create mode 100644 services/sca/v1betaapi/model_application_custom_rule_secret_mapping.go create mode 100644 services/sca/v1betaapi/model_application_custom_scale_rule.go create mode 100644 services/sca/v1betaapi/model_application_domains.go create mode 100644 services/sca/v1betaapi/model_application_event.go create mode 100644 services/sca/v1betaapi/model_application_http_scale_rule.go create mode 100644 services/sca/v1betaapi/model_application_instance.go create mode 100644 services/sca/v1betaapi/model_application_instance_status.go create mode 100644 services/sca/v1betaapi/model_application_internal_network.go create mode 100644 services/sca/v1betaapi/model_application_log.go create mode 100644 services/sca/v1betaapi/model_application_manual_scaling.go create mode 100644 services/sca/v1betaapi/model_application_network.go create mode 100644 services/sca/v1betaapi/model_application_public_network.go create mode 100644 services/sca/v1betaapi/model_application_rule_type.go create mode 100644 services/sca/v1betaapi/model_application_scale_rule.go create mode 100644 services/sca/v1betaapi/model_application_scaling.go create mode 100644 services/sca/v1betaapi/model_application_scaling_type.go create mode 100644 services/sca/v1betaapi/model_application_status.go create mode 100644 services/sca/v1betaapi/model_application_summary.go create mode 100644 services/sca/v1betaapi/model_container.go create mode 100644 services/sca/v1betaapi/model_container_env_var.go create mode 100644 services/sca/v1betaapi/model_container_env_var_type.go create mode 100644 services/sca/v1betaapi/model_create_application_payload.go create mode 100644 services/sca/v1betaapi/model_create_environment_payload.go create mode 100644 services/sca/v1betaapi/model_environment.go create mode 100644 services/sca/v1betaapi/model_environment_current_status.go create mode 100644 services/sca/v1betaapi/model_environment_registries_vault.go create mode 100644 services/sca/v1betaapi/model_environment_registry.go create mode 100644 services/sca/v1betaapi/model_environment_registry_status.go create mode 100644 services/sca/v1betaapi/model_environment_secret.go create mode 100644 services/sca/v1betaapi/model_environment_secret_status.go create mode 100644 services/sca/v1betaapi/model_environment_secrets_vault.go create mode 100644 services/sca/v1betaapi/model_environment_status.go create mode 100644 services/sca/v1betaapi/model_get_application_events_response.go create mode 100644 services/sca/v1betaapi/model_get_application_logs_response.go create mode 100644 services/sca/v1betaapi/model_get_overview_response.go create mode 100644 services/sca/v1betaapi/model_list_applications_response.go create mode 100644 services/sca/v1betaapi/model_list_environments_response.go create mode 100644 services/sca/v1betaapi/model_overview_summary.go create mode 100644 services/sca/v1betaapi/model_registry_consumer.go create mode 100644 services/sca/v1betaapi/model_secret_consumer.go create mode 100644 services/sca/v1betaapi/model_update_application_payload.go create mode 100644 services/sca/v1betaapi/model_update_environment_registries_payload.go create mode 100644 services/sca/v1betaapi/model_update_environment_secrets_payload.go create mode 100644 services/sca/v1betaapi/response.go create mode 100644 services/sca/v1betaapi/utils.go diff --git a/services/sca/oas_commit b/services/sca/oas_commit index fa742ff4a1..cdc3a7c3ed 100644 --- a/services/sca/oas_commit +++ b/services/sca/oas_commit @@ -1 +1 @@ -7fd0fb8e513021dfbad1f5ee736785ec72987b40 +c2afb47c530277ab9289d3d54cc32a606a28fd4b diff --git a/services/sca/v1betaapi/api_default.go b/services/sca/v1betaapi/api_default.go new file mode 100644 index 0000000000..1ed6aebe31 --- /dev/null +++ b/services/sca/v1betaapi/api_default.go @@ -0,0 +1,2879 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1betaapi + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +type DefaultAPI interface { + + /* + CreateApplication Creates a new application within an environment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to create the application in. + @param region Region to create the application in. + @param environmentId Environment to create the application in. + @return ApiCreateApplicationRequest + */ + CreateApplication(ctx context.Context, projectId string, region string, environmentId string) ApiCreateApplicationRequest + + // CreateApplicationExecute executes the request + // @return Application + CreateApplicationExecute(r ApiCreateApplicationRequest) (*Application, error) + + /* + CreateEnvironment Creates a new environment within a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to create the environment + @param region Region to place the environment + @return ApiCreateEnvironmentRequest + */ + CreateEnvironment(ctx context.Context, projectId string, region string) ApiCreateEnvironmentRequest + + // CreateEnvironmentExecute executes the request + // @return Environment + CreateEnvironmentExecute(r ApiCreateEnvironmentRequest) (*Environment, error) + + /* + DeleteApplication Deletes an application by resource name. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to delete the application in. + @param region Region to delete the application in. + @param environmentId Environment to delete the application in. + @param applicationId Application id to delete. + @return ApiDeleteApplicationRequest + */ + DeleteApplication(ctx context.Context, projectId string, region string, environmentId string, applicationId string) ApiDeleteApplicationRequest + + // DeleteApplicationExecute executes the request + // @return Application + DeleteApplicationExecute(r ApiDeleteApplicationRequest) (*Application, error) + + /* + GetApplication Retrieves a application by resource name. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to fetch the application from. + @param region Region to fetch the application from. + @param environmentId Environment to fetch the application from. + @param applicationId Application id to fetch. + @return ApiGetApplicationRequest + */ + GetApplication(ctx context.Context, projectId string, region string, environmentId string, applicationId string) ApiGetApplicationRequest + + // GetApplicationExecute executes the request + // @return Application + GetApplicationExecute(r ApiGetApplicationRequest) (*Application, error) + + /* + GetApplicationEvents Retrieves events of an application. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to fetch the application events from. + @param region Region to fetch the application events from. + @param environmentId Environment to fetch the application events from. + @param applicationId Application id to fetch the events. + @return ApiGetApplicationEventsRequest + */ + GetApplicationEvents(ctx context.Context, projectId string, region string, environmentId string, applicationId string) ApiGetApplicationEventsRequest + + // GetApplicationEventsExecute executes the request + // @return GetApplicationEventsResponse + GetApplicationEventsExecute(r ApiGetApplicationEventsRequest) (*GetApplicationEventsResponse, error) + + /* + GetApplicationLogs Retrieves logs of an application. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to fetch the application logs from. + @param region Region to fetch the application logs from. + @param environmentId Environment to fetch the application logs from. + @param applicationId Application id to fetch the logs. + @return ApiGetApplicationLogsRequest + */ + GetApplicationLogs(ctx context.Context, projectId string, region string, environmentId string, applicationId string) ApiGetApplicationLogsRequest + + // GetApplicationLogsExecute executes the request + // @return GetApplicationLogsResponse + GetApplicationLogsExecute(r ApiGetApplicationLogsRequest) (*GetApplicationLogsResponse, error) + + /* + GetEnvironment Retrieves an environment by resource name. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to retrieve the environment + @param region Region to fetch the environment + @param environmentId Environment identifier, for example: default. + @return ApiGetEnvironmentRequest + */ + GetEnvironment(ctx context.Context, projectId string, region string, environmentId string) ApiGetEnvironmentRequest + + // GetEnvironmentExecute executes the request + // @return Environment + GetEnvironmentExecute(r ApiGetEnvironmentRequest) (*Environment, error) + + /* + GetOverview Retrieves an aggregated overview of the project's current state. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to fetch the overview from. + @param region Region to fetch the overview from. + @return ApiGetOverviewRequest + */ + GetOverview(ctx context.Context, projectId string, region string) ApiGetOverviewRequest + + // GetOverviewExecute executes the request + // @return GetOverviewResponse + GetOverviewExecute(r ApiGetOverviewRequest) (*GetOverviewResponse, error) + + /* + ListApplications Lists applications within an environment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to list the applications from. + @param region Region to list the applications from. + @param environmentId Environment to list the applications from. + @return ApiListApplicationsRequest + */ + ListApplications(ctx context.Context, projectId string, region string, environmentId string) ApiListApplicationsRequest + + // ListApplicationsExecute executes the request + // @return ListApplicationsResponse + ListApplicationsExecute(r ApiListApplicationsRequest) (*ListApplicationsResponse, error) + + /* + ListEnvironmentRegistries Retrieves the registries defined within an environment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to fetch the environment registries from. + @param region Region to fetch the environment registries from. + @param environmentId Environment to fetch the environment registries from. + @return ApiListEnvironmentRegistriesRequest + */ + ListEnvironmentRegistries(ctx context.Context, projectId string, region string, environmentId string) ApiListEnvironmentRegistriesRequest + + // ListEnvironmentRegistriesExecute executes the request + // @return EnvironmentRegistriesVault + ListEnvironmentRegistriesExecute(r ApiListEnvironmentRegistriesRequest) (*EnvironmentRegistriesVault, error) + + /* + ListEnvironmentSecrets Retrieves the secrets defined within an environment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to fetch the environment secrets from. + @param region Region to fetch the environment secrets from. + @param environmentId Environment to fetch the environment secrets from. + @return ApiListEnvironmentSecretsRequest + */ + ListEnvironmentSecrets(ctx context.Context, projectId string, region string, environmentId string) ApiListEnvironmentSecretsRequest + + // ListEnvironmentSecretsExecute executes the request + // @return EnvironmentSecretsVault + ListEnvironmentSecretsExecute(r ApiListEnvironmentSecretsRequest) (*EnvironmentSecretsVault, error) + + /* + ListEnvironments Lists environments within a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to list environments from. + @param region Region to fetch the environments from. + @return ApiListEnvironmentsRequest + */ + ListEnvironments(ctx context.Context, projectId string, region string) ApiListEnvironmentsRequest + + // ListEnvironmentsExecute executes the request + // @return ListEnvironmentsResponse + ListEnvironmentsExecute(r ApiListEnvironmentsRequest) (*ListEnvironmentsResponse, error) + + /* + ListProjectApplications Lists applications within a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to list the applications in. + @param region Region to list the applications from. + @return ApiListProjectApplicationsRequest + */ + ListProjectApplications(ctx context.Context, projectId string, region string) ApiListProjectApplicationsRequest + + // ListProjectApplicationsExecute executes the request + // @return ListApplicationsResponse + ListProjectApplicationsExecute(r ApiListProjectApplicationsRequest) (*ListApplicationsResponse, error) + + /* + UpdateApplication Updates an existing application. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to update the application in. + @param region Region to update the application in. + @param environmentId Environment to update the application in. + @param applicationId Application id to update. + @return ApiUpdateApplicationRequest + */ + UpdateApplication(ctx context.Context, projectId string, region string, environmentId string, applicationId string) ApiUpdateApplicationRequest + + // UpdateApplicationExecute executes the request + // @return Application + UpdateApplicationExecute(r ApiUpdateApplicationRequest) (*Application, error) + + /* + UpdateEnvironmentRegistries Updates the environment registries collection. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to update the environment registries in. + @param region Region to update the environment registries from. + @param environmentId Environment to update the environment registries in. + @return ApiUpdateEnvironmentRegistriesRequest + */ + UpdateEnvironmentRegistries(ctx context.Context, projectId string, region string, environmentId string) ApiUpdateEnvironmentRegistriesRequest + + // UpdateEnvironmentRegistriesExecute executes the request + // @return EnvironmentRegistriesVault + UpdateEnvironmentRegistriesExecute(r ApiUpdateEnvironmentRegistriesRequest) (*EnvironmentRegistriesVault, error) + + /* + UpdateEnvironmentSecrets Updates the environment secrets collection. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to update the environment secrets in. + @param region Region to update the environment secrets from. + @param environmentId Environment to update the environment secrets in. + @return ApiUpdateEnvironmentSecretsRequest + */ + UpdateEnvironmentSecrets(ctx context.Context, projectId string, region string, environmentId string) ApiUpdateEnvironmentSecretsRequest + + // UpdateEnvironmentSecretsExecute executes the request + // @return EnvironmentSecretsVault + UpdateEnvironmentSecretsExecute(r ApiUpdateEnvironmentSecretsRequest) (*EnvironmentSecretsVault, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiCreateApplicationRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + environmentId string + createApplicationPayload *CreateApplicationPayload +} + +// Application to create. +func (r ApiCreateApplicationRequest) CreateApplicationPayload(createApplicationPayload CreateApplicationPayload) ApiCreateApplicationRequest { + r.createApplicationPayload = &createApplicationPayload + return r +} + +func (r ApiCreateApplicationRequest) Execute() (*Application, error) { + return r.ApiService.CreateApplicationExecute(r) +} + +/* +CreateApplication Creates a new application within an environment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to create the application in. + @param region Region to create the application in. + @param environmentId Environment to create the application in. + @return ApiCreateApplicationRequest +*/ +func (a *DefaultAPIService) CreateApplication(ctx context.Context, projectId string, region string, environmentId string) ApiCreateApplicationRequest { + return ApiCreateApplicationRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + } +} + +// Execute executes the request +// +// @return Application +func (a *DefaultAPIService) CreateApplicationExecute(r ApiCreateApplicationRequest) (*Application, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Application + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateApplication") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/environments/{environmentId}/applications" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"environmentId"+"}", url.PathEscape(parameterValueToString(r.environmentId, "environmentId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createApplicationPayload == nil { + return localVarReturnValue, reportError("createApplicationPayload 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.createApplicationPayload + 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 ApiErrorResponse + 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 ApiErrorResponse + 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 ApiErrorResponse + 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 >= 400 && localVarHTTPResponse.StatusCode < 500 { + var v ApiErrorResponse + 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 ApiCreateEnvironmentRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createEnvironmentPayload *CreateEnvironmentPayload +} + +// Environment to create. +func (r ApiCreateEnvironmentRequest) CreateEnvironmentPayload(createEnvironmentPayload CreateEnvironmentPayload) ApiCreateEnvironmentRequest { + r.createEnvironmentPayload = &createEnvironmentPayload + return r +} + +func (r ApiCreateEnvironmentRequest) Execute() (*Environment, error) { + return r.ApiService.CreateEnvironmentExecute(r) +} + +/* +CreateEnvironment Creates a new environment within a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to create the environment + @param region Region to place the environment + @return ApiCreateEnvironmentRequest +*/ +func (a *DefaultAPIService) CreateEnvironment(ctx context.Context, projectId string, region string) ApiCreateEnvironmentRequest { + return ApiCreateEnvironmentRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return Environment +func (a *DefaultAPIService) CreateEnvironmentExecute(r ApiCreateEnvironmentRequest) (*Environment, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Environment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateEnvironment") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/environments" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createEnvironmentPayload == nil { + return localVarReturnValue, reportError("createEnvironmentPayload 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.createEnvironmentPayload + 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 ApiErrorResponse + 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 ApiErrorResponse + 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 ApiErrorResponse + 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 >= 400 && localVarHTTPResponse.StatusCode < 500 { + var v ApiErrorResponse + 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 ApiDeleteApplicationRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + environmentId string + applicationId string +} + +func (r ApiDeleteApplicationRequest) Execute() (*Application, error) { + return r.ApiService.DeleteApplicationExecute(r) +} + +/* +DeleteApplication Deletes an application by resource name. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to delete the application in. + @param region Region to delete the application in. + @param environmentId Environment to delete the application in. + @param applicationId Application id to delete. + @return ApiDeleteApplicationRequest +*/ +func (a *DefaultAPIService) DeleteApplication(ctx context.Context, projectId string, region string, environmentId string, applicationId string) ApiDeleteApplicationRequest { + return ApiDeleteApplicationRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + applicationId: applicationId, + } +} + +// Execute executes the request +// +// @return Application +func (a *DefaultAPIService) DeleteApplicationExecute(r ApiDeleteApplicationRequest) (*Application, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Application + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteApplication") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/environments/{environmentId}/applications/{applicationId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"environmentId"+"}", url.PathEscape(parameterValueToString(r.environmentId, "environmentId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"applicationId"+"}", url.PathEscape(parameterValueToString(r.applicationId, "applicationId")), -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 == 401 { + var v ApiErrorResponse + 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 ApiErrorResponse + 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 >= 400 && localVarHTTPResponse.StatusCode < 500 { + var v ApiErrorResponse + 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 ApiGetApplicationRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + environmentId string + applicationId string +} + +func (r ApiGetApplicationRequest) Execute() (*Application, error) { + return r.ApiService.GetApplicationExecute(r) +} + +/* +GetApplication Retrieves a application by resource name. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to fetch the application from. + @param region Region to fetch the application from. + @param environmentId Environment to fetch the application from. + @param applicationId Application id to fetch. + @return ApiGetApplicationRequest +*/ +func (a *DefaultAPIService) GetApplication(ctx context.Context, projectId string, region string, environmentId string, applicationId string) ApiGetApplicationRequest { + return ApiGetApplicationRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + applicationId: applicationId, + } +} + +// Execute executes the request +// +// @return Application +func (a *DefaultAPIService) GetApplicationExecute(r ApiGetApplicationRequest) (*Application, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Application + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetApplication") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/environments/{environmentId}/applications/{applicationId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"environmentId"+"}", url.PathEscape(parameterValueToString(r.environmentId, "environmentId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"applicationId"+"}", url.PathEscape(parameterValueToString(r.applicationId, "applicationId")), -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 == 401 { + var v ApiErrorResponse + 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 ApiErrorResponse + 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 >= 400 && localVarHTTPResponse.StatusCode < 500 { + var v ApiErrorResponse + 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 ApiGetApplicationEventsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + environmentId string + applicationId string +} + +func (r ApiGetApplicationEventsRequest) Execute() (*GetApplicationEventsResponse, error) { + return r.ApiService.GetApplicationEventsExecute(r) +} + +/* +GetApplicationEvents Retrieves events of an application. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to fetch the application events from. + @param region Region to fetch the application events from. + @param environmentId Environment to fetch the application events from. + @param applicationId Application id to fetch the events. + @return ApiGetApplicationEventsRequest +*/ +func (a *DefaultAPIService) GetApplicationEvents(ctx context.Context, projectId string, region string, environmentId string, applicationId string) ApiGetApplicationEventsRequest { + return ApiGetApplicationEventsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + applicationId: applicationId, + } +} + +// Execute executes the request +// +// @return GetApplicationEventsResponse +func (a *DefaultAPIService) GetApplicationEventsExecute(r ApiGetApplicationEventsRequest) (*GetApplicationEventsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetApplicationEventsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetApplicationEvents") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/environments/{environmentId}/applications/{applicationId}/events" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"environmentId"+"}", url.PathEscape(parameterValueToString(r.environmentId, "environmentId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"applicationId"+"}", url.PathEscape(parameterValueToString(r.applicationId, "applicationId")), -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 == 401 { + var v ApiErrorResponse + 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 ApiErrorResponse + 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 >= 400 && localVarHTTPResponse.StatusCode < 500 { + var v ApiErrorResponse + 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 ApiGetApplicationLogsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + environmentId string + applicationId string + instance *string + container *string + previous *bool +} + +// Instance name of the application. +func (r ApiGetApplicationLogsRequest) Instance(instance string) ApiGetApplicationLogsRequest { + r.instance = &instance + return r +} + +// Container name to collect logs. +func (r ApiGetApplicationLogsRequest) Container(container string) ApiGetApplicationLogsRequest { + r.container = &container + return r +} + +// Get previous failed execution of the container. +func (r ApiGetApplicationLogsRequest) Previous(previous bool) ApiGetApplicationLogsRequest { + r.previous = &previous + return r +} + +func (r ApiGetApplicationLogsRequest) Execute() (*GetApplicationLogsResponse, error) { + return r.ApiService.GetApplicationLogsExecute(r) +} + +/* +GetApplicationLogs Retrieves logs of an application. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to fetch the application logs from. + @param region Region to fetch the application logs from. + @param environmentId Environment to fetch the application logs from. + @param applicationId Application id to fetch the logs. + @return ApiGetApplicationLogsRequest +*/ +func (a *DefaultAPIService) GetApplicationLogs(ctx context.Context, projectId string, region string, environmentId string, applicationId string) ApiGetApplicationLogsRequest { + return ApiGetApplicationLogsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + applicationId: applicationId, + } +} + +// Execute executes the request +// +// @return GetApplicationLogsResponse +func (a *DefaultAPIService) GetApplicationLogsExecute(r ApiGetApplicationLogsRequest) (*GetApplicationLogsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetApplicationLogsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetApplicationLogs") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/environments/{environmentId}/applications/{applicationId}/logs" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"environmentId"+"}", url.PathEscape(parameterValueToString(r.environmentId, "environmentId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"applicationId"+"}", url.PathEscape(parameterValueToString(r.applicationId, "applicationId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.instance == nil { + return localVarReturnValue, reportError("instance is required and must be specified") + } + if r.container == nil { + return localVarReturnValue, reportError("container is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "instance", r.instance, "form", "") + parameterAddToHeaderOrQuery(localVarQueryParams, "container", r.container, "form", "") + if r.previous != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "previous", r.previous, "form", "") + } + // 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 ApiErrorResponse + 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 ApiErrorResponse + 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 ApiErrorResponse + 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 >= 400 && localVarHTTPResponse.StatusCode < 500 { + var v ApiErrorResponse + 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 ApiGetEnvironmentRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + environmentId string +} + +func (r ApiGetEnvironmentRequest) Execute() (*Environment, error) { + return r.ApiService.GetEnvironmentExecute(r) +} + +/* +GetEnvironment Retrieves an environment by resource name. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to retrieve the environment + @param region Region to fetch the environment + @param environmentId Environment identifier, for example: default. + @return ApiGetEnvironmentRequest +*/ +func (a *DefaultAPIService) GetEnvironment(ctx context.Context, projectId string, region string, environmentId string) ApiGetEnvironmentRequest { + return ApiGetEnvironmentRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + } +} + +// Execute executes the request +// +// @return Environment +func (a *DefaultAPIService) GetEnvironmentExecute(r ApiGetEnvironmentRequest) (*Environment, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Environment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetEnvironment") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/environments/{environmentId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"environmentId"+"}", url.PathEscape(parameterValueToString(r.environmentId, "environmentId")), -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 == 401 { + var v ApiErrorResponse + 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 ApiErrorResponse + 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 >= 400 && localVarHTTPResponse.StatusCode < 500 { + var v ApiErrorResponse + 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 ApiGetOverviewRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string +} + +func (r ApiGetOverviewRequest) Execute() (*GetOverviewResponse, error) { + return r.ApiService.GetOverviewExecute(r) +} + +/* +GetOverview Retrieves an aggregated overview of the project's current state. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to fetch the overview from. + @param region Region to fetch the overview from. + @return ApiGetOverviewRequest +*/ +func (a *DefaultAPIService) GetOverview(ctx context.Context, projectId string, region string) ApiGetOverviewRequest { + return ApiGetOverviewRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return GetOverviewResponse +func (a *DefaultAPIService) GetOverviewExecute(r ApiGetOverviewRequest) (*GetOverviewResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetOverviewResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetOverview") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/overview" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -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 == 401 { + var v ApiErrorResponse + 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 >= 400 && localVarHTTPResponse.StatusCode < 500 { + var v ApiErrorResponse + 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 ApiListApplicationsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + environmentId string +} + +func (r ApiListApplicationsRequest) Execute() (*ListApplicationsResponse, error) { + return r.ApiService.ListApplicationsExecute(r) +} + +/* +ListApplications Lists applications within an environment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to list the applications from. + @param region Region to list the applications from. + @param environmentId Environment to list the applications from. + @return ApiListApplicationsRequest +*/ +func (a *DefaultAPIService) ListApplications(ctx context.Context, projectId string, region string, environmentId string) ApiListApplicationsRequest { + return ApiListApplicationsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + } +} + +// Execute executes the request +// +// @return ListApplicationsResponse +func (a *DefaultAPIService) ListApplicationsExecute(r ApiListApplicationsRequest) (*ListApplicationsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListApplicationsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListApplications") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/environments/{environmentId}/applications" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"environmentId"+"}", url.PathEscape(parameterValueToString(r.environmentId, "environmentId")), -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 ApiErrorResponse + 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 ApiErrorResponse + 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 >= 400 && localVarHTTPResponse.StatusCode < 500 { + var v ApiErrorResponse + 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 ApiListEnvironmentRegistriesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + environmentId string +} + +func (r ApiListEnvironmentRegistriesRequest) Execute() (*EnvironmentRegistriesVault, error) { + return r.ApiService.ListEnvironmentRegistriesExecute(r) +} + +/* +ListEnvironmentRegistries Retrieves the registries defined within an environment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to fetch the environment registries from. + @param region Region to fetch the environment registries from. + @param environmentId Environment to fetch the environment registries from. + @return ApiListEnvironmentRegistriesRequest +*/ +func (a *DefaultAPIService) ListEnvironmentRegistries(ctx context.Context, projectId string, region string, environmentId string) ApiListEnvironmentRegistriesRequest { + return ApiListEnvironmentRegistriesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + } +} + +// Execute executes the request +// +// @return EnvironmentRegistriesVault +func (a *DefaultAPIService) ListEnvironmentRegistriesExecute(r ApiListEnvironmentRegistriesRequest) (*EnvironmentRegistriesVault, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EnvironmentRegistriesVault + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListEnvironmentRegistries") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/environments/{environmentId}/registries" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"environmentId"+"}", url.PathEscape(parameterValueToString(r.environmentId, "environmentId")), -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 == 401 { + var v ApiErrorResponse + 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 ApiErrorResponse + 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 >= 400 && localVarHTTPResponse.StatusCode < 500 { + var v ApiErrorResponse + 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 ApiListEnvironmentSecretsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + environmentId string +} + +func (r ApiListEnvironmentSecretsRequest) Execute() (*EnvironmentSecretsVault, error) { + return r.ApiService.ListEnvironmentSecretsExecute(r) +} + +/* +ListEnvironmentSecrets Retrieves the secrets defined within an environment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to fetch the environment secrets from. + @param region Region to fetch the environment secrets from. + @param environmentId Environment to fetch the environment secrets from. + @return ApiListEnvironmentSecretsRequest +*/ +func (a *DefaultAPIService) ListEnvironmentSecrets(ctx context.Context, projectId string, region string, environmentId string) ApiListEnvironmentSecretsRequest { + return ApiListEnvironmentSecretsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + } +} + +// Execute executes the request +// +// @return EnvironmentSecretsVault +func (a *DefaultAPIService) ListEnvironmentSecretsExecute(r ApiListEnvironmentSecretsRequest) (*EnvironmentSecretsVault, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EnvironmentSecretsVault + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListEnvironmentSecrets") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/environments/{environmentId}/secrets" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"environmentId"+"}", url.PathEscape(parameterValueToString(r.environmentId, "environmentId")), -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 == 401 { + var v ApiErrorResponse + 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 ApiErrorResponse + 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 >= 400 && localVarHTTPResponse.StatusCode < 500 { + var v ApiErrorResponse + 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 ApiListEnvironmentsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string +} + +func (r ApiListEnvironmentsRequest) Execute() (*ListEnvironmentsResponse, error) { + return r.ApiService.ListEnvironmentsExecute(r) +} + +/* +ListEnvironments Lists environments within a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to list environments from. + @param region Region to fetch the environments from. + @return ApiListEnvironmentsRequest +*/ +func (a *DefaultAPIService) ListEnvironments(ctx context.Context, projectId string, region string) ApiListEnvironmentsRequest { + return ApiListEnvironmentsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return ListEnvironmentsResponse +func (a *DefaultAPIService) ListEnvironmentsExecute(r ApiListEnvironmentsRequest) (*ListEnvironmentsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListEnvironmentsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListEnvironments") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/environments" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -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 ApiErrorResponse + 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 ApiErrorResponse + 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 >= 400 && localVarHTTPResponse.StatusCode < 500 { + var v ApiErrorResponse + 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 ApiListProjectApplicationsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string +} + +func (r ApiListProjectApplicationsRequest) Execute() (*ListApplicationsResponse, error) { + return r.ApiService.ListProjectApplicationsExecute(r) +} + +/* +ListProjectApplications Lists applications within a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to list the applications in. + @param region Region to list the applications from. + @return ApiListProjectApplicationsRequest +*/ +func (a *DefaultAPIService) ListProjectApplications(ctx context.Context, projectId string, region string) ApiListProjectApplicationsRequest { + return ApiListProjectApplicationsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return ListApplicationsResponse +func (a *DefaultAPIService) ListProjectApplicationsExecute(r ApiListProjectApplicationsRequest) (*ListApplicationsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListApplicationsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListProjectApplications") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/applications" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -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 ApiErrorResponse + 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 ApiErrorResponse + 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 >= 400 && localVarHTTPResponse.StatusCode < 500 { + var v ApiErrorResponse + 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 ApiUpdateApplicationRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + environmentId string + applicationId string + updateApplicationPayload *UpdateApplicationPayload +} + +// The application to update. +func (r ApiUpdateApplicationRequest) UpdateApplicationPayload(updateApplicationPayload UpdateApplicationPayload) ApiUpdateApplicationRequest { + r.updateApplicationPayload = &updateApplicationPayload + return r +} + +func (r ApiUpdateApplicationRequest) Execute() (*Application, error) { + return r.ApiService.UpdateApplicationExecute(r) +} + +/* +UpdateApplication Updates an existing application. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to update the application in. + @param region Region to update the application in. + @param environmentId Environment to update the application in. + @param applicationId Application id to update. + @return ApiUpdateApplicationRequest +*/ +func (a *DefaultAPIService) UpdateApplication(ctx context.Context, projectId string, region string, environmentId string, applicationId string) ApiUpdateApplicationRequest { + return ApiUpdateApplicationRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + applicationId: applicationId, + } +} + +// Execute executes the request +// +// @return Application +func (a *DefaultAPIService) UpdateApplicationExecute(r ApiUpdateApplicationRequest) (*Application, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Application + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateApplication") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/environments/{environmentId}/applications/{applicationId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"environmentId"+"}", url.PathEscape(parameterValueToString(r.environmentId, "environmentId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"applicationId"+"}", url.PathEscape(parameterValueToString(r.applicationId, "applicationId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateApplicationPayload == nil { + return localVarReturnValue, reportError("updateApplicationPayload 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.updateApplicationPayload + 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 ApiErrorResponse + 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 ApiErrorResponse + 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 ApiErrorResponse + 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 ApiErrorResponse + 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 >= 400 && localVarHTTPResponse.StatusCode < 500 { + var v ApiErrorResponse + 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 ApiUpdateEnvironmentRegistriesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + environmentId string + updateEnvironmentRegistriesPayload *UpdateEnvironmentRegistriesPayload +} + +// The subset of registries to merge or replace in the vault. +func (r ApiUpdateEnvironmentRegistriesRequest) UpdateEnvironmentRegistriesPayload(updateEnvironmentRegistriesPayload UpdateEnvironmentRegistriesPayload) ApiUpdateEnvironmentRegistriesRequest { + r.updateEnvironmentRegistriesPayload = &updateEnvironmentRegistriesPayload + return r +} + +func (r ApiUpdateEnvironmentRegistriesRequest) Execute() (*EnvironmentRegistriesVault, error) { + return r.ApiService.UpdateEnvironmentRegistriesExecute(r) +} + +/* +UpdateEnvironmentRegistries Updates the environment registries collection. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to update the environment registries in. + @param region Region to update the environment registries from. + @param environmentId Environment to update the environment registries in. + @return ApiUpdateEnvironmentRegistriesRequest +*/ +func (a *DefaultAPIService) UpdateEnvironmentRegistries(ctx context.Context, projectId string, region string, environmentId string) ApiUpdateEnvironmentRegistriesRequest { + return ApiUpdateEnvironmentRegistriesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + } +} + +// Execute executes the request +// +// @return EnvironmentRegistriesVault +func (a *DefaultAPIService) UpdateEnvironmentRegistriesExecute(r ApiUpdateEnvironmentRegistriesRequest) (*EnvironmentRegistriesVault, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EnvironmentRegistriesVault + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateEnvironmentRegistries") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/environments/{environmentId}/registries" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"environmentId"+"}", url.PathEscape(parameterValueToString(r.environmentId, "environmentId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateEnvironmentRegistriesPayload == nil { + return localVarReturnValue, reportError("updateEnvironmentRegistriesPayload 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.updateEnvironmentRegistriesPayload + 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 ApiErrorResponse + 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 ApiErrorResponse + 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 ApiErrorResponse + 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 >= 400 && localVarHTTPResponse.StatusCode < 500 { + var v ApiErrorResponse + 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 ApiUpdateEnvironmentSecretsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + environmentId string + updateEnvironmentSecretsPayload *UpdateEnvironmentSecretsPayload +} + +// The subset of secrets to merge or replace in the vault. +func (r ApiUpdateEnvironmentSecretsRequest) UpdateEnvironmentSecretsPayload(updateEnvironmentSecretsPayload UpdateEnvironmentSecretsPayload) ApiUpdateEnvironmentSecretsRequest { + r.updateEnvironmentSecretsPayload = &updateEnvironmentSecretsPayload + return r +} + +func (r ApiUpdateEnvironmentSecretsRequest) Execute() (*EnvironmentSecretsVault, error) { + return r.ApiService.UpdateEnvironmentSecretsExecute(r) +} + +/* +UpdateEnvironmentSecrets Updates the environment secrets collection. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project to update the environment secrets in. + @param region Region to update the environment secrets from. + @param environmentId Environment to update the environment secrets in. + @return ApiUpdateEnvironmentSecretsRequest +*/ +func (a *DefaultAPIService) UpdateEnvironmentSecrets(ctx context.Context, projectId string, region string, environmentId string) ApiUpdateEnvironmentSecretsRequest { + return ApiUpdateEnvironmentSecretsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + } +} + +// Execute executes the request +// +// @return EnvironmentSecretsVault +func (a *DefaultAPIService) UpdateEnvironmentSecretsExecute(r ApiUpdateEnvironmentSecretsRequest) (*EnvironmentSecretsVault, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EnvironmentSecretsVault + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateEnvironmentSecrets") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/regions/{region}/environments/{environmentId}/secrets" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"environmentId"+"}", url.PathEscape(parameterValueToString(r.environmentId, "environmentId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateEnvironmentSecretsPayload == nil { + return localVarReturnValue, reportError("updateEnvironmentSecretsPayload 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.updateEnvironmentSecretsPayload + 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 ApiErrorResponse + 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 ApiErrorResponse + 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 ApiErrorResponse + 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 >= 400 && localVarHTTPResponse.StatusCode < 500 { + var v ApiErrorResponse + 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/sca/v1betaapi/api_default_mock.go b/services/sca/v1betaapi/api_default_mock.go new file mode 100644 index 0000000000..d568cf771b --- /dev/null +++ b/services/sca/v1betaapi/api_default_mock.go @@ -0,0 +1,376 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "context" +) + +// 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 { + // CreateApplicationExecuteMock can be populated to implement the behavior of the CreateApplicationExecute function of this mock + CreateApplicationExecuteMock *func(r ApiCreateApplicationRequest) (*Application, error) + // CreateEnvironmentExecuteMock can be populated to implement the behavior of the CreateEnvironmentExecute function of this mock + CreateEnvironmentExecuteMock *func(r ApiCreateEnvironmentRequest) (*Environment, error) + // DeleteApplicationExecuteMock can be populated to implement the behavior of the DeleteApplicationExecute function of this mock + DeleteApplicationExecuteMock *func(r ApiDeleteApplicationRequest) (*Application, error) + // GetApplicationExecuteMock can be populated to implement the behavior of the GetApplicationExecute function of this mock + GetApplicationExecuteMock *func(r ApiGetApplicationRequest) (*Application, error) + // GetApplicationEventsExecuteMock can be populated to implement the behavior of the GetApplicationEventsExecute function of this mock + GetApplicationEventsExecuteMock *func(r ApiGetApplicationEventsRequest) (*GetApplicationEventsResponse, error) + // GetApplicationLogsExecuteMock can be populated to implement the behavior of the GetApplicationLogsExecute function of this mock + GetApplicationLogsExecuteMock *func(r ApiGetApplicationLogsRequest) (*GetApplicationLogsResponse, error) + // GetEnvironmentExecuteMock can be populated to implement the behavior of the GetEnvironmentExecute function of this mock + GetEnvironmentExecuteMock *func(r ApiGetEnvironmentRequest) (*Environment, error) + // GetOverviewExecuteMock can be populated to implement the behavior of the GetOverviewExecute function of this mock + GetOverviewExecuteMock *func(r ApiGetOverviewRequest) (*GetOverviewResponse, error) + // ListApplicationsExecuteMock can be populated to implement the behavior of the ListApplicationsExecute function of this mock + ListApplicationsExecuteMock *func(r ApiListApplicationsRequest) (*ListApplicationsResponse, error) + // ListEnvironmentRegistriesExecuteMock can be populated to implement the behavior of the ListEnvironmentRegistriesExecute function of this mock + ListEnvironmentRegistriesExecuteMock *func(r ApiListEnvironmentRegistriesRequest) (*EnvironmentRegistriesVault, error) + // ListEnvironmentSecretsExecuteMock can be populated to implement the behavior of the ListEnvironmentSecretsExecute function of this mock + ListEnvironmentSecretsExecuteMock *func(r ApiListEnvironmentSecretsRequest) (*EnvironmentSecretsVault, error) + // ListEnvironmentsExecuteMock can be populated to implement the behavior of the ListEnvironmentsExecute function of this mock + ListEnvironmentsExecuteMock *func(r ApiListEnvironmentsRequest) (*ListEnvironmentsResponse, error) + // ListProjectApplicationsExecuteMock can be populated to implement the behavior of the ListProjectApplicationsExecute function of this mock + ListProjectApplicationsExecuteMock *func(r ApiListProjectApplicationsRequest) (*ListApplicationsResponse, error) + // UpdateApplicationExecuteMock can be populated to implement the behavior of the UpdateApplicationExecute function of this mock + UpdateApplicationExecuteMock *func(r ApiUpdateApplicationRequest) (*Application, error) + // UpdateEnvironmentRegistriesExecuteMock can be populated to implement the behavior of the UpdateEnvironmentRegistriesExecute function of this mock + UpdateEnvironmentRegistriesExecuteMock *func(r ApiUpdateEnvironmentRegistriesRequest) (*EnvironmentRegistriesVault, error) + // UpdateEnvironmentSecretsExecuteMock can be populated to implement the behavior of the UpdateEnvironmentSecretsExecute function of this mock + UpdateEnvironmentSecretsExecuteMock *func(r ApiUpdateEnvironmentSecretsRequest) (*EnvironmentSecretsVault, error) +} + +func (a DefaultAPIServiceMock) CreateApplication(ctx context.Context, projectId string, region string, environmentId string) ApiCreateApplicationRequest { + return ApiCreateApplicationRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + } +} + +// CreateApplicationExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateApplicationExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateApplicationExecute(r ApiCreateApplicationRequest) (*Application, error) { + if a.CreateApplicationExecuteMock == nil { + var localVarReturnValue *Application + return localVarReturnValue, nil + } + + return (*a.CreateApplicationExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateEnvironment(ctx context.Context, projectId string, region string) ApiCreateEnvironmentRequest { + return ApiCreateEnvironmentRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateEnvironmentExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateEnvironmentExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateEnvironmentExecute(r ApiCreateEnvironmentRequest) (*Environment, error) { + if a.CreateEnvironmentExecuteMock == nil { + var localVarReturnValue *Environment + return localVarReturnValue, nil + } + + return (*a.CreateEnvironmentExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteApplication(ctx context.Context, projectId string, region string, environmentId string, applicationId string) ApiDeleteApplicationRequest { + return ApiDeleteApplicationRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + applicationId: applicationId, + } +} + +// DeleteApplicationExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteApplicationExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteApplicationExecute(r ApiDeleteApplicationRequest) (*Application, error) { + if a.DeleteApplicationExecuteMock == nil { + var localVarReturnValue *Application + return localVarReturnValue, nil + } + + return (*a.DeleteApplicationExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetApplication(ctx context.Context, projectId string, region string, environmentId string, applicationId string) ApiGetApplicationRequest { + return ApiGetApplicationRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + applicationId: applicationId, + } +} + +// GetApplicationExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetApplicationExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetApplicationExecute(r ApiGetApplicationRequest) (*Application, error) { + if a.GetApplicationExecuteMock == nil { + var localVarReturnValue *Application + return localVarReturnValue, nil + } + + return (*a.GetApplicationExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetApplicationEvents(ctx context.Context, projectId string, region string, environmentId string, applicationId string) ApiGetApplicationEventsRequest { + return ApiGetApplicationEventsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + applicationId: applicationId, + } +} + +// GetApplicationEventsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetApplicationEventsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetApplicationEventsExecute(r ApiGetApplicationEventsRequest) (*GetApplicationEventsResponse, error) { + if a.GetApplicationEventsExecuteMock == nil { + var localVarReturnValue *GetApplicationEventsResponse + return localVarReturnValue, nil + } + + return (*a.GetApplicationEventsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetApplicationLogs(ctx context.Context, projectId string, region string, environmentId string, applicationId string) ApiGetApplicationLogsRequest { + return ApiGetApplicationLogsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + applicationId: applicationId, + } +} + +// GetApplicationLogsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetApplicationLogsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetApplicationLogsExecute(r ApiGetApplicationLogsRequest) (*GetApplicationLogsResponse, error) { + if a.GetApplicationLogsExecuteMock == nil { + var localVarReturnValue *GetApplicationLogsResponse + return localVarReturnValue, nil + } + + return (*a.GetApplicationLogsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetEnvironment(ctx context.Context, projectId string, region string, environmentId string) ApiGetEnvironmentRequest { + return ApiGetEnvironmentRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + } +} + +// GetEnvironmentExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetEnvironmentExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetEnvironmentExecute(r ApiGetEnvironmentRequest) (*Environment, error) { + if a.GetEnvironmentExecuteMock == nil { + var localVarReturnValue *Environment + return localVarReturnValue, nil + } + + return (*a.GetEnvironmentExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetOverview(ctx context.Context, projectId string, region string) ApiGetOverviewRequest { + return ApiGetOverviewRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// GetOverviewExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetOverviewExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetOverviewExecute(r ApiGetOverviewRequest) (*GetOverviewResponse, error) { + if a.GetOverviewExecuteMock == nil { + var localVarReturnValue *GetOverviewResponse + return localVarReturnValue, nil + } + + return (*a.GetOverviewExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListApplications(ctx context.Context, projectId string, region string, environmentId string) ApiListApplicationsRequest { + return ApiListApplicationsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + } +} + +// ListApplicationsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListApplicationsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListApplicationsExecute(r ApiListApplicationsRequest) (*ListApplicationsResponse, error) { + if a.ListApplicationsExecuteMock == nil { + var localVarReturnValue *ListApplicationsResponse + return localVarReturnValue, nil + } + + return (*a.ListApplicationsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListEnvironmentRegistries(ctx context.Context, projectId string, region string, environmentId string) ApiListEnvironmentRegistriesRequest { + return ApiListEnvironmentRegistriesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + } +} + +// ListEnvironmentRegistriesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListEnvironmentRegistriesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListEnvironmentRegistriesExecute(r ApiListEnvironmentRegistriesRequest) (*EnvironmentRegistriesVault, error) { + if a.ListEnvironmentRegistriesExecuteMock == nil { + var localVarReturnValue *EnvironmentRegistriesVault + return localVarReturnValue, nil + } + + return (*a.ListEnvironmentRegistriesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListEnvironmentSecrets(ctx context.Context, projectId string, region string, environmentId string) ApiListEnvironmentSecretsRequest { + return ApiListEnvironmentSecretsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + } +} + +// ListEnvironmentSecretsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListEnvironmentSecretsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListEnvironmentSecretsExecute(r ApiListEnvironmentSecretsRequest) (*EnvironmentSecretsVault, error) { + if a.ListEnvironmentSecretsExecuteMock == nil { + var localVarReturnValue *EnvironmentSecretsVault + return localVarReturnValue, nil + } + + return (*a.ListEnvironmentSecretsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListEnvironments(ctx context.Context, projectId string, region string) ApiListEnvironmentsRequest { + return ApiListEnvironmentsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListEnvironmentsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListEnvironmentsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListEnvironmentsExecute(r ApiListEnvironmentsRequest) (*ListEnvironmentsResponse, error) { + if a.ListEnvironmentsExecuteMock == nil { + var localVarReturnValue *ListEnvironmentsResponse + return localVarReturnValue, nil + } + + return (*a.ListEnvironmentsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListProjectApplications(ctx context.Context, projectId string, region string) ApiListProjectApplicationsRequest { + return ApiListProjectApplicationsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListProjectApplicationsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListProjectApplicationsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListProjectApplicationsExecute(r ApiListProjectApplicationsRequest) (*ListApplicationsResponse, error) { + if a.ListProjectApplicationsExecuteMock == nil { + var localVarReturnValue *ListApplicationsResponse + return localVarReturnValue, nil + } + + return (*a.ListProjectApplicationsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateApplication(ctx context.Context, projectId string, region string, environmentId string, applicationId string) ApiUpdateApplicationRequest { + return ApiUpdateApplicationRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + applicationId: applicationId, + } +} + +// UpdateApplicationExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateApplicationExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateApplicationExecute(r ApiUpdateApplicationRequest) (*Application, error) { + if a.UpdateApplicationExecuteMock == nil { + var localVarReturnValue *Application + return localVarReturnValue, nil + } + + return (*a.UpdateApplicationExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateEnvironmentRegistries(ctx context.Context, projectId string, region string, environmentId string) ApiUpdateEnvironmentRegistriesRequest { + return ApiUpdateEnvironmentRegistriesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + } +} + +// UpdateEnvironmentRegistriesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateEnvironmentRegistriesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateEnvironmentRegistriesExecute(r ApiUpdateEnvironmentRegistriesRequest) (*EnvironmentRegistriesVault, error) { + if a.UpdateEnvironmentRegistriesExecuteMock == nil { + var localVarReturnValue *EnvironmentRegistriesVault + return localVarReturnValue, nil + } + + return (*a.UpdateEnvironmentRegistriesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateEnvironmentSecrets(ctx context.Context, projectId string, region string, environmentId string) ApiUpdateEnvironmentSecretsRequest { + return ApiUpdateEnvironmentSecretsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + environmentId: environmentId, + } +} + +// UpdateEnvironmentSecretsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateEnvironmentSecretsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateEnvironmentSecretsExecute(r ApiUpdateEnvironmentSecretsRequest) (*EnvironmentSecretsVault, error) { + if a.UpdateEnvironmentSecretsExecuteMock == nil { + var localVarReturnValue *EnvironmentSecretsVault + return localVarReturnValue, nil + } + + return (*a.UpdateEnvironmentSecretsExecuteMock)(r) +} diff --git a/services/sca/v1betaapi/client.go b/services/sca/v1betaapi/client.go new file mode 100644 index 0000000000..13a0e745c8 --- /dev/null +++ b/services/sca/v1betaapi/client.go @@ -0,0 +1,667 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1betaapi + +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 Container Applications (SCA) API v1beta.0.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 r, ok := v.(*io.Reader); ok { + *r = bytes.NewReader(b) + return nil + } + // Must stay before the JSON branch: json.Unmarshal would base64-decode into *[]byte. + if p, ok := v.(*[]byte); ok { + *p = 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/sca/v1betaapi/configuration.go b/services/sca/v1betaapi/configuration.go new file mode 100644 index 0000000000..80f1db037a --- /dev/null +++ b/services/sca/v1betaapi/configuration.go @@ -0,0 +1,40 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1betaapi + +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/sca", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://sca.api.{region}stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "eu01.", + EnumValues: []string{ + "eu01.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/sca/v1betaapi/model_api_error_response.go b/services/sca/v1betaapi/model_api_error_response.go new file mode 100644 index 0000000000..b1d9dbd30f --- /dev/null +++ b/services/sca/v1betaapi/model_api_error_response.go @@ -0,0 +1,192 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the ApiErrorResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApiErrorResponse{} + +// ApiErrorResponse ApiErrorResponse represents a standard error response from the API. +type ApiErrorResponse struct { + // The HTTP status code or internal error code. + Code *int32 `json:"code,omitempty"` + // A human-readable error message. + Message *string `json:"message,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ApiErrorResponse ApiErrorResponse + +// NewApiErrorResponse instantiates a new ApiErrorResponse 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 NewApiErrorResponse() *ApiErrorResponse { + this := ApiErrorResponse{} + return &this +} + +// NewApiErrorResponseWithDefaults instantiates a new ApiErrorResponse 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 NewApiErrorResponseWithDefaults() *ApiErrorResponse { + this := ApiErrorResponse{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *ApiErrorResponse) GetCode() int32 { + if o == nil || IsNil(o.Code) { + var ret int32 + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiErrorResponse) GetCodeOk() (*int32, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *ApiErrorResponse) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given int32 and assigns it to the Code field. +func (o *ApiErrorResponse) SetCode(v int32) { + o.Code = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *ApiErrorResponse) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiErrorResponse) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *ApiErrorResponse) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *ApiErrorResponse) SetMessage(v string) { + o.Message = &v +} + +func (o ApiErrorResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApiErrorResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ApiErrorResponse) UnmarshalJSON(data []byte) (err error) { + varApiErrorResponse := _ApiErrorResponse{} + + err = json.Unmarshal(data, &varApiErrorResponse) + + if err != nil { + return err + } + + *o = ApiErrorResponse(varApiErrorResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "code") + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApiErrorResponse struct { + value *ApiErrorResponse + isSet bool +} + +func (v NullableApiErrorResponse) Get() *ApiErrorResponse { + return v.value +} + +func (v *NullableApiErrorResponse) Set(val *ApiErrorResponse) { + v.value = val + v.isSet = true +} + +func (v NullableApiErrorResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableApiErrorResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApiErrorResponse(val *ApiErrorResponse) *NullableApiErrorResponse { + return &NullableApiErrorResponse{value: val, isSet: true} +} + +func (v NullableApiErrorResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApiErrorResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application.go b/services/sca/v1betaapi/model_application.go new file mode 100644 index 0000000000..c964b1e869 --- /dev/null +++ b/services/sca/v1betaapi/model_application.go @@ -0,0 +1,567 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Application type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Application{} + +// Application Application describes a deployable multi-container workload instance. +type Application struct { + // Containers to deploy for the application. + Containers []Container `json:"containers"` + // Creation date in RFC3339 format. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Human-readable display name. + DisplayName string `json:"displayName"` + // Environment identifier where the application belongs. + EnvironmentId *string `json:"environmentId,omitempty"` + // Environment human-readable display name. + EnvironmentName *string `json:"environmentName,omitempty"` + // Application identifier. + Id *string `json:"id,omitempty"` + Network *ApplicationNetwork `json:"network,omitempty"` + // Region of the environment. + Region *string `json:"region,omitempty"` + Scaling ApplicationScaling `json:"scaling"` + Status *ApplicationStatus `json:"status,omitempty"` + // Indicates if the application resources are stopped. + Stopped *bool `json:"stopped,omitempty"` + // Last update date in RFC3339 format. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Application Application + +// NewApplication instantiates a new Application 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 NewApplication(containers []Container, displayName string, scaling ApplicationScaling) *Application { + this := Application{} + this.Containers = containers + this.DisplayName = displayName + this.Scaling = scaling + return &this +} + +// NewApplicationWithDefaults instantiates a new Application 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 NewApplicationWithDefaults() *Application { + this := Application{} + return &this +} + +// GetContainers returns the Containers field value +func (o *Application) GetContainers() []Container { + if o == nil { + var ret []Container + return ret + } + + return o.Containers +} + +// GetContainersOk returns a tuple with the Containers field value +// and a boolean to check if the value has been set. +func (o *Application) GetContainersOk() ([]Container, bool) { + if o == nil { + return nil, false + } + return o.Containers, true +} + +// SetContainers sets field value +func (o *Application) SetContainers(v []Container) { + o.Containers = v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Application) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Application) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Application) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Application) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDisplayName returns the DisplayName field value +func (o *Application) GetDisplayName() string { + if o == nil { + var ret string + return ret + } + + return o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value +// and a boolean to check if the value has been set. +func (o *Application) GetDisplayNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DisplayName, true +} + +// SetDisplayName sets field value +func (o *Application) SetDisplayName(v string) { + o.DisplayName = v +} + +// GetEnvironmentId returns the EnvironmentId field value if set, zero value otherwise. +func (o *Application) GetEnvironmentId() string { + if o == nil || IsNil(o.EnvironmentId) { + var ret string + return ret + } + return *o.EnvironmentId +} + +// GetEnvironmentIdOk returns a tuple with the EnvironmentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Application) GetEnvironmentIdOk() (*string, bool) { + if o == nil || IsNil(o.EnvironmentId) { + return nil, false + } + return o.EnvironmentId, true +} + +// HasEnvironmentId returns a boolean if a field has been set. +func (o *Application) HasEnvironmentId() bool { + if o != nil && !IsNil(o.EnvironmentId) { + return true + } + + return false +} + +// SetEnvironmentId gets a reference to the given string and assigns it to the EnvironmentId field. +func (o *Application) SetEnvironmentId(v string) { + o.EnvironmentId = &v +} + +// GetEnvironmentName returns the EnvironmentName field value if set, zero value otherwise. +func (o *Application) GetEnvironmentName() string { + if o == nil || IsNil(o.EnvironmentName) { + var ret string + return ret + } + return *o.EnvironmentName +} + +// GetEnvironmentNameOk returns a tuple with the EnvironmentName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Application) GetEnvironmentNameOk() (*string, bool) { + if o == nil || IsNil(o.EnvironmentName) { + return nil, false + } + return o.EnvironmentName, true +} + +// HasEnvironmentName returns a boolean if a field has been set. +func (o *Application) HasEnvironmentName() bool { + if o != nil && !IsNil(o.EnvironmentName) { + return true + } + + return false +} + +// SetEnvironmentName gets a reference to the given string and assigns it to the EnvironmentName field. +func (o *Application) SetEnvironmentName(v string) { + o.EnvironmentName = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Application) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Application) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Application) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Application) SetId(v string) { + o.Id = &v +} + +// GetNetwork returns the Network field value if set, zero value otherwise. +func (o *Application) GetNetwork() ApplicationNetwork { + if o == nil || IsNil(o.Network) { + var ret ApplicationNetwork + return ret + } + return *o.Network +} + +// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Application) GetNetworkOk() (*ApplicationNetwork, bool) { + if o == nil || IsNil(o.Network) { + return nil, false + } + return o.Network, true +} + +// HasNetwork returns a boolean if a field has been set. +func (o *Application) HasNetwork() bool { + if o != nil && !IsNil(o.Network) { + return true + } + + return false +} + +// SetNetwork gets a reference to the given ApplicationNetwork and assigns it to the Network field. +func (o *Application) SetNetwork(v ApplicationNetwork) { + o.Network = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *Application) GetRegion() string { + if o == nil || IsNil(o.Region) { + var ret string + return ret + } + return *o.Region +} + +// GetRegionOk returns a tuple with the Region field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Application) GetRegionOk() (*string, bool) { + if o == nil || IsNil(o.Region) { + return nil, false + } + return o.Region, true +} + +// HasRegion returns a boolean if a field has been set. +func (o *Application) HasRegion() bool { + if o != nil && !IsNil(o.Region) { + return true + } + + return false +} + +// SetRegion gets a reference to the given string and assigns it to the Region field. +func (o *Application) SetRegion(v string) { + o.Region = &v +} + +// GetScaling returns the Scaling field value +func (o *Application) GetScaling() ApplicationScaling { + if o == nil { + var ret ApplicationScaling + return ret + } + + return o.Scaling +} + +// GetScalingOk returns a tuple with the Scaling field value +// and a boolean to check if the value has been set. +func (o *Application) GetScalingOk() (*ApplicationScaling, bool) { + if o == nil { + return nil, false + } + return &o.Scaling, true +} + +// SetScaling sets field value +func (o *Application) SetScaling(v ApplicationScaling) { + o.Scaling = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Application) GetStatus() ApplicationStatus { + if o == nil || IsNil(o.Status) { + var ret ApplicationStatus + 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 *Application) GetStatusOk() (*ApplicationStatus, 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 *Application) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given ApplicationStatus and assigns it to the Status field. +func (o *Application) SetStatus(v ApplicationStatus) { + o.Status = &v +} + +// GetStopped returns the Stopped field value if set, zero value otherwise. +func (o *Application) GetStopped() bool { + if o == nil || IsNil(o.Stopped) { + var ret bool + return ret + } + return *o.Stopped +} + +// GetStoppedOk returns a tuple with the Stopped field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Application) GetStoppedOk() (*bool, bool) { + if o == nil || IsNil(o.Stopped) { + return nil, false + } + return o.Stopped, true +} + +// HasStopped returns a boolean if a field has been set. +func (o *Application) HasStopped() bool { + if o != nil && !IsNil(o.Stopped) { + return true + } + + return false +} + +// SetStopped gets a reference to the given bool and assigns it to the Stopped field. +func (o *Application) SetStopped(v bool) { + o.Stopped = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Application) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Application) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Application) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Application) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Application) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Application) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["containers"] = o.Containers + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + toSerialize["displayName"] = o.DisplayName + if !IsNil(o.EnvironmentId) { + toSerialize["environmentId"] = o.EnvironmentId + } + if !IsNil(o.EnvironmentName) { + toSerialize["environmentName"] = o.EnvironmentName + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Network) { + toSerialize["network"] = o.Network + } + if !IsNil(o.Region) { + toSerialize["region"] = o.Region + } + toSerialize["scaling"] = o.Scaling + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Stopped) { + toSerialize["stopped"] = o.Stopped + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Application) 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{ + "containers", + "displayName", + "scaling", + } + + 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) + } + } + + varApplication := _Application{} + + err = json.Unmarshal(data, &varApplication) + + if err != nil { + return err + } + + *o = Application(varApplication) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "containers") + delete(additionalProperties, "createdAt") + delete(additionalProperties, "displayName") + delete(additionalProperties, "environmentId") + delete(additionalProperties, "environmentName") + delete(additionalProperties, "id") + delete(additionalProperties, "network") + delete(additionalProperties, "region") + delete(additionalProperties, "scaling") + delete(additionalProperties, "status") + delete(additionalProperties, "stopped") + delete(additionalProperties, "updatedAt") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplication struct { + value *Application + isSet bool +} + +func (v NullableApplication) Get() *Application { + return v.value +} + +func (v *NullableApplication) Set(val *Application) { + v.value = val + v.isSet = true +} + +func (v NullableApplication) IsSet() bool { + return v.isSet +} + +func (v *NullableApplication) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplication(val *Application) *NullableApplication { + return &NullableApplication{value: val, isSet: true} +} + +func (v NullableApplication) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplication) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application_access_control.go b/services/sca/v1betaapi/model_application_access_control.go new file mode 100644 index 0000000000..18e54f0b5a --- /dev/null +++ b/services/sca/v1betaapi/model_application_access_control.go @@ -0,0 +1,192 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the ApplicationAccessControl type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationAccessControl{} + +// ApplicationAccessControl struct for ApplicationAccessControl +type ApplicationAccessControl struct { + // List of IPv4 CIDR ranges that the application is allowed to communicate with. + Egress []string `json:"egress,omitempty"` + // List of IPv4 CIDR ranges allowed to access the application. + Ingress []string `json:"ingress,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ApplicationAccessControl ApplicationAccessControl + +// NewApplicationAccessControl instantiates a new ApplicationAccessControl 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 NewApplicationAccessControl() *ApplicationAccessControl { + this := ApplicationAccessControl{} + return &this +} + +// NewApplicationAccessControlWithDefaults instantiates a new ApplicationAccessControl 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 NewApplicationAccessControlWithDefaults() *ApplicationAccessControl { + this := ApplicationAccessControl{} + return &this +} + +// GetEgress returns the Egress field value if set, zero value otherwise. +func (o *ApplicationAccessControl) GetEgress() []string { + if o == nil || IsNil(o.Egress) { + var ret []string + return ret + } + return o.Egress +} + +// GetEgressOk returns a tuple with the Egress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationAccessControl) GetEgressOk() ([]string, bool) { + if o == nil || IsNil(o.Egress) { + return nil, false + } + return o.Egress, true +} + +// HasEgress returns a boolean if a field has been set. +func (o *ApplicationAccessControl) HasEgress() bool { + if o != nil && !IsNil(o.Egress) { + return true + } + + return false +} + +// SetEgress gets a reference to the given []string and assigns it to the Egress field. +func (o *ApplicationAccessControl) SetEgress(v []string) { + o.Egress = v +} + +// GetIngress returns the Ingress field value if set, zero value otherwise. +func (o *ApplicationAccessControl) GetIngress() []string { + if o == nil || IsNil(o.Ingress) { + var ret []string + return ret + } + return o.Ingress +} + +// GetIngressOk returns a tuple with the Ingress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationAccessControl) GetIngressOk() ([]string, bool) { + if o == nil || IsNil(o.Ingress) { + return nil, false + } + return o.Ingress, true +} + +// HasIngress returns a boolean if a field has been set. +func (o *ApplicationAccessControl) HasIngress() bool { + if o != nil && !IsNil(o.Ingress) { + return true + } + + return false +} + +// SetIngress gets a reference to the given []string and assigns it to the Ingress field. +func (o *ApplicationAccessControl) SetIngress(v []string) { + o.Ingress = v +} + +func (o ApplicationAccessControl) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationAccessControl) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Egress) { + toSerialize["egress"] = o.Egress + } + if !IsNil(o.Ingress) { + toSerialize["ingress"] = o.Ingress + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ApplicationAccessControl) UnmarshalJSON(data []byte) (err error) { + varApplicationAccessControl := _ApplicationAccessControl{} + + err = json.Unmarshal(data, &varApplicationAccessControl) + + if err != nil { + return err + } + + *o = ApplicationAccessControl(varApplicationAccessControl) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "egress") + delete(additionalProperties, "ingress") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplicationAccessControl struct { + value *ApplicationAccessControl + isSet bool +} + +func (v NullableApplicationAccessControl) Get() *ApplicationAccessControl { + return v.value +} + +func (v *NullableApplicationAccessControl) Set(val *ApplicationAccessControl) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationAccessControl) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationAccessControl) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationAccessControl(val *ApplicationAccessControl) *NullableApplicationAccessControl { + return &NullableApplicationAccessControl{value: val, isSet: true} +} + +func (v NullableApplicationAccessControl) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationAccessControl) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application_auto_scaling.go b/services/sca/v1betaapi/model_application_auto_scaling.go new file mode 100644 index 0000000000..19767f733c --- /dev/null +++ b/services/sca/v1betaapi/model_application_auto_scaling.go @@ -0,0 +1,265 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the ApplicationAutoScaling type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationAutoScaling{} + +// ApplicationAutoScaling AutoScaling configuration. +type ApplicationAutoScaling struct { + // Allow automatically scale to zero. + AllowScaleToZero *bool `json:"allowScaleToZero,omitempty"` + // Maximum number of instances. + MaxInstances int32 `json:"maxInstances"` + // Minimum number of instances. + MinInstances int32 `json:"minInstances"` + // Scaling rules. + Rules []ApplicationScaleRule `json:"rules"` + AdditionalProperties map[string]interface{} +} + +type _ApplicationAutoScaling ApplicationAutoScaling + +// NewApplicationAutoScaling instantiates a new ApplicationAutoScaling 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 NewApplicationAutoScaling(maxInstances int32, minInstances int32, rules []ApplicationScaleRule) *ApplicationAutoScaling { + this := ApplicationAutoScaling{} + this.MaxInstances = maxInstances + this.MinInstances = minInstances + this.Rules = rules + return &this +} + +// NewApplicationAutoScalingWithDefaults instantiates a new ApplicationAutoScaling 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 NewApplicationAutoScalingWithDefaults() *ApplicationAutoScaling { + this := ApplicationAutoScaling{} + return &this +} + +// GetAllowScaleToZero returns the AllowScaleToZero field value if set, zero value otherwise. +func (o *ApplicationAutoScaling) GetAllowScaleToZero() bool { + if o == nil || IsNil(o.AllowScaleToZero) { + var ret bool + return ret + } + return *o.AllowScaleToZero +} + +// GetAllowScaleToZeroOk returns a tuple with the AllowScaleToZero field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationAutoScaling) GetAllowScaleToZeroOk() (*bool, bool) { + if o == nil || IsNil(o.AllowScaleToZero) { + return nil, false + } + return o.AllowScaleToZero, true +} + +// HasAllowScaleToZero returns a boolean if a field has been set. +func (o *ApplicationAutoScaling) HasAllowScaleToZero() bool { + if o != nil && !IsNil(o.AllowScaleToZero) { + return true + } + + return false +} + +// SetAllowScaleToZero gets a reference to the given bool and assigns it to the AllowScaleToZero field. +func (o *ApplicationAutoScaling) SetAllowScaleToZero(v bool) { + o.AllowScaleToZero = &v +} + +// GetMaxInstances returns the MaxInstances field value +func (o *ApplicationAutoScaling) GetMaxInstances() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MaxInstances +} + +// GetMaxInstancesOk returns a tuple with the MaxInstances field value +// and a boolean to check if the value has been set. +func (o *ApplicationAutoScaling) GetMaxInstancesOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MaxInstances, true +} + +// SetMaxInstances sets field value +func (o *ApplicationAutoScaling) SetMaxInstances(v int32) { + o.MaxInstances = v +} + +// GetMinInstances returns the MinInstances field value +func (o *ApplicationAutoScaling) GetMinInstances() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MinInstances +} + +// GetMinInstancesOk returns a tuple with the MinInstances field value +// and a boolean to check if the value has been set. +func (o *ApplicationAutoScaling) GetMinInstancesOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MinInstances, true +} + +// SetMinInstances sets field value +func (o *ApplicationAutoScaling) SetMinInstances(v int32) { + o.MinInstances = v +} + +// GetRules returns the Rules field value +func (o *ApplicationAutoScaling) GetRules() []ApplicationScaleRule { + if o == nil { + var ret []ApplicationScaleRule + return ret + } + + return o.Rules +} + +// GetRulesOk returns a tuple with the Rules field value +// and a boolean to check if the value has been set. +func (o *ApplicationAutoScaling) GetRulesOk() ([]ApplicationScaleRule, bool) { + if o == nil { + return nil, false + } + return o.Rules, true +} + +// SetRules sets field value +func (o *ApplicationAutoScaling) SetRules(v []ApplicationScaleRule) { + o.Rules = v +} + +func (o ApplicationAutoScaling) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationAutoScaling) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AllowScaleToZero) { + toSerialize["allowScaleToZero"] = o.AllowScaleToZero + } + toSerialize["maxInstances"] = o.MaxInstances + toSerialize["minInstances"] = o.MinInstances + toSerialize["rules"] = o.Rules + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ApplicationAutoScaling) 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{ + "maxInstances", + "minInstances", + "rules", + } + + 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) + } + } + + varApplicationAutoScaling := _ApplicationAutoScaling{} + + err = json.Unmarshal(data, &varApplicationAutoScaling) + + if err != nil { + return err + } + + *o = ApplicationAutoScaling(varApplicationAutoScaling) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "allowScaleToZero") + delete(additionalProperties, "maxInstances") + delete(additionalProperties, "minInstances") + delete(additionalProperties, "rules") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplicationAutoScaling struct { + value *ApplicationAutoScaling + isSet bool +} + +func (v NullableApplicationAutoScaling) Get() *ApplicationAutoScaling { + return v.value +} + +func (v *NullableApplicationAutoScaling) Set(val *ApplicationAutoScaling) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationAutoScaling) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationAutoScaling) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationAutoScaling(val *ApplicationAutoScaling) *NullableApplicationAutoScaling { + return &NullableApplicationAutoScaling{value: val, isSet: true} +} + +func (v NullableApplicationAutoScaling) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationAutoScaling) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application_current_status.go b/services/sca/v1betaapi/model_application_current_status.go new file mode 100644 index 0000000000..db0216516b --- /dev/null +++ b/services/sca/v1betaapi/model_application_current_status.go @@ -0,0 +1,121 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// ApplicationCurrentStatus Current status of the application. - CURRENT_STATUS_UNSPECIFIED: Used as zero value. - CURRENT_STATUS_PROGRESSING: Applications replicas are being created. - CURRENT_STATUS_RUNNING: Application is ready and has the desired replicas running. - CURRENT_STATUS_FAILED: Application is not available and has some error. - CURRENT_STATUS_IDLE: Application is ready but is scaled to 0 replicas. - CURRENT_STATUS_NONE: Application is stopped. +type ApplicationCurrentStatus string + +// List of ApplicationCurrentStatus +const ( + APPLICATIONCURRENTSTATUS_CURRENT_STATUS_UNSPECIFIED ApplicationCurrentStatus = "CURRENT_STATUS_UNSPECIFIED" + APPLICATIONCURRENTSTATUS_CURRENT_STATUS_PROGRESSING ApplicationCurrentStatus = "CURRENT_STATUS_PROGRESSING" + APPLICATIONCURRENTSTATUS_CURRENT_STATUS_RUNNING ApplicationCurrentStatus = "CURRENT_STATUS_RUNNING" + APPLICATIONCURRENTSTATUS_CURRENT_STATUS_FAILED ApplicationCurrentStatus = "CURRENT_STATUS_FAILED" + APPLICATIONCURRENTSTATUS_CURRENT_STATUS_IDLE ApplicationCurrentStatus = "CURRENT_STATUS_IDLE" + APPLICATIONCURRENTSTATUS_CURRENT_STATUS_NONE ApplicationCurrentStatus = "CURRENT_STATUS_NONE" + APPLICATIONCURRENTSTATUS_UNKNOWN_DEFAULT_OPEN_API ApplicationCurrentStatus = "unknown_default_open_api" +) + +// All allowed values of ApplicationCurrentStatus enum +var AllowedApplicationCurrentStatusEnumValues = []ApplicationCurrentStatus{ + "CURRENT_STATUS_UNSPECIFIED", + "CURRENT_STATUS_PROGRESSING", + "CURRENT_STATUS_RUNNING", + "CURRENT_STATUS_FAILED", + "CURRENT_STATUS_IDLE", + "CURRENT_STATUS_NONE", + "unknown_default_open_api", +} + +func (v *ApplicationCurrentStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ApplicationCurrentStatus(value) + for _, existing := range AllowedApplicationCurrentStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = APPLICATIONCURRENTSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewApplicationCurrentStatusFromValue returns a pointer to a valid ApplicationCurrentStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewApplicationCurrentStatusFromValue(v string) (*ApplicationCurrentStatus, error) { + ev := ApplicationCurrentStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ApplicationCurrentStatus: valid values are %v", v, AllowedApplicationCurrentStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ApplicationCurrentStatus) IsValid() bool { + for _, existing := range AllowedApplicationCurrentStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ApplicationCurrentStatus value +func (v ApplicationCurrentStatus) Ptr() *ApplicationCurrentStatus { + return &v +} + +type NullableApplicationCurrentStatus struct { + value *ApplicationCurrentStatus + isSet bool +} + +func (v NullableApplicationCurrentStatus) Get() *ApplicationCurrentStatus { + return v.value +} + +func (v *NullableApplicationCurrentStatus) Set(val *ApplicationCurrentStatus) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationCurrentStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationCurrentStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationCurrentStatus(val *ApplicationCurrentStatus) *NullableApplicationCurrentStatus { + return &NullableApplicationCurrentStatus{value: val, isSet: true} +} + +func (v NullableApplicationCurrentStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationCurrentStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application_custom_rule_parameter.go b/services/sca/v1betaapi/model_application_custom_rule_parameter.go new file mode 100644 index 0000000000..c6067dd599 --- /dev/null +++ b/services/sca/v1betaapi/model_application_custom_rule_parameter.go @@ -0,0 +1,197 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the ApplicationCustomRuleParameter type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationCustomRuleParameter{} + +// ApplicationCustomRuleParameter CustomRuleParameter defines a single scaler parameter from KEDA Scaler metadata configuration. +type ApplicationCustomRuleParameter struct { + // Parameter name/key from KEDA metadata parameters. + Name string `json:"name"` + // Parameter value for KEDA metadata key. + Value string `json:"value"` + AdditionalProperties map[string]interface{} +} + +type _ApplicationCustomRuleParameter ApplicationCustomRuleParameter + +// NewApplicationCustomRuleParameter instantiates a new ApplicationCustomRuleParameter 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 NewApplicationCustomRuleParameter(name string, value string) *ApplicationCustomRuleParameter { + this := ApplicationCustomRuleParameter{} + this.Name = name + this.Value = value + return &this +} + +// NewApplicationCustomRuleParameterWithDefaults instantiates a new ApplicationCustomRuleParameter 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 NewApplicationCustomRuleParameterWithDefaults() *ApplicationCustomRuleParameter { + this := ApplicationCustomRuleParameter{} + return &this +} + +// GetName returns the Name field value +func (o *ApplicationCustomRuleParameter) 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 *ApplicationCustomRuleParameter) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ApplicationCustomRuleParameter) SetName(v string) { + o.Name = v +} + +// GetValue returns the Value field value +func (o *ApplicationCustomRuleParameter) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *ApplicationCustomRuleParameter) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *ApplicationCustomRuleParameter) SetValue(v string) { + o.Value = v +} + +func (o ApplicationCustomRuleParameter) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationCustomRuleParameter) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["value"] = o.Value + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ApplicationCustomRuleParameter) 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{ + "name", + "value", + } + + 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) + } + } + + varApplicationCustomRuleParameter := _ApplicationCustomRuleParameter{} + + err = json.Unmarshal(data, &varApplicationCustomRuleParameter) + + if err != nil { + return err + } + + *o = ApplicationCustomRuleParameter(varApplicationCustomRuleParameter) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "value") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplicationCustomRuleParameter struct { + value *ApplicationCustomRuleParameter + isSet bool +} + +func (v NullableApplicationCustomRuleParameter) Get() *ApplicationCustomRuleParameter { + return v.value +} + +func (v *NullableApplicationCustomRuleParameter) Set(val *ApplicationCustomRuleParameter) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationCustomRuleParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationCustomRuleParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationCustomRuleParameter(val *ApplicationCustomRuleParameter) *NullableApplicationCustomRuleParameter { + return &NullableApplicationCustomRuleParameter{value: val, isSet: true} +} + +func (v NullableApplicationCustomRuleParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationCustomRuleParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application_custom_rule_secret_mapping.go b/services/sca/v1betaapi/model_application_custom_rule_secret_mapping.go new file mode 100644 index 0000000000..7c350f2205 --- /dev/null +++ b/services/sca/v1betaapi/model_application_custom_rule_secret_mapping.go @@ -0,0 +1,197 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the ApplicationCustomRuleSecretMapping type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationCustomRuleSecretMapping{} + +// ApplicationCustomRuleSecretMapping CustomRuleSecretMapping maps a scaler parameter to an environment secret. +type ApplicationCustomRuleSecretMapping struct { + // Secret parameter name. + Parameter string `json:"parameter"` + // Environment secret name. + Secret string `json:"secret"` + AdditionalProperties map[string]interface{} +} + +type _ApplicationCustomRuleSecretMapping ApplicationCustomRuleSecretMapping + +// NewApplicationCustomRuleSecretMapping instantiates a new ApplicationCustomRuleSecretMapping 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 NewApplicationCustomRuleSecretMapping(parameter string, secret string) *ApplicationCustomRuleSecretMapping { + this := ApplicationCustomRuleSecretMapping{} + this.Parameter = parameter + this.Secret = secret + return &this +} + +// NewApplicationCustomRuleSecretMappingWithDefaults instantiates a new ApplicationCustomRuleSecretMapping 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 NewApplicationCustomRuleSecretMappingWithDefaults() *ApplicationCustomRuleSecretMapping { + this := ApplicationCustomRuleSecretMapping{} + return &this +} + +// GetParameter returns the Parameter field value +func (o *ApplicationCustomRuleSecretMapping) GetParameter() string { + if o == nil { + var ret string + return ret + } + + return o.Parameter +} + +// GetParameterOk returns a tuple with the Parameter field value +// and a boolean to check if the value has been set. +func (o *ApplicationCustomRuleSecretMapping) GetParameterOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Parameter, true +} + +// SetParameter sets field value +func (o *ApplicationCustomRuleSecretMapping) SetParameter(v string) { + o.Parameter = v +} + +// GetSecret returns the Secret field value +func (o *ApplicationCustomRuleSecretMapping) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *ApplicationCustomRuleSecretMapping) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *ApplicationCustomRuleSecretMapping) SetSecret(v string) { + o.Secret = v +} + +func (o ApplicationCustomRuleSecretMapping) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationCustomRuleSecretMapping) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["parameter"] = o.Parameter + toSerialize["secret"] = o.Secret + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ApplicationCustomRuleSecretMapping) 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{ + "parameter", + "secret", + } + + 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) + } + } + + varApplicationCustomRuleSecretMapping := _ApplicationCustomRuleSecretMapping{} + + err = json.Unmarshal(data, &varApplicationCustomRuleSecretMapping) + + if err != nil { + return err + } + + *o = ApplicationCustomRuleSecretMapping(varApplicationCustomRuleSecretMapping) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "parameter") + delete(additionalProperties, "secret") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplicationCustomRuleSecretMapping struct { + value *ApplicationCustomRuleSecretMapping + isSet bool +} + +func (v NullableApplicationCustomRuleSecretMapping) Get() *ApplicationCustomRuleSecretMapping { + return v.value +} + +func (v *NullableApplicationCustomRuleSecretMapping) Set(val *ApplicationCustomRuleSecretMapping) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationCustomRuleSecretMapping) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationCustomRuleSecretMapping) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationCustomRuleSecretMapping(val *ApplicationCustomRuleSecretMapping) *NullableApplicationCustomRuleSecretMapping { + return &NullableApplicationCustomRuleSecretMapping{value: val, isSet: true} +} + +func (v NullableApplicationCustomRuleSecretMapping) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationCustomRuleSecretMapping) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application_custom_scale_rule.go b/services/sca/v1betaapi/model_application_custom_scale_rule.go new file mode 100644 index 0000000000..b5c5ee4bd6 --- /dev/null +++ b/services/sca/v1betaapi/model_application_custom_scale_rule.go @@ -0,0 +1,243 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the ApplicationCustomScaleRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationCustomScaleRule{} + +// ApplicationCustomScaleRule CustomScaleRule defines parameters for KEDA Scalers. +type ApplicationCustomScaleRule struct { + // Scaler parameters. + Parameters []ApplicationCustomRuleParameter `json:"parameters,omitempty"` + // Secret mappings for the scaler. + SecretsMapping []ApplicationCustomRuleSecretMapping `json:"secretsMapping,omitempty"` + // Scaler type. + Type string `json:"type"` + AdditionalProperties map[string]interface{} +} + +type _ApplicationCustomScaleRule ApplicationCustomScaleRule + +// NewApplicationCustomScaleRule instantiates a new ApplicationCustomScaleRule 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 NewApplicationCustomScaleRule(types string) *ApplicationCustomScaleRule { + this := ApplicationCustomScaleRule{} + this.Type = types + return &this +} + +// NewApplicationCustomScaleRuleWithDefaults instantiates a new ApplicationCustomScaleRule 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 NewApplicationCustomScaleRuleWithDefaults() *ApplicationCustomScaleRule { + this := ApplicationCustomScaleRule{} + return &this +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *ApplicationCustomScaleRule) GetParameters() []ApplicationCustomRuleParameter { + if o == nil || IsNil(o.Parameters) { + var ret []ApplicationCustomRuleParameter + 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 *ApplicationCustomScaleRule) GetParametersOk() ([]ApplicationCustomRuleParameter, 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 *ApplicationCustomScaleRule) HasParameters() bool { + if o != nil && !IsNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given []ApplicationCustomRuleParameter and assigns it to the Parameters field. +func (o *ApplicationCustomScaleRule) SetParameters(v []ApplicationCustomRuleParameter) { + o.Parameters = v +} + +// GetSecretsMapping returns the SecretsMapping field value if set, zero value otherwise. +func (o *ApplicationCustomScaleRule) GetSecretsMapping() []ApplicationCustomRuleSecretMapping { + if o == nil || IsNil(o.SecretsMapping) { + var ret []ApplicationCustomRuleSecretMapping + return ret + } + return o.SecretsMapping +} + +// GetSecretsMappingOk returns a tuple with the SecretsMapping field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationCustomScaleRule) GetSecretsMappingOk() ([]ApplicationCustomRuleSecretMapping, bool) { + if o == nil || IsNil(o.SecretsMapping) { + return nil, false + } + return o.SecretsMapping, true +} + +// HasSecretsMapping returns a boolean if a field has been set. +func (o *ApplicationCustomScaleRule) HasSecretsMapping() bool { + if o != nil && !IsNil(o.SecretsMapping) { + return true + } + + return false +} + +// SetSecretsMapping gets a reference to the given []ApplicationCustomRuleSecretMapping and assigns it to the SecretsMapping field. +func (o *ApplicationCustomScaleRule) SetSecretsMapping(v []ApplicationCustomRuleSecretMapping) { + o.SecretsMapping = v +} + +// GetType returns the Type field value +func (o *ApplicationCustomScaleRule) 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 *ApplicationCustomScaleRule) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ApplicationCustomScaleRule) SetType(v string) { + o.Type = v +} + +func (o ApplicationCustomScaleRule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationCustomScaleRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + if !IsNil(o.SecretsMapping) { + toSerialize["secretsMapping"] = o.SecretsMapping + } + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ApplicationCustomScaleRule) 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{ + "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) + } + } + + varApplicationCustomScaleRule := _ApplicationCustomScaleRule{} + + err = json.Unmarshal(data, &varApplicationCustomScaleRule) + + if err != nil { + return err + } + + *o = ApplicationCustomScaleRule(varApplicationCustomScaleRule) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "parameters") + delete(additionalProperties, "secretsMapping") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplicationCustomScaleRule struct { + value *ApplicationCustomScaleRule + isSet bool +} + +func (v NullableApplicationCustomScaleRule) Get() *ApplicationCustomScaleRule { + return v.value +} + +func (v *NullableApplicationCustomScaleRule) Set(val *ApplicationCustomScaleRule) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationCustomScaleRule) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationCustomScaleRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationCustomScaleRule(val *ApplicationCustomScaleRule) *NullableApplicationCustomScaleRule { + return &NullableApplicationCustomScaleRule{value: val, isSet: true} +} + +func (v NullableApplicationCustomScaleRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationCustomScaleRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application_domains.go b/services/sca/v1betaapi/model_application_domains.go new file mode 100644 index 0000000000..21f0d3f52a --- /dev/null +++ b/services/sca/v1betaapi/model_application_domains.go @@ -0,0 +1,192 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the ApplicationDomains type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationDomains{} + +// ApplicationDomains List of application domains. +type ApplicationDomains struct { + // Default domain for the application. + Default *string `json:"default,omitempty"` + // Internal domain for the application. + Internal *string `json:"internal,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ApplicationDomains ApplicationDomains + +// NewApplicationDomains instantiates a new ApplicationDomains 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 NewApplicationDomains() *ApplicationDomains { + this := ApplicationDomains{} + return &this +} + +// NewApplicationDomainsWithDefaults instantiates a new ApplicationDomains 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 NewApplicationDomainsWithDefaults() *ApplicationDomains { + this := ApplicationDomains{} + return &this +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *ApplicationDomains) GetDefault() string { + if o == nil || IsNil(o.Default) { + var ret string + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationDomains) GetDefaultOk() (*string, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *ApplicationDomains) HasDefault() bool { + if o != nil && !IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given string and assigns it to the Default field. +func (o *ApplicationDomains) SetDefault(v string) { + o.Default = &v +} + +// GetInternal returns the Internal field value if set, zero value otherwise. +func (o *ApplicationDomains) GetInternal() string { + if o == nil || IsNil(o.Internal) { + var ret string + return ret + } + return *o.Internal +} + +// GetInternalOk returns a tuple with the Internal field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationDomains) GetInternalOk() (*string, bool) { + if o == nil || IsNil(o.Internal) { + return nil, false + } + return o.Internal, true +} + +// HasInternal returns a boolean if a field has been set. +func (o *ApplicationDomains) HasInternal() bool { + if o != nil && !IsNil(o.Internal) { + return true + } + + return false +} + +// SetInternal gets a reference to the given string and assigns it to the Internal field. +func (o *ApplicationDomains) SetInternal(v string) { + o.Internal = &v +} + +func (o ApplicationDomains) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationDomains) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Default) { + toSerialize["default"] = o.Default + } + if !IsNil(o.Internal) { + toSerialize["internal"] = o.Internal + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ApplicationDomains) UnmarshalJSON(data []byte) (err error) { + varApplicationDomains := _ApplicationDomains{} + + err = json.Unmarshal(data, &varApplicationDomains) + + if err != nil { + return err + } + + *o = ApplicationDomains(varApplicationDomains) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "default") + delete(additionalProperties, "internal") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplicationDomains struct { + value *ApplicationDomains + isSet bool +} + +func (v NullableApplicationDomains) Get() *ApplicationDomains { + return v.value +} + +func (v *NullableApplicationDomains) Set(val *ApplicationDomains) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationDomains) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationDomains) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationDomains(val *ApplicationDomains) *NullableApplicationDomains { + return &NullableApplicationDomains{value: val, isSet: true} +} + +func (v NullableApplicationDomains) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationDomains) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application_event.go b/services/sca/v1betaapi/model_application_event.go new file mode 100644 index 0000000000..1d69c72a08 --- /dev/null +++ b/services/sca/v1betaapi/model_application_event.go @@ -0,0 +1,154 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the ApplicationEvent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationEvent{} + +// ApplicationEvent Event defines an event line. +type ApplicationEvent struct { + // Event message. + Message *string `json:"message,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ApplicationEvent ApplicationEvent + +// NewApplicationEvent instantiates a new ApplicationEvent 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 NewApplicationEvent() *ApplicationEvent { + this := ApplicationEvent{} + return &this +} + +// NewApplicationEventWithDefaults instantiates a new ApplicationEvent 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 NewApplicationEventWithDefaults() *ApplicationEvent { + this := ApplicationEvent{} + return &this +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *ApplicationEvent) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationEvent) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *ApplicationEvent) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *ApplicationEvent) SetMessage(v string) { + o.Message = &v +} + +func (o ApplicationEvent) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationEvent) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ApplicationEvent) UnmarshalJSON(data []byte) (err error) { + varApplicationEvent := _ApplicationEvent{} + + err = json.Unmarshal(data, &varApplicationEvent) + + if err != nil { + return err + } + + *o = ApplicationEvent(varApplicationEvent) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplicationEvent struct { + value *ApplicationEvent + isSet bool +} + +func (v NullableApplicationEvent) Get() *ApplicationEvent { + return v.value +} + +func (v *NullableApplicationEvent) Set(val *ApplicationEvent) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationEvent) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationEvent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationEvent(val *ApplicationEvent) *NullableApplicationEvent { + return &NullableApplicationEvent{value: val, isSet: true} +} + +func (v NullableApplicationEvent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationEvent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application_http_scale_rule.go b/services/sca/v1betaapi/model_application_http_scale_rule.go new file mode 100644 index 0000000000..d25f5b2e5e --- /dev/null +++ b/services/sca/v1betaapi/model_application_http_scale_rule.go @@ -0,0 +1,192 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the ApplicationHttpScaleRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationHttpScaleRule{} + +// ApplicationHttpScaleRule HttpScaleRule defines parameters for HTTP-based scaling. +type ApplicationHttpScaleRule struct { + // Target concurrency per instance. + Concurrency *int32 `json:"concurrency,omitempty"` + // Target requests per second per instance. + Rps *int32 `json:"rps,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ApplicationHttpScaleRule ApplicationHttpScaleRule + +// NewApplicationHttpScaleRule instantiates a new ApplicationHttpScaleRule 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 NewApplicationHttpScaleRule() *ApplicationHttpScaleRule { + this := ApplicationHttpScaleRule{} + return &this +} + +// NewApplicationHttpScaleRuleWithDefaults instantiates a new ApplicationHttpScaleRule 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 NewApplicationHttpScaleRuleWithDefaults() *ApplicationHttpScaleRule { + this := ApplicationHttpScaleRule{} + return &this +} + +// GetConcurrency returns the Concurrency field value if set, zero value otherwise. +func (o *ApplicationHttpScaleRule) GetConcurrency() int32 { + if o == nil || IsNil(o.Concurrency) { + var ret int32 + return ret + } + return *o.Concurrency +} + +// GetConcurrencyOk returns a tuple with the Concurrency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationHttpScaleRule) GetConcurrencyOk() (*int32, bool) { + if o == nil || IsNil(o.Concurrency) { + return nil, false + } + return o.Concurrency, true +} + +// HasConcurrency returns a boolean if a field has been set. +func (o *ApplicationHttpScaleRule) HasConcurrency() bool { + if o != nil && !IsNil(o.Concurrency) { + return true + } + + return false +} + +// SetConcurrency gets a reference to the given int32 and assigns it to the Concurrency field. +func (o *ApplicationHttpScaleRule) SetConcurrency(v int32) { + o.Concurrency = &v +} + +// GetRps returns the Rps field value if set, zero value otherwise. +func (o *ApplicationHttpScaleRule) GetRps() int32 { + if o == nil || IsNil(o.Rps) { + var ret int32 + return ret + } + return *o.Rps +} + +// GetRpsOk returns a tuple with the Rps field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationHttpScaleRule) GetRpsOk() (*int32, bool) { + if o == nil || IsNil(o.Rps) { + return nil, false + } + return o.Rps, true +} + +// HasRps returns a boolean if a field has been set. +func (o *ApplicationHttpScaleRule) HasRps() bool { + if o != nil && !IsNil(o.Rps) { + return true + } + + return false +} + +// SetRps gets a reference to the given int32 and assigns it to the Rps field. +func (o *ApplicationHttpScaleRule) SetRps(v int32) { + o.Rps = &v +} + +func (o ApplicationHttpScaleRule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationHttpScaleRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Concurrency) { + toSerialize["concurrency"] = o.Concurrency + } + if !IsNil(o.Rps) { + toSerialize["rps"] = o.Rps + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ApplicationHttpScaleRule) UnmarshalJSON(data []byte) (err error) { + varApplicationHttpScaleRule := _ApplicationHttpScaleRule{} + + err = json.Unmarshal(data, &varApplicationHttpScaleRule) + + if err != nil { + return err + } + + *o = ApplicationHttpScaleRule(varApplicationHttpScaleRule) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "concurrency") + delete(additionalProperties, "rps") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplicationHttpScaleRule struct { + value *ApplicationHttpScaleRule + isSet bool +} + +func (v NullableApplicationHttpScaleRule) Get() *ApplicationHttpScaleRule { + return v.value +} + +func (v *NullableApplicationHttpScaleRule) Set(val *ApplicationHttpScaleRule) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationHttpScaleRule) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationHttpScaleRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationHttpScaleRule(val *ApplicationHttpScaleRule) *NullableApplicationHttpScaleRule { + return &NullableApplicationHttpScaleRule{value: val, isSet: true} +} + +func (v NullableApplicationHttpScaleRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationHttpScaleRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application_instance.go b/services/sca/v1betaapi/model_application_instance.go new file mode 100644 index 0000000000..c67ca80b96 --- /dev/null +++ b/services/sca/v1betaapi/model_application_instance.go @@ -0,0 +1,195 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the ApplicationInstance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationInstance{} + +// ApplicationInstance Application instance summary. +type ApplicationInstance struct { + // Instance's name. + Name *string `json:"name,omitempty"` + Status *ApplicationInstanceStatus `json:"status,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ApplicationInstance ApplicationInstance + +// NewApplicationInstance instantiates a new ApplicationInstance 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 NewApplicationInstance() *ApplicationInstance { + this := ApplicationInstance{} + var status ApplicationInstanceStatus = APPLICATIONINSTANCESTATUS_INSTANCE_STATUS_PROGRESSING + this.Status = &status + return &this +} + +// NewApplicationInstanceWithDefaults instantiates a new ApplicationInstance 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 NewApplicationInstanceWithDefaults() *ApplicationInstance { + this := ApplicationInstance{} + var status ApplicationInstanceStatus = APPLICATIONINSTANCESTATUS_INSTANCE_STATUS_PROGRESSING + this.Status = &status + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ApplicationInstance) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationInstance) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *ApplicationInstance) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ApplicationInstance) SetName(v string) { + o.Name = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *ApplicationInstance) GetStatus() ApplicationInstanceStatus { + if o == nil || IsNil(o.Status) { + var ret ApplicationInstanceStatus + 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 *ApplicationInstance) GetStatusOk() (*ApplicationInstanceStatus, 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 *ApplicationInstance) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given ApplicationInstanceStatus and assigns it to the Status field. +func (o *ApplicationInstance) SetStatus(v ApplicationInstanceStatus) { + o.Status = &v +} + +func (o ApplicationInstance) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationInstance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ApplicationInstance) UnmarshalJSON(data []byte) (err error) { + varApplicationInstance := _ApplicationInstance{} + + err = json.Unmarshal(data, &varApplicationInstance) + + if err != nil { + return err + } + + *o = ApplicationInstance(varApplicationInstance) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "status") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplicationInstance struct { + value *ApplicationInstance + isSet bool +} + +func (v NullableApplicationInstance) Get() *ApplicationInstance { + return v.value +} + +func (v *NullableApplicationInstance) Set(val *ApplicationInstance) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationInstance) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationInstance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationInstance(val *ApplicationInstance) *NullableApplicationInstance { + return &NullableApplicationInstance{value: val, isSet: true} +} + +func (v NullableApplicationInstance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationInstance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application_instance_status.go b/services/sca/v1betaapi/model_application_instance_status.go new file mode 100644 index 0000000000..de342cde44 --- /dev/null +++ b/services/sca/v1betaapi/model_application_instance_status.go @@ -0,0 +1,115 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// ApplicationInstanceStatus - INSTANCE_STATUS_PROGRESSING: Instance is being created. - INSTANCE_STATUS_RUNNING: Instance is available and running. - INSTANCE_STATUS_FAILED: Instance is not available and has some error. +type ApplicationInstanceStatus string + +// List of ApplicationInstanceStatus +const ( + APPLICATIONINSTANCESTATUS_INSTANCE_STATUS_PROGRESSING ApplicationInstanceStatus = "INSTANCE_STATUS_PROGRESSING" + APPLICATIONINSTANCESTATUS_INSTANCE_STATUS_RUNNING ApplicationInstanceStatus = "INSTANCE_STATUS_RUNNING" + APPLICATIONINSTANCESTATUS_INSTANCE_STATUS_FAILED ApplicationInstanceStatus = "INSTANCE_STATUS_FAILED" + APPLICATIONINSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API ApplicationInstanceStatus = "unknown_default_open_api" +) + +// All allowed values of ApplicationInstanceStatus enum +var AllowedApplicationInstanceStatusEnumValues = []ApplicationInstanceStatus{ + "INSTANCE_STATUS_PROGRESSING", + "INSTANCE_STATUS_RUNNING", + "INSTANCE_STATUS_FAILED", + "unknown_default_open_api", +} + +func (v *ApplicationInstanceStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ApplicationInstanceStatus(value) + for _, existing := range AllowedApplicationInstanceStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = APPLICATIONINSTANCESTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewApplicationInstanceStatusFromValue returns a pointer to a valid ApplicationInstanceStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewApplicationInstanceStatusFromValue(v string) (*ApplicationInstanceStatus, error) { + ev := ApplicationInstanceStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ApplicationInstanceStatus: valid values are %v", v, AllowedApplicationInstanceStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ApplicationInstanceStatus) IsValid() bool { + for _, existing := range AllowedApplicationInstanceStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ApplicationInstanceStatus value +func (v ApplicationInstanceStatus) Ptr() *ApplicationInstanceStatus { + return &v +} + +type NullableApplicationInstanceStatus struct { + value *ApplicationInstanceStatus + isSet bool +} + +func (v NullableApplicationInstanceStatus) Get() *ApplicationInstanceStatus { + return v.value +} + +func (v *NullableApplicationInstanceStatus) Set(val *ApplicationInstanceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationInstanceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationInstanceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationInstanceStatus(val *ApplicationInstanceStatus) *NullableApplicationInstanceStatus { + return &NullableApplicationInstanceStatus{value: val, isSet: true} +} + +func (v NullableApplicationInstanceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationInstanceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application_internal_network.go b/services/sca/v1betaapi/model_application_internal_network.go new file mode 100644 index 0000000000..09a6060175 --- /dev/null +++ b/services/sca/v1betaapi/model_application_internal_network.go @@ -0,0 +1,205 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the ApplicationInternalNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationInternalNetwork{} + +// ApplicationInternalNetwork struct for ApplicationInternalNetwork +type ApplicationInternalNetwork struct { + // Enable or disable internal networking. + Enabled bool `json:"enabled"` + // Port to expose the application internally. + Port *int32 `json:"port,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ApplicationInternalNetwork ApplicationInternalNetwork + +// NewApplicationInternalNetwork instantiates a new ApplicationInternalNetwork 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 NewApplicationInternalNetwork(enabled bool) *ApplicationInternalNetwork { + this := ApplicationInternalNetwork{} + this.Enabled = enabled + return &this +} + +// NewApplicationInternalNetworkWithDefaults instantiates a new ApplicationInternalNetwork 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 NewApplicationInternalNetworkWithDefaults() *ApplicationInternalNetwork { + this := ApplicationInternalNetwork{} + return &this +} + +// GetEnabled returns the Enabled field value +func (o *ApplicationInternalNetwork) GetEnabled() bool { + if o == nil { + var ret bool + return ret + } + + return o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value +// and a boolean to check if the value has been set. +func (o *ApplicationInternalNetwork) GetEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Enabled, true +} + +// SetEnabled sets field value +func (o *ApplicationInternalNetwork) SetEnabled(v bool) { + o.Enabled = v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *ApplicationInternalNetwork) 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 *ApplicationInternalNetwork) 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 *ApplicationInternalNetwork) 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 *ApplicationInternalNetwork) SetPort(v int32) { + o.Port = &v +} + +func (o ApplicationInternalNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationInternalNetwork) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["enabled"] = o.Enabled + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ApplicationInternalNetwork) 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{ + "enabled", + } + + 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) + } + } + + varApplicationInternalNetwork := _ApplicationInternalNetwork{} + + err = json.Unmarshal(data, &varApplicationInternalNetwork) + + if err != nil { + return err + } + + *o = ApplicationInternalNetwork(varApplicationInternalNetwork) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "enabled") + delete(additionalProperties, "port") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplicationInternalNetwork struct { + value *ApplicationInternalNetwork + isSet bool +} + +func (v NullableApplicationInternalNetwork) Get() *ApplicationInternalNetwork { + return v.value +} + +func (v *NullableApplicationInternalNetwork) Set(val *ApplicationInternalNetwork) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationInternalNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationInternalNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationInternalNetwork(val *ApplicationInternalNetwork) *NullableApplicationInternalNetwork { + return &NullableApplicationInternalNetwork{value: val, isSet: true} +} + +func (v NullableApplicationInternalNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationInternalNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application_log.go b/services/sca/v1betaapi/model_application_log.go new file mode 100644 index 0000000000..9e35569f77 --- /dev/null +++ b/services/sca/v1betaapi/model_application_log.go @@ -0,0 +1,154 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the ApplicationLog type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationLog{} + +// ApplicationLog Log defines a log line. +type ApplicationLog struct { + // Log message. + Message *string `json:"message,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ApplicationLog ApplicationLog + +// NewApplicationLog instantiates a new ApplicationLog 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 NewApplicationLog() *ApplicationLog { + this := ApplicationLog{} + return &this +} + +// NewApplicationLogWithDefaults instantiates a new ApplicationLog 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 NewApplicationLogWithDefaults() *ApplicationLog { + this := ApplicationLog{} + return &this +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *ApplicationLog) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationLog) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *ApplicationLog) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *ApplicationLog) SetMessage(v string) { + o.Message = &v +} + +func (o ApplicationLog) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationLog) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ApplicationLog) UnmarshalJSON(data []byte) (err error) { + varApplicationLog := _ApplicationLog{} + + err = json.Unmarshal(data, &varApplicationLog) + + if err != nil { + return err + } + + *o = ApplicationLog(varApplicationLog) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplicationLog struct { + value *ApplicationLog + isSet bool +} + +func (v NullableApplicationLog) Get() *ApplicationLog { + return v.value +} + +func (v *NullableApplicationLog) Set(val *ApplicationLog) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationLog) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationLog) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationLog(val *ApplicationLog) *NullableApplicationLog { + return &NullableApplicationLog{value: val, isSet: true} +} + +func (v NullableApplicationLog) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationLog) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application_manual_scaling.go b/services/sca/v1betaapi/model_application_manual_scaling.go new file mode 100644 index 0000000000..5c0eb4413a --- /dev/null +++ b/services/sca/v1betaapi/model_application_manual_scaling.go @@ -0,0 +1,167 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the ApplicationManualScaling type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationManualScaling{} + +// ApplicationManualScaling ManualScaling configuration. +type ApplicationManualScaling struct { + // Number of instances to run. + Instances int32 `json:"instances"` + AdditionalProperties map[string]interface{} +} + +type _ApplicationManualScaling ApplicationManualScaling + +// NewApplicationManualScaling instantiates a new ApplicationManualScaling 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 NewApplicationManualScaling(instances int32) *ApplicationManualScaling { + this := ApplicationManualScaling{} + this.Instances = instances + return &this +} + +// NewApplicationManualScalingWithDefaults instantiates a new ApplicationManualScaling 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 NewApplicationManualScalingWithDefaults() *ApplicationManualScaling { + this := ApplicationManualScaling{} + return &this +} + +// GetInstances returns the Instances field value +func (o *ApplicationManualScaling) GetInstances() int32 { + if o == nil { + var ret int32 + 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 *ApplicationManualScaling) GetInstancesOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Instances, true +} + +// SetInstances sets field value +func (o *ApplicationManualScaling) SetInstances(v int32) { + o.Instances = v +} + +func (o ApplicationManualScaling) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationManualScaling) 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 *ApplicationManualScaling) 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) + } + } + + varApplicationManualScaling := _ApplicationManualScaling{} + + err = json.Unmarshal(data, &varApplicationManualScaling) + + if err != nil { + return err + } + + *o = ApplicationManualScaling(varApplicationManualScaling) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "instances") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplicationManualScaling struct { + value *ApplicationManualScaling + isSet bool +} + +func (v NullableApplicationManualScaling) Get() *ApplicationManualScaling { + return v.value +} + +func (v *NullableApplicationManualScaling) Set(val *ApplicationManualScaling) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationManualScaling) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationManualScaling) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationManualScaling(val *ApplicationManualScaling) *NullableApplicationManualScaling { + return &NullableApplicationManualScaling{value: val, isSet: true} +} + +func (v NullableApplicationManualScaling) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationManualScaling) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application_network.go b/services/sca/v1betaapi/model_application_network.go new file mode 100644 index 0000000000..1e3f5c89ac --- /dev/null +++ b/services/sca/v1betaapi/model_application_network.go @@ -0,0 +1,190 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the ApplicationNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationNetwork{} + +// ApplicationNetwork Network configuration for an application. +type ApplicationNetwork struct { + Internal *ApplicationInternalNetwork `json:"internal,omitempty"` + Public *ApplicationPublicNetwork `json:"public,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ApplicationNetwork ApplicationNetwork + +// NewApplicationNetwork instantiates a new ApplicationNetwork 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 NewApplicationNetwork() *ApplicationNetwork { + this := ApplicationNetwork{} + return &this +} + +// NewApplicationNetworkWithDefaults instantiates a new ApplicationNetwork 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 NewApplicationNetworkWithDefaults() *ApplicationNetwork { + this := ApplicationNetwork{} + return &this +} + +// GetInternal returns the Internal field value if set, zero value otherwise. +func (o *ApplicationNetwork) GetInternal() ApplicationInternalNetwork { + if o == nil || IsNil(o.Internal) { + var ret ApplicationInternalNetwork + return ret + } + return *o.Internal +} + +// GetInternalOk returns a tuple with the Internal field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationNetwork) GetInternalOk() (*ApplicationInternalNetwork, bool) { + if o == nil || IsNil(o.Internal) { + return nil, false + } + return o.Internal, true +} + +// HasInternal returns a boolean if a field has been set. +func (o *ApplicationNetwork) HasInternal() bool { + if o != nil && !IsNil(o.Internal) { + return true + } + + return false +} + +// SetInternal gets a reference to the given ApplicationInternalNetwork and assigns it to the Internal field. +func (o *ApplicationNetwork) SetInternal(v ApplicationInternalNetwork) { + o.Internal = &v +} + +// GetPublic returns the Public field value if set, zero value otherwise. +func (o *ApplicationNetwork) GetPublic() ApplicationPublicNetwork { + if o == nil || IsNil(o.Public) { + var ret ApplicationPublicNetwork + return ret + } + return *o.Public +} + +// GetPublicOk returns a tuple with the Public field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationNetwork) GetPublicOk() (*ApplicationPublicNetwork, bool) { + if o == nil || IsNil(o.Public) { + return nil, false + } + return o.Public, true +} + +// HasPublic returns a boolean if a field has been set. +func (o *ApplicationNetwork) HasPublic() bool { + if o != nil && !IsNil(o.Public) { + return true + } + + return false +} + +// SetPublic gets a reference to the given ApplicationPublicNetwork and assigns it to the Public field. +func (o *ApplicationNetwork) SetPublic(v ApplicationPublicNetwork) { + o.Public = &v +} + +func (o ApplicationNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationNetwork) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Internal) { + toSerialize["internal"] = o.Internal + } + if !IsNil(o.Public) { + toSerialize["public"] = o.Public + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ApplicationNetwork) UnmarshalJSON(data []byte) (err error) { + varApplicationNetwork := _ApplicationNetwork{} + + err = json.Unmarshal(data, &varApplicationNetwork) + + if err != nil { + return err + } + + *o = ApplicationNetwork(varApplicationNetwork) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "internal") + delete(additionalProperties, "public") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplicationNetwork struct { + value *ApplicationNetwork + isSet bool +} + +func (v NullableApplicationNetwork) Get() *ApplicationNetwork { + return v.value +} + +func (v *NullableApplicationNetwork) Set(val *ApplicationNetwork) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationNetwork(val *ApplicationNetwork) *NullableApplicationNetwork { + return &NullableApplicationNetwork{value: val, isSet: true} +} + +func (v NullableApplicationNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application_public_network.go b/services/sca/v1betaapi/model_application_public_network.go new file mode 100644 index 0000000000..c554ae06c4 --- /dev/null +++ b/services/sca/v1betaapi/model_application_public_network.go @@ -0,0 +1,242 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the ApplicationPublicNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationPublicNetwork{} + +// ApplicationPublicNetwork struct for ApplicationPublicNetwork +type ApplicationPublicNetwork struct { + AccessControl *ApplicationAccessControl `json:"accessControl,omitempty"` + // Enable or disable public networking. + Enabled bool `json:"enabled"` + // Port to expose the application. + Port *int32 `json:"port,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ApplicationPublicNetwork ApplicationPublicNetwork + +// NewApplicationPublicNetwork instantiates a new ApplicationPublicNetwork 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 NewApplicationPublicNetwork(enabled bool) *ApplicationPublicNetwork { + this := ApplicationPublicNetwork{} + this.Enabled = enabled + return &this +} + +// NewApplicationPublicNetworkWithDefaults instantiates a new ApplicationPublicNetwork 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 NewApplicationPublicNetworkWithDefaults() *ApplicationPublicNetwork { + this := ApplicationPublicNetwork{} + return &this +} + +// GetAccessControl returns the AccessControl field value if set, zero value otherwise. +func (o *ApplicationPublicNetwork) GetAccessControl() ApplicationAccessControl { + if o == nil || IsNil(o.AccessControl) { + var ret ApplicationAccessControl + return ret + } + return *o.AccessControl +} + +// GetAccessControlOk returns a tuple with the AccessControl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationPublicNetwork) GetAccessControlOk() (*ApplicationAccessControl, bool) { + if o == nil || IsNil(o.AccessControl) { + return nil, false + } + return o.AccessControl, true +} + +// HasAccessControl returns a boolean if a field has been set. +func (o *ApplicationPublicNetwork) HasAccessControl() bool { + if o != nil && !IsNil(o.AccessControl) { + return true + } + + return false +} + +// SetAccessControl gets a reference to the given ApplicationAccessControl and assigns it to the AccessControl field. +func (o *ApplicationPublicNetwork) SetAccessControl(v ApplicationAccessControl) { + o.AccessControl = &v +} + +// GetEnabled returns the Enabled field value +func (o *ApplicationPublicNetwork) GetEnabled() bool { + if o == nil { + var ret bool + return ret + } + + return o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value +// and a boolean to check if the value has been set. +func (o *ApplicationPublicNetwork) GetEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Enabled, true +} + +// SetEnabled sets field value +func (o *ApplicationPublicNetwork) SetEnabled(v bool) { + o.Enabled = v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *ApplicationPublicNetwork) 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 *ApplicationPublicNetwork) 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 *ApplicationPublicNetwork) 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 *ApplicationPublicNetwork) SetPort(v int32) { + o.Port = &v +} + +func (o ApplicationPublicNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationPublicNetwork) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AccessControl) { + toSerialize["accessControl"] = o.AccessControl + } + toSerialize["enabled"] = o.Enabled + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ApplicationPublicNetwork) 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{ + "enabled", + } + + 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) + } + } + + varApplicationPublicNetwork := _ApplicationPublicNetwork{} + + err = json.Unmarshal(data, &varApplicationPublicNetwork) + + if err != nil { + return err + } + + *o = ApplicationPublicNetwork(varApplicationPublicNetwork) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "accessControl") + delete(additionalProperties, "enabled") + delete(additionalProperties, "port") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplicationPublicNetwork struct { + value *ApplicationPublicNetwork + isSet bool +} + +func (v NullableApplicationPublicNetwork) Get() *ApplicationPublicNetwork { + return v.value +} + +func (v *NullableApplicationPublicNetwork) Set(val *ApplicationPublicNetwork) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationPublicNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationPublicNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationPublicNetwork(val *ApplicationPublicNetwork) *NullableApplicationPublicNetwork { + return &NullableApplicationPublicNetwork{value: val, isSet: true} +} + +func (v NullableApplicationPublicNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationPublicNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application_rule_type.go b/services/sca/v1betaapi/model_application_rule_type.go new file mode 100644 index 0000000000..b8b2ca76e7 --- /dev/null +++ b/services/sca/v1betaapi/model_application_rule_type.go @@ -0,0 +1,115 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// ApplicationRuleType - RULE_TYPE_UNSPECIFIED: Used as zero value. - RULE_TYPE_HTTP: HTTP scaling rule. - RULE_TYPE_CUSTOM: Custom scaling rule (e.g. KEDA). +type ApplicationRuleType string + +// List of ApplicationRuleType +const ( + APPLICATIONRULETYPE_RULE_TYPE_UNSPECIFIED ApplicationRuleType = "RULE_TYPE_UNSPECIFIED" + APPLICATIONRULETYPE_RULE_TYPE_HTTP ApplicationRuleType = "RULE_TYPE_HTTP" + APPLICATIONRULETYPE_RULE_TYPE_CUSTOM ApplicationRuleType = "RULE_TYPE_CUSTOM" + APPLICATIONRULETYPE_UNKNOWN_DEFAULT_OPEN_API ApplicationRuleType = "unknown_default_open_api" +) + +// All allowed values of ApplicationRuleType enum +var AllowedApplicationRuleTypeEnumValues = []ApplicationRuleType{ + "RULE_TYPE_UNSPECIFIED", + "RULE_TYPE_HTTP", + "RULE_TYPE_CUSTOM", + "unknown_default_open_api", +} + +func (v *ApplicationRuleType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ApplicationRuleType(value) + for _, existing := range AllowedApplicationRuleTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = APPLICATIONRULETYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewApplicationRuleTypeFromValue returns a pointer to a valid ApplicationRuleType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewApplicationRuleTypeFromValue(v string) (*ApplicationRuleType, error) { + ev := ApplicationRuleType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ApplicationRuleType: valid values are %v", v, AllowedApplicationRuleTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ApplicationRuleType) IsValid() bool { + for _, existing := range AllowedApplicationRuleTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ApplicationRuleType value +func (v ApplicationRuleType) Ptr() *ApplicationRuleType { + return &v +} + +type NullableApplicationRuleType struct { + value *ApplicationRuleType + isSet bool +} + +func (v NullableApplicationRuleType) Get() *ApplicationRuleType { + return v.value +} + +func (v *NullableApplicationRuleType) Set(val *ApplicationRuleType) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationRuleType) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationRuleType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationRuleType(val *ApplicationRuleType) *NullableApplicationRuleType { + return &NullableApplicationRuleType{value: val, isSet: true} +} + +func (v NullableApplicationRuleType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationRuleType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application_scale_rule.go b/services/sca/v1betaapi/model_application_scale_rule.go new file mode 100644 index 0000000000..4e93e41e67 --- /dev/null +++ b/services/sca/v1betaapi/model_application_scale_rule.go @@ -0,0 +1,272 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the ApplicationScaleRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationScaleRule{} + +// ApplicationScaleRule ScaleRule defines one autoscaling trigger. +type ApplicationScaleRule struct { + CustomRule *ApplicationCustomScaleRule `json:"customRule,omitempty"` + HttpRule *ApplicationHttpScaleRule `json:"httpRule,omitempty"` + // Rule name. + Name string `json:"name"` + Type ApplicationRuleType `json:"type"` + AdditionalProperties map[string]interface{} +} + +type _ApplicationScaleRule ApplicationScaleRule + +// NewApplicationScaleRule instantiates a new ApplicationScaleRule 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 NewApplicationScaleRule(name string, types ApplicationRuleType) *ApplicationScaleRule { + this := ApplicationScaleRule{} + this.Name = name + this.Type = types + return &this +} + +// NewApplicationScaleRuleWithDefaults instantiates a new ApplicationScaleRule 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 NewApplicationScaleRuleWithDefaults() *ApplicationScaleRule { + this := ApplicationScaleRule{} + var types ApplicationRuleType = APPLICATIONRULETYPE_RULE_TYPE_UNSPECIFIED + this.Type = types + return &this +} + +// GetCustomRule returns the CustomRule field value if set, zero value otherwise. +func (o *ApplicationScaleRule) GetCustomRule() ApplicationCustomScaleRule { + if o == nil || IsNil(o.CustomRule) { + var ret ApplicationCustomScaleRule + return ret + } + return *o.CustomRule +} + +// GetCustomRuleOk returns a tuple with the CustomRule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationScaleRule) GetCustomRuleOk() (*ApplicationCustomScaleRule, bool) { + if o == nil || IsNil(o.CustomRule) { + return nil, false + } + return o.CustomRule, true +} + +// HasCustomRule returns a boolean if a field has been set. +func (o *ApplicationScaleRule) HasCustomRule() bool { + if o != nil && !IsNil(o.CustomRule) { + return true + } + + return false +} + +// SetCustomRule gets a reference to the given ApplicationCustomScaleRule and assigns it to the CustomRule field. +func (o *ApplicationScaleRule) SetCustomRule(v ApplicationCustomScaleRule) { + o.CustomRule = &v +} + +// GetHttpRule returns the HttpRule field value if set, zero value otherwise. +func (o *ApplicationScaleRule) GetHttpRule() ApplicationHttpScaleRule { + if o == nil || IsNil(o.HttpRule) { + var ret ApplicationHttpScaleRule + return ret + } + return *o.HttpRule +} + +// GetHttpRuleOk returns a tuple with the HttpRule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationScaleRule) GetHttpRuleOk() (*ApplicationHttpScaleRule, bool) { + if o == nil || IsNil(o.HttpRule) { + return nil, false + } + return o.HttpRule, true +} + +// HasHttpRule returns a boolean if a field has been set. +func (o *ApplicationScaleRule) HasHttpRule() bool { + if o != nil && !IsNil(o.HttpRule) { + return true + } + + return false +} + +// SetHttpRule gets a reference to the given ApplicationHttpScaleRule and assigns it to the HttpRule field. +func (o *ApplicationScaleRule) SetHttpRule(v ApplicationHttpScaleRule) { + o.HttpRule = &v +} + +// GetName returns the Name field value +func (o *ApplicationScaleRule) 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 *ApplicationScaleRule) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ApplicationScaleRule) SetName(v string) { + o.Name = v +} + +// GetType returns the Type field value +func (o *ApplicationScaleRule) GetType() ApplicationRuleType { + if o == nil { + var ret ApplicationRuleType + 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 *ApplicationScaleRule) GetTypeOk() (*ApplicationRuleType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ApplicationScaleRule) SetType(v ApplicationRuleType) { + o.Type = v +} + +func (o ApplicationScaleRule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationScaleRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CustomRule) { + toSerialize["customRule"] = o.CustomRule + } + if !IsNil(o.HttpRule) { + toSerialize["httpRule"] = o.HttpRule + } + toSerialize["name"] = o.Name + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ApplicationScaleRule) 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{ + "name", + "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) + } + } + + varApplicationScaleRule := _ApplicationScaleRule{} + + err = json.Unmarshal(data, &varApplicationScaleRule) + + if err != nil { + return err + } + + *o = ApplicationScaleRule(varApplicationScaleRule) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "customRule") + delete(additionalProperties, "httpRule") + delete(additionalProperties, "name") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplicationScaleRule struct { + value *ApplicationScaleRule + isSet bool +} + +func (v NullableApplicationScaleRule) Get() *ApplicationScaleRule { + return v.value +} + +func (v *NullableApplicationScaleRule) Set(val *ApplicationScaleRule) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationScaleRule) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationScaleRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationScaleRule(val *ApplicationScaleRule) *NullableApplicationScaleRule { + return &NullableApplicationScaleRule{value: val, isSet: true} +} + +func (v NullableApplicationScaleRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationScaleRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application_scaling.go b/services/sca/v1betaapi/model_application_scaling.go new file mode 100644 index 0000000000..6fece9e3b6 --- /dev/null +++ b/services/sca/v1betaapi/model_application_scaling.go @@ -0,0 +1,242 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the ApplicationScaling type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationScaling{} + +// ApplicationScaling Scaling configuration for the application. +type ApplicationScaling struct { + AutoScaling *ApplicationAutoScaling `json:"autoScaling,omitempty"` + ManualScaling *ApplicationManualScaling `json:"manualScaling,omitempty"` + Type ApplicationScalingType `json:"type"` + AdditionalProperties map[string]interface{} +} + +type _ApplicationScaling ApplicationScaling + +// NewApplicationScaling instantiates a new ApplicationScaling 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 NewApplicationScaling(types ApplicationScalingType) *ApplicationScaling { + this := ApplicationScaling{} + this.Type = types + return &this +} + +// NewApplicationScalingWithDefaults instantiates a new ApplicationScaling 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 NewApplicationScalingWithDefaults() *ApplicationScaling { + this := ApplicationScaling{} + var types ApplicationScalingType = APPLICATIONSCALINGTYPE_SCALING_TYPE_UNSPECIFIED + this.Type = types + return &this +} + +// GetAutoScaling returns the AutoScaling field value if set, zero value otherwise. +func (o *ApplicationScaling) GetAutoScaling() ApplicationAutoScaling { + if o == nil || IsNil(o.AutoScaling) { + var ret ApplicationAutoScaling + return ret + } + return *o.AutoScaling +} + +// GetAutoScalingOk returns a tuple with the AutoScaling field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationScaling) GetAutoScalingOk() (*ApplicationAutoScaling, bool) { + if o == nil || IsNil(o.AutoScaling) { + return nil, false + } + return o.AutoScaling, true +} + +// HasAutoScaling returns a boolean if a field has been set. +func (o *ApplicationScaling) HasAutoScaling() bool { + if o != nil && !IsNil(o.AutoScaling) { + return true + } + + return false +} + +// SetAutoScaling gets a reference to the given ApplicationAutoScaling and assigns it to the AutoScaling field. +func (o *ApplicationScaling) SetAutoScaling(v ApplicationAutoScaling) { + o.AutoScaling = &v +} + +// GetManualScaling returns the ManualScaling field value if set, zero value otherwise. +func (o *ApplicationScaling) GetManualScaling() ApplicationManualScaling { + if o == nil || IsNil(o.ManualScaling) { + var ret ApplicationManualScaling + return ret + } + return *o.ManualScaling +} + +// GetManualScalingOk returns a tuple with the ManualScaling field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationScaling) GetManualScalingOk() (*ApplicationManualScaling, bool) { + if o == nil || IsNil(o.ManualScaling) { + return nil, false + } + return o.ManualScaling, true +} + +// HasManualScaling returns a boolean if a field has been set. +func (o *ApplicationScaling) HasManualScaling() bool { + if o != nil && !IsNil(o.ManualScaling) { + return true + } + + return false +} + +// SetManualScaling gets a reference to the given ApplicationManualScaling and assigns it to the ManualScaling field. +func (o *ApplicationScaling) SetManualScaling(v ApplicationManualScaling) { + o.ManualScaling = &v +} + +// GetType returns the Type field value +func (o *ApplicationScaling) GetType() ApplicationScalingType { + if o == nil { + var ret ApplicationScalingType + 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 *ApplicationScaling) GetTypeOk() (*ApplicationScalingType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ApplicationScaling) SetType(v ApplicationScalingType) { + o.Type = v +} + +func (o ApplicationScaling) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationScaling) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AutoScaling) { + toSerialize["autoScaling"] = o.AutoScaling + } + if !IsNil(o.ManualScaling) { + toSerialize["manualScaling"] = o.ManualScaling + } + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ApplicationScaling) 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{ + "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) + } + } + + varApplicationScaling := _ApplicationScaling{} + + err = json.Unmarshal(data, &varApplicationScaling) + + if err != nil { + return err + } + + *o = ApplicationScaling(varApplicationScaling) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "autoScaling") + delete(additionalProperties, "manualScaling") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplicationScaling struct { + value *ApplicationScaling + isSet bool +} + +func (v NullableApplicationScaling) Get() *ApplicationScaling { + return v.value +} + +func (v *NullableApplicationScaling) Set(val *ApplicationScaling) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationScaling) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationScaling) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationScaling(val *ApplicationScaling) *NullableApplicationScaling { + return &NullableApplicationScaling{value: val, isSet: true} +} + +func (v NullableApplicationScaling) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationScaling) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application_scaling_type.go b/services/sca/v1betaapi/model_application_scaling_type.go new file mode 100644 index 0000000000..287fe5b701 --- /dev/null +++ b/services/sca/v1betaapi/model_application_scaling_type.go @@ -0,0 +1,115 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// ApplicationScalingType ScalingType for the scaling configuration of the application. - SCALING_TYPE_UNSPECIFIED: Used as zero value. - SCALING_TYPE_AUTO: Auto scaling based on rules. - SCALING_TYPE_MANUAL: Manual scaling with fixed number of instances. +type ApplicationScalingType string + +// List of ApplicationScalingType +const ( + APPLICATIONSCALINGTYPE_SCALING_TYPE_UNSPECIFIED ApplicationScalingType = "SCALING_TYPE_UNSPECIFIED" + APPLICATIONSCALINGTYPE_SCALING_TYPE_AUTO ApplicationScalingType = "SCALING_TYPE_AUTO" + APPLICATIONSCALINGTYPE_SCALING_TYPE_MANUAL ApplicationScalingType = "SCALING_TYPE_MANUAL" + APPLICATIONSCALINGTYPE_UNKNOWN_DEFAULT_OPEN_API ApplicationScalingType = "unknown_default_open_api" +) + +// All allowed values of ApplicationScalingType enum +var AllowedApplicationScalingTypeEnumValues = []ApplicationScalingType{ + "SCALING_TYPE_UNSPECIFIED", + "SCALING_TYPE_AUTO", + "SCALING_TYPE_MANUAL", + "unknown_default_open_api", +} + +func (v *ApplicationScalingType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ApplicationScalingType(value) + for _, existing := range AllowedApplicationScalingTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = APPLICATIONSCALINGTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewApplicationScalingTypeFromValue returns a pointer to a valid ApplicationScalingType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewApplicationScalingTypeFromValue(v string) (*ApplicationScalingType, error) { + ev := ApplicationScalingType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ApplicationScalingType: valid values are %v", v, AllowedApplicationScalingTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ApplicationScalingType) IsValid() bool { + for _, existing := range AllowedApplicationScalingTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ApplicationScalingType value +func (v ApplicationScalingType) Ptr() *ApplicationScalingType { + return &v +} + +type NullableApplicationScalingType struct { + value *ApplicationScalingType + isSet bool +} + +func (v NullableApplicationScalingType) Get() *ApplicationScalingType { + return v.value +} + +func (v *NullableApplicationScalingType) Set(val *ApplicationScalingType) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationScalingType) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationScalingType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationScalingType(val *ApplicationScalingType) *NullableApplicationScalingType { + return &NullableApplicationScalingType{value: val, isSet: true} +} + +func (v NullableApplicationScalingType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationScalingType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application_status.go b/services/sca/v1betaapi/model_application_status.go new file mode 100644 index 0000000000..c8a9ee19fa --- /dev/null +++ b/services/sca/v1betaapi/model_application_status.go @@ -0,0 +1,270 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "time" +) + +// checks if the ApplicationStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationStatus{} + +// ApplicationStatus Status of the application. +type ApplicationStatus struct { + Current *ApplicationCurrentStatus `json:"current,omitempty"` + Domains *ApplicationDomains `json:"domains,omitempty"` + Instances []ApplicationInstance `json:"instances,omitempty"` + // Last time the application was deployed. + LastDeployment *time.Time `json:"lastDeployment,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ApplicationStatus ApplicationStatus + +// NewApplicationStatus instantiates a new ApplicationStatus 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 NewApplicationStatus() *ApplicationStatus { + this := ApplicationStatus{} + var current ApplicationCurrentStatus = APPLICATIONCURRENTSTATUS_CURRENT_STATUS_UNSPECIFIED + this.Current = ¤t + return &this +} + +// NewApplicationStatusWithDefaults instantiates a new ApplicationStatus 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 NewApplicationStatusWithDefaults() *ApplicationStatus { + this := ApplicationStatus{} + var current ApplicationCurrentStatus = APPLICATIONCURRENTSTATUS_CURRENT_STATUS_UNSPECIFIED + this.Current = ¤t + return &this +} + +// GetCurrent returns the Current field value if set, zero value otherwise. +func (o *ApplicationStatus) GetCurrent() ApplicationCurrentStatus { + if o == nil || IsNil(o.Current) { + var ret ApplicationCurrentStatus + return ret + } + return *o.Current +} + +// GetCurrentOk returns a tuple with the Current field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationStatus) GetCurrentOk() (*ApplicationCurrentStatus, bool) { + if o == nil || IsNil(o.Current) { + return nil, false + } + return o.Current, true +} + +// HasCurrent returns a boolean if a field has been set. +func (o *ApplicationStatus) HasCurrent() bool { + if o != nil && !IsNil(o.Current) { + return true + } + + return false +} + +// SetCurrent gets a reference to the given ApplicationCurrentStatus and assigns it to the Current field. +func (o *ApplicationStatus) SetCurrent(v ApplicationCurrentStatus) { + o.Current = &v +} + +// GetDomains returns the Domains field value if set, zero value otherwise. +func (o *ApplicationStatus) GetDomains() ApplicationDomains { + if o == nil || IsNil(o.Domains) { + var ret ApplicationDomains + return ret + } + return *o.Domains +} + +// GetDomainsOk returns a tuple with the Domains field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationStatus) GetDomainsOk() (*ApplicationDomains, bool) { + if o == nil || IsNil(o.Domains) { + return nil, false + } + return o.Domains, true +} + +// HasDomains returns a boolean if a field has been set. +func (o *ApplicationStatus) HasDomains() bool { + if o != nil && !IsNil(o.Domains) { + return true + } + + return false +} + +// SetDomains gets a reference to the given ApplicationDomains and assigns it to the Domains field. +func (o *ApplicationStatus) SetDomains(v ApplicationDomains) { + o.Domains = &v +} + +// GetInstances returns the Instances field value if set, zero value otherwise. +func (o *ApplicationStatus) GetInstances() []ApplicationInstance { + if o == nil || IsNil(o.Instances) { + var ret []ApplicationInstance + return ret + } + return o.Instances +} + +// GetInstancesOk returns a tuple with the Instances field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationStatus) GetInstancesOk() ([]ApplicationInstance, bool) { + if o == nil || IsNil(o.Instances) { + return nil, false + } + return o.Instances, true +} + +// HasInstances returns a boolean if a field has been set. +func (o *ApplicationStatus) HasInstances() bool { + if o != nil && !IsNil(o.Instances) { + return true + } + + return false +} + +// SetInstances gets a reference to the given []ApplicationInstance and assigns it to the Instances field. +func (o *ApplicationStatus) SetInstances(v []ApplicationInstance) { + o.Instances = v +} + +// GetLastDeployment returns the LastDeployment field value if set, zero value otherwise. +func (o *ApplicationStatus) GetLastDeployment() time.Time { + if o == nil || IsNil(o.LastDeployment) { + var ret time.Time + return ret + } + return *o.LastDeployment +} + +// GetLastDeploymentOk returns a tuple with the LastDeployment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationStatus) GetLastDeploymentOk() (*time.Time, bool) { + if o == nil || IsNil(o.LastDeployment) { + return nil, false + } + return o.LastDeployment, true +} + +// HasLastDeployment returns a boolean if a field has been set. +func (o *ApplicationStatus) HasLastDeployment() bool { + if o != nil && !IsNil(o.LastDeployment) { + return true + } + + return false +} + +// SetLastDeployment gets a reference to the given time.Time and assigns it to the LastDeployment field. +func (o *ApplicationStatus) SetLastDeployment(v time.Time) { + o.LastDeployment = &v +} + +func (o ApplicationStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Current) { + toSerialize["current"] = o.Current + } + if !IsNil(o.Domains) { + toSerialize["domains"] = o.Domains + } + if !IsNil(o.Instances) { + toSerialize["instances"] = o.Instances + } + if !IsNil(o.LastDeployment) { + toSerialize["lastDeployment"] = o.LastDeployment + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ApplicationStatus) UnmarshalJSON(data []byte) (err error) { + varApplicationStatus := _ApplicationStatus{} + + err = json.Unmarshal(data, &varApplicationStatus) + + if err != nil { + return err + } + + *o = ApplicationStatus(varApplicationStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "current") + delete(additionalProperties, "domains") + delete(additionalProperties, "instances") + delete(additionalProperties, "lastDeployment") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplicationStatus struct { + value *ApplicationStatus + isSet bool +} + +func (v NullableApplicationStatus) Get() *ApplicationStatus { + return v.value +} + +func (v *NullableApplicationStatus) Set(val *ApplicationStatus) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationStatus(val *ApplicationStatus) *NullableApplicationStatus { + return &NullableApplicationStatus{value: val, isSet: true} +} + +func (v NullableApplicationStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_application_summary.go b/services/sca/v1betaapi/model_application_summary.go new file mode 100644 index 0000000000..9816af0537 --- /dev/null +++ b/services/sca/v1betaapi/model_application_summary.go @@ -0,0 +1,458 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "time" +) + +// checks if the ApplicationSummary type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationSummary{} + +// ApplicationSummary ApplicationSummary describes a briefer representation of an application. +type ApplicationSummary struct { + // Creation date in RFC3339 format. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Human-readable display name. + DisplayName *string `json:"displayName,omitempty"` + // Environment identifier where the application belongs. + EnvironmentId *string `json:"environmentId,omitempty"` + // Environment human-readable display name. + EnvironmentName *string `json:"environmentName,omitempty"` + // Application identifier. + Id *string `json:"id,omitempty"` + // Region of the environment. + Region *string `json:"region,omitempty"` + Status *ApplicationStatus `json:"status,omitempty"` + // Indicates if the application resources are stopped. + Stopped *bool `json:"stopped,omitempty"` + // Last update date in RFC3339 format. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ApplicationSummary ApplicationSummary + +// NewApplicationSummary instantiates a new ApplicationSummary 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 NewApplicationSummary() *ApplicationSummary { + this := ApplicationSummary{} + return &this +} + +// NewApplicationSummaryWithDefaults instantiates a new ApplicationSummary 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 NewApplicationSummaryWithDefaults() *ApplicationSummary { + this := ApplicationSummary{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *ApplicationSummary) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationSummary) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *ApplicationSummary) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *ApplicationSummary) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDisplayName returns the DisplayName field value if set, zero value otherwise. +func (o *ApplicationSummary) GetDisplayName() string { + if o == nil || IsNil(o.DisplayName) { + var ret string + return ret + } + return *o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationSummary) GetDisplayNameOk() (*string, bool) { + if o == nil || IsNil(o.DisplayName) { + return nil, false + } + return o.DisplayName, true +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *ApplicationSummary) HasDisplayName() bool { + if o != nil && !IsNil(o.DisplayName) { + return true + } + + return false +} + +// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. +func (o *ApplicationSummary) SetDisplayName(v string) { + o.DisplayName = &v +} + +// GetEnvironmentId returns the EnvironmentId field value if set, zero value otherwise. +func (o *ApplicationSummary) GetEnvironmentId() string { + if o == nil || IsNil(o.EnvironmentId) { + var ret string + return ret + } + return *o.EnvironmentId +} + +// GetEnvironmentIdOk returns a tuple with the EnvironmentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationSummary) GetEnvironmentIdOk() (*string, bool) { + if o == nil || IsNil(o.EnvironmentId) { + return nil, false + } + return o.EnvironmentId, true +} + +// HasEnvironmentId returns a boolean if a field has been set. +func (o *ApplicationSummary) HasEnvironmentId() bool { + if o != nil && !IsNil(o.EnvironmentId) { + return true + } + + return false +} + +// SetEnvironmentId gets a reference to the given string and assigns it to the EnvironmentId field. +func (o *ApplicationSummary) SetEnvironmentId(v string) { + o.EnvironmentId = &v +} + +// GetEnvironmentName returns the EnvironmentName field value if set, zero value otherwise. +func (o *ApplicationSummary) GetEnvironmentName() string { + if o == nil || IsNil(o.EnvironmentName) { + var ret string + return ret + } + return *o.EnvironmentName +} + +// GetEnvironmentNameOk returns a tuple with the EnvironmentName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationSummary) GetEnvironmentNameOk() (*string, bool) { + if o == nil || IsNil(o.EnvironmentName) { + return nil, false + } + return o.EnvironmentName, true +} + +// HasEnvironmentName returns a boolean if a field has been set. +func (o *ApplicationSummary) HasEnvironmentName() bool { + if o != nil && !IsNil(o.EnvironmentName) { + return true + } + + return false +} + +// SetEnvironmentName gets a reference to the given string and assigns it to the EnvironmentName field. +func (o *ApplicationSummary) SetEnvironmentName(v string) { + o.EnvironmentName = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *ApplicationSummary) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationSummary) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *ApplicationSummary) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *ApplicationSummary) SetId(v string) { + o.Id = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *ApplicationSummary) GetRegion() string { + if o == nil || IsNil(o.Region) { + var ret string + return ret + } + return *o.Region +} + +// GetRegionOk returns a tuple with the Region field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationSummary) GetRegionOk() (*string, bool) { + if o == nil || IsNil(o.Region) { + return nil, false + } + return o.Region, true +} + +// HasRegion returns a boolean if a field has been set. +func (o *ApplicationSummary) HasRegion() bool { + if o != nil && !IsNil(o.Region) { + return true + } + + return false +} + +// SetRegion gets a reference to the given string and assigns it to the Region field. +func (o *ApplicationSummary) SetRegion(v string) { + o.Region = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *ApplicationSummary) GetStatus() ApplicationStatus { + if o == nil || IsNil(o.Status) { + var ret ApplicationStatus + 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 *ApplicationSummary) GetStatusOk() (*ApplicationStatus, 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 *ApplicationSummary) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given ApplicationStatus and assigns it to the Status field. +func (o *ApplicationSummary) SetStatus(v ApplicationStatus) { + o.Status = &v +} + +// GetStopped returns the Stopped field value if set, zero value otherwise. +func (o *ApplicationSummary) GetStopped() bool { + if o == nil || IsNil(o.Stopped) { + var ret bool + return ret + } + return *o.Stopped +} + +// GetStoppedOk returns a tuple with the Stopped field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationSummary) GetStoppedOk() (*bool, bool) { + if o == nil || IsNil(o.Stopped) { + return nil, false + } + return o.Stopped, true +} + +// HasStopped returns a boolean if a field has been set. +func (o *ApplicationSummary) HasStopped() bool { + if o != nil && !IsNil(o.Stopped) { + return true + } + + return false +} + +// SetStopped gets a reference to the given bool and assigns it to the Stopped field. +func (o *ApplicationSummary) SetStopped(v bool) { + o.Stopped = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *ApplicationSummary) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationSummary) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *ApplicationSummary) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *ApplicationSummary) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o ApplicationSummary) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationSummary) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.DisplayName) { + toSerialize["displayName"] = o.DisplayName + } + if !IsNil(o.EnvironmentId) { + toSerialize["environmentId"] = o.EnvironmentId + } + if !IsNil(o.EnvironmentName) { + toSerialize["environmentName"] = o.EnvironmentName + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Region) { + toSerialize["region"] = o.Region + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Stopped) { + toSerialize["stopped"] = o.Stopped + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ApplicationSummary) UnmarshalJSON(data []byte) (err error) { + varApplicationSummary := _ApplicationSummary{} + + err = json.Unmarshal(data, &varApplicationSummary) + + if err != nil { + return err + } + + *o = ApplicationSummary(varApplicationSummary) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "createdAt") + delete(additionalProperties, "displayName") + delete(additionalProperties, "environmentId") + delete(additionalProperties, "environmentName") + delete(additionalProperties, "id") + delete(additionalProperties, "region") + delete(additionalProperties, "status") + delete(additionalProperties, "stopped") + delete(additionalProperties, "updatedAt") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplicationSummary struct { + value *ApplicationSummary + isSet bool +} + +func (v NullableApplicationSummary) Get() *ApplicationSummary { + return v.value +} + +func (v *NullableApplicationSummary) Set(val *ApplicationSummary) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationSummary) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationSummary) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationSummary(val *ApplicationSummary) *NullableApplicationSummary { + return &NullableApplicationSummary{value: val, isSet: true} +} + +func (v NullableApplicationSummary) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationSummary) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_container.go b/services/sca/v1betaapi/model_container.go new file mode 100644 index 0000000000..c900b93d85 --- /dev/null +++ b/services/sca/v1betaapi/model_container.go @@ -0,0 +1,387 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the Container type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Container{} + +// Container Container describes a simplified container configuration for the application. +type Container struct { + // Container argument override. + Args []string `json:"args,omitempty"` + // Container command override. + Command []string `json:"command,omitempty"` + // CPU limit for the container. + Cpu *int32 `json:"cpu,omitempty"` + // Environment variables exposed to the container. + EnvironmentVariables []ContainerEnvVar `json:"environmentVariables,omitempty"` + // Container image configuration. + Image string `json:"image"` + // Memory limit for the container. + Memory *int32 `json:"memory,omitempty"` + // Container name. + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _Container Container + +// NewContainer instantiates a new Container 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 NewContainer(image string, name string) *Container { + this := Container{} + this.Image = image + this.Name = name + return &this +} + +// NewContainerWithDefaults instantiates a new Container 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 NewContainerWithDefaults() *Container { + this := Container{} + return &this +} + +// GetArgs returns the Args field value if set, zero value otherwise. +func (o *Container) GetArgs() []string { + if o == nil || IsNil(o.Args) { + var ret []string + return ret + } + return o.Args +} + +// GetArgsOk returns a tuple with the Args field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Container) GetArgsOk() ([]string, bool) { + if o == nil || IsNil(o.Args) { + return nil, false + } + return o.Args, true +} + +// HasArgs returns a boolean if a field has been set. +func (o *Container) HasArgs() bool { + if o != nil && !IsNil(o.Args) { + return true + } + + return false +} + +// SetArgs gets a reference to the given []string and assigns it to the Args field. +func (o *Container) SetArgs(v []string) { + o.Args = v +} + +// GetCommand returns the Command field value if set, zero value otherwise. +func (o *Container) GetCommand() []string { + if o == nil || IsNil(o.Command) { + var ret []string + return ret + } + return o.Command +} + +// GetCommandOk returns a tuple with the Command field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Container) GetCommandOk() ([]string, bool) { + if o == nil || IsNil(o.Command) { + return nil, false + } + return o.Command, true +} + +// HasCommand returns a boolean if a field has been set. +func (o *Container) HasCommand() bool { + if o != nil && !IsNil(o.Command) { + return true + } + + return false +} + +// SetCommand gets a reference to the given []string and assigns it to the Command field. +func (o *Container) SetCommand(v []string) { + o.Command = v +} + +// GetCpu returns the Cpu field value if set, zero value otherwise. +func (o *Container) GetCpu() int32 { + if o == nil || IsNil(o.Cpu) { + var ret int32 + return ret + } + return *o.Cpu +} + +// GetCpuOk returns a tuple with the Cpu field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Container) GetCpuOk() (*int32, bool) { + if o == nil || IsNil(o.Cpu) { + return nil, false + } + return o.Cpu, true +} + +// HasCpu returns a boolean if a field has been set. +func (o *Container) HasCpu() bool { + if o != nil && !IsNil(o.Cpu) { + return true + } + + return false +} + +// SetCpu gets a reference to the given int32 and assigns it to the Cpu field. +func (o *Container) SetCpu(v int32) { + o.Cpu = &v +} + +// GetEnvironmentVariables returns the EnvironmentVariables field value if set, zero value otherwise. +func (o *Container) GetEnvironmentVariables() []ContainerEnvVar { + if o == nil || IsNil(o.EnvironmentVariables) { + var ret []ContainerEnvVar + return ret + } + return o.EnvironmentVariables +} + +// GetEnvironmentVariablesOk returns a tuple with the EnvironmentVariables field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Container) GetEnvironmentVariablesOk() ([]ContainerEnvVar, bool) { + if o == nil || IsNil(o.EnvironmentVariables) { + return nil, false + } + return o.EnvironmentVariables, true +} + +// HasEnvironmentVariables returns a boolean if a field has been set. +func (o *Container) HasEnvironmentVariables() bool { + if o != nil && !IsNil(o.EnvironmentVariables) { + return true + } + + return false +} + +// SetEnvironmentVariables gets a reference to the given []ContainerEnvVar and assigns it to the EnvironmentVariables field. +func (o *Container) SetEnvironmentVariables(v []ContainerEnvVar) { + o.EnvironmentVariables = v +} + +// GetImage returns the Image field value +func (o *Container) GetImage() string { + if o == nil { + var ret string + return ret + } + + return o.Image +} + +// GetImageOk returns a tuple with the Image field value +// and a boolean to check if the value has been set. +func (o *Container) GetImageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Image, true +} + +// SetImage sets field value +func (o *Container) SetImage(v string) { + o.Image = v +} + +// GetMemory returns the Memory field value if set, zero value otherwise. +func (o *Container) GetMemory() int32 { + if o == nil || IsNil(o.Memory) { + var ret int32 + return ret + } + return *o.Memory +} + +// GetMemoryOk returns a tuple with the Memory field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Container) GetMemoryOk() (*int32, bool) { + if o == nil || IsNil(o.Memory) { + return nil, false + } + return o.Memory, true +} + +// HasMemory returns a boolean if a field has been set. +func (o *Container) HasMemory() bool { + if o != nil && !IsNil(o.Memory) { + return true + } + + return false +} + +// SetMemory gets a reference to the given int32 and assigns it to the Memory field. +func (o *Container) SetMemory(v int32) { + o.Memory = &v +} + +// GetName returns the Name field value +func (o *Container) 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 *Container) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Container) SetName(v string) { + o.Name = v +} + +func (o Container) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Container) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Args) { + toSerialize["args"] = o.Args + } + if !IsNil(o.Command) { + toSerialize["command"] = o.Command + } + if !IsNil(o.Cpu) { + toSerialize["cpu"] = o.Cpu + } + if !IsNil(o.EnvironmentVariables) { + toSerialize["environmentVariables"] = o.EnvironmentVariables + } + toSerialize["image"] = o.Image + if !IsNil(o.Memory) { + toSerialize["memory"] = o.Memory + } + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Container) 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{ + "image", + "name", + } + + 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) + } + } + + varContainer := _Container{} + + err = json.Unmarshal(data, &varContainer) + + if err != nil { + return err + } + + *o = Container(varContainer) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "args") + delete(additionalProperties, "command") + delete(additionalProperties, "cpu") + delete(additionalProperties, "environmentVariables") + delete(additionalProperties, "image") + delete(additionalProperties, "memory") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableContainer struct { + value *Container + isSet bool +} + +func (v NullableContainer) Get() *Container { + return v.value +} + +func (v *NullableContainer) Set(val *Container) { + v.value = val + v.isSet = true +} + +func (v NullableContainer) IsSet() bool { + return v.isSet +} + +func (v *NullableContainer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContainer(val *Container) *NullableContainer { + return &NullableContainer{value: val, isSet: true} +} + +func (v NullableContainer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContainer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_container_env_var.go b/services/sca/v1betaapi/model_container_env_var.go new file mode 100644 index 0000000000..f033cdd029 --- /dev/null +++ b/services/sca/v1betaapi/model_container_env_var.go @@ -0,0 +1,238 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the ContainerEnvVar type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContainerEnvVar{} + +// ContainerEnvVar EnvVar defines a single environment variable. +type ContainerEnvVar struct { + // Environment variable key. + Key string `json:"key"` + Origin *ContainerEnvVarType `json:"origin,omitempty"` + // Environment variable value. + Value string `json:"value"` + AdditionalProperties map[string]interface{} +} + +type _ContainerEnvVar ContainerEnvVar + +// NewContainerEnvVar instantiates a new ContainerEnvVar 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 NewContainerEnvVar(key string, value string) *ContainerEnvVar { + this := ContainerEnvVar{} + this.Key = key + var origin ContainerEnvVarType = CONTAINERENVVARTYPE_ENV_FROM_SOURCE_TYPE_UNSPECIFIED + this.Origin = &origin + this.Value = value + return &this +} + +// NewContainerEnvVarWithDefaults instantiates a new ContainerEnvVar 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 NewContainerEnvVarWithDefaults() *ContainerEnvVar { + this := ContainerEnvVar{} + var origin ContainerEnvVarType = CONTAINERENVVARTYPE_ENV_FROM_SOURCE_TYPE_UNSPECIFIED + this.Origin = &origin + return &this +} + +// GetKey returns the Key field value +func (o *ContainerEnvVar) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *ContainerEnvVar) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *ContainerEnvVar) SetKey(v string) { + o.Key = v +} + +// GetOrigin returns the Origin field value if set, zero value otherwise. +func (o *ContainerEnvVar) GetOrigin() ContainerEnvVarType { + if o == nil || IsNil(o.Origin) { + var ret ContainerEnvVarType + return ret + } + return *o.Origin +} + +// GetOriginOk returns a tuple with the Origin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContainerEnvVar) GetOriginOk() (*ContainerEnvVarType, bool) { + if o == nil || IsNil(o.Origin) { + return nil, false + } + return o.Origin, true +} + +// HasOrigin returns a boolean if a field has been set. +func (o *ContainerEnvVar) HasOrigin() bool { + if o != nil && !IsNil(o.Origin) { + return true + } + + return false +} + +// SetOrigin gets a reference to the given ContainerEnvVarType and assigns it to the Origin field. +func (o *ContainerEnvVar) SetOrigin(v ContainerEnvVarType) { + o.Origin = &v +} + +// GetValue returns the Value field value +func (o *ContainerEnvVar) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *ContainerEnvVar) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *ContainerEnvVar) SetValue(v string) { + o.Value = v +} + +func (o ContainerEnvVar) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ContainerEnvVar) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + if !IsNil(o.Origin) { + toSerialize["origin"] = o.Origin + } + toSerialize["value"] = o.Value + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ContainerEnvVar) 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{ + "key", + "value", + } + + 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) + } + } + + varContainerEnvVar := _ContainerEnvVar{} + + err = json.Unmarshal(data, &varContainerEnvVar) + + if err != nil { + return err + } + + *o = ContainerEnvVar(varContainerEnvVar) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "key") + delete(additionalProperties, "origin") + delete(additionalProperties, "value") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableContainerEnvVar struct { + value *ContainerEnvVar + isSet bool +} + +func (v NullableContainerEnvVar) Get() *ContainerEnvVar { + return v.value +} + +func (v *NullableContainerEnvVar) Set(val *ContainerEnvVar) { + v.value = val + v.isSet = true +} + +func (v NullableContainerEnvVar) IsSet() bool { + return v.isSet +} + +func (v *NullableContainerEnvVar) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContainerEnvVar(val *ContainerEnvVar) *NullableContainerEnvVar { + return &NullableContainerEnvVar{value: val, isSet: true} +} + +func (v NullableContainerEnvVar) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContainerEnvVar) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_container_env_var_type.go b/services/sca/v1betaapi/model_container_env_var_type.go new file mode 100644 index 0000000000..9eaa295ae6 --- /dev/null +++ b/services/sca/v1betaapi/model_container_env_var_type.go @@ -0,0 +1,115 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// ContainerEnvVarType EnvVarType identifies the origin of an environment variable. - ENV_FROM_SOURCE_TYPE_UNSPECIFIED: Used as zero value. - ENV_FROM_SOURCE_TYPE_MANUAL: Environment source from a literal value. - ENV_FROM_SOURCE_TYPE_SECRET: Environment source from a secret. +type ContainerEnvVarType string + +// List of ContainerEnvVarType +const ( + CONTAINERENVVARTYPE_ENV_FROM_SOURCE_TYPE_UNSPECIFIED ContainerEnvVarType = "ENV_FROM_SOURCE_TYPE_UNSPECIFIED" + CONTAINERENVVARTYPE_ENV_FROM_SOURCE_TYPE_MANUAL ContainerEnvVarType = "ENV_FROM_SOURCE_TYPE_MANUAL" + CONTAINERENVVARTYPE_ENV_FROM_SOURCE_TYPE_SECRET ContainerEnvVarType = "ENV_FROM_SOURCE_TYPE_SECRET" + CONTAINERENVVARTYPE_UNKNOWN_DEFAULT_OPEN_API ContainerEnvVarType = "unknown_default_open_api" +) + +// All allowed values of ContainerEnvVarType enum +var AllowedContainerEnvVarTypeEnumValues = []ContainerEnvVarType{ + "ENV_FROM_SOURCE_TYPE_UNSPECIFIED", + "ENV_FROM_SOURCE_TYPE_MANUAL", + "ENV_FROM_SOURCE_TYPE_SECRET", + "unknown_default_open_api", +} + +func (v *ContainerEnvVarType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ContainerEnvVarType(value) + for _, existing := range AllowedContainerEnvVarTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = CONTAINERENVVARTYPE_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewContainerEnvVarTypeFromValue returns a pointer to a valid ContainerEnvVarType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewContainerEnvVarTypeFromValue(v string) (*ContainerEnvVarType, error) { + ev := ContainerEnvVarType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ContainerEnvVarType: valid values are %v", v, AllowedContainerEnvVarTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ContainerEnvVarType) IsValid() bool { + for _, existing := range AllowedContainerEnvVarTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ContainerEnvVarType value +func (v ContainerEnvVarType) Ptr() *ContainerEnvVarType { + return &v +} + +type NullableContainerEnvVarType struct { + value *ContainerEnvVarType + isSet bool +} + +func (v NullableContainerEnvVarType) Get() *ContainerEnvVarType { + return v.value +} + +func (v *NullableContainerEnvVarType) Set(val *ContainerEnvVarType) { + v.value = val + v.isSet = true +} + +func (v NullableContainerEnvVarType) IsSet() bool { + return v.isSet +} + +func (v *NullableContainerEnvVarType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContainerEnvVarType(val *ContainerEnvVarType) *NullableContainerEnvVarType { + return &NullableContainerEnvVarType{value: val, isSet: true} +} + +func (v NullableContainerEnvVarType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContainerEnvVarType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_create_application_payload.go b/services/sca/v1betaapi/model_create_application_payload.go new file mode 100644 index 0000000000..9cb0ac7f72 --- /dev/null +++ b/services/sca/v1betaapi/model_create_application_payload.go @@ -0,0 +1,567 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the CreateApplicationPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateApplicationPayload{} + +// CreateApplicationPayload Application describes a deployable multi-container workload instance. +type CreateApplicationPayload struct { + // Containers to deploy for the application. + Containers []Container `json:"containers"` + // Creation date in RFC3339 format. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Human-readable display name. + DisplayName string `json:"displayName"` + // Environment identifier where the application belongs. + EnvironmentId *string `json:"environmentId,omitempty"` + // Environment human-readable display name. + EnvironmentName *string `json:"environmentName,omitempty"` + // Application identifier. + Id *string `json:"id,omitempty"` + Network *ApplicationNetwork `json:"network,omitempty"` + // Region of the environment. + Region *string `json:"region,omitempty"` + Scaling ApplicationScaling `json:"scaling"` + Status *ApplicationStatus `json:"status,omitempty"` + // Indicates if the application resources are stopped. + Stopped *bool `json:"stopped,omitempty"` + // Last update date in RFC3339 format. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateApplicationPayload CreateApplicationPayload + +// NewCreateApplicationPayload instantiates a new CreateApplicationPayload 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 NewCreateApplicationPayload(containers []Container, displayName string, scaling ApplicationScaling) *CreateApplicationPayload { + this := CreateApplicationPayload{} + this.Containers = containers + this.DisplayName = displayName + this.Scaling = scaling + return &this +} + +// NewCreateApplicationPayloadWithDefaults instantiates a new CreateApplicationPayload 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 NewCreateApplicationPayloadWithDefaults() *CreateApplicationPayload { + this := CreateApplicationPayload{} + return &this +} + +// GetContainers returns the Containers field value +func (o *CreateApplicationPayload) GetContainers() []Container { + if o == nil { + var ret []Container + return ret + } + + return o.Containers +} + +// GetContainersOk returns a tuple with the Containers field value +// and a boolean to check if the value has been set. +func (o *CreateApplicationPayload) GetContainersOk() ([]Container, bool) { + if o == nil { + return nil, false + } + return o.Containers, true +} + +// SetContainers sets field value +func (o *CreateApplicationPayload) SetContainers(v []Container) { + o.Containers = v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateApplicationPayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateApplicationPayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateApplicationPayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateApplicationPayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDisplayName returns the DisplayName field value +func (o *CreateApplicationPayload) GetDisplayName() string { + if o == nil { + var ret string + return ret + } + + return o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value +// and a boolean to check if the value has been set. +func (o *CreateApplicationPayload) GetDisplayNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DisplayName, true +} + +// SetDisplayName sets field value +func (o *CreateApplicationPayload) SetDisplayName(v string) { + o.DisplayName = v +} + +// GetEnvironmentId returns the EnvironmentId field value if set, zero value otherwise. +func (o *CreateApplicationPayload) GetEnvironmentId() string { + if o == nil || IsNil(o.EnvironmentId) { + var ret string + return ret + } + return *o.EnvironmentId +} + +// GetEnvironmentIdOk returns a tuple with the EnvironmentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateApplicationPayload) GetEnvironmentIdOk() (*string, bool) { + if o == nil || IsNil(o.EnvironmentId) { + return nil, false + } + return o.EnvironmentId, true +} + +// HasEnvironmentId returns a boolean if a field has been set. +func (o *CreateApplicationPayload) HasEnvironmentId() bool { + if o != nil && !IsNil(o.EnvironmentId) { + return true + } + + return false +} + +// SetEnvironmentId gets a reference to the given string and assigns it to the EnvironmentId field. +func (o *CreateApplicationPayload) SetEnvironmentId(v string) { + o.EnvironmentId = &v +} + +// GetEnvironmentName returns the EnvironmentName field value if set, zero value otherwise. +func (o *CreateApplicationPayload) GetEnvironmentName() string { + if o == nil || IsNil(o.EnvironmentName) { + var ret string + return ret + } + return *o.EnvironmentName +} + +// GetEnvironmentNameOk returns a tuple with the EnvironmentName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateApplicationPayload) GetEnvironmentNameOk() (*string, bool) { + if o == nil || IsNil(o.EnvironmentName) { + return nil, false + } + return o.EnvironmentName, true +} + +// HasEnvironmentName returns a boolean if a field has been set. +func (o *CreateApplicationPayload) HasEnvironmentName() bool { + if o != nil && !IsNil(o.EnvironmentName) { + return true + } + + return false +} + +// SetEnvironmentName gets a reference to the given string and assigns it to the EnvironmentName field. +func (o *CreateApplicationPayload) SetEnvironmentName(v string) { + o.EnvironmentName = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateApplicationPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateApplicationPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateApplicationPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateApplicationPayload) SetId(v string) { + o.Id = &v +} + +// GetNetwork returns the Network field value if set, zero value otherwise. +func (o *CreateApplicationPayload) GetNetwork() ApplicationNetwork { + if o == nil || IsNil(o.Network) { + var ret ApplicationNetwork + return ret + } + return *o.Network +} + +// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateApplicationPayload) GetNetworkOk() (*ApplicationNetwork, bool) { + if o == nil || IsNil(o.Network) { + return nil, false + } + return o.Network, true +} + +// HasNetwork returns a boolean if a field has been set. +func (o *CreateApplicationPayload) HasNetwork() bool { + if o != nil && !IsNil(o.Network) { + return true + } + + return false +} + +// SetNetwork gets a reference to the given ApplicationNetwork and assigns it to the Network field. +func (o *CreateApplicationPayload) SetNetwork(v ApplicationNetwork) { + o.Network = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *CreateApplicationPayload) GetRegion() string { + if o == nil || IsNil(o.Region) { + var ret string + return ret + } + return *o.Region +} + +// GetRegionOk returns a tuple with the Region field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateApplicationPayload) GetRegionOk() (*string, bool) { + if o == nil || IsNil(o.Region) { + return nil, false + } + return o.Region, true +} + +// HasRegion returns a boolean if a field has been set. +func (o *CreateApplicationPayload) HasRegion() bool { + if o != nil && !IsNil(o.Region) { + return true + } + + return false +} + +// SetRegion gets a reference to the given string and assigns it to the Region field. +func (o *CreateApplicationPayload) SetRegion(v string) { + o.Region = &v +} + +// GetScaling returns the Scaling field value +func (o *CreateApplicationPayload) GetScaling() ApplicationScaling { + if o == nil { + var ret ApplicationScaling + return ret + } + + return o.Scaling +} + +// GetScalingOk returns a tuple with the Scaling field value +// and a boolean to check if the value has been set. +func (o *CreateApplicationPayload) GetScalingOk() (*ApplicationScaling, bool) { + if o == nil { + return nil, false + } + return &o.Scaling, true +} + +// SetScaling sets field value +func (o *CreateApplicationPayload) SetScaling(v ApplicationScaling) { + o.Scaling = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateApplicationPayload) GetStatus() ApplicationStatus { + if o == nil || IsNil(o.Status) { + var ret ApplicationStatus + 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 *CreateApplicationPayload) GetStatusOk() (*ApplicationStatus, 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 *CreateApplicationPayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given ApplicationStatus and assigns it to the Status field. +func (o *CreateApplicationPayload) SetStatus(v ApplicationStatus) { + o.Status = &v +} + +// GetStopped returns the Stopped field value if set, zero value otherwise. +func (o *CreateApplicationPayload) GetStopped() bool { + if o == nil || IsNil(o.Stopped) { + var ret bool + return ret + } + return *o.Stopped +} + +// GetStoppedOk returns a tuple with the Stopped field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateApplicationPayload) GetStoppedOk() (*bool, bool) { + if o == nil || IsNil(o.Stopped) { + return nil, false + } + return o.Stopped, true +} + +// HasStopped returns a boolean if a field has been set. +func (o *CreateApplicationPayload) HasStopped() bool { + if o != nil && !IsNil(o.Stopped) { + return true + } + + return false +} + +// SetStopped gets a reference to the given bool and assigns it to the Stopped field. +func (o *CreateApplicationPayload) SetStopped(v bool) { + o.Stopped = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *CreateApplicationPayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateApplicationPayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *CreateApplicationPayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *CreateApplicationPayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o CreateApplicationPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateApplicationPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["containers"] = o.Containers + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + toSerialize["displayName"] = o.DisplayName + if !IsNil(o.EnvironmentId) { + toSerialize["environmentId"] = o.EnvironmentId + } + if !IsNil(o.EnvironmentName) { + toSerialize["environmentName"] = o.EnvironmentName + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Network) { + toSerialize["network"] = o.Network + } + if !IsNil(o.Region) { + toSerialize["region"] = o.Region + } + toSerialize["scaling"] = o.Scaling + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Stopped) { + toSerialize["stopped"] = o.Stopped + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateApplicationPayload) 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{ + "containers", + "displayName", + "scaling", + } + + 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) + } + } + + varCreateApplicationPayload := _CreateApplicationPayload{} + + err = json.Unmarshal(data, &varCreateApplicationPayload) + + if err != nil { + return err + } + + *o = CreateApplicationPayload(varCreateApplicationPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "containers") + delete(additionalProperties, "createdAt") + delete(additionalProperties, "displayName") + delete(additionalProperties, "environmentId") + delete(additionalProperties, "environmentName") + delete(additionalProperties, "id") + delete(additionalProperties, "network") + delete(additionalProperties, "region") + delete(additionalProperties, "scaling") + delete(additionalProperties, "status") + delete(additionalProperties, "stopped") + delete(additionalProperties, "updatedAt") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateApplicationPayload struct { + value *CreateApplicationPayload + isSet bool +} + +func (v NullableCreateApplicationPayload) Get() *CreateApplicationPayload { + return v.value +} + +func (v *NullableCreateApplicationPayload) Set(val *CreateApplicationPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateApplicationPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateApplicationPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateApplicationPayload(val *CreateApplicationPayload) *NullableCreateApplicationPayload { + return &NullableCreateApplicationPayload{value: val, isSet: true} +} + +func (v NullableCreateApplicationPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateApplicationPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_create_environment_payload.go b/services/sca/v1betaapi/model_create_environment_payload.go new file mode 100644 index 0000000000..6e665ce372 --- /dev/null +++ b/services/sca/v1betaapi/model_create_environment_payload.go @@ -0,0 +1,357 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the CreateEnvironmentPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateEnvironmentPayload{} + +// CreateEnvironmentPayload Environment describes an isolated container scope within a project. +type CreateEnvironmentPayload struct { + // Creation date in RFC3339 format. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Is the default environmet. + Default *bool `json:"default,omitempty"` + // Human-readable display name. + DisplayName string `json:"displayName"` + // Environment identifier. + Id *string `json:"id,omitempty"` + // Region of the environment. + Region *string `json:"region,omitempty"` + Status *EnvironmentStatus `json:"status,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateEnvironmentPayload CreateEnvironmentPayload + +// NewCreateEnvironmentPayload instantiates a new CreateEnvironmentPayload 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 NewCreateEnvironmentPayload(displayName string) *CreateEnvironmentPayload { + this := CreateEnvironmentPayload{} + this.DisplayName = displayName + return &this +} + +// NewCreateEnvironmentPayloadWithDefaults instantiates a new CreateEnvironmentPayload 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 NewCreateEnvironmentPayloadWithDefaults() *CreateEnvironmentPayload { + this := CreateEnvironmentPayload{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateEnvironmentPayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateEnvironmentPayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateEnvironmentPayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateEnvironmentPayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *CreateEnvironmentPayload) GetDefault() bool { + if o == nil || IsNil(o.Default) { + var ret bool + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateEnvironmentPayload) GetDefaultOk() (*bool, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *CreateEnvironmentPayload) HasDefault() bool { + if o != nil && !IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given bool and assigns it to the Default field. +func (o *CreateEnvironmentPayload) SetDefault(v bool) { + o.Default = &v +} + +// GetDisplayName returns the DisplayName field value +func (o *CreateEnvironmentPayload) GetDisplayName() string { + if o == nil { + var ret string + return ret + } + + return o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value +// and a boolean to check if the value has been set. +func (o *CreateEnvironmentPayload) GetDisplayNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DisplayName, true +} + +// SetDisplayName sets field value +func (o *CreateEnvironmentPayload) SetDisplayName(v string) { + o.DisplayName = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateEnvironmentPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateEnvironmentPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateEnvironmentPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateEnvironmentPayload) SetId(v string) { + o.Id = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *CreateEnvironmentPayload) GetRegion() string { + if o == nil || IsNil(o.Region) { + var ret string + return ret + } + return *o.Region +} + +// GetRegionOk returns a tuple with the Region field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateEnvironmentPayload) GetRegionOk() (*string, bool) { + if o == nil || IsNil(o.Region) { + return nil, false + } + return o.Region, true +} + +// HasRegion returns a boolean if a field has been set. +func (o *CreateEnvironmentPayload) HasRegion() bool { + if o != nil && !IsNil(o.Region) { + return true + } + + return false +} + +// SetRegion gets a reference to the given string and assigns it to the Region field. +func (o *CreateEnvironmentPayload) SetRegion(v string) { + o.Region = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateEnvironmentPayload) GetStatus() EnvironmentStatus { + if o == nil || IsNil(o.Status) { + var ret EnvironmentStatus + 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 *CreateEnvironmentPayload) GetStatusOk() (*EnvironmentStatus, 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 *CreateEnvironmentPayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given EnvironmentStatus and assigns it to the Status field. +func (o *CreateEnvironmentPayload) SetStatus(v EnvironmentStatus) { + o.Status = &v +} + +func (o CreateEnvironmentPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateEnvironmentPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Default) { + toSerialize["default"] = o.Default + } + toSerialize["displayName"] = o.DisplayName + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Region) { + toSerialize["region"] = o.Region + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateEnvironmentPayload) 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{ + "displayName", + } + + 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) + } + } + + varCreateEnvironmentPayload := _CreateEnvironmentPayload{} + + err = json.Unmarshal(data, &varCreateEnvironmentPayload) + + if err != nil { + return err + } + + *o = CreateEnvironmentPayload(varCreateEnvironmentPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "createdAt") + delete(additionalProperties, "default") + delete(additionalProperties, "displayName") + delete(additionalProperties, "id") + delete(additionalProperties, "region") + delete(additionalProperties, "status") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateEnvironmentPayload struct { + value *CreateEnvironmentPayload + isSet bool +} + +func (v NullableCreateEnvironmentPayload) Get() *CreateEnvironmentPayload { + return v.value +} + +func (v *NullableCreateEnvironmentPayload) Set(val *CreateEnvironmentPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateEnvironmentPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateEnvironmentPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateEnvironmentPayload(val *CreateEnvironmentPayload) *NullableCreateEnvironmentPayload { + return &NullableCreateEnvironmentPayload{value: val, isSet: true} +} + +func (v NullableCreateEnvironmentPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateEnvironmentPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_environment.go b/services/sca/v1betaapi/model_environment.go new file mode 100644 index 0000000000..facabbf9d5 --- /dev/null +++ b/services/sca/v1betaapi/model_environment.go @@ -0,0 +1,357 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Environment type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Environment{} + +// Environment Environment describes an isolated container scope within a project. +type Environment struct { + // Creation date in RFC3339 format. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Is the default environmet. + Default *bool `json:"default,omitempty"` + // Human-readable display name. + DisplayName string `json:"displayName"` + // Environment identifier. + Id *string `json:"id,omitempty"` + // Region of the environment. + Region *string `json:"region,omitempty"` + Status *EnvironmentStatus `json:"status,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Environment Environment + +// NewEnvironment instantiates a new Environment 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 NewEnvironment(displayName string) *Environment { + this := Environment{} + this.DisplayName = displayName + return &this +} + +// NewEnvironmentWithDefaults instantiates a new Environment 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 NewEnvironmentWithDefaults() *Environment { + this := Environment{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Environment) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Environment) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Environment) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Environment) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *Environment) GetDefault() bool { + if o == nil || IsNil(o.Default) { + var ret bool + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Environment) GetDefaultOk() (*bool, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *Environment) HasDefault() bool { + if o != nil && !IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given bool and assigns it to the Default field. +func (o *Environment) SetDefault(v bool) { + o.Default = &v +} + +// GetDisplayName returns the DisplayName field value +func (o *Environment) GetDisplayName() string { + if o == nil { + var ret string + return ret + } + + return o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value +// and a boolean to check if the value has been set. +func (o *Environment) GetDisplayNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DisplayName, true +} + +// SetDisplayName sets field value +func (o *Environment) SetDisplayName(v string) { + o.DisplayName = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Environment) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Environment) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Environment) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Environment) SetId(v string) { + o.Id = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *Environment) GetRegion() string { + if o == nil || IsNil(o.Region) { + var ret string + return ret + } + return *o.Region +} + +// GetRegionOk returns a tuple with the Region field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Environment) GetRegionOk() (*string, bool) { + if o == nil || IsNil(o.Region) { + return nil, false + } + return o.Region, true +} + +// HasRegion returns a boolean if a field has been set. +func (o *Environment) HasRegion() bool { + if o != nil && !IsNil(o.Region) { + return true + } + + return false +} + +// SetRegion gets a reference to the given string and assigns it to the Region field. +func (o *Environment) SetRegion(v string) { + o.Region = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Environment) GetStatus() EnvironmentStatus { + if o == nil || IsNil(o.Status) { + var ret EnvironmentStatus + 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 *Environment) GetStatusOk() (*EnvironmentStatus, 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 *Environment) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given EnvironmentStatus and assigns it to the Status field. +func (o *Environment) SetStatus(v EnvironmentStatus) { + o.Status = &v +} + +func (o Environment) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Environment) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Default) { + toSerialize["default"] = o.Default + } + toSerialize["displayName"] = o.DisplayName + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Region) { + toSerialize["region"] = o.Region + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Environment) 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{ + "displayName", + } + + 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) + } + } + + varEnvironment := _Environment{} + + err = json.Unmarshal(data, &varEnvironment) + + if err != nil { + return err + } + + *o = Environment(varEnvironment) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "createdAt") + delete(additionalProperties, "default") + delete(additionalProperties, "displayName") + delete(additionalProperties, "id") + delete(additionalProperties, "region") + delete(additionalProperties, "status") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEnvironment struct { + value *Environment + isSet bool +} + +func (v NullableEnvironment) Get() *Environment { + return v.value +} + +func (v *NullableEnvironment) Set(val *Environment) { + v.value = val + v.isSet = true +} + +func (v NullableEnvironment) IsSet() bool { + return v.isSet +} + +func (v *NullableEnvironment) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnvironment(val *Environment) *NullableEnvironment { + return &NullableEnvironment{value: val, isSet: true} +} + +func (v NullableEnvironment) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnvironment) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_environment_current_status.go b/services/sca/v1betaapi/model_environment_current_status.go new file mode 100644 index 0000000000..6f22baada5 --- /dev/null +++ b/services/sca/v1betaapi/model_environment_current_status.go @@ -0,0 +1,115 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// EnvironmentCurrentStatus - CURRENT_STATUS_UNSPECIFIED: Used as zero value. - CURRENT_STATUS_PROGRESSING: Environment is being created. - CURRENT_STATUS_CREATED: Environment is successfully created. +type EnvironmentCurrentStatus string + +// List of EnvironmentCurrentStatus +const ( + ENVIRONMENTCURRENTSTATUS_CURRENT_STATUS_UNSPECIFIED EnvironmentCurrentStatus = "CURRENT_STATUS_UNSPECIFIED" + ENVIRONMENTCURRENTSTATUS_CURRENT_STATUS_PROGRESSING EnvironmentCurrentStatus = "CURRENT_STATUS_PROGRESSING" + ENVIRONMENTCURRENTSTATUS_CURRENT_STATUS_CREATED EnvironmentCurrentStatus = "CURRENT_STATUS_CREATED" + ENVIRONMENTCURRENTSTATUS_UNKNOWN_DEFAULT_OPEN_API EnvironmentCurrentStatus = "unknown_default_open_api" +) + +// All allowed values of EnvironmentCurrentStatus enum +var AllowedEnvironmentCurrentStatusEnumValues = []EnvironmentCurrentStatus{ + "CURRENT_STATUS_UNSPECIFIED", + "CURRENT_STATUS_PROGRESSING", + "CURRENT_STATUS_CREATED", + "unknown_default_open_api", +} + +func (v *EnvironmentCurrentStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EnvironmentCurrentStatus(value) + for _, existing := range AllowedEnvironmentCurrentStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = ENVIRONMENTCURRENTSTATUS_UNKNOWN_DEFAULT_OPEN_API + return nil +} + +// NewEnvironmentCurrentStatusFromValue returns a pointer to a valid EnvironmentCurrentStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEnvironmentCurrentStatusFromValue(v string) (*EnvironmentCurrentStatus, error) { + ev := EnvironmentCurrentStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EnvironmentCurrentStatus: valid values are %v", v, AllowedEnvironmentCurrentStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EnvironmentCurrentStatus) IsValid() bool { + for _, existing := range AllowedEnvironmentCurrentStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EnvironmentCurrentStatus value +func (v EnvironmentCurrentStatus) Ptr() *EnvironmentCurrentStatus { + return &v +} + +type NullableEnvironmentCurrentStatus struct { + value *EnvironmentCurrentStatus + isSet bool +} + +func (v NullableEnvironmentCurrentStatus) Get() *EnvironmentCurrentStatus { + return v.value +} + +func (v *NullableEnvironmentCurrentStatus) Set(val *EnvironmentCurrentStatus) { + v.value = val + v.isSet = true +} + +func (v NullableEnvironmentCurrentStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableEnvironmentCurrentStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnvironmentCurrentStatus(val *EnvironmentCurrentStatus) *NullableEnvironmentCurrentStatus { + return &NullableEnvironmentCurrentStatus{value: val, isSet: true} +} + +func (v NullableEnvironmentCurrentStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnvironmentCurrentStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_environment_registries_vault.go b/services/sca/v1betaapi/model_environment_registries_vault.go new file mode 100644 index 0000000000..f05ee8ac23 --- /dev/null +++ b/services/sca/v1betaapi/model_environment_registries_vault.go @@ -0,0 +1,167 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the EnvironmentRegistriesVault type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EnvironmentRegistriesVault{} + +// EnvironmentRegistriesVault Represents the collection Environment registries. +type EnvironmentRegistriesVault struct { + // The collection of configured registries. + Registries []EnvironmentRegistry `json:"registries"` + AdditionalProperties map[string]interface{} +} + +type _EnvironmentRegistriesVault EnvironmentRegistriesVault + +// NewEnvironmentRegistriesVault instantiates a new EnvironmentRegistriesVault 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 NewEnvironmentRegistriesVault(registries []EnvironmentRegistry) *EnvironmentRegistriesVault { + this := EnvironmentRegistriesVault{} + this.Registries = registries + return &this +} + +// NewEnvironmentRegistriesVaultWithDefaults instantiates a new EnvironmentRegistriesVault 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 NewEnvironmentRegistriesVaultWithDefaults() *EnvironmentRegistriesVault { + this := EnvironmentRegistriesVault{} + return &this +} + +// GetRegistries returns the Registries field value +func (o *EnvironmentRegistriesVault) GetRegistries() []EnvironmentRegistry { + if o == nil { + var ret []EnvironmentRegistry + return ret + } + + return o.Registries +} + +// GetRegistriesOk returns a tuple with the Registries field value +// and a boolean to check if the value has been set. +func (o *EnvironmentRegistriesVault) GetRegistriesOk() ([]EnvironmentRegistry, bool) { + if o == nil { + return nil, false + } + return o.Registries, true +} + +// SetRegistries sets field value +func (o *EnvironmentRegistriesVault) SetRegistries(v []EnvironmentRegistry) { + o.Registries = v +} + +func (o EnvironmentRegistriesVault) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EnvironmentRegistriesVault) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["registries"] = o.Registries + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EnvironmentRegistriesVault) 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{ + "registries", + } + + 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) + } + } + + varEnvironmentRegistriesVault := _EnvironmentRegistriesVault{} + + err = json.Unmarshal(data, &varEnvironmentRegistriesVault) + + if err != nil { + return err + } + + *o = EnvironmentRegistriesVault(varEnvironmentRegistriesVault) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "registries") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEnvironmentRegistriesVault struct { + value *EnvironmentRegistriesVault + isSet bool +} + +func (v NullableEnvironmentRegistriesVault) Get() *EnvironmentRegistriesVault { + return v.value +} + +func (v *NullableEnvironmentRegistriesVault) Set(val *EnvironmentRegistriesVault) { + v.value = val + v.isSet = true +} + +func (v NullableEnvironmentRegistriesVault) IsSet() bool { + return v.isSet +} + +func (v *NullableEnvironmentRegistriesVault) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnvironmentRegistriesVault(val *EnvironmentRegistriesVault) *NullableEnvironmentRegistriesVault { + return &NullableEnvironmentRegistriesVault{value: val, isSet: true} +} + +func (v NullableEnvironmentRegistriesVault) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnvironmentRegistriesVault) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_environment_registry.go b/services/sca/v1betaapi/model_environment_registry.go new file mode 100644 index 0000000000..1da8e3ee33 --- /dev/null +++ b/services/sca/v1betaapi/model_environment_registry.go @@ -0,0 +1,395 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the EnvironmentRegistry type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EnvironmentRegistry{} + +// EnvironmentRegistry EnvironmentRegistry defines a single registry representation. +type EnvironmentRegistry struct { + // Creation timestamp of this registry entry. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Registry password. Omit or set to null to keep the existing value unchanged. + Password *string `json:"password,omitempty"` + // Registry region. + Region *string `json:"region,omitempty"` + // Registry server. + Server string `json:"server"` + Status *EnvironmentRegistryStatus `json:"status,omitempty"` + // Last update timestamp of this registry entry. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // Registry username. Omit or set to null to keep the existing value unchanged. + Username *string `json:"username,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EnvironmentRegistry EnvironmentRegistry + +// NewEnvironmentRegistry instantiates a new EnvironmentRegistry 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 NewEnvironmentRegistry(server string) *EnvironmentRegistry { + this := EnvironmentRegistry{} + this.Server = server + return &this +} + +// NewEnvironmentRegistryWithDefaults instantiates a new EnvironmentRegistry 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 NewEnvironmentRegistryWithDefaults() *EnvironmentRegistry { + this := EnvironmentRegistry{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *EnvironmentRegistry) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvironmentRegistry) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *EnvironmentRegistry) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *EnvironmentRegistry) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *EnvironmentRegistry) GetPassword() string { + if o == nil || IsNil(o.Password) { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvironmentRegistry) GetPasswordOk() (*string, bool) { + if o == nil || IsNil(o.Password) { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *EnvironmentRegistry) HasPassword() bool { + if o != nil && !IsNil(o.Password) { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *EnvironmentRegistry) SetPassword(v string) { + o.Password = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *EnvironmentRegistry) GetRegion() string { + if o == nil || IsNil(o.Region) { + var ret string + return ret + } + return *o.Region +} + +// GetRegionOk returns a tuple with the Region field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvironmentRegistry) GetRegionOk() (*string, bool) { + if o == nil || IsNil(o.Region) { + return nil, false + } + return o.Region, true +} + +// HasRegion returns a boolean if a field has been set. +func (o *EnvironmentRegistry) HasRegion() bool { + if o != nil && !IsNil(o.Region) { + return true + } + + return false +} + +// SetRegion gets a reference to the given string and assigns it to the Region field. +func (o *EnvironmentRegistry) SetRegion(v string) { + o.Region = &v +} + +// GetServer returns the Server field value +func (o *EnvironmentRegistry) GetServer() string { + if o == nil { + var ret string + return ret + } + + return o.Server +} + +// GetServerOk returns a tuple with the Server field value +// and a boolean to check if the value has been set. +func (o *EnvironmentRegistry) GetServerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Server, true +} + +// SetServer sets field value +func (o *EnvironmentRegistry) SetServer(v string) { + o.Server = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *EnvironmentRegistry) GetStatus() EnvironmentRegistryStatus { + if o == nil || IsNil(o.Status) { + var ret EnvironmentRegistryStatus + 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 *EnvironmentRegistry) GetStatusOk() (*EnvironmentRegistryStatus, 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 *EnvironmentRegistry) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given EnvironmentRegistryStatus and assigns it to the Status field. +func (o *EnvironmentRegistry) SetStatus(v EnvironmentRegistryStatus) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *EnvironmentRegistry) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvironmentRegistry) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *EnvironmentRegistry) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *EnvironmentRegistry) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *EnvironmentRegistry) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvironmentRegistry) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *EnvironmentRegistry) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *EnvironmentRegistry) SetUsername(v string) { + o.Username = &v +} + +func (o EnvironmentRegistry) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EnvironmentRegistry) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Password) { + toSerialize["password"] = o.Password + } + if !IsNil(o.Region) { + toSerialize["region"] = o.Region + } + toSerialize["server"] = o.Server + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EnvironmentRegistry) 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{ + "server", + } + + 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) + } + } + + varEnvironmentRegistry := _EnvironmentRegistry{} + + err = json.Unmarshal(data, &varEnvironmentRegistry) + + if err != nil { + return err + } + + *o = EnvironmentRegistry(varEnvironmentRegistry) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "createdAt") + delete(additionalProperties, "password") + delete(additionalProperties, "region") + delete(additionalProperties, "server") + delete(additionalProperties, "status") + delete(additionalProperties, "updatedAt") + delete(additionalProperties, "username") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEnvironmentRegistry struct { + value *EnvironmentRegistry + isSet bool +} + +func (v NullableEnvironmentRegistry) Get() *EnvironmentRegistry { + return v.value +} + +func (v *NullableEnvironmentRegistry) Set(val *EnvironmentRegistry) { + v.value = val + v.isSet = true +} + +func (v NullableEnvironmentRegistry) IsSet() bool { + return v.isSet +} + +func (v *NullableEnvironmentRegistry) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnvironmentRegistry(val *EnvironmentRegistry) *NullableEnvironmentRegistry { + return &NullableEnvironmentRegistry{value: val, isSet: true} +} + +func (v NullableEnvironmentRegistry) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnvironmentRegistry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_environment_registry_status.go b/services/sca/v1betaapi/model_environment_registry_status.go new file mode 100644 index 0000000000..607bf6c537 --- /dev/null +++ b/services/sca/v1betaapi/model_environment_registry_status.go @@ -0,0 +1,154 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the EnvironmentRegistryStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EnvironmentRegistryStatus{} + +// EnvironmentRegistryStatus EnvironmentRegistryStatus computed fields for a single registry. +type EnvironmentRegistryStatus struct { + // List of entities actively consuming this registry. + Consumers []RegistryConsumer `json:"consumers,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EnvironmentRegistryStatus EnvironmentRegistryStatus + +// NewEnvironmentRegistryStatus instantiates a new EnvironmentRegistryStatus 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 NewEnvironmentRegistryStatus() *EnvironmentRegistryStatus { + this := EnvironmentRegistryStatus{} + return &this +} + +// NewEnvironmentRegistryStatusWithDefaults instantiates a new EnvironmentRegistryStatus 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 NewEnvironmentRegistryStatusWithDefaults() *EnvironmentRegistryStatus { + this := EnvironmentRegistryStatus{} + return &this +} + +// GetConsumers returns the Consumers field value if set, zero value otherwise. +func (o *EnvironmentRegistryStatus) GetConsumers() []RegistryConsumer { + if o == nil || IsNil(o.Consumers) { + var ret []RegistryConsumer + return ret + } + return o.Consumers +} + +// GetConsumersOk returns a tuple with the Consumers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvironmentRegistryStatus) GetConsumersOk() ([]RegistryConsumer, bool) { + if o == nil || IsNil(o.Consumers) { + return nil, false + } + return o.Consumers, true +} + +// HasConsumers returns a boolean if a field has been set. +func (o *EnvironmentRegistryStatus) HasConsumers() bool { + if o != nil && !IsNil(o.Consumers) { + return true + } + + return false +} + +// SetConsumers gets a reference to the given []RegistryConsumer and assigns it to the Consumers field. +func (o *EnvironmentRegistryStatus) SetConsumers(v []RegistryConsumer) { + o.Consumers = v +} + +func (o EnvironmentRegistryStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EnvironmentRegistryStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Consumers) { + toSerialize["consumers"] = o.Consumers + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EnvironmentRegistryStatus) UnmarshalJSON(data []byte) (err error) { + varEnvironmentRegistryStatus := _EnvironmentRegistryStatus{} + + err = json.Unmarshal(data, &varEnvironmentRegistryStatus) + + if err != nil { + return err + } + + *o = EnvironmentRegistryStatus(varEnvironmentRegistryStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "consumers") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEnvironmentRegistryStatus struct { + value *EnvironmentRegistryStatus + isSet bool +} + +func (v NullableEnvironmentRegistryStatus) Get() *EnvironmentRegistryStatus { + return v.value +} + +func (v *NullableEnvironmentRegistryStatus) Set(val *EnvironmentRegistryStatus) { + v.value = val + v.isSet = true +} + +func (v NullableEnvironmentRegistryStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableEnvironmentRegistryStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnvironmentRegistryStatus(val *EnvironmentRegistryStatus) *NullableEnvironmentRegistryStatus { + return &NullableEnvironmentRegistryStatus{value: val, isSet: true} +} + +func (v NullableEnvironmentRegistryStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnvironmentRegistryStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_environment_secret.go b/services/sca/v1betaapi/model_environment_secret.go new file mode 100644 index 0000000000..3005a54741 --- /dev/null +++ b/services/sca/v1betaapi/model_environment_secret.go @@ -0,0 +1,357 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the EnvironmentSecret type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EnvironmentSecret{} + +// EnvironmentSecret EnvironmentSecret defines a single secret representation. +type EnvironmentSecret struct { + // Creation timestamp of this registry entry. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Secret key. + Key string `json:"key"` + // Secret region. + Region *string `json:"region,omitempty"` + Status *EnvironmentSecretStatus `json:"status,omitempty"` + // Last update timestamp of this registry entry. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // Secret value. Omit or set to null to keep the existing value unchanged. + Value *string `json:"value,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EnvironmentSecret EnvironmentSecret + +// NewEnvironmentSecret instantiates a new EnvironmentSecret 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 NewEnvironmentSecret(key string) *EnvironmentSecret { + this := EnvironmentSecret{} + this.Key = key + return &this +} + +// NewEnvironmentSecretWithDefaults instantiates a new EnvironmentSecret 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 NewEnvironmentSecretWithDefaults() *EnvironmentSecret { + this := EnvironmentSecret{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *EnvironmentSecret) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvironmentSecret) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *EnvironmentSecret) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *EnvironmentSecret) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetKey returns the Key field value +func (o *EnvironmentSecret) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *EnvironmentSecret) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *EnvironmentSecret) SetKey(v string) { + o.Key = v +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *EnvironmentSecret) GetRegion() string { + if o == nil || IsNil(o.Region) { + var ret string + return ret + } + return *o.Region +} + +// GetRegionOk returns a tuple with the Region field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvironmentSecret) GetRegionOk() (*string, bool) { + if o == nil || IsNil(o.Region) { + return nil, false + } + return o.Region, true +} + +// HasRegion returns a boolean if a field has been set. +func (o *EnvironmentSecret) HasRegion() bool { + if o != nil && !IsNil(o.Region) { + return true + } + + return false +} + +// SetRegion gets a reference to the given string and assigns it to the Region field. +func (o *EnvironmentSecret) SetRegion(v string) { + o.Region = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *EnvironmentSecret) GetStatus() EnvironmentSecretStatus { + if o == nil || IsNil(o.Status) { + var ret EnvironmentSecretStatus + 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 *EnvironmentSecret) GetStatusOk() (*EnvironmentSecretStatus, 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 *EnvironmentSecret) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given EnvironmentSecretStatus and assigns it to the Status field. +func (o *EnvironmentSecret) SetStatus(v EnvironmentSecretStatus) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *EnvironmentSecret) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvironmentSecret) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *EnvironmentSecret) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *EnvironmentSecret) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *EnvironmentSecret) GetValue() string { + if o == nil || IsNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvironmentSecret) GetValueOk() (*string, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *EnvironmentSecret) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *EnvironmentSecret) SetValue(v string) { + o.Value = &v +} + +func (o EnvironmentSecret) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EnvironmentSecret) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + toSerialize["key"] = o.Key + if !IsNil(o.Region) { + toSerialize["region"] = o.Region + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EnvironmentSecret) 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{ + "key", + } + + 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) + } + } + + varEnvironmentSecret := _EnvironmentSecret{} + + err = json.Unmarshal(data, &varEnvironmentSecret) + + if err != nil { + return err + } + + *o = EnvironmentSecret(varEnvironmentSecret) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "createdAt") + delete(additionalProperties, "key") + delete(additionalProperties, "region") + delete(additionalProperties, "status") + delete(additionalProperties, "updatedAt") + delete(additionalProperties, "value") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEnvironmentSecret struct { + value *EnvironmentSecret + isSet bool +} + +func (v NullableEnvironmentSecret) Get() *EnvironmentSecret { + return v.value +} + +func (v *NullableEnvironmentSecret) Set(val *EnvironmentSecret) { + v.value = val + v.isSet = true +} + +func (v NullableEnvironmentSecret) IsSet() bool { + return v.isSet +} + +func (v *NullableEnvironmentSecret) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnvironmentSecret(val *EnvironmentSecret) *NullableEnvironmentSecret { + return &NullableEnvironmentSecret{value: val, isSet: true} +} + +func (v NullableEnvironmentSecret) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnvironmentSecret) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_environment_secret_status.go b/services/sca/v1betaapi/model_environment_secret_status.go new file mode 100644 index 0000000000..8fb39cb8c6 --- /dev/null +++ b/services/sca/v1betaapi/model_environment_secret_status.go @@ -0,0 +1,154 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the EnvironmentSecretStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EnvironmentSecretStatus{} + +// EnvironmentSecretStatus EnvironmentSecretStatus computed fields for a single secret. +type EnvironmentSecretStatus struct { + // List of entities actively consuming this secret. + Consumers []SecretConsumer `json:"consumers,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EnvironmentSecretStatus EnvironmentSecretStatus + +// NewEnvironmentSecretStatus instantiates a new EnvironmentSecretStatus 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 NewEnvironmentSecretStatus() *EnvironmentSecretStatus { + this := EnvironmentSecretStatus{} + return &this +} + +// NewEnvironmentSecretStatusWithDefaults instantiates a new EnvironmentSecretStatus 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 NewEnvironmentSecretStatusWithDefaults() *EnvironmentSecretStatus { + this := EnvironmentSecretStatus{} + return &this +} + +// GetConsumers returns the Consumers field value if set, zero value otherwise. +func (o *EnvironmentSecretStatus) GetConsumers() []SecretConsumer { + if o == nil || IsNil(o.Consumers) { + var ret []SecretConsumer + return ret + } + return o.Consumers +} + +// GetConsumersOk returns a tuple with the Consumers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvironmentSecretStatus) GetConsumersOk() ([]SecretConsumer, bool) { + if o == nil || IsNil(o.Consumers) { + return nil, false + } + return o.Consumers, true +} + +// HasConsumers returns a boolean if a field has been set. +func (o *EnvironmentSecretStatus) HasConsumers() bool { + if o != nil && !IsNil(o.Consumers) { + return true + } + + return false +} + +// SetConsumers gets a reference to the given []SecretConsumer and assigns it to the Consumers field. +func (o *EnvironmentSecretStatus) SetConsumers(v []SecretConsumer) { + o.Consumers = v +} + +func (o EnvironmentSecretStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EnvironmentSecretStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Consumers) { + toSerialize["consumers"] = o.Consumers + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EnvironmentSecretStatus) UnmarshalJSON(data []byte) (err error) { + varEnvironmentSecretStatus := _EnvironmentSecretStatus{} + + err = json.Unmarshal(data, &varEnvironmentSecretStatus) + + if err != nil { + return err + } + + *o = EnvironmentSecretStatus(varEnvironmentSecretStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "consumers") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEnvironmentSecretStatus struct { + value *EnvironmentSecretStatus + isSet bool +} + +func (v NullableEnvironmentSecretStatus) Get() *EnvironmentSecretStatus { + return v.value +} + +func (v *NullableEnvironmentSecretStatus) Set(val *EnvironmentSecretStatus) { + v.value = val + v.isSet = true +} + +func (v NullableEnvironmentSecretStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableEnvironmentSecretStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnvironmentSecretStatus(val *EnvironmentSecretStatus) *NullableEnvironmentSecretStatus { + return &NullableEnvironmentSecretStatus{value: val, isSet: true} +} + +func (v NullableEnvironmentSecretStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnvironmentSecretStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_environment_secrets_vault.go b/services/sca/v1betaapi/model_environment_secrets_vault.go new file mode 100644 index 0000000000..163bc4c532 --- /dev/null +++ b/services/sca/v1betaapi/model_environment_secrets_vault.go @@ -0,0 +1,167 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the EnvironmentSecretsVault type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EnvironmentSecretsVault{} + +// EnvironmentSecretsVault Represents the vault containing the Environment secrets. +type EnvironmentSecretsVault struct { + // The collection of configured secrets. + Secrets []EnvironmentSecret `json:"secrets"` + AdditionalProperties map[string]interface{} +} + +type _EnvironmentSecretsVault EnvironmentSecretsVault + +// NewEnvironmentSecretsVault instantiates a new EnvironmentSecretsVault 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 NewEnvironmentSecretsVault(secrets []EnvironmentSecret) *EnvironmentSecretsVault { + this := EnvironmentSecretsVault{} + this.Secrets = secrets + return &this +} + +// NewEnvironmentSecretsVaultWithDefaults instantiates a new EnvironmentSecretsVault 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 NewEnvironmentSecretsVaultWithDefaults() *EnvironmentSecretsVault { + this := EnvironmentSecretsVault{} + return &this +} + +// GetSecrets returns the Secrets field value +func (o *EnvironmentSecretsVault) GetSecrets() []EnvironmentSecret { + if o == nil { + var ret []EnvironmentSecret + return ret + } + + return o.Secrets +} + +// GetSecretsOk returns a tuple with the Secrets field value +// and a boolean to check if the value has been set. +func (o *EnvironmentSecretsVault) GetSecretsOk() ([]EnvironmentSecret, bool) { + if o == nil { + return nil, false + } + return o.Secrets, true +} + +// SetSecrets sets field value +func (o *EnvironmentSecretsVault) SetSecrets(v []EnvironmentSecret) { + o.Secrets = v +} + +func (o EnvironmentSecretsVault) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EnvironmentSecretsVault) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["secrets"] = o.Secrets + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EnvironmentSecretsVault) 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{ + "secrets", + } + + 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) + } + } + + varEnvironmentSecretsVault := _EnvironmentSecretsVault{} + + err = json.Unmarshal(data, &varEnvironmentSecretsVault) + + if err != nil { + return err + } + + *o = EnvironmentSecretsVault(varEnvironmentSecretsVault) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "secrets") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEnvironmentSecretsVault struct { + value *EnvironmentSecretsVault + isSet bool +} + +func (v NullableEnvironmentSecretsVault) Get() *EnvironmentSecretsVault { + return v.value +} + +func (v *NullableEnvironmentSecretsVault) Set(val *EnvironmentSecretsVault) { + v.value = val + v.isSet = true +} + +func (v NullableEnvironmentSecretsVault) IsSet() bool { + return v.isSet +} + +func (v *NullableEnvironmentSecretsVault) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnvironmentSecretsVault(val *EnvironmentSecretsVault) *NullableEnvironmentSecretsVault { + return &NullableEnvironmentSecretsVault{value: val, isSet: true} +} + +func (v NullableEnvironmentSecretsVault) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnvironmentSecretsVault) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_environment_status.go b/services/sca/v1betaapi/model_environment_status.go new file mode 100644 index 0000000000..5a29fea1c8 --- /dev/null +++ b/services/sca/v1betaapi/model_environment_status.go @@ -0,0 +1,195 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the EnvironmentStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EnvironmentStatus{} + +// EnvironmentStatus Status of the environment. +type EnvironmentStatus struct { + // Amount of applications in the environment. + ApplicationsNumber *int32 `json:"applicationsNumber,omitempty"` + Current *EnvironmentCurrentStatus `json:"current,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EnvironmentStatus EnvironmentStatus + +// NewEnvironmentStatus instantiates a new EnvironmentStatus 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 NewEnvironmentStatus() *EnvironmentStatus { + this := EnvironmentStatus{} + var current EnvironmentCurrentStatus = ENVIRONMENTCURRENTSTATUS_CURRENT_STATUS_UNSPECIFIED + this.Current = ¤t + return &this +} + +// NewEnvironmentStatusWithDefaults instantiates a new EnvironmentStatus 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 NewEnvironmentStatusWithDefaults() *EnvironmentStatus { + this := EnvironmentStatus{} + var current EnvironmentCurrentStatus = ENVIRONMENTCURRENTSTATUS_CURRENT_STATUS_UNSPECIFIED + this.Current = ¤t + return &this +} + +// GetApplicationsNumber returns the ApplicationsNumber field value if set, zero value otherwise. +func (o *EnvironmentStatus) GetApplicationsNumber() int32 { + if o == nil || IsNil(o.ApplicationsNumber) { + var ret int32 + return ret + } + return *o.ApplicationsNumber +} + +// GetApplicationsNumberOk returns a tuple with the ApplicationsNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvironmentStatus) GetApplicationsNumberOk() (*int32, bool) { + if o == nil || IsNil(o.ApplicationsNumber) { + return nil, false + } + return o.ApplicationsNumber, true +} + +// HasApplicationsNumber returns a boolean if a field has been set. +func (o *EnvironmentStatus) HasApplicationsNumber() bool { + if o != nil && !IsNil(o.ApplicationsNumber) { + return true + } + + return false +} + +// SetApplicationsNumber gets a reference to the given int32 and assigns it to the ApplicationsNumber field. +func (o *EnvironmentStatus) SetApplicationsNumber(v int32) { + o.ApplicationsNumber = &v +} + +// GetCurrent returns the Current field value if set, zero value otherwise. +func (o *EnvironmentStatus) GetCurrent() EnvironmentCurrentStatus { + if o == nil || IsNil(o.Current) { + var ret EnvironmentCurrentStatus + return ret + } + return *o.Current +} + +// GetCurrentOk returns a tuple with the Current field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnvironmentStatus) GetCurrentOk() (*EnvironmentCurrentStatus, bool) { + if o == nil || IsNil(o.Current) { + return nil, false + } + return o.Current, true +} + +// HasCurrent returns a boolean if a field has been set. +func (o *EnvironmentStatus) HasCurrent() bool { + if o != nil && !IsNil(o.Current) { + return true + } + + return false +} + +// SetCurrent gets a reference to the given EnvironmentCurrentStatus and assigns it to the Current field. +func (o *EnvironmentStatus) SetCurrent(v EnvironmentCurrentStatus) { + o.Current = &v +} + +func (o EnvironmentStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EnvironmentStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ApplicationsNumber) { + toSerialize["applicationsNumber"] = o.ApplicationsNumber + } + if !IsNil(o.Current) { + toSerialize["current"] = o.Current + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EnvironmentStatus) UnmarshalJSON(data []byte) (err error) { + varEnvironmentStatus := _EnvironmentStatus{} + + err = json.Unmarshal(data, &varEnvironmentStatus) + + if err != nil { + return err + } + + *o = EnvironmentStatus(varEnvironmentStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "applicationsNumber") + delete(additionalProperties, "current") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEnvironmentStatus struct { + value *EnvironmentStatus + isSet bool +} + +func (v NullableEnvironmentStatus) Get() *EnvironmentStatus { + return v.value +} + +func (v *NullableEnvironmentStatus) Set(val *EnvironmentStatus) { + v.value = val + v.isSet = true +} + +func (v NullableEnvironmentStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableEnvironmentStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnvironmentStatus(val *EnvironmentStatus) *NullableEnvironmentStatus { + return &NullableEnvironmentStatus{value: val, isSet: true} +} + +func (v NullableEnvironmentStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnvironmentStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_get_application_events_response.go b/services/sca/v1betaapi/model_get_application_events_response.go new file mode 100644 index 0000000000..551961ad9d --- /dev/null +++ b/services/sca/v1betaapi/model_get_application_events_response.go @@ -0,0 +1,154 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the GetApplicationEventsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetApplicationEventsResponse{} + +// GetApplicationEventsResponse GetApplicationEventsResponse contains an application's events list. +type GetApplicationEventsResponse struct { + // Events list. + Events []ApplicationEvent `json:"events,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GetApplicationEventsResponse GetApplicationEventsResponse + +// NewGetApplicationEventsResponse instantiates a new GetApplicationEventsResponse 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 NewGetApplicationEventsResponse() *GetApplicationEventsResponse { + this := GetApplicationEventsResponse{} + return &this +} + +// NewGetApplicationEventsResponseWithDefaults instantiates a new GetApplicationEventsResponse 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 NewGetApplicationEventsResponseWithDefaults() *GetApplicationEventsResponse { + this := GetApplicationEventsResponse{} + return &this +} + +// GetEvents returns the Events field value if set, zero value otherwise. +func (o *GetApplicationEventsResponse) GetEvents() []ApplicationEvent { + if o == nil || IsNil(o.Events) { + var ret []ApplicationEvent + return ret + } + return o.Events +} + +// GetEventsOk returns a tuple with the Events field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetApplicationEventsResponse) GetEventsOk() ([]ApplicationEvent, bool) { + if o == nil || IsNil(o.Events) { + return nil, false + } + return o.Events, true +} + +// HasEvents returns a boolean if a field has been set. +func (o *GetApplicationEventsResponse) HasEvents() bool { + if o != nil && !IsNil(o.Events) { + return true + } + + return false +} + +// SetEvents gets a reference to the given []ApplicationEvent and assigns it to the Events field. +func (o *GetApplicationEventsResponse) SetEvents(v []ApplicationEvent) { + o.Events = v +} + +func (o GetApplicationEventsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetApplicationEventsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Events) { + toSerialize["events"] = o.Events + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetApplicationEventsResponse) UnmarshalJSON(data []byte) (err error) { + varGetApplicationEventsResponse := _GetApplicationEventsResponse{} + + err = json.Unmarshal(data, &varGetApplicationEventsResponse) + + if err != nil { + return err + } + + *o = GetApplicationEventsResponse(varGetApplicationEventsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "events") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetApplicationEventsResponse struct { + value *GetApplicationEventsResponse + isSet bool +} + +func (v NullableGetApplicationEventsResponse) Get() *GetApplicationEventsResponse { + return v.value +} + +func (v *NullableGetApplicationEventsResponse) Set(val *GetApplicationEventsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetApplicationEventsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetApplicationEventsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetApplicationEventsResponse(val *GetApplicationEventsResponse) *NullableGetApplicationEventsResponse { + return &NullableGetApplicationEventsResponse{value: val, isSet: true} +} + +func (v NullableGetApplicationEventsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetApplicationEventsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_get_application_logs_response.go b/services/sca/v1betaapi/model_get_application_logs_response.go new file mode 100644 index 0000000000..ab7e331baf --- /dev/null +++ b/services/sca/v1betaapi/model_get_application_logs_response.go @@ -0,0 +1,154 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the GetApplicationLogsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetApplicationLogsResponse{} + +// GetApplicationLogsResponse GetApplicationLogsResponse contains an application's logs list. +type GetApplicationLogsResponse struct { + // Logs list. + Logs []ApplicationLog `json:"logs,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GetApplicationLogsResponse GetApplicationLogsResponse + +// NewGetApplicationLogsResponse instantiates a new GetApplicationLogsResponse 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 NewGetApplicationLogsResponse() *GetApplicationLogsResponse { + this := GetApplicationLogsResponse{} + return &this +} + +// NewGetApplicationLogsResponseWithDefaults instantiates a new GetApplicationLogsResponse 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 NewGetApplicationLogsResponseWithDefaults() *GetApplicationLogsResponse { + this := GetApplicationLogsResponse{} + return &this +} + +// GetLogs returns the Logs field value if set, zero value otherwise. +func (o *GetApplicationLogsResponse) GetLogs() []ApplicationLog { + if o == nil || IsNil(o.Logs) { + var ret []ApplicationLog + return ret + } + return o.Logs +} + +// GetLogsOk returns a tuple with the Logs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetApplicationLogsResponse) GetLogsOk() ([]ApplicationLog, bool) { + if o == nil || IsNil(o.Logs) { + return nil, false + } + return o.Logs, true +} + +// HasLogs returns a boolean if a field has been set. +func (o *GetApplicationLogsResponse) HasLogs() bool { + if o != nil && !IsNil(o.Logs) { + return true + } + + return false +} + +// SetLogs gets a reference to the given []ApplicationLog and assigns it to the Logs field. +func (o *GetApplicationLogsResponse) SetLogs(v []ApplicationLog) { + o.Logs = v +} + +func (o GetApplicationLogsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetApplicationLogsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Logs) { + toSerialize["logs"] = o.Logs + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetApplicationLogsResponse) UnmarshalJSON(data []byte) (err error) { + varGetApplicationLogsResponse := _GetApplicationLogsResponse{} + + err = json.Unmarshal(data, &varGetApplicationLogsResponse) + + if err != nil { + return err + } + + *o = GetApplicationLogsResponse(varGetApplicationLogsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "logs") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetApplicationLogsResponse struct { + value *GetApplicationLogsResponse + isSet bool +} + +func (v NullableGetApplicationLogsResponse) Get() *GetApplicationLogsResponse { + return v.value +} + +func (v *NullableGetApplicationLogsResponse) Set(val *GetApplicationLogsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetApplicationLogsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetApplicationLogsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetApplicationLogsResponse(val *GetApplicationLogsResponse) *NullableGetApplicationLogsResponse { + return &NullableGetApplicationLogsResponse{value: val, isSet: true} +} + +func (v NullableGetApplicationLogsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetApplicationLogsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_get_overview_response.go b/services/sca/v1betaapi/model_get_overview_response.go new file mode 100644 index 0000000000..f36b3c912c --- /dev/null +++ b/services/sca/v1betaapi/model_get_overview_response.go @@ -0,0 +1,191 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the GetOverviewResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetOverviewResponse{} + +// GetOverviewResponse GetOverviewResponse contains a summary of the current state of the project's application. +type GetOverviewResponse struct { + // Region where the overview is being fetched from. + Region *string `json:"region,omitempty"` + Summary *OverviewSummary `json:"summary,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GetOverviewResponse GetOverviewResponse + +// NewGetOverviewResponse instantiates a new GetOverviewResponse 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 NewGetOverviewResponse() *GetOverviewResponse { + this := GetOverviewResponse{} + return &this +} + +// NewGetOverviewResponseWithDefaults instantiates a new GetOverviewResponse 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 NewGetOverviewResponseWithDefaults() *GetOverviewResponse { + this := GetOverviewResponse{} + return &this +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *GetOverviewResponse) GetRegion() string { + if o == nil || IsNil(o.Region) { + var ret string + return ret + } + return *o.Region +} + +// GetRegionOk returns a tuple with the Region field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetOverviewResponse) GetRegionOk() (*string, bool) { + if o == nil || IsNil(o.Region) { + return nil, false + } + return o.Region, true +} + +// HasRegion returns a boolean if a field has been set. +func (o *GetOverviewResponse) HasRegion() bool { + if o != nil && !IsNil(o.Region) { + return true + } + + return false +} + +// SetRegion gets a reference to the given string and assigns it to the Region field. +func (o *GetOverviewResponse) SetRegion(v string) { + o.Region = &v +} + +// GetSummary returns the Summary field value if set, zero value otherwise. +func (o *GetOverviewResponse) GetSummary() OverviewSummary { + if o == nil || IsNil(o.Summary) { + var ret OverviewSummary + return ret + } + return *o.Summary +} + +// GetSummaryOk returns a tuple with the Summary field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetOverviewResponse) GetSummaryOk() (*OverviewSummary, bool) { + if o == nil || IsNil(o.Summary) { + return nil, false + } + return o.Summary, true +} + +// HasSummary returns a boolean if a field has been set. +func (o *GetOverviewResponse) HasSummary() bool { + if o != nil && !IsNil(o.Summary) { + return true + } + + return false +} + +// SetSummary gets a reference to the given OverviewSummary and assigns it to the Summary field. +func (o *GetOverviewResponse) SetSummary(v OverviewSummary) { + o.Summary = &v +} + +func (o GetOverviewResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetOverviewResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Region) { + toSerialize["region"] = o.Region + } + if !IsNil(o.Summary) { + toSerialize["summary"] = o.Summary + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetOverviewResponse) UnmarshalJSON(data []byte) (err error) { + varGetOverviewResponse := _GetOverviewResponse{} + + err = json.Unmarshal(data, &varGetOverviewResponse) + + if err != nil { + return err + } + + *o = GetOverviewResponse(varGetOverviewResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "region") + delete(additionalProperties, "summary") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetOverviewResponse struct { + value *GetOverviewResponse + isSet bool +} + +func (v NullableGetOverviewResponse) Get() *GetOverviewResponse { + return v.value +} + +func (v *NullableGetOverviewResponse) Set(val *GetOverviewResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetOverviewResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetOverviewResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetOverviewResponse(val *GetOverviewResponse) *NullableGetOverviewResponse { + return &NullableGetOverviewResponse{value: val, isSet: true} +} + +func (v NullableGetOverviewResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetOverviewResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_list_applications_response.go b/services/sca/v1betaapi/model_list_applications_response.go new file mode 100644 index 0000000000..f1792b2243 --- /dev/null +++ b/services/sca/v1betaapi/model_list_applications_response.go @@ -0,0 +1,154 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the ListApplicationsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListApplicationsResponse{} + +// ListApplicationsResponse ListApplicationsResponse contains applications and pagination metadata. +type ListApplicationsResponse struct { + // Applications summaries under the requested parent. + Items []ApplicationSummary `json:"items,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ListApplicationsResponse ListApplicationsResponse + +// NewListApplicationsResponse instantiates a new ListApplicationsResponse 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 NewListApplicationsResponse() *ListApplicationsResponse { + this := ListApplicationsResponse{} + return &this +} + +// NewListApplicationsResponseWithDefaults instantiates a new ListApplicationsResponse 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 NewListApplicationsResponseWithDefaults() *ListApplicationsResponse { + this := ListApplicationsResponse{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ListApplicationsResponse) GetItems() []ApplicationSummary { + if o == nil || IsNil(o.Items) { + var ret []ApplicationSummary + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListApplicationsResponse) GetItemsOk() ([]ApplicationSummary, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *ListApplicationsResponse) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []ApplicationSummary and assigns it to the Items field. +func (o *ListApplicationsResponse) SetItems(v []ApplicationSummary) { + o.Items = v +} + +func (o ListApplicationsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListApplicationsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListApplicationsResponse) UnmarshalJSON(data []byte) (err error) { + varListApplicationsResponse := _ListApplicationsResponse{} + + err = json.Unmarshal(data, &varListApplicationsResponse) + + if err != nil { + return err + } + + *o = ListApplicationsResponse(varListApplicationsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "items") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListApplicationsResponse struct { + value *ListApplicationsResponse + isSet bool +} + +func (v NullableListApplicationsResponse) Get() *ListApplicationsResponse { + return v.value +} + +func (v *NullableListApplicationsResponse) Set(val *ListApplicationsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListApplicationsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListApplicationsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListApplicationsResponse(val *ListApplicationsResponse) *NullableListApplicationsResponse { + return &NullableListApplicationsResponse{value: val, isSet: true} +} + +func (v NullableListApplicationsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListApplicationsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_list_environments_response.go b/services/sca/v1betaapi/model_list_environments_response.go new file mode 100644 index 0000000000..32f89fe662 --- /dev/null +++ b/services/sca/v1betaapi/model_list_environments_response.go @@ -0,0 +1,154 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the ListEnvironmentsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListEnvironmentsResponse{} + +// ListEnvironmentsResponse ListEnvironmentsResponse contains environments and pagination metadata. +type ListEnvironmentsResponse struct { + // Environments under the requested parent. + Items []Environment `json:"items,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ListEnvironmentsResponse ListEnvironmentsResponse + +// NewListEnvironmentsResponse instantiates a new ListEnvironmentsResponse 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 NewListEnvironmentsResponse() *ListEnvironmentsResponse { + this := ListEnvironmentsResponse{} + return &this +} + +// NewListEnvironmentsResponseWithDefaults instantiates a new ListEnvironmentsResponse 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 NewListEnvironmentsResponseWithDefaults() *ListEnvironmentsResponse { + this := ListEnvironmentsResponse{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ListEnvironmentsResponse) GetItems() []Environment { + if o == nil || IsNil(o.Items) { + var ret []Environment + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListEnvironmentsResponse) GetItemsOk() ([]Environment, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *ListEnvironmentsResponse) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []Environment and assigns it to the Items field. +func (o *ListEnvironmentsResponse) SetItems(v []Environment) { + o.Items = v +} + +func (o ListEnvironmentsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListEnvironmentsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListEnvironmentsResponse) UnmarshalJSON(data []byte) (err error) { + varListEnvironmentsResponse := _ListEnvironmentsResponse{} + + err = json.Unmarshal(data, &varListEnvironmentsResponse) + + if err != nil { + return err + } + + *o = ListEnvironmentsResponse(varListEnvironmentsResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "items") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListEnvironmentsResponse struct { + value *ListEnvironmentsResponse + isSet bool +} + +func (v NullableListEnvironmentsResponse) Get() *ListEnvironmentsResponse { + return v.value +} + +func (v *NullableListEnvironmentsResponse) Set(val *ListEnvironmentsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListEnvironmentsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListEnvironmentsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListEnvironmentsResponse(val *ListEnvironmentsResponse) *NullableListEnvironmentsResponse { + return &NullableListEnvironmentsResponse{value: val, isSet: true} +} + +func (v NullableListEnvironmentsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListEnvironmentsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_overview_summary.go b/services/sca/v1betaapi/model_overview_summary.go new file mode 100644 index 0000000000..fd726f4332 --- /dev/null +++ b/services/sca/v1betaapi/model_overview_summary.go @@ -0,0 +1,192 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the OverviewSummary type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OverviewSummary{} + +// OverviewSummary Summary describes the current status of a project. +type OverviewSummary struct { + // Number of applications running in a project. + ApplicationsRunning *int32 `json:"applicationsRunning,omitempty"` + // Number of applications created in a project. + ApplicationsTotal *int32 `json:"applicationsTotal,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OverviewSummary OverviewSummary + +// NewOverviewSummary instantiates a new OverviewSummary 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 NewOverviewSummary() *OverviewSummary { + this := OverviewSummary{} + return &this +} + +// NewOverviewSummaryWithDefaults instantiates a new OverviewSummary 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 NewOverviewSummaryWithDefaults() *OverviewSummary { + this := OverviewSummary{} + return &this +} + +// GetApplicationsRunning returns the ApplicationsRunning field value if set, zero value otherwise. +func (o *OverviewSummary) GetApplicationsRunning() int32 { + if o == nil || IsNil(o.ApplicationsRunning) { + var ret int32 + return ret + } + return *o.ApplicationsRunning +} + +// GetApplicationsRunningOk returns a tuple with the ApplicationsRunning field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OverviewSummary) GetApplicationsRunningOk() (*int32, bool) { + if o == nil || IsNil(o.ApplicationsRunning) { + return nil, false + } + return o.ApplicationsRunning, true +} + +// HasApplicationsRunning returns a boolean if a field has been set. +func (o *OverviewSummary) HasApplicationsRunning() bool { + if o != nil && !IsNil(o.ApplicationsRunning) { + return true + } + + return false +} + +// SetApplicationsRunning gets a reference to the given int32 and assigns it to the ApplicationsRunning field. +func (o *OverviewSummary) SetApplicationsRunning(v int32) { + o.ApplicationsRunning = &v +} + +// GetApplicationsTotal returns the ApplicationsTotal field value if set, zero value otherwise. +func (o *OverviewSummary) GetApplicationsTotal() int32 { + if o == nil || IsNil(o.ApplicationsTotal) { + var ret int32 + return ret + } + return *o.ApplicationsTotal +} + +// GetApplicationsTotalOk returns a tuple with the ApplicationsTotal field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OverviewSummary) GetApplicationsTotalOk() (*int32, bool) { + if o == nil || IsNil(o.ApplicationsTotal) { + return nil, false + } + return o.ApplicationsTotal, true +} + +// HasApplicationsTotal returns a boolean if a field has been set. +func (o *OverviewSummary) HasApplicationsTotal() bool { + if o != nil && !IsNil(o.ApplicationsTotal) { + return true + } + + return false +} + +// SetApplicationsTotal gets a reference to the given int32 and assigns it to the ApplicationsTotal field. +func (o *OverviewSummary) SetApplicationsTotal(v int32) { + o.ApplicationsTotal = &v +} + +func (o OverviewSummary) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OverviewSummary) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ApplicationsRunning) { + toSerialize["applicationsRunning"] = o.ApplicationsRunning + } + if !IsNil(o.ApplicationsTotal) { + toSerialize["applicationsTotal"] = o.ApplicationsTotal + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OverviewSummary) UnmarshalJSON(data []byte) (err error) { + varOverviewSummary := _OverviewSummary{} + + err = json.Unmarshal(data, &varOverviewSummary) + + if err != nil { + return err + } + + *o = OverviewSummary(varOverviewSummary) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "applicationsRunning") + delete(additionalProperties, "applicationsTotal") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOverviewSummary struct { + value *OverviewSummary + isSet bool +} + +func (v NullableOverviewSummary) Get() *OverviewSummary { + return v.value +} + +func (v *NullableOverviewSummary) Set(val *OverviewSummary) { + v.value = val + v.isSet = true +} + +func (v NullableOverviewSummary) IsSet() bool { + return v.isSet +} + +func (v *NullableOverviewSummary) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOverviewSummary(val *OverviewSummary) *NullableOverviewSummary { + return &NullableOverviewSummary{value: val, isSet: true} +} + +func (v NullableOverviewSummary) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOverviewSummary) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_registry_consumer.go b/services/sca/v1betaapi/model_registry_consumer.go new file mode 100644 index 0000000000..66b1d006e1 --- /dev/null +++ b/services/sca/v1betaapi/model_registry_consumer.go @@ -0,0 +1,230 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the RegistryConsumer type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RegistryConsumer{} + +// RegistryConsumer RegistryConsumer lists the usages of a single Environment registry. +type RegistryConsumer struct { + // The container where the registry is used. + Container *string `json:"container,omitempty"` + // The display name of the entity. + DisplayName *string `json:"displayName,omitempty"` + // The entity that is consuming the registry. + Id *string `json:"id,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RegistryConsumer RegistryConsumer + +// NewRegistryConsumer instantiates a new RegistryConsumer 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 NewRegistryConsumer() *RegistryConsumer { + this := RegistryConsumer{} + return &this +} + +// NewRegistryConsumerWithDefaults instantiates a new RegistryConsumer 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 NewRegistryConsumerWithDefaults() *RegistryConsumer { + this := RegistryConsumer{} + return &this +} + +// GetContainer returns the Container field value if set, zero value otherwise. +func (o *RegistryConsumer) GetContainer() string { + if o == nil || IsNil(o.Container) { + var ret string + return ret + } + return *o.Container +} + +// GetContainerOk returns a tuple with the Container field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegistryConsumer) GetContainerOk() (*string, bool) { + if o == nil || IsNil(o.Container) { + return nil, false + } + return o.Container, true +} + +// HasContainer returns a boolean if a field has been set. +func (o *RegistryConsumer) HasContainer() bool { + if o != nil && !IsNil(o.Container) { + return true + } + + return false +} + +// SetContainer gets a reference to the given string and assigns it to the Container field. +func (o *RegistryConsumer) SetContainer(v string) { + o.Container = &v +} + +// GetDisplayName returns the DisplayName field value if set, zero value otherwise. +func (o *RegistryConsumer) GetDisplayName() string { + if o == nil || IsNil(o.DisplayName) { + var ret string + return ret + } + return *o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegistryConsumer) GetDisplayNameOk() (*string, bool) { + if o == nil || IsNil(o.DisplayName) { + return nil, false + } + return o.DisplayName, true +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *RegistryConsumer) HasDisplayName() bool { + if o != nil && !IsNil(o.DisplayName) { + return true + } + + return false +} + +// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. +func (o *RegistryConsumer) SetDisplayName(v string) { + o.DisplayName = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *RegistryConsumer) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegistryConsumer) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *RegistryConsumer) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *RegistryConsumer) SetId(v string) { + o.Id = &v +} + +func (o RegistryConsumer) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RegistryConsumer) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Container) { + toSerialize["container"] = o.Container + } + if !IsNil(o.DisplayName) { + toSerialize["displayName"] = o.DisplayName + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RegistryConsumer) UnmarshalJSON(data []byte) (err error) { + varRegistryConsumer := _RegistryConsumer{} + + err = json.Unmarshal(data, &varRegistryConsumer) + + if err != nil { + return err + } + + *o = RegistryConsumer(varRegistryConsumer) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "container") + delete(additionalProperties, "displayName") + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRegistryConsumer struct { + value *RegistryConsumer + isSet bool +} + +func (v NullableRegistryConsumer) Get() *RegistryConsumer { + return v.value +} + +func (v *NullableRegistryConsumer) Set(val *RegistryConsumer) { + v.value = val + v.isSet = true +} + +func (v NullableRegistryConsumer) IsSet() bool { + return v.isSet +} + +func (v *NullableRegistryConsumer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegistryConsumer(val *RegistryConsumer) *NullableRegistryConsumer { + return &NullableRegistryConsumer{value: val, isSet: true} +} + +func (v NullableRegistryConsumer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegistryConsumer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_secret_consumer.go b/services/sca/v1betaapi/model_secret_consumer.go new file mode 100644 index 0000000000..8ed2b19e65 --- /dev/null +++ b/services/sca/v1betaapi/model_secret_consumer.go @@ -0,0 +1,230 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the SecretConsumer type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SecretConsumer{} + +// SecretConsumer SecretConsumer lists the usages of a single Environment secret. +type SecretConsumer struct { + // The container where the secret is used. + Container *string `json:"container,omitempty"` + // The display name of the entity. + DisplayName *string `json:"displayName,omitempty"` + // The entity that is consuming the secret. + Id *string `json:"id,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SecretConsumer SecretConsumer + +// NewSecretConsumer instantiates a new SecretConsumer 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 NewSecretConsumer() *SecretConsumer { + this := SecretConsumer{} + return &this +} + +// NewSecretConsumerWithDefaults instantiates a new SecretConsumer 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 NewSecretConsumerWithDefaults() *SecretConsumer { + this := SecretConsumer{} + return &this +} + +// GetContainer returns the Container field value if set, zero value otherwise. +func (o *SecretConsumer) GetContainer() string { + if o == nil || IsNil(o.Container) { + var ret string + return ret + } + return *o.Container +} + +// GetContainerOk returns a tuple with the Container field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecretConsumer) GetContainerOk() (*string, bool) { + if o == nil || IsNil(o.Container) { + return nil, false + } + return o.Container, true +} + +// HasContainer returns a boolean if a field has been set. +func (o *SecretConsumer) HasContainer() bool { + if o != nil && !IsNil(o.Container) { + return true + } + + return false +} + +// SetContainer gets a reference to the given string and assigns it to the Container field. +func (o *SecretConsumer) SetContainer(v string) { + o.Container = &v +} + +// GetDisplayName returns the DisplayName field value if set, zero value otherwise. +func (o *SecretConsumer) GetDisplayName() string { + if o == nil || IsNil(o.DisplayName) { + var ret string + return ret + } + return *o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecretConsumer) GetDisplayNameOk() (*string, bool) { + if o == nil || IsNil(o.DisplayName) { + return nil, false + } + return o.DisplayName, true +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *SecretConsumer) HasDisplayName() bool { + if o != nil && !IsNil(o.DisplayName) { + return true + } + + return false +} + +// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. +func (o *SecretConsumer) SetDisplayName(v string) { + o.DisplayName = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SecretConsumer) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecretConsumer) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SecretConsumer) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SecretConsumer) SetId(v string) { + o.Id = &v +} + +func (o SecretConsumer) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SecretConsumer) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Container) { + toSerialize["container"] = o.Container + } + if !IsNil(o.DisplayName) { + toSerialize["displayName"] = o.DisplayName + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SecretConsumer) UnmarshalJSON(data []byte) (err error) { + varSecretConsumer := _SecretConsumer{} + + err = json.Unmarshal(data, &varSecretConsumer) + + if err != nil { + return err + } + + *o = SecretConsumer(varSecretConsumer) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "container") + delete(additionalProperties, "displayName") + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSecretConsumer struct { + value *SecretConsumer + isSet bool +} + +func (v NullableSecretConsumer) Get() *SecretConsumer { + return v.value +} + +func (v *NullableSecretConsumer) Set(val *SecretConsumer) { + v.value = val + v.isSet = true +} + +func (v NullableSecretConsumer) IsSet() bool { + return v.isSet +} + +func (v *NullableSecretConsumer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSecretConsumer(val *SecretConsumer) *NullableSecretConsumer { + return &NullableSecretConsumer{value: val, isSet: true} +} + +func (v NullableSecretConsumer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSecretConsumer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_update_application_payload.go b/services/sca/v1betaapi/model_update_application_payload.go new file mode 100644 index 0000000000..25dc94eee0 --- /dev/null +++ b/services/sca/v1betaapi/model_update_application_payload.go @@ -0,0 +1,567 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the UpdateApplicationPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateApplicationPayload{} + +// UpdateApplicationPayload Application describes a deployable multi-container workload instance. +type UpdateApplicationPayload struct { + // Containers to deploy for the application. + Containers []Container `json:"containers"` + // Creation date in RFC3339 format. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Human-readable display name. + DisplayName string `json:"displayName"` + // Environment identifier where the application belongs. + EnvironmentId *string `json:"environmentId,omitempty"` + // Environment human-readable display name. + EnvironmentName *string `json:"environmentName,omitempty"` + // Application identifier. + Id *string `json:"id,omitempty"` + Network *ApplicationNetwork `json:"network,omitempty"` + // Region of the environment. + Region *string `json:"region,omitempty"` + Scaling ApplicationScaling `json:"scaling"` + Status *ApplicationStatus `json:"status,omitempty"` + // Indicates if the application resources are stopped. + Stopped *bool `json:"stopped,omitempty"` + // Last update date in RFC3339 format. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UpdateApplicationPayload UpdateApplicationPayload + +// NewUpdateApplicationPayload instantiates a new UpdateApplicationPayload 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 NewUpdateApplicationPayload(containers []Container, displayName string, scaling ApplicationScaling) *UpdateApplicationPayload { + this := UpdateApplicationPayload{} + this.Containers = containers + this.DisplayName = displayName + this.Scaling = scaling + return &this +} + +// NewUpdateApplicationPayloadWithDefaults instantiates a new UpdateApplicationPayload 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 NewUpdateApplicationPayloadWithDefaults() *UpdateApplicationPayload { + this := UpdateApplicationPayload{} + return &this +} + +// GetContainers returns the Containers field value +func (o *UpdateApplicationPayload) GetContainers() []Container { + if o == nil { + var ret []Container + return ret + } + + return o.Containers +} + +// GetContainersOk returns a tuple with the Containers field value +// and a boolean to check if the value has been set. +func (o *UpdateApplicationPayload) GetContainersOk() ([]Container, bool) { + if o == nil { + return nil, false + } + return o.Containers, true +} + +// SetContainers sets field value +func (o *UpdateApplicationPayload) SetContainers(v []Container) { + o.Containers = v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *UpdateApplicationPayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateApplicationPayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *UpdateApplicationPayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *UpdateApplicationPayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDisplayName returns the DisplayName field value +func (o *UpdateApplicationPayload) GetDisplayName() string { + if o == nil { + var ret string + return ret + } + + return o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value +// and a boolean to check if the value has been set. +func (o *UpdateApplicationPayload) GetDisplayNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DisplayName, true +} + +// SetDisplayName sets field value +func (o *UpdateApplicationPayload) SetDisplayName(v string) { + o.DisplayName = v +} + +// GetEnvironmentId returns the EnvironmentId field value if set, zero value otherwise. +func (o *UpdateApplicationPayload) GetEnvironmentId() string { + if o == nil || IsNil(o.EnvironmentId) { + var ret string + return ret + } + return *o.EnvironmentId +} + +// GetEnvironmentIdOk returns a tuple with the EnvironmentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateApplicationPayload) GetEnvironmentIdOk() (*string, bool) { + if o == nil || IsNil(o.EnvironmentId) { + return nil, false + } + return o.EnvironmentId, true +} + +// HasEnvironmentId returns a boolean if a field has been set. +func (o *UpdateApplicationPayload) HasEnvironmentId() bool { + if o != nil && !IsNil(o.EnvironmentId) { + return true + } + + return false +} + +// SetEnvironmentId gets a reference to the given string and assigns it to the EnvironmentId field. +func (o *UpdateApplicationPayload) SetEnvironmentId(v string) { + o.EnvironmentId = &v +} + +// GetEnvironmentName returns the EnvironmentName field value if set, zero value otherwise. +func (o *UpdateApplicationPayload) GetEnvironmentName() string { + if o == nil || IsNil(o.EnvironmentName) { + var ret string + return ret + } + return *o.EnvironmentName +} + +// GetEnvironmentNameOk returns a tuple with the EnvironmentName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateApplicationPayload) GetEnvironmentNameOk() (*string, bool) { + if o == nil || IsNil(o.EnvironmentName) { + return nil, false + } + return o.EnvironmentName, true +} + +// HasEnvironmentName returns a boolean if a field has been set. +func (o *UpdateApplicationPayload) HasEnvironmentName() bool { + if o != nil && !IsNil(o.EnvironmentName) { + return true + } + + return false +} + +// SetEnvironmentName gets a reference to the given string and assigns it to the EnvironmentName field. +func (o *UpdateApplicationPayload) SetEnvironmentName(v string) { + o.EnvironmentName = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *UpdateApplicationPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateApplicationPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *UpdateApplicationPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *UpdateApplicationPayload) SetId(v string) { + o.Id = &v +} + +// GetNetwork returns the Network field value if set, zero value otherwise. +func (o *UpdateApplicationPayload) GetNetwork() ApplicationNetwork { + if o == nil || IsNil(o.Network) { + var ret ApplicationNetwork + return ret + } + return *o.Network +} + +// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateApplicationPayload) GetNetworkOk() (*ApplicationNetwork, bool) { + if o == nil || IsNil(o.Network) { + return nil, false + } + return o.Network, true +} + +// HasNetwork returns a boolean if a field has been set. +func (o *UpdateApplicationPayload) HasNetwork() bool { + if o != nil && !IsNil(o.Network) { + return true + } + + return false +} + +// SetNetwork gets a reference to the given ApplicationNetwork and assigns it to the Network field. +func (o *UpdateApplicationPayload) SetNetwork(v ApplicationNetwork) { + o.Network = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *UpdateApplicationPayload) GetRegion() string { + if o == nil || IsNil(o.Region) { + var ret string + return ret + } + return *o.Region +} + +// GetRegionOk returns a tuple with the Region field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateApplicationPayload) GetRegionOk() (*string, bool) { + if o == nil || IsNil(o.Region) { + return nil, false + } + return o.Region, true +} + +// HasRegion returns a boolean if a field has been set. +func (o *UpdateApplicationPayload) HasRegion() bool { + if o != nil && !IsNil(o.Region) { + return true + } + + return false +} + +// SetRegion gets a reference to the given string and assigns it to the Region field. +func (o *UpdateApplicationPayload) SetRegion(v string) { + o.Region = &v +} + +// GetScaling returns the Scaling field value +func (o *UpdateApplicationPayload) GetScaling() ApplicationScaling { + if o == nil { + var ret ApplicationScaling + return ret + } + + return o.Scaling +} + +// GetScalingOk returns a tuple with the Scaling field value +// and a boolean to check if the value has been set. +func (o *UpdateApplicationPayload) GetScalingOk() (*ApplicationScaling, bool) { + if o == nil { + return nil, false + } + return &o.Scaling, true +} + +// SetScaling sets field value +func (o *UpdateApplicationPayload) SetScaling(v ApplicationScaling) { + o.Scaling = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *UpdateApplicationPayload) GetStatus() ApplicationStatus { + if o == nil || IsNil(o.Status) { + var ret ApplicationStatus + 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 *UpdateApplicationPayload) GetStatusOk() (*ApplicationStatus, 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 *UpdateApplicationPayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given ApplicationStatus and assigns it to the Status field. +func (o *UpdateApplicationPayload) SetStatus(v ApplicationStatus) { + o.Status = &v +} + +// GetStopped returns the Stopped field value if set, zero value otherwise. +func (o *UpdateApplicationPayload) GetStopped() bool { + if o == nil || IsNil(o.Stopped) { + var ret bool + return ret + } + return *o.Stopped +} + +// GetStoppedOk returns a tuple with the Stopped field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateApplicationPayload) GetStoppedOk() (*bool, bool) { + if o == nil || IsNil(o.Stopped) { + return nil, false + } + return o.Stopped, true +} + +// HasStopped returns a boolean if a field has been set. +func (o *UpdateApplicationPayload) HasStopped() bool { + if o != nil && !IsNil(o.Stopped) { + return true + } + + return false +} + +// SetStopped gets a reference to the given bool and assigns it to the Stopped field. +func (o *UpdateApplicationPayload) SetStopped(v bool) { + o.Stopped = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *UpdateApplicationPayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateApplicationPayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *UpdateApplicationPayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *UpdateApplicationPayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o UpdateApplicationPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateApplicationPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["containers"] = o.Containers + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + toSerialize["displayName"] = o.DisplayName + if !IsNil(o.EnvironmentId) { + toSerialize["environmentId"] = o.EnvironmentId + } + if !IsNil(o.EnvironmentName) { + toSerialize["environmentName"] = o.EnvironmentName + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Network) { + toSerialize["network"] = o.Network + } + if !IsNil(o.Region) { + toSerialize["region"] = o.Region + } + toSerialize["scaling"] = o.Scaling + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Stopped) { + toSerialize["stopped"] = o.Stopped + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateApplicationPayload) 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{ + "containers", + "displayName", + "scaling", + } + + 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) + } + } + + varUpdateApplicationPayload := _UpdateApplicationPayload{} + + err = json.Unmarshal(data, &varUpdateApplicationPayload) + + if err != nil { + return err + } + + *o = UpdateApplicationPayload(varUpdateApplicationPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "containers") + delete(additionalProperties, "createdAt") + delete(additionalProperties, "displayName") + delete(additionalProperties, "environmentId") + delete(additionalProperties, "environmentName") + delete(additionalProperties, "id") + delete(additionalProperties, "network") + delete(additionalProperties, "region") + delete(additionalProperties, "scaling") + delete(additionalProperties, "status") + delete(additionalProperties, "stopped") + delete(additionalProperties, "updatedAt") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateApplicationPayload struct { + value *UpdateApplicationPayload + isSet bool +} + +func (v NullableUpdateApplicationPayload) Get() *UpdateApplicationPayload { + return v.value +} + +func (v *NullableUpdateApplicationPayload) Set(val *UpdateApplicationPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateApplicationPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateApplicationPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateApplicationPayload(val *UpdateApplicationPayload) *NullableUpdateApplicationPayload { + return &NullableUpdateApplicationPayload{value: val, isSet: true} +} + +func (v NullableUpdateApplicationPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateApplicationPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_update_environment_registries_payload.go b/services/sca/v1betaapi/model_update_environment_registries_payload.go new file mode 100644 index 0000000000..054303d181 --- /dev/null +++ b/services/sca/v1betaapi/model_update_environment_registries_payload.go @@ -0,0 +1,167 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateEnvironmentRegistriesPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateEnvironmentRegistriesPayload{} + +// UpdateEnvironmentRegistriesPayload Represents the collection Environment registries. +type UpdateEnvironmentRegistriesPayload struct { + // The collection of configured registries. + Registries []EnvironmentRegistry `json:"registries"` + AdditionalProperties map[string]interface{} +} + +type _UpdateEnvironmentRegistriesPayload UpdateEnvironmentRegistriesPayload + +// NewUpdateEnvironmentRegistriesPayload instantiates a new UpdateEnvironmentRegistriesPayload 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 NewUpdateEnvironmentRegistriesPayload(registries []EnvironmentRegistry) *UpdateEnvironmentRegistriesPayload { + this := UpdateEnvironmentRegistriesPayload{} + this.Registries = registries + return &this +} + +// NewUpdateEnvironmentRegistriesPayloadWithDefaults instantiates a new UpdateEnvironmentRegistriesPayload 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 NewUpdateEnvironmentRegistriesPayloadWithDefaults() *UpdateEnvironmentRegistriesPayload { + this := UpdateEnvironmentRegistriesPayload{} + return &this +} + +// GetRegistries returns the Registries field value +func (o *UpdateEnvironmentRegistriesPayload) GetRegistries() []EnvironmentRegistry { + if o == nil { + var ret []EnvironmentRegistry + return ret + } + + return o.Registries +} + +// GetRegistriesOk returns a tuple with the Registries field value +// and a boolean to check if the value has been set. +func (o *UpdateEnvironmentRegistriesPayload) GetRegistriesOk() ([]EnvironmentRegistry, bool) { + if o == nil { + return nil, false + } + return o.Registries, true +} + +// SetRegistries sets field value +func (o *UpdateEnvironmentRegistriesPayload) SetRegistries(v []EnvironmentRegistry) { + o.Registries = v +} + +func (o UpdateEnvironmentRegistriesPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateEnvironmentRegistriesPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["registries"] = o.Registries + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateEnvironmentRegistriesPayload) 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{ + "registries", + } + + 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) + } + } + + varUpdateEnvironmentRegistriesPayload := _UpdateEnvironmentRegistriesPayload{} + + err = json.Unmarshal(data, &varUpdateEnvironmentRegistriesPayload) + + if err != nil { + return err + } + + *o = UpdateEnvironmentRegistriesPayload(varUpdateEnvironmentRegistriesPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "registries") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateEnvironmentRegistriesPayload struct { + value *UpdateEnvironmentRegistriesPayload + isSet bool +} + +func (v NullableUpdateEnvironmentRegistriesPayload) Get() *UpdateEnvironmentRegistriesPayload { + return v.value +} + +func (v *NullableUpdateEnvironmentRegistriesPayload) Set(val *UpdateEnvironmentRegistriesPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateEnvironmentRegistriesPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateEnvironmentRegistriesPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateEnvironmentRegistriesPayload(val *UpdateEnvironmentRegistriesPayload) *NullableUpdateEnvironmentRegistriesPayload { + return &NullableUpdateEnvironmentRegistriesPayload{value: val, isSet: true} +} + +func (v NullableUpdateEnvironmentRegistriesPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateEnvironmentRegistriesPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/model_update_environment_secrets_payload.go b/services/sca/v1betaapi/model_update_environment_secrets_payload.go new file mode 100644 index 0000000000..edbd7c4701 --- /dev/null +++ b/services/sca/v1betaapi/model_update_environment_secrets_payload.go @@ -0,0 +1,167 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateEnvironmentSecretsPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateEnvironmentSecretsPayload{} + +// UpdateEnvironmentSecretsPayload Represents the vault containing the Environment secrets. +type UpdateEnvironmentSecretsPayload struct { + // The collection of configured secrets. + Secrets []EnvironmentSecret `json:"secrets"` + AdditionalProperties map[string]interface{} +} + +type _UpdateEnvironmentSecretsPayload UpdateEnvironmentSecretsPayload + +// NewUpdateEnvironmentSecretsPayload instantiates a new UpdateEnvironmentSecretsPayload 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 NewUpdateEnvironmentSecretsPayload(secrets []EnvironmentSecret) *UpdateEnvironmentSecretsPayload { + this := UpdateEnvironmentSecretsPayload{} + this.Secrets = secrets + return &this +} + +// NewUpdateEnvironmentSecretsPayloadWithDefaults instantiates a new UpdateEnvironmentSecretsPayload 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 NewUpdateEnvironmentSecretsPayloadWithDefaults() *UpdateEnvironmentSecretsPayload { + this := UpdateEnvironmentSecretsPayload{} + return &this +} + +// GetSecrets returns the Secrets field value +func (o *UpdateEnvironmentSecretsPayload) GetSecrets() []EnvironmentSecret { + if o == nil { + var ret []EnvironmentSecret + return ret + } + + return o.Secrets +} + +// GetSecretsOk returns a tuple with the Secrets field value +// and a boolean to check if the value has been set. +func (o *UpdateEnvironmentSecretsPayload) GetSecretsOk() ([]EnvironmentSecret, bool) { + if o == nil { + return nil, false + } + return o.Secrets, true +} + +// SetSecrets sets field value +func (o *UpdateEnvironmentSecretsPayload) SetSecrets(v []EnvironmentSecret) { + o.Secrets = v +} + +func (o UpdateEnvironmentSecretsPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateEnvironmentSecretsPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["secrets"] = o.Secrets + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateEnvironmentSecretsPayload) 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{ + "secrets", + } + + 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) + } + } + + varUpdateEnvironmentSecretsPayload := _UpdateEnvironmentSecretsPayload{} + + err = json.Unmarshal(data, &varUpdateEnvironmentSecretsPayload) + + if err != nil { + return err + } + + *o = UpdateEnvironmentSecretsPayload(varUpdateEnvironmentSecretsPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "secrets") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateEnvironmentSecretsPayload struct { + value *UpdateEnvironmentSecretsPayload + isSet bool +} + +func (v NullableUpdateEnvironmentSecretsPayload) Get() *UpdateEnvironmentSecretsPayload { + return v.value +} + +func (v *NullableUpdateEnvironmentSecretsPayload) Set(val *UpdateEnvironmentSecretsPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateEnvironmentSecretsPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateEnvironmentSecretsPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateEnvironmentSecretsPayload(val *UpdateEnvironmentSecretsPayload) *NullableUpdateEnvironmentSecretsPayload { + return &NullableUpdateEnvironmentSecretsPayload{value: val, isSet: true} +} + +func (v NullableUpdateEnvironmentSecretsPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateEnvironmentSecretsPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sca/v1betaapi/response.go b/services/sca/v1betaapi/response.go new file mode 100644 index 0000000000..57fe3e8724 --- /dev/null +++ b/services/sca/v1betaapi/response.go @@ -0,0 +1,47 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +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/sca/v1betaapi/utils.go b/services/sca/v1betaapi/utils.go new file mode 100644 index 0000000000..d3fc61ccf2 --- /dev/null +++ b/services/sca/v1betaapi/utils.go @@ -0,0 +1,361 @@ +/* +STACKIT Container Applications (SCA) + +STACKIT Container Applications (SCA) is a Platform as a Service (PaaS) that provides developers with a complete, managed platform to deploy and operate applications without managing the underlying infrastructure. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +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...) +}